/* Converters / Formatters hub pages. Everything is scoped to #hub so it cannot disturb the rest of the site; colours come from the
   site's tokens in /style.css (so light and dark theme both work). */
main.hub-page { max-width: 1400px; padding-top: 137px; }
main.hub-page > .breadcrumbs { margin-bottom: 14px; }

#hub {
  --panel: var(--surface);
  --panel-2: color-mix(in srgb, var(--text) 6%, var(--surface));
  --line: var(--border);
  --line-2: color-mix(in srgb, var(--text) 16%, var(--border));
  --faint: color-mix(in srgb, var(--muted) 80%, var(--bg));
  --accent-ink: var(--on-accent);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --ok: #3ddc97; --warn: #ffb454; --err: #ff6b6b; --info: #6cb6ff;
  --side-w: 290px;
  display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); gap: 28px; align-items: start;
}

/* ---------------------------------------------------------------- sidebar */
#hub .side { position: sticky; top: 100px; max-height: calc(100vh - 116px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
#hub .side-title { display: block; padding: 16px 18px 4px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; text-decoration: none; }
#hub .search { display: block; margin: 8px 14px 4px; }
#hub .search input { width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; font-size: 14px; color: var(--text); }
#hub .search input::placeholder { color: var(--faint); }
#hub .search input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
#hub .side nav { flex: 1; overflow-y: auto; padding: 6px 8px 10px; scrollbar-width: thin; }
#hub .side ol { list-style: none; margin: 0; padding: 0; }
#hub .side li { margin: 1px 0; }
#hub .side nav a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); border-left: 3px solid transparent; }
#hub .side nav a:hover { background: var(--panel-2); color: var(--text); }
#hub .side nav a[aria-current="page"] { background: var(--accent-soft); color: var(--text); border-left-color: var(--accent); }
#hub .side .n { font: 600 12px/1.9 var(--mono); color: var(--faint); }
#hub .side a[aria-current="page"] .n { color: var(--accent); }
#hub .side .t { display: block; font-weight: 600; font-size: 14.5px; color: var(--text); line-height: 1.3; }
#hub .side .s { display: block; font-size: 12.5px; color: var(--faint); line-height: 1.35; }
#hub .no-match { margin: 14px; color: var(--faint); font-size: 14px; }
#hub .side-foot { margin: 0; padding: 12px 18px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--faint); }
#hub .side-foot b { color: var(--muted); font-weight: 600; }
#hub .topbar { display: none; }

/* ------------------------------------------------------------------- main */
#hub .hub-main { min-width: 0; }
/* the prerendered sidebar and intro are replaced by hub.js; keep them invisible until it has built the real page (revealed after 3s if the script never runs) */
#hub:not(.hub-ready) { visibility: hidden; animation: hub-reveal 0s 3s forwards; }
@keyframes hub-reveal { to { visibility: visible; } }
#hub .crumb { margin: 0 0 6px; font-size: 13px; color: var(--faint); }
#hub .crumb a { text-decoration: none; }
#hub .crumb a:hover { text-decoration: underline; }
#hub .crumb b { color: var(--accent); font-family: var(--mono); font-weight: 600; }
#hub .tool-head h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 6.4vw, 2.8rem); line-height: 1.12; letter-spacing: -.03em; }
#hub .blurb { margin: 0 0 24px; max-width: 74ch; color: var(--muted); font-size: 16px; }
#hub .cards { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
#hub .card-link { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; transition: border-color var(--dur-fast), transform var(--dur-fast); }
#hub .card-link:hover { border-color: var(--accent); transform: translateY(-2px); }
#hub .card-link strong { font-size: 16px; }
#hub .card-link .sub { font-size: 12.5px; color: var(--accent); font-weight: 600; }
#hub .card-link .bl { font-size: 13.5px; color: var(--muted); flex: 1; }
#hub .card-link .go { font-size: 13px; font-weight: 600; display: flex; gap: 6px; align-items: center; }

#hub .panels { display: grid; grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr); gap: 0; align-items: stretch; }
#hub .arrow { display: grid; place-items: center; color: var(--accent); }
#hub .arrow span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line-2); font-size: 14px; }
#hub .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; min-width: 0; min-height: 460px; }
#hub .panel > header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
#hub .panel h2 { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
#hub .tag { font: 700 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line-2); }
#hub .panel.to .tag { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
#hub .panel-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; }
#hub .hint { color: var(--faint); font-size: 14px; margin: 0; }

