/* ------------------------------------------------------------------ */
/* Converter workspace — shared by the Markdown / Excel / CSV pages    */
/* ------------------------------------------------------------------ */

/* Only the converter's own toggled panels opt out of the flex layout. The
   global Tailwind `.hidden` must keep its normal specificity so `md:flex`
   can still reveal the desktop navigation. */
.preview-empty.hidden,
#preview.hidden,
.sheet-tabs.hidden {
  display: none !important;
}

.tool-page-hero {
  padding-top: 2.5rem;
}

.tool-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 14px;
  line-height: 20px;
  color: #6b7280;
}

.tool-breadcrumb a {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.15s;
}

.tool-breadcrumb a:hover {
  color: #111827;
}

.tool-breadcrumb svg {
  flex: 0 0 auto;
  color: #9ca3af;
}

.tool-breadcrumb [aria-current] {
  color: #111827;
}

.converter-shell {
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #ffffff;
  padding: 22px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 30px 70px -55px rgba(15, 23, 42, 0.55);
}

.converter-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1280px) {
  .converter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
}

/* On stacked widths, show the preview right after the upload card instead of
   letting the "What you get" card push it below the fold. */
@media (max-width: 1279px) {
  .word-grid .tool-column {
    display: contents;
  }

  .word-grid .tool-column > .tool-card:first-child {
    order: 1;
  }

  .word-grid .preview-card {
    order: 2;
  }

  .word-grid .tool-column > .tool-card:last-child {
    order: 3;
  }
}

.tool-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.tool-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
}

.tool-card.is-grow {
  flex: 1 1 auto;
}

.tool-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 18px 0;
}

.tool-card-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.tool-card-title svg {
  color: #64748b;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #475569;
  text-transform: uppercase;
}

.tool-card-body {
  padding: 14px 18px 18px;
}

.tool-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #94a3b8;
}

.tool-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #ffffff;
  color: #374151;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.tool-mini-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* Dropzone ---------------------------------------------------------- */

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 16px;
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-dragging {
  border-color: #111827;
  background: #f9fafb;
  outline: none;
}

.dropzone svg {
  margin-bottom: 8px;
  color: #6b7280;
}

.dropzone h3, .dropzone .dz-drop-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #374151;
}

.dropzone p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #6b7280;
}

.dropzone .dz-formats {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.dz-chip {
  padding: 2px 7px;
  border-radius: 4px;
  background: #f1f5f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #475569;
}

.file-status {
  margin: 10px 0 0;
  font-size: 12px;
  color: #94a3b8;
  overflow-wrap: anywhere;
}

/* Editor ------------------------------------------------------------ */

.source-area {
  width: 100%;
  min-height: 260px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
  padding: 14px;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
  outline: none;
  resize: vertical;
}

.source-area:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.14);
}

@media (min-width: 1100px) {
  .source-area {
    flex: 1 1 auto;
    min-height: 300px;
    height: 320px;
  }
}

/* Preview ----------------------------------------------------------- */

.preview-card {
  min-height: 520px;
}

.preview-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border-top: 1px solid #eef2f7;
  border-radius: 0 0 12px 12px;
  background: #f1f5f9;
  padding: 18px;
}

.paper-sheet {
  width: 100%;
  max-width: 720px;
  min-height: 460px;
  margin: 0 auto;
  padding: 34px 38px;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #e2e8f0;
  border-radius: 2px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 18px 40px -28px rgba(15, 23, 42, 0.35);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--preview-font-size, 11pt);
  overflow-wrap: anywhere;
}

.paper-sheet[data-orientation="landscape"] {
  max-width: 100%;
  min-height: 380px;
}

.preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  padding: 24px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #94a3b8;
  font-size: 14px;
  text-align: center;
}

/* Inside the paper sheet the empty state should read as page text. Keep it
   near the top so it is visible as soon as the preview card scrolls in. */
.paper-sheet .preview-empty {
  min-height: 240px;
  align-items: flex-start;
  padding: 48px 24px;
  border: 0;
  background: transparent;
}

/* Markdown typography ---------------------------------------------- */

.md-preview > :first-child {
  margin-top: 0;
}

