/* Converter-specific styles for /tools/chinese-converter/.
   Loaded after /assets/css/sot-tool.css; only adds what the shared sheet lacks.
   This sheet is only linked from the three converter pages, so overriding shared
   selectors here cannot reach /tools/chinese-stroke-order/. */

/* The shared hero centres its two columns vertically, which suits the short
   stroke-order stage. The converter card carries the text boxes, the diff, the
   ambiguity notes and the download buttons, so it is much taller: centring sank
   the intro into the middle of the band and misaligned it against the card top.
   Top-align the columns instead and give the card the wider column. */
@media (min-width:901px){
  .sot-hero__inner{align-items:start;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:1.75rem}
  /* Keep the intro in view while the reader scrolls down the diff column. */
  .sot-hero__inner > :first-child{position:sticky;top:1.25rem}
}

.converter-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:1rem;margin-top:.9rem}
.converter-panel > *{min-width:0}
.converter-field{display:flex;flex-direction:column;gap:.35rem;min-width:0}
.converter-field .sot-label{margin:0}
.converter-textarea{box-sizing:border-box;width:100%;min-height:11rem;padding:.7rem .8rem;border:2px solid var(--sot-line);border-radius:.75rem;background:#fff;color:var(--sot-ink);font-family:inherit;font-size:1.08rem;line-height:1.8;resize:vertical}
.converter-textarea::placeholder{color:#9ca3af}
.converter-textarea:focus-visible{outline:3px solid var(--sot-teal);outline-offset:1px;border-color:var(--sot-deep)}
.converter-textarea[readonly]{background:var(--sot-surface)}
.converter-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin-top:.85rem}
.converter-modes{display:inline-flex;border:1px solid var(--sot-line);border-radius:.75rem;overflow:hidden}
.converter-mode{font-family:inherit;font-size:.92rem;font-weight:700;padding:.55rem .85rem;border:0;background:#fff;color:#0f7a6e;cursor:pointer}
.converter-mode + .converter-mode{border-inline-start:1px solid var(--sot-line)}
.converter-mode[aria-pressed="true"]{background:var(--sot-deep);color:#fff}
.converter-mode:focus-visible{outline:3px solid var(--sot-teal);outline-offset:-3px}
.converter-hint{margin:.6rem 0 0;font-size:.86rem;line-height:1.6;color:var(--sot-muted);min-height:1.4em}
.converter-count{margin-inline-start:auto;font-size:.82rem;color:#6b7280}
.converter-diff{margin-top:1.15rem;border:1px solid var(--sot-line);border-radius:.75rem;overflow:hidden}
.converter-diff__head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:.5rem;padding:.65rem .85rem;background:var(--sot-surface);border-bottom:1px solid var(--sot-line)}
.converter-diff__title{margin:0;font-size:.95rem;font-weight:800;color:var(--sot-ink)}
.converter-diff__legend{margin:0;font-size:.78rem;color:#6b7280;display:flex;gap:.75rem;flex-wrap:wrap}
.converter-diff__legend span::before{content:"";display:inline-block;width:.7rem;height:.7rem;border-radius:.2rem;margin-inline-end:.3rem;vertical-align:-.05rem}
.converter-diff__legend .is-changed::before{background:#fde68a}
.converter-diff__legend .is-ambiguous::before{background:#fecaca}
.converter-diff__body{padding:.85rem;font-size:1.05rem;line-height:2}
.converter-row{display:grid;grid-template-columns:3.2rem minmax(0,1fr);gap:.6rem;align-items:baseline;padding:.35rem 0;border-bottom:1px dashed #e5e7eb}
.converter-row:last-child{border-bottom:0}
.converter-row__label{font-size:.78rem;font-weight:700;letter-spacing:.02em;text-transform:uppercase;color:#6b7280}
.converter-row__text{margin:0;word-break:break-word}
.converter-char{padding:0 .05em;border-radius:.25rem}
.converter-char--changed{background:#fde68a;color:#111827}
.converter-char--ambiguous{background:#fecaca;color:#111827;box-shadow:inset 0 -2px 0 #ef4444}
.converter-char--same{color:inherit}
.converter-pairs{list-style:none;margin:1.1rem 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:.6rem}
.converter-pair{background:var(--sot-surface);border-radius:.65rem;padding:.6rem .75rem;font-size:.92rem;line-height:1.65;color:#374151}
.converter-pair b{color:var(--sot-ink);font-weight:800;font-size:1.02rem}
.converter-warn{margin:1rem 0 0;border-inline-start:4px solid #ef4444;background:#fef2f2;border-radius:.5rem;padding:.9rem 1.1rem}
.converter-warn p{margin:0;font-size:.92rem;line-height:1.7;color:#7f1d1d}
.converter-noscript{margin:1rem 0 0;padding:.85rem 1rem;border-radius:.6rem;background:#fef3c7;color:#78350f;font-size:.92rem}
/* Shared mobile breakpoint: back to one column, and never a sticky intro. */
@media (max-width:900px){
  .sot-hero__inner{align-items:stretch}
  .sot-hero__inner > :first-child{position:static;top:auto}
}

@media (max-width:820px){
  .converter-panel{grid-template-columns:minmax(0,1fr)}
}