#hub .drop { border: 2px dashed var(--line-2); border-radius: 12px; padding: 34px 18px; text-align: center; cursor: pointer; background: var(--panel-2); transition: border-color .15s, background .15s; display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; justify-content: center; min-height: 240px; }
#hub .drop:hover, #hub .drop.over { border-color: var(--accent); background: var(--accent-soft); }
#hub .drop .big { font-size: 17px; font-weight: 600; }
#hub .drop .or { color: var(--faint); font-size: 13.5px; }
#hub .drop .fa-solid { font-size: 30px; color: var(--accent); margin-bottom: 8px; }
#hub .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

#hub .btn { appearance: none; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; text-decoration: none; }
#hub .btn:hover { border-color: var(--muted); }
#hub .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
#hub .btn.primary:hover { filter: brightness(1.07); }
#hub .btn.small { padding: 5px 10px; font-size: 13px; font-weight: 500; }
#hub .btn.ghost { background: transparent; }
#hub .btn[disabled] { opacity: .45; cursor: not-allowed; }

#hub .filecard { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel-2); }
#hub .filecard .ico { width: 36px; height: 36px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 700 10px var(--mono); text-transform: uppercase; }
#hub .filecard .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hub .filecard .sz { font-size: 12.5px; color: var(--faint); }
#hub .info { font-size: 13.5px; color: var(--muted); margin: 0; }

#hub .opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; }
#hub .opt { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); min-width: 0; }
#hub .opt > span { font-weight: 500; }
#hub .opt select, #hub .opt input[type=text] { background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 9px; font-size: 14px; color: var(--text); width: 100%; min-width: 0; }
#hub .opt select:focus, #hub .opt input[type=text]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
#hub .opt.check { flex-direction: row; align-items: flex-start; gap: 9px; color: var(--text); cursor: pointer; }
#hub .opt.check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 2px 0 0; flex: none; }
#hub .opt.check span { font-weight: 400; color: var(--text); }
#hub .segment { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; background: var(--bg); }
#hub .segment label { cursor: pointer; }
#hub .segment input { position: absolute; opacity: 0; pointer-events: none; }
#hub .segment span { display: block; padding: 7px 16px; font-size: 14px; font-weight: 600; color: var(--muted); }
#hub .segment input:checked + span { background: var(--accent); color: var(--accent-ink); }
#hub .segment input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

#hub .chips-label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin: 0 0 8px; padding: 0; }
#hub .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
#hub .chip { position: relative; }
#hub .chip input { position: absolute; opacity: 0; pointer-events: none; }
#hub .chip span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel-2); font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); }
#hub .chip:hover span { border-color: var(--muted); color: var(--text); }
#hub .chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
#hub .chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

#hub textarea.inp, #hub .out { width: 100%; flex: 1; min-height: 300px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 13px; font: 13.5px/1.55 var(--mono); color: var(--text); resize: vertical; tab-size: 4; }
#hub textarea.inp:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
#hub textarea.inp::placeholder { color: var(--faint); }
#hub .out { margin: 0; overflow: auto; white-space: pre; max-height: 560px; resize: none; }
#hub .out.wrap { white-space: pre-wrap; word-break: break-word; }

#hub .status { margin: 0; padding: 9px 12px; border-radius: 9px; font-size: 14px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
#hub .status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: currentColor; }
#hub .status.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 9%, transparent); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
#hub .status.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, transparent); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
#hub .status.error { color: var(--err); background: color-mix(in srgb, var(--err) 9%, transparent); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
#hub .status.info { color: var(--info); background: color-mix(in srgb, var(--info) 8%, transparent); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
#hub .status > span { color: var(--text); flex: 1; }
#hub .notes { margin: 0; padding: 0 0 0 18px; color: var(--muted); font-size: 13.5px; }
#hub .notes li { margin: 2px 0; }
#hub .mismatch { border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
#hub .mismatch p { margin: 0; }

#hub .tabs { display: inline-flex; gap: 4px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px; padding: 3px; align-self: flex-start; }
#hub .tabs button { background: none; border: 0; padding: 5px 12px; border-radius: 7px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; }
#hub .tabs button[aria-selected=true] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