.md-preview h1,
.md-preview h2,
.md-preview h3,
.md-preview h4,
.md-preview h5,
.md-preview h6 {
  color: #0f172a;
  font-weight: 700;
  line-height: 1.25;
  margin: 1.5em 0 0.55em;
  letter-spacing: -0.015em;
}

.md-preview h1 {
  font-size: 1.85em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid #e2e8f0;
}

.md-preview h2 {
  font-size: 1.45em;
}

.md-preview h3 {
  font-size: 1.2em;
}

.md-preview h4 {
  font-size: 1.05em;
}

.md-preview h5,
.md-preview h6 {
  font-size: 1em;
  color: #334155;
}

.md-preview p {
  margin: 0 0 1em;
}

.md-preview ul,
.md-preview ol {
  margin: 0 0 1em;
  padding-left: 1.45em;
}

.md-preview ul {
  list-style: disc outside;
}

.md-preview ul ul {
  list-style: circle outside;
}

.md-preview ul ul ul {
  list-style: square outside;
}

.md-preview ol {
  list-style: decimal outside;
}

.md-preview li::marker {
  color: #64748b;
}

.md-preview li {
  margin: 0.28em 0;
}

.md-preview li > ul,
.md-preview li > ol {
  margin: 0.3em 0 0.2em;
}

.md-preview blockquote {
  margin: 1.1em 0;
  padding: 0.15em 0 0.15em 1em;
  border-left: 3px solid #cbd5e1;
  color: #475569;
  font-style: italic;
}

.md-preview blockquote p:last-child {
  margin-bottom: 0;
}

.md-preview code {
  padding: 0.15em 0.36em;
  border-radius: 4px;
  background: #f1f5f9;
  color: #9a3412;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.md-preview pre {
  margin: 1.1em 0;
  padding: 14px 16px;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  background: #f5f5f4;
  overflow: auto;
}

.md-preview pre code {
  padding: 0;
  background: none;
  color: #1e293b;
  font-size: 0.85em;
  line-height: 1.55;
}

.md-preview table {
  width: 100%;
  margin: 1.1em 0;
  border-collapse: collapse;
  font-size: 0.92em;
}

.md-preview th,
.md-preview td {
  padding: 0.42em 0.6em;
  border: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}

.md-preview th {
  background: #f1f5f9;
  font-weight: 600;
  color: #0f172a;
}

.md-preview img {
  max-width: 100%;
  height: auto;
}

.md-preview a {
  color: #1d4ed8;
  text-decoration: underline;
}

.md-preview hr {
  margin: 1.7em 0;
  border: 0;
  border-top: 1px solid #e2e8f0;
}

.md-preview input[type="checkbox"] {
  margin-right: 0.4em;
}

/* GFM task items already carry a checkbox, so the bullet would be noise. */
.md-preview li:has(> input[type="checkbox"]) {
  list-style: none;
}

/* Spreadsheet preview ---------------------------------------------- */

.sheet-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px 18px 0;
  scrollbar-width: thin;
}

.sheet-tabs.hidden {
  display: none !important;
}

.sheet-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  height: 30px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 7px 7px 0 0;
  border-bottom-color: transparent;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.sheet-tab:hover {
  background: #f1f5f9;
  color: #334155;
}

.sheet-tab.is-active {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #0f172a;
  font-weight: 600;
  box-shadow: inset 0 2px 0 #111827;
}

.sheet-tab-count {
  padding: 0 5px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 10px;
  font-weight: 600;
}

.sheet-tab.is-active .sheet-tab-count {
  background: #111827;
  color: #ffffff;
}

.preview-caption {
  padding: 8px 18px;
  border-top: 1px solid #eef2f7;
  color: #94a3b8;
  font-size: 11px;
  letter-spacing: 0.01em;
}

.grid-preview {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 11px;
  line-height: 1.45;
  table-layout: fixed;
}

.grid-preview th,
.grid-preview td {
  padding: 5px 8px;
  border: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.grid-preview th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef2f7;
  color: #0f172a;
  font-weight: 600;
}

.grid-preview tbody tr:nth-child(even) {
  background: #f8fafc;
}

.grid-preview td.is-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.grid-preview td.is-date {
  white-space: nowrap;
}

.grid-preview-note {
  margin: 10px 0 0;
  color: #94a3b8;
  font-size: 11px;
}

/* Options + actions ------------------------------------------------ */

.tool-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #f1f5f9;
}

