/* Final compact layout. Application behavior lives in unchanged JS modules. */
:root { color-scheme: dark; --page-width: 1680px; --frame-space: 208px; --line: #30424e; --accent: #a2e4cb; }
* { box-sizing: border-box; }
body { margin: 0; background: #0a1017; color: #e9f0f4; font: 14px/1.5 "Segoe UI", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; }
button, a, input, select, summary { touch-action: manipulation; }
button, summary, select { cursor: pointer; }
button:disabled { opacity: .4; cursor: not-allowed; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #8ae4d2; outline-offset: 3px; }
a { color: #a0d6cb; }
[hidden] { display: none !important; }
header, main, footer { width: calc(100% - 48px); max-width: var(--page-width); margin-inline: auto; }
header { height: 44px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #23313e; }
.brand { font-size: 16px; font-weight: 650; letter-spacing: -.02em; color: #edf5f8; text-decoration: none; }
/* Shared Free Tools navigation style: compact, keyboard-accessible back link. */
.tool-nav { padding: 8px 0 0; }
.back-to-tools { display: inline-flex; align-items: center; min-height: 34px; padding: 7px 12px; border: 1px solid #30424e; border-radius: 8px; color: #aabfce; font-size: 12px; line-height: 1.45; font-weight: 600; text-decoration: none; transition: color .15s, border-color .15s, background .15s; }
.back-to-tools:hover { color: #f3f8fa; border-color: #5287a7; background: #14232e; }
.tool-badge { padding: 4px 10px; border: 1px solid #2b5144; border-radius: 6px; background: #15372d; color: #a5dfc8; font-size: 11px; line-height: 1.4; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 10px 0 12px; }
.intro-tagline { margin: 0; flex-shrink: 0; font-size: clamp(24px, 2.1vw, 29px); line-height: 1.2; letter-spacing: -.045em; font-weight: 650; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.intro em { font-style: normal; color: #8ce1ca; }
.lead { flex: 0 1 560px; margin: 0; color: #afc2ce; font-size: 13px; line-height: 1.5; }
.workspace { display: grid; grid-template-columns: 320px minmax(0, 1fr); align-items: stretch; border: 1px solid var(--line); border-radius: 12px; background: #101b25; box-shadow: 0 14px 45px #0002; }
.controls { min-width: 0; padding: 12px 16px; border-right: 1px solid var(--line); border-radius: 11px 0 0 11px; background: #0e1822; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
h2 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.4; letter-spacing: -.02em; }
.text-button { min-width: 44px; min-height: 36px; border: 0; padding: 4px 6px; background: none; color: #b5ced6; font-size: 12px; }
.drop { position: relative; border: 1px dashed #49606c; border-radius: 8px; background: #182733; transition: background .15s; }
.drop.drag { background: #23483e; border-color: #9be3ca; }
.drop input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.drop:focus-within { outline: 2px solid #8ae4d2; outline-offset: 3px; }
.drop label { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; gap: 2px 6px; min-height: 62px; padding: 9px; cursor: pointer; color: #abc2ce; font-size: 12px; }
.drop strong { color: #e3f1f7; font-size: 13px; font-weight: 500; }
.upload-icon { display: none; }
.drop small { grid-column: 1 / -1; text-align: center; color: #9ab3c3; font-size: 11px; line-height: 1.4; }
.file-info { margin-top: 7px; color: #adc4d0; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.file-info strong, .file-info span { display: block; }
.file-info strong { color: #e0ebf0; font-size: 12px; font-weight: 500; }
fieldset { min-width: 0; border: 0; padding: 0; margin: 9px 0 0; }
legend { margin-bottom: 1px; padding: 0; font-size: 11px; line-height: 1.5; color: #b2c8d3; }
.field { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 8px; color: #d1e0e7; font-size: 12px; line-height: 1.5; }
.field select { display: block; min-width: 0; width: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid #3b5362; border-radius: 6px; background: #172734; color: #e0edf2; font-size: 13px; }
select:disabled { opacity: .55; }
.help { margin: 4px 0 6px; color: #a3bbc9; font-size: 11px; line-height: 1.45; }
.primary, .secondary { min-height: 40px; border-radius: 6px; padding: 9px 15px; font-size: 12px; line-height: 1.5; }
.primary { border: 1px solid var(--accent); background: var(--accent); color: #102921; font-weight: 600; }
.primary:hover:not(:disabled) { background: #bcefdc; }
.primary span { margin-left: 10px; }
.secondary { border: 1px solid #405767; background: #192c3a; color: #dce9ee; }
.controls > .secondary { display: block; width: 100%; margin-top: 8px; }
.status { margin-top: 8px; min-height: 32px; color: #b2cbd7; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.status.busy::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border: 1px solid #7bc7b2; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.error { margin-top: 8px; padding-left: 10px; border-left: 2px solid #efaa99; color: #ffd0c7; font-size: 12px; overflow-wrap: anywhere; }
.preview-area { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 16px; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; }
.eyebrow { margin: 0; color: #a3c0cc; font: 10px/1.5 ui-monospace, monospace; letter-spacing: .1em; }
.preview-toolbar h2 { margin-top: 2px; font-size: 17px; }
.preview-note { color: #a3bbc9; font-size: 11px; }
.comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; flex: 1 0 250px; min-height: 250px; }
figure { display: flex; flex-direction: column; min-width: 0; margin: 0; border: 1px solid #304752; border-radius: 8px; background: #0c1720; }
figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; padding: 7px 11px; font-size: 12px; }
figcaption b { font-weight: 500; }
figcaption span { color: #9bbac9; font: 9px/1.4 ui-monospace, monospace; letter-spacing: .04em; text-align: right; overflow-wrap: anywhere; }
.preview-window { position: relative; display: grid; place-items: center; flex: 1; min-height: 210px; background: #101720; border-radius: 0 0 7px 7px; }
.preview-window.checker { background: conic-gradient(#273744 25%, #1a2834 0 50%, #273744 0 75%, #1a2834 0) 0 0 / 18px 18px; }
.preview-window img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 0 0 7px 7px; }
.empty { margin: 0; padding: 20px 12px; text-align: center; color: #a2bac9; font-size: 13px; }
.empty small { color: #90acbd; font-size: 11px; }
.result-info { color: #b8ced9; }
.simple-stats { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; }
.simple-stats b { color: #dcecf1; font-weight: 500; }
.result-info > p { margin: 4px 0 0; color: #b4ccd8; font-size: 11px; line-height: 1.5; }
.export-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; border-top: 1px solid #2b414e; padding-top: 10px; }
.export-bar p { flex: 1 1 170px; margin: 0; color: #a5c0cf; font-size: 11px; }
.export-bar > div { display: flex; flex-wrap: wrap; gap: 8px; }
.code-panel { border-top: 1px solid #2b414e; }
.code-panel summary { display: flex; align-items: center; min-height: 32px; width: fit-content; color: #b6d1df; font-size: 12px; }
.code-panel summary::before { content: "▸"; margin-right: 7px; }
.code-panel[open] summary::before { content: "▾"; }
.code-panel textarea { display: block; width: 100%; min-height: 180px; max-height: 70svh; resize: vertical; margin: 4px 0 0; padding: 12px; border: 1px solid #3a5261; border-radius: 6px; background: #09131d; color: #b2dce1; font: 12px/1.6 ui-monospace, monospace; white-space: pre; overflow: auto; }
.scope-note { margin: 7px 0 5px; color: #9bb3c2; font-size: 10.5px; line-height: 1.45; }
footer { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px 16px; border-top: 1px solid #243642; padding: 10px 0 13px; color: #9cb5c4; font-size: 11px; }
.footer-copy { grid-column: 2; margin: 0; line-height: 1.6; text-align: center; }
.footer-copy a { color: #e9f0f4; font-weight: 650; text-decoration: none; }
.footer-copy a:hover { color: #a6d9e9; text-decoration: underline; }
footer details { grid-column: 3; justify-self: end; max-width: 650px; }
footer details[open] { grid-column: 1 / -1; justify-self: stretch; }
footer summary { display: flex; align-items: center; min-height: 24px; color: #b0cbd9; }
footer summary::before { content: "+"; margin-right: 6px; }
footer details[open] summary::before { content: "−"; }
footer details p { margin: 8px 0; text-align: left; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Minimum rather than fixed/clipped height: disclosures, errors and long text can grow. */
@media (min-width: 1000px) and (min-height: 700px) { .workspace { min-height: calc(100svh - var(--frame-space)); } }
@media (min-width: 721px) and (max-width: 1100px) {
  .workspace { grid-template-columns: 300px minmax(0, 1fr); --frame-space: 222px; }
  .controls, .preview-area { padding-inline: 12px; }
  .field { grid-template-columns: 104px minmax(0, 1fr); }
  .export-bar p { flex-basis: 100%; }
}
@media (max-width: 720px) {
  header, main, footer { width: calc(100% - 32px); }
  header { height: 48px; }
  .intro { display: block; padding: 14px 0; }
  .intro-tagline { font-size: 25px; }
  .lead { margin-top: 8px; font-size: 13px; }
  .workspace { grid-template-columns: 1fr; }
  .controls { padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--line); border-radius: 11px 11px 0 0; }
  .text-button { min-height: 44px; }
  .drop label { min-height: 72px; }
  .file-info { font-size: 12px; }
  .file-info strong { font-size: 13px; }
  fieldset { margin-top: 12px; }
  legend { font-size: 12px; }
  .field { display: block; margin-top: 12px; font-size: 13px; }
  .field select { min-height: 44px; margin-top: 5px; font-size: 14px; }
  .help { font-size: 12px; line-height: 1.5; }
  .status { min-height: 36px; font-size: 12px; }
  .preview-area { padding: 14px; gap: 12px; }
  .preview-toolbar h2 { font-size: 17px; }
  .comparison { grid-template-columns: 1fr; flex: none; gap: 12px; }
  .preview-window { height: clamp(220px, 62vw, 320px); min-height: 220px; flex: none; }
  .simple-stats { font-size: 12px; }
  .result-info > p { font-size: 12px; }
  .export-bar p { flex-basis: 100%; font-size: 12px; }
  .export-bar > div { width: 100%; }
  .export-bar button { flex: 1; min-height: 44px; font-size: 13px; }
  .controls > .secondary { min-height: 44px; }
  .code-panel summary { min-height: 44px; font-size: 13px; }
  .code-panel textarea { min-height: 180px; max-height: none; }
  .scope-note { margin: 10px 0; font-size: 11px; }
  .tool-nav { padding-top: 10px; }
  .back-to-tools { min-height: 44px; font-size: 12px; }
  footer { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 12px 0; }
  .footer-copy { grid-column: 1; }
  footer details { grid-column: 1; justify-self: center; }
  footer details[open] { grid-column: 1; justify-self: stretch; }
  footer summary { min-height: 44px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; scroll-behavior: auto !important; transition: none !important; } }
