/* Mirror Text Generator — tool styles (base card styles shared with the speech time calculator) */

.tool-shell {
  background: #05070a;
  background-image: none;
  min-height: calc(100vh - var(--header-h, 72px));
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(2rem, 5vw, 3.5rem) var(--page-pad-inline, 1.25rem);
}

.tool-card {
  width: 100%;
  max-width: 680px;
  background: #111a2e;
  border: 1px solid rgba(96, 165, 250, 0.14);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(96, 165, 250, 0.06);
  overflow: hidden;
}

.tool-card__header {
  padding: 1.75rem 2rem 0;
}

.tool-card__eyebrow {
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #60a5fa;
  margin: 0 0 0.5rem;
}

.tool-card__title {
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  color: #f1f5f9;
}

.calc-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.calc-textarea {
  width: 100%;
  min-height: 130px;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(96, 165, 250, 0.14);
  border-radius: 10px;
  color: #f1f5f9;
  font-family: var(--font-body, "DM Sans", sans-serif);
  font-size: 0.9375rem;
  line-height: 1.55;
  resize: vertical;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.calc-textarea:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.45);
}

.calc-textarea::placeholder {
  color: #475569;
}

.word-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: #60a5fa;
  font-weight: 600;
  margin-top: 0.5rem;
}

.ref-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(96, 165, 250, 0.12);
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ref-table th {
  padding: 0.75rem 1rem;
  text-align: start;
  background: rgba(29, 78, 216, 0.15);
  color: #93c5fd;
  font-family: var(--font-display, "Sora", sans-serif);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid rgba(96, 165, 250, 0.12);
}

.ref-table td {
  padding: 0.65rem 1rem;
  color: #94a3b8;
  border-bottom: 1px solid rgba(96, 165, 250, 0.07);
  white-space: nowrap;
}

.ref-table tr:last-child td {
  border-bottom: none;
}

.ref-table td:first-child {
  color: #f1f5f9;
  font-weight: 600;
  font-family: var(--font-display, "Sora", sans-serif);
}

.ref-table tr:hover td {
  background: rgba(59, 130, 246, 0.05);
}

/* CTA bar inside the old single-card layout (translated pages); the English page uses the shared .tool-cta card */
.tool-card .tool-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(29, 78, 216, 0.08);
  border-top: 1px solid rgba(96, 165, 250, 0.1);
}

.tool-card .tool-cta p {
  flex: 0 0 100%;
  width: 100%;
  margin: 0;
  color: #94a3b8;
  font-size: 0.9375rem;
  text-align: center;
}

.tool-card .tool-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Tool body */
.tool-body {
  padding: 0 2rem 2rem;
}

.tool-card__lead {
  margin: -0.75rem 0 1.25rem;
  color: #94a3b8;
  font-size: 0.9375rem;
}

.out-group {
  margin-top: 1.25rem;
}

.out-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.out-group__head .calc-label {
  margin: 0;
}

.out-group__tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.out-select {
  padding: 0.35rem 0.5rem;
  background: #0c1220;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 8px;
  color: #cbd5e1;
  font: inherit;
  font-size: 0.8125rem;
}

.copy-btn,
.ghost-btn {
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  min-width: 4.5rem;
  transition: background 0.15s, border-color 0.15s;
}

.copy-btn:hover,
.ghost-btn:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(96, 165, 250, 0.6);
}

.ghost-btn:disabled,
.tool-card .tool-cta .btn-download:disabled,
.mt-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.calc-textarea--out {
  min-height: 84px;
  font-size: 1.0625rem;
}

/* Visual mirror preview */
.mirror-preview {
  margin-top: 0.5rem;
  min-height: 140px;
  padding: 1.5rem 1.25rem;
  background: #000;
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mirror-preview__text {
  margin: 0;
  max-width: 100%;
  color: #fff;
  font-family: var(--font-body, "DM Sans", sans-serif);
  font-size: clamp(1.15rem, 3.5vw, 1.6rem);
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  transform: scaleX(-1);
}

.mirror-preview.is-flip-v .mirror-preview__text {
  transform: scaleY(-1);
}

.mirror-preview.is-flip-h.is-flip-v .mirror-preview__text {
  transform: scale(-1, -1);
}

.mirror-preview.is-empty .mirror-preview__text {
  color: #475569;
  font-weight: 500;
}

.preview-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: #94a3b8;
}