/* Used when the converter has no options and only the action buttons remain. */
.tool-toolbar-actions {
  justify-content: center;
}

.tool-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
}

.option-group {
  display: grid;
  gap: 4px;
}

.option-group > label,
.option-label {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.option-select {
  height: 34px;
  padding: 0 9px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #ffffff;
  color: #111827;
  font-size: 13px;
  outline: none;
}

.option-select:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.14);
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.option-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #374151;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.option-check input {
  width: 15px;
  height: 15px;
  accent-color: #111827;
  cursor: pointer;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
  box-shadow: 0 10px 24px -16px rgba(15, 23, 42, 0.9);
}

.btn-primary:hover {
  background: #1f2937;
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary.is-busy svg {
  animation: tool-spin 1s linear infinite;
}

@keyframes tool-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-ghost {
  border-color: #e5e7eb;
  background: #ffffff;
  color: #374151;
}

.btn-ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.tool-message {
  display: none;
  margin: 14px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
}

.tool-message.is-visible {
  display: block;
}

.tool-message.is-error {
  color: #b91c1c;
}

.tool-message.is-success {
  color: #15803d;
}

.tool-footnote {
  margin: 12px 0 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 640px) {
  .converter-shell {
    padding: 14px;
    border-radius: 16px;
  }

  .paper-sheet {
    padding: 22px 20px;
    min-height: 380px;
  }

  .preview-scroll {
    padding: 12px;
  }

  .tool-toolbar {
    align-items: stretch;
  }

  .tool-actions {
    width: 100%;
  }

  .tool-actions .btn {
    flex: 1 1 auto;
  }
}

/* Dark mode --------------------------------------------------------- */

html.dark .converter-shell {
  border-color: #1e293b;
  background: #0f172a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

html.dark .tool-card {
  border-color: #1e293b;
  background: #0f172a;
}

html.dark .tool-card-title {
  color: #f8fafc;
}

html.dark .tool-card-title svg {
  color: #94a3b8;
}

html.dark .tool-badge {
  background: #1e293b;
  color: #cbd5e1;
}

html.dark .tool-mini-btn {
  border-color: #334155;
  background: #0f172a;
  color: #cbd5e1;
}

html.dark .tool-mini-btn:hover {
  background: #1e293b;
}

html.dark .dropzone {
  border-color: #334155;
}

html.dark .dropzone:hover,
html.dark .dropzone.is-dragging {
  border-color: #94a3b8;
  background: #111c2e;
}

html.dark .dropzone h3, .dropzone .dz-drop-title {
  color: #e2e8f0;
}

html.dark .dropzone p,
html.dark .file-status,
html.dark .tool-meta,
html.dark .preview-caption {
  color: #94a3b8;
}

html.dark .dz-chip {
  background: #1e293b;
  color: #cbd5e1;
}

html.dark .source-area {
  border-color: #334155;
  background: #0b1220;
  color: #e2e8f0;
}

html.dark .source-area:focus {
  border-color: #64748b;
}

html.dark .preview-scroll {
  border-top-color: #1e293b;
  background: #0b1220;
}

html.dark .preview-empty {
  border-color: #334155;
  background: #0f172a;
  color: #64748b;
}

html.dark .sheet-tab {
  border-color: #1e293b;
  background: #111c2e;
  color: #94a3b8;
}

html.dark .sheet-tab.is-active {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
  box-shadow: inset 0 2px 0 #e2e8f0;
}

html.dark .sheet-tab-count {
  background: #334155;
  color: #e2e8f0;
}

html.dark .sheet-tab.is-active .sheet-tab-count {
  background: #e2e8f0;
  color: #0f172a;
}

html.dark .preview-caption {
  border-top-color: #1e293b;
}

html.dark .tool-toolbar {
  border-top-color: #1e293b;
}

html.dark .option-select {
  border-color: #334155;
  background: #0f172a;
  color: #f8fafc;
}

html.dark .option-check {
  color: #cbd5e1;
}

html.dark .option-check input {
  accent-color: #e2e8f0;
}

html.dark .btn-ghost {
  border-color: #334155;
  background: #0f172a;
  color: #e2e8f0;
}

html.dark .btn-ghost:hover {
  background: #1e293b;
}

html.dark .btn-primary {
  background: #f8fafc;
  border-color: #f8fafc;
  color: #0f172a;
}

html.dark .btn-primary:hover {
  background: #e2e8f0;
}

html.dark .tool-message {
  color: #94a3b8;
}

/* Word -> other formats --------------------------------------------- */

.result-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f8fafc;
}

.result-tab {
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  background: transparent;
  color: #6b7280;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
}

.result-tab.is-active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.code-output {
  display: block;
  width: 100%;
  min-height: 460px;
  margin: 0;
  padding: 16px;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  overflow: auto;
  white-space: pre;
  tab-size: 2;
}

.code-output.hidden {
  display: none !important;
}

.paper-sheet.is-code {
  display: none;
}

.paper-sheet.is-tables {
  padding: 0;
  max-width: 100%;
  overflow: hidden;
}

.paper-sheet.is-tables .md-preview {
  padding: 20px 22px;
}

html.dark .result-tabs {
  border-color: #1e293b;
  background: #111c2e;
}

html.dark .result-tab {
  color: #94a3b8;
}

html.dark .result-tab.is-active {
  background: #0f172a;
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px #334155;
}



/* ------------------------------------------------------------------ */
/* Match the markdowntoword.io generator geometry and type scale       */
/* ------------------------------------------------------------------ */

.converter-shell {
  padding: 32px;
  border-radius: 24px;
}

.tool-card {
  border-radius: 8px;
}

.tool-card-head {
  padding: 24px 24px 0;
}

.tool-card-title {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
}

.tool-card-title svg {
  width: 20px;
  height: 20px;
}

.tool-card-body {
  padding: 16px 24px 24px;
}

.tool-meta {
  font-size: 14px;
  line-height: 20px;
}

.tool-mini-btn {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  line-height: 16px;
}

.dropzone {
  padding: 14px 16px;
  border-radius: 12px;
}

.dropzone svg {
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
}

.dropzone h3, .dropzone .dz-drop-title {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}

.dropzone p {
  font-size: 14px;
  line-height: 20px;
}

.file-status {
  margin-top: 8px;
  font-size: 12px;
  line-height: 16px;
}

.source-area {
  padding: 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 20px;
}

.result-tabs {
  padding: 4px;
}

.result-tab {
  padding: 4px 12px;
  font-size: 14px;
  line-height: 20px;
}

.btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}