#hub .tablewrap { overflow: auto; border: 1px solid var(--line-2); border-radius: 10px; max-height: 520px; background: var(--bg); }
#hub table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 13.5px; }
#hub th, #hub td { padding: 7px 11px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
#hub th { position: sticky; top: 0; background: var(--panel-2); font-weight: 600; font-size: 12.5px; color: var(--muted); white-space: nowrap; z-index: 1; }
#hub td { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
#hub table.texty { width: 100%; min-width: 0; }
#hub table.texty td { white-space: normal; overflow-wrap: anywhere; }
#hub table.texty td.sev-error, #hub table.texty td.sev-warning, #hub table.texty td.sev-info, #hub table.texty td[class^=cx-] { white-space: nowrap; }
#hub td.long { white-space: normal; min-width: 200px; max-width: 460px; overflow-wrap: anywhere; font-family: var(--font); font-size: 13px; }
#hub tr:last-child td { border-bottom: 0; }
#hub td.err { color: var(--err); font-weight: 600; }
#hub td.sev-error, #hub td.sev-warning, #hub td.sev-info, #hub td[class^=cx-] { font-family: var(--font); font-weight: 600; white-space: nowrap; }
#hub td.sev-error { color: var(--err); } #hub td.sev-warning { color: var(--warn); } #hub td.sev-info { color: var(--info); }
#hub td.cx-simple { color: var(--ok); } #hub td.cx-moderate { color: var(--warn); } #hub td.cx-complex { color: var(--err); }
#hub .swatches { display: flex; gap: 4px; flex-wrap: wrap; }
#hub .sw { width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line-2); display: flex; align-items: flex-end; justify-content: center; font: 600 9.5px var(--mono); padding-bottom: 3px; }
#hub .sw.low { outline: 2px solid var(--warn); outline-offset: 1px; }
#hub .swlabel { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }

#hub .notes-card { margin-top: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 16px 20px; }
#hub .notes-card h2 { margin: 0 0 8px; font-size: 14px; letter-spacing: .02em; }
#hub .notes-card ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
#hub .notes-card li { margin: 4px 0; }
#hub .privacy { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13.5px; margin: 12px 0 0; }
#hub .privacy .fa-solid { color: var(--ok); flex: none; }
#hub .spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: hub-sp .7s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes hub-sp { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  #hub .panels { grid-template-columns: minmax(0, 1fr); }
  #hub .arrow { height: 42px; }
  #hub .arrow span { transform: rotate(90deg); }
  #hub .panel { min-height: 0; }
}
/* a wide result table (5+ columns) gets the full width: From on top, To below */
#hub .panels.stack { grid-template-columns: minmax(0, 1fr); }
#hub .panels.stack .arrow { height: 42px; }
#hub .panels.stack .arrow span { transform: rotate(90deg); }
#hub .panels.stack .panel { min-height: 0; }
#hub .panels.stack textarea.inp { flex: none; height: 220px; min-height: 160px; }
@media (max-width: 860px) {
  #hub { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  #hub .topbar { display: flex; align-items: center; gap: 12px; }
  #hub .side { position: fixed; inset: 0 auto 0 0; max-height: none; width: min(88vw, 340px); z-index: 60; border-radius: 0; transform: translateX(-102%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0); }
  #hub .side.open { transform: none; visibility: visible; transition: transform .2s ease, visibility 0s; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); }
}
@media (prefers-reduced-motion: reduce) { #hub * { transition: none !important; animation: none !important; } }
#hub .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Converters landing: one drop zone, then the formats it can become */
#hub .tool-head.center { text-align: center; }
#hub .landing { margin: 28px 0 0; display: flex; flex-direction: column; gap: 18px; }
#hub .drop { min-height: 300px; }
#hub .landing .pick-q { margin: 6px 0 0; text-align: center; color: var(--muted); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
#hub .landing .targets { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
#hub .landing .targets .btn { padding: 13px 26px; font-size: 16px; }
#hub .drop > .fa-cloud-arrow-up { font-size: 56px; color: var(--accent); margin-bottom: 8px; }
#hub .drop .big { font-size: 26px; }
#hub .drop .or { margin-bottom: 14px; font-size: 16px; }
#hub .sel-btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 34px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 18px; }
#hub .drop:hover .sel-btn, #hub .drop:focus-visible .sel-btn { filter: brightness(1.08); }
#hub .sel-btn .fa-solid { color: inherit; font-size: 1em; margin: 0; }
#hub .convert-bar { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
#hub .convert-bar .row { justify-content: flex-start; }
#hub .convert-bar .row[hidden] { display: none; }
#hub .btn.big { padding: 13px 34px; font-size: 17px; }
#hub .panels.stack .panel[hidden] { display: none; }
#hub .panel.big-box { min-height: 520px; padding: 12px 12px 20px; }
#hub .panel.big-box .panel-body { padding: 14px; }
#hub .result-area { padding: 14px; border-top: 1px solid var(--line); margin: 6px 14px 0; padding-left: 0; padding-right: 0; display: flex; flex-direction: column; gap: 12px; }
#hub .result-area[hidden] { display: none; }
#hub .result-area .panel-body { padding: 0; }
#hub .landing { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 26px; min-height: 420px; }


/* Converters landing, file list: one row per file, with the output format picker on the row and the action bar along the bottom of the card */
#hub .landing:has(.batch) { padding-bottom: 0; }
#hub .batch { display: flex; flex-direction: column; flex: 1; gap: 18px; min-height: 340px; }
#hub .blist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
#hub .bfile { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel-2); }
#hub .bfile .ico { width: 40px; height: 40px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 700 10px var(--mono); text-transform: uppercase; }
#hub .bfile .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hub .bfile .sz { font-size: 12.5px; color: var(--faint); }
#hub .bpick { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
#hub .blabel { display: inline-flex; align-items: center; gap: 8px; }
#hub .bchip { padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--text); font-weight: 600; font-size: 13px; }
#hub .dd { position: relative; }
#hub .dd-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 160px; padding: 8px 12px; font: 500 14px var(--font); color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; cursor: pointer; transition: border-color .15s, background .15s; }
#hub .dd-btn:hover:not(:disabled), #hub .dd.open .dd-btn { border-color: var(--accent); }
#hub .dd-btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#hub .dd-btn:disabled { opacity: .5; cursor: default; }
#hub .dd-btn i { font-size: 11px; color: var(--muted); transition: transform .15s; }
#hub .dd.open .dd-btn i { transform: rotate(180deg); }
#hub .dd.need .dd-btn { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, var(--line-2)); background: var(--accent-soft); }
#hub .dd.need .dd-btn i { color: var(--accent); }
#hub .dd-list { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; min-width: 100%; margin: 0; padding: 5px; list-style: none; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 14px 34px rgba(0, 0, 0, .45); }
#hub .dd-list[hidden] { display: none; }
#hub .dd-opt { margin-top: 2px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8px 10px; border-radius: 7px; font-size: 14px; color: var(--text); cursor: pointer; white-space: nowrap; }
#hub .dd-opt.on, #hub .dd-opt:hover { background: color-mix(in srgb, var(--text) 9%, transparent); }
#hub .dd-opt[aria-selected="true"] { font-weight: 600; }
#hub .dd-opt i { font-size: 12px; color: var(--muted); }
#hub .bremove { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
#hub .bremove:hover:not(:disabled) { background: var(--accent-soft); color: var(--text); }
#hub .bremove:disabled { opacity: .4; cursor: default; }
#hub .bstate { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); min-width: 0; }
#hub .bstate.ok { color: var(--text); }
#hub .bstate.ok .fa-check { color: #34d399; }
#hub .bstate.bad { color: #f87171; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hub .bbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: auto -26px 0; padding: 16px 26px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; background: var(--panel-2); }
#hub .binfo-text { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; color: var(--muted); }
#hub .bactions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
#hub .bactions .btn { display: inline-flex; align-items: center; gap: 10px; }
#hub .bactions .btn[hidden] { display: none; }
@media (max-width: 720px) {
  #hub .bfile { grid-template-columns: 40px minmax(0, 1fr) auto; }
  #hub .bpick { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; }
  #hub .bbar { flex-direction: column; align-items: stretch; }
  #hub .bactions { margin-left: 0; flex-wrap: wrap; }
}

/* text tools: the Download and Copy buttons sit in a bar along the bottom of the result panel, like the file list card */
#hub .panel.to .panel-body { display: flex; flex-direction: column; }
#hub .panel.to .row:has([data-role="download"]) { justify-content: flex-end; margin: auto -14px -14px; padding: 14px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; background: var(--panel-2); }

/* ShapeGrid background (converters and formatters): a fixed canvas behind the page */
#shape-grid-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .45; }
body:has(#shape-grid-bg) main.hub-page, body:has(#shape-grid-bg) .site-footer { position: relative; z-index: 1; }

/* the drop area has no inner box: only the outer rectangle stays (a dashed outline appears while a file is dragged over) */
#hub .landing .drop, #hub .big-box .drop { border: 2px dashed transparent; background: none; }
#hub .landing .drop:hover, #hub .big-box .drop:hover { background: none; }
#hub .landing .drop.over, #hub .big-box .drop.over { border-color: var(--accent); background: var(--accent-soft); }

/* animated from -> to graphic */
#hub .flow { max-width: 520px; margin: 4px auto 18px; }
#hub .f-svg { display: block; width: 100%; height: auto; overflow: visible; }
#hub .f-ring { fill: none; stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 7; opacity: .55; transform-origin: 260px 115px; animation: f-turn 60s linear infinite; }
#hub .f-ring.r2 { animation-duration: 90s; animation-direction: reverse; opacity: .35; }
#hub .f-box { fill: var(--panel-2); stroke: var(--line-2); stroke-width: 1; }
#hub .f-card.to:not(.idle) .f-box { stroke: var(--accent); fill: color-mix(in srgb, var(--accent) 9%, var(--panel-2)); animation: f-glow 2.4s ease-in-out infinite; }
#hub .f-card.idle .f-box { stroke-dasharray: 5 6; }
#hub .f-card.to.idle { opacity: .55; }
#hub .f-ico { fill: none; stroke: var(--text); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#hub .f-card.to:not(.idle) .f-ico { stroke: var(--accent); }
#hub .f-glyph { fill: var(--text); stroke: none; font: 700 19px var(--mono); }
#hub .f-card.to:not(.idle) .f-glyph { fill: var(--accent); }
#hub .f-label { fill: var(--text); font: 700 15px var(--font); letter-spacing: .02em; }
#hub .f-card.to:not(.idle) .f-label { fill: var(--accent); }
#hub .f-dot { fill: var(--muted); animation: f-blink 1.2s ease-in-out infinite; }
#hub .f-dot.d1 { animation-delay: .2s; } #hub .f-dot.d2 { animation-delay: .4s; }
#hub .bob { animation: f-bob 1.6s ease-in-out infinite; }
#hub .f-line { stroke: var(--line-2); stroke-width: 1.5; stroke-dasharray: 4 5; animation: f-flow 1s linear infinite; }
#hub .f-hub-bg { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.2; }
#hub .f-spin { transform-origin: 260px 115px; animation: f-turn 6s linear infinite; }
#hub .f-arrows { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#hub .f-cap { fill: var(--muted); font: 500 12px var(--font); letter-spacing: .28em; }
#hub .f-pulse { fill: var(--accent); }
@keyframes f-turn { to { transform: rotate(360deg); } }
@keyframes f-flow { to { stroke-dashoffset: -18; } }
@keyframes f-glow { 50% { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 45%, transparent)); } }
@keyframes f-bob { 50% { transform: translateY(-6px); } }
@keyframes f-blink { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { #hub .flow * { animation: none !important; } }

/* title and graphic share one row */
#hub .head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 18px; }
#hub .head-row .tool-head { flex: 1 1 0; min-width: 0; margin-bottom: 0; }
#hub .head-row .tool-head p:last-child { margin-bottom: 0; }
#hub .head-row .flow { flex: 0 0 min(400px, 42%); max-width: none; margin: 0; }
@media (max-width: 900px) { #hub .head-row { flex-direction: column; align-items: stretch; } #hub .head-row .flow { flex: none; width: min(400px, 100%); margin: 0 auto; } }

/* glass look for the big file box: the same smoky glass as the header */
#hub .landing, #hub .panel.big-box {
  background: rgba(22, 22, 25, .58);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5);
}

/* Formatters landing: same card as the converters drop zone, with the tools as buttons */
#hub .fmt-landing { align-items: center; justify-content: center; text-align: center; min-height: 420px; }
#hub .fmt-landing > .fa-code { font-size: 56px; color: var(--accent); }
#hub .fmt-landing .big { font-size: 26px; margin-bottom: 8px; }

/* Formatters: input and result share one rectangle */
#hub .one .panel { min-height: 0; }
#hub .one .panel > header.mid { border-top: 1px solid var(--line); }
#hub .one .tag.to { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
#hub .one textarea.inp { flex: none; height: 240px; min-height: 160px; }
#hub .one .out { background: #000; border-color: var(--line); }
#hub.solo { grid-template-columns: minmax(0, 1fr); }
#hub.solo .side, #hub.solo .topbar { display: none; }