.preview-options label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.tool-card .tool-cta .btn-download {
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.6rem 1.25rem;
}

/* Long-form content */
.mirror-prose {
  color: var(--text-muted, #94a3b8);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.mirror-prose h3 {
  font-family: var(--font-display, "Sora", sans-serif);
  color: var(--text, #f1f5f9);
  font-size: 1.15rem;
  margin: 1.75rem 0 0.5rem;
}

.mirror-prose p {
  margin: 0 0 1rem;
}

.mirror-prose ol {
  margin: 0 0 1rem;
  padding-inline-start: 1.25rem;
}

.mirror-prose li {
  margin-bottom: 0.5rem;
}

.mirror-prose strong {
  color: var(--text, #f1f5f9);
}

.answer-block {
  margin: 0 auto 2rem;
  padding: 1.1rem 1.25rem;
  border-inline-start: 3px solid var(--accent, #3b82f6);
  background: rgba(37, 99, 235, 0.08);
  border-radius: 0 12px 12px 0;
  color: var(--text, #f1f5f9);
}

.ref-table td.ref-table__sample {
  font-family: var(--font-body, "DM Sans", sans-serif);
  font-weight: 500;
  color: #e2e8f0;
}

.ref-table--wrap td {
  white-space: normal;
}

/* App download card */
.app-card {
  display: grid;
  gap: 1.25rem;
  align-items: center;
  padding: 1.5rem;
  border-radius: var(--radius-md, 16px);
  background: var(--bg-card, #111a2e);
  border: 1px solid var(--border-subtle, rgba(96, 165, 250, 0.12));
  box-shadow: var(--shadow-card);
}

.app-card img {
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.app-card h3 {
  font-family: var(--font-display, "Sora", sans-serif);
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: var(--text, #f1f5f9);
}

.app-card p {
  margin: 0 0 1rem;
  color: var(--text-muted, #94a3b8);
}

@media (min-width: 760px) {
  .app-card {
    grid-template-columns: 300px 1fr;
    padding: 2rem;
  }
}

@media (max-width: 560px) {
  .tool-card__header {
    padding: 1.25rem 1.25rem 0;
  }
  .tool-body {
    padding: 0 1.25rem 1.5rem;
  }
  .tool-card .tool-cta {
    padding: 1.5rem 1.25rem;
  }
}

/* ── 2026-11 redesign: photo hero, two-column tool, explainer rows ── */
.mt-hero {
  position: relative;
  overflow: hidden;
  background: #05070a;
  border-bottom: 1px solid rgba(96, 165, 250, 0.1);
}
.mt-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 50%;
}
.mt-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5, 9, 18, 0.95) 0%, rgba(5, 9, 18, 0.8) 42%, rgba(5, 9, 18, 0.2) 75%, rgba(5, 9, 18, 0.05) 100%);
}
.mt-hero__copy {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(1.75rem, 4vw, 3rem) var(--page-pad-inline, 1.25rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
}
.mt-hero__copy > * { max-width: 38rem; }
.mt-hero__eyebrow {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-bright, #60a5fa);
}
.mt-hero__title {
  margin: 0;
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #f8fafc;
}
.mt-hero__title span {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.5em;
  letter-spacing: -0.01em;
  color: var(--accent-bright, #60a5fa);
}
.mt-hero__lead {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #cbd5e1;
}
.mt-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mt-hero__chips li {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* Tool: input + preview on the left, the three copyable results on the right */
.mt-tool {
  background: #05070a;
  padding: clamp(1.25rem, 3vw, 2rem) var(--page-pad-inline, 1.25rem) clamp(2rem, 5vw, 3.5rem);
}
.mt-tool__grid {
  display: grid;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  grid-template-areas: "input" "outputs" "preview";
}
.mt-panel {
  min-width: 0;
  padding: 1.25rem;
  background: #111a2e;
  border: 1px solid rgba(96, 165, 250, 0.14);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.mt-panel--input { grid-area: input; }
.mt-panel--outputs { grid-area: outputs; }
.mt-panel--preview { grid-area: preview; }
.mt-panel--outputs .out-group:first-child { margin-top: 0; }
.mt-input { min-height: 150px; font-size: 1rem; }
.mt-send {
  display: block;
  width: 100%;
  margin-top: 1rem;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.75rem 1.25rem;
}

@media (min-width: 900px) {
  .mt-tool__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "input outputs" "preview outputs";
    align-items: start;
  }
  .mt-panel--outputs { align-self: stretch; }
  .mt-panel--outputs .calc-textarea--out { min-height: 96px; }
}

@media (max-width: 719px) {
  .mt-hero__img {
    position: relative;
    display: block;
    height: 150px;
    object-position: 70% 55%;
  }
  .mt-hero::after {
    inset: 0 0 auto 0;
    height: 150px;
    background: linear-gradient(180deg, rgba(5, 9, 18, 0) 40%, rgba(5, 9, 18, 1) 100%);
  }
  .mt-hero__copy { padding-top: 0.25rem; padding-bottom: 1.25rem; gap: 0.7rem; }
  .mt-hero__title { font-size: 2rem; }
  .mt-hero__lead { font-size: 0.95rem; line-height: 1.5; }
  .mt-hero__chips li { font-size: 0.78rem; padding: 0.3rem 0.65rem; }
  .mt-panel { padding: 1rem; border-radius: 16px; }
  .mt-input { min-height: 110px; }
}

/* Rendered samples: real text, not an image */
.mt-samples {
  margin: 0;
  display: grid;
  gap: 0.6rem;
}
.mt-sample {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: #0f1a33;
  border: 1px solid rgba(96, 165, 250, 0.16);
}
.mt-sample__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}
.mt-sample__text {
  margin: 0;
  font-family: var(--font-body, "DM Sans", sans-serif);
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  font-weight: 600;
  color: #f1f5f9;
  overflow-wrap: anywhere;
}
.mt-sample--glass { background: #000; border-color: rgba(96, 165, 250, 0.3); }
.mt-sample__flip { display: inline-block; transform: scaleX(-1); }
@media (max-width: 480px) {
  .mt-sample { grid-template-columns: 1fr; gap: 0.3rem; }
}

/* Three mode cards */
.mt-modes {
  display: grid;
  gap: 1rem;
  margin-top: clamp(2.5rem, 6vw, 4rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
.mt-mode {
  padding: 1.35rem;
  border-radius: 16px;
  background: #0f1a33;
  border: 1px solid rgba(96, 165, 250, 0.14);
}
.mt-mode h3 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: 1.15rem;
  color: #f1f5f9;
}
.mt-mode p { margin: 0; color: #94a3b8; line-height: 1.65; font-size: 0.95rem; }
.mt-mode strong { color: #e2e8f0; }
.tool-row a { color: var(--accent-bright, #60a5fa); }
.tool-steps + p { margin-top: 0.9rem; }

/* Right-to-left pages (ar, he): mirror the photo scrim so the text side stays dark. */
[dir="rtl"] .mt-hero::after { transform: scaleX(-1); }

/* The 38rem measure is for the lead paragraph; the title may run wider so it stays on one line. */
.mt-hero__copy > .mt-hero__title { max-width: 52rem; }
/* Japanese / Korean titles are long runs of wide glyphs: a smaller size keeps them on one
   line, and auto-phrase stops a wrap from splitting a word (ジェネレ|ーター). */
:lang(ja) .mt-hero__title,
:lang(ko) .mt-hero__title {
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  word-break: auto-phrase;
}