.tool-toolbar {
  margin-top: 32px;
  padding-top: 0;
  border-top: 0;
}

.tool-footnote {
  font-size: 14px;
  line-height: 20px;
}

@media (min-width: 1280px) {
  .converter-grid {
    grid-template-rows: 823px;
  }

  .tool-column {
    height: 823px;
    gap: 24px;
  }

  .tool-column > .tool-card:first-child {
    flex: 0 0 250px;
    height: 250px;
  }

  .tool-column > .tool-card:last-child {
    flex: 1 1 auto;
    min-height: 0;
  }

  .preview-card {
    height: 823px;
    min-height: 0;
  }

  .source-area {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
  }
}

/* Reference-style upload card: status is announced to screen readers only,
   so the dropzone can keep the reference padding inside a 250 px card. */
.file-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tool-column > .tool-card:first-child .tool-card-body {
  padding-top: 8px;
}

.dropzone {
  padding: 24px;
}

.dropzone svg {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
}

.result-tab {
  padding: 5px 12px;
}

.converter-shell {
  border: 0;
}

@media (min-width: 1280px) {
  .preview-card .preview-scroll {
    padding: 16px 24px 24px;
  }

  .preview-card .paper-sheet {
    min-height: 100%;
  }
}

.preview-scroll {
  display: flex;
  flex-direction: column;
}

.result-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.code-output {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 420px;
  margin: 0;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f3f4f6;
  color: #111827;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 20px;
  resize: none;
  overflow: auto;
  white-space: pre;
  outline: none;
}

.code-output::placeholder {
  color: #6b7280;
}

html.dark .code-output {
  border-color: #1e293b;
  background: #0b1220;
  color: #e2e8f0;
}

html.dark .code-output::placeholder {
  color: #94a3b8;
}

.code-output {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.source-area {
  background: #f3f4f6;
}

html.dark .source-area {
  background: #0b1220;
}

.tool-toolbar > .tool-actions:only-child {
  margin-left: auto;
  margin-right: auto;
}

.word-paper {
  padding: 40px 44px;
  overflow-x: auto;
}

.word-doc h1 {
  margin: 0 0 2px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.word-doc h2 {
  margin: 22px 0 10px;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  color: #475569;
}

.word-doc .grid-preview {
  margin-top: 6px;
  font-size: 10.5pt;
}

@media (max-width: 640px) {
  .word-paper {
    padding: 24px 20px;
  }

  .word-doc h1 {
    font-size: 20px;
  }
}

.upload-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  background: #ecfdf5;
  color: #047857;
  font-size: 12.5px;
  line-height: 18px;
}

.upload-feedback.hidden {
  display: none;
}

.upload-feedback svg {
  flex: 0 0 auto;
}

.upload-feedback span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-feedback strong {
  font-weight: 600;
}

.tool-card-body.is-converted .dropzone {
  padding: 8px 12px 6px;
}

.tool-card-body.is-converted .dropzone svg {
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
}

.tool-card-body.is-converted .dropzone h3, .dropzone .dz-drop-title {
  margin: 0;
  font-size: 13px;
  line-height: 18px;
}

.tool-card-body.is-converted .dropzone p {
  display: none;
}

html.dark .upload-feedback {
  border-color: #166534;
  background: #052e1b;
  color: #86efac;
}

.upload-feedback {
  gap: 9px;
  padding: 9px 12px;
  font-size: 14px;
  line-height: 20px;
}

.upload-feedback svg {
  width: 18px;
  height: 18px;
}

.tool-card-body.is-converted {
  display: flex;
  flex-direction: column;
}

.tool-card-body.is-converted .upload-feedback {
  margin-top: auto;
}

.tool-column > .tool-card:first-child {
  display: flex;
  flex-direction: column;
}

.tool-column > .tool-card:first-child .tool-card-body {
  flex: 1 1 auto;
}

/* Keep the normal dropzone after a conversion and let the upload card grow,
   so the success banner sits directly below it. The lower card moves down. */
.tool-card-body.is-converted .dropzone {
  padding: 24px;
}

.tool-card-body.is-converted .dropzone svg {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
}

.tool-card-body.is-converted .dropzone h3, .dropzone .dz-drop-title {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 20px;
}

.tool-card-body.is-converted .dropzone p {
  display: block;
}

.tool-card-body.is-converted .upload-feedback {
  margin-top: 12px;
}

@media (min-width: 1280px) {
  .converter-grid:has(.tool-card-body.is-converted) {
    grid-template-rows: auto;
    align-items: start;
  }

  .tool-column:has(.tool-card-body.is-converted) {
    height: auto;
  }

  .tool-column:has(.tool-card-body.is-converted) > .tool-card:first-child {
    flex: 0 0 auto;
    height: auto;
  }

  .tool-column:has(.tool-card-body.is-converted) > .tool-card:last-child {
    flex: 0 0 549px;
    height: 549px;
  }
}

.upload-feedback .feedback-error,
.upload-feedback .feedback-problem {
  display: none;
}

.upload-feedback.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.upload-feedback.is-error .feedback-ok {
  display: none;
}

.upload-feedback.is-error .feedback-error {
  display: block;
}

.upload-feedback.is-error .feedback-success {
  display: none;
}

.upload-feedback.is-error .feedback-problem {
  display: inline;
  overflow: visible;
  white-space: normal;
}

html.dark .upload-feedback.is-error {
  border-color: #7f1d1d;
  background: #2b0b0b;
  color: #fca5a5;
}

.preview-truncated {
  margin-top: 24px;
  padding: 12px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  line-height: 20px;
}

html.dark .preview-truncated {
  border-color: #334155;
  background: #0f172a;
  color: #94a3b8;
}

.word-dropzone {
  padding: 16px;
}

.word-dropzone > svg {
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
}

.word-dropzone .dz-upload-title {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  color: #030712;
}

.word-dropzone p {
  font-size: 14px;
  line-height: 20px;
}

html.dark .word-dropzone .dz-upload-title {
  color: #f8fafc;
}

.tools-menu-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.tools-menu-all:hover {
  background: #f1f5f9;
}

html.dark .tools-menu-all {
  border-color: #1e293b;
  color: #f8fafc;
}

html.dark .tools-menu-all:hover {
  background: #1e293b;
}
