/* Medley styles. Values: tokens.gen.css (from DESIGN.md). Layout and motion: DESIGN.md "Layout" and "Motion". */
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/assets/inter-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/assets/inter-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ease: cubic-bezier(.23, 1, .32, 1);
  --ease-move: cubic-bezier(.77, 0, .175, 1);
  --press: 160ms;
  --font: Inter, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Hiragino Sans", "Noto Sans JP", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color-scheme: light dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 var(--fs-body)/1.5 var(--font); -webkit-font-smoothing: antialiased; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.ic { flex: none; overflow: visible; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* A control that works only with JavaScript (data-js) shows once a script sets the "js" class on <html> (lang.js, app.ts). */
html:not(.js) [data-js] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* A file picker is a hidden input inside its label: the label shows the ring (WCAG 2.4.7). */
label:has(> input.vh:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Header */
.top { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: var(--s5); padding: 0 var(--s7); border-bottom: 1px solid var(--hair); }
.brand { display: flex; align-items: center; gap: var(--s2); width: 224px; text-decoration: none; color: var(--ink); font-size: var(--fs-h2); font-weight: 700; letter-spacing: -0.01em; }
.brand .bento { color: var(--brand); }
.tabs { display: flex; gap: var(--s6); font-size: var(--fs-body); }
.tabs a { color: var(--body); text-decoration: none; line-height: 64px; display: block; }
.tabs a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--brand); }
.top-right { width: 224px; display: flex; justify-content: flex-end; }
.lang { position: relative; }
.lang summary { list-style: none; display: flex; align-items: center; gap: var(--s2); color: var(--muted); cursor: pointer; padding: var(--s2) 0; }
.lang summary::-webkit-details-marker { display: none; }
.lang ul { position: absolute; right: 0; top: 100%; z-index: 20; margin: var(--s1) 0 0; padding: var(--s1); list-style: none; min-width: 160px; background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-card); box-shadow: 0 8px 24px var(--shadow), 0 2px 6px var(--shadow-near); transform-origin: top right; animation: pop 180ms var(--ease); }
.lang li a { display: block; padding: var(--s2) var(--s3); border-radius: var(--r-card); text-decoration: none; }
.lang li a[aria-current="true"] { background: var(--hair); }
.menu-btn { display: none; }

/* Search */
.search { position: relative; display: flex; align-items: center; gap: var(--s3); height: 48px; padding: 0 var(--s4); background: var(--field); border: 1px solid var(--edge); border-radius: var(--r-pill); color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: var(--fs-button); color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.search:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.search-top { width: 224px; height: 40px; padding: 0 var(--s3); gap: var(--s2); }
.search-top input { font-size: var(--fs-body); }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; margin: 0; padding: var(--s1); list-style: none; background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-card); box-shadow: 0 8px 24px var(--shadow), 0 2px 6px var(--shadow-near); transform-origin: top center; animation: pop 180ms var(--ease); }
.results[hidden] { display: none; }
.results a { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r-card); text-decoration: none; color: var(--ink); }
/* The picked result: a 2px brand ring inside the row, 3:1 or more against the list in each theme (WCAG 1.4.11). */
.results a[aria-selected="true"] { background: var(--hair); box-shadow: inset 0 0 0 2px var(--brand); }
.results .none { padding: var(--s2) var(--s3); color: var(--muted); }

/* Home */
.hero { display: flex; flex-direction: column; gap: var(--s5); padding: var(--s7) var(--s7) var(--s4); }
.hero h1 { margin: 0; text-align: center; font-size: var(--fs-display); line-height: 1.15; letter-spacing: -0.02em; }
.hero .search { width: 560px; max-width: 100%; margin: 0 auto; }
.bento-row { display: grid; align-items: start; gap: var(--s4); padding: var(--s4) var(--s7) 0; }
.bento-row:last-of-type { padding-bottom: var(--s7); }
.row-a { grid-template-columns: 47fr 27fr; }
.row-b { grid-template-columns: 27fr 47fr; }
.block { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); min-width: 0; scroll-margin-top: var(--s4); }
.block h2, .more-tools h2 { margin: 0; display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-h2); }
.block h2 a { text-decoration: none; }
.g-pdf { --hue: var(--hue-pdf); --tint: var(--tint-pdf); }
.g-image { --hue: var(--hue-image); --tint: var(--tint-image); }
.g-doc { --hue: var(--hue-doc); --tint: var(--tint-doc); }
.g-av { --hue: var(--hue-av); --tint: var(--tint-av); }
.block { background: var(--tint); }
.k1 { border-radius: var(--r-block); }
.k2 { border-radius: 0; }
.k3 { border-radius: var(--r-block); }
.k4 { border-radius: 0 0 var(--r-block) 0; }
.hue { color: var(--hue); display: flex; }
.cards { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.card { display: flex; align-items: center; gap: var(--s3); min-height: 48px; padding: var(--s2) var(--s3); background: var(--card); border-radius: var(--r-card); color: var(--ink); text-decoration: none; line-height: 1.25; overflow-wrap: break-word; word-break: keep-all; transition: transform var(--press) var(--ease), box-shadow 160ms ease; }
.card:active { transform: scale(.97); }
/* Without JavaScript the "More" button stays hidden, so every card shows. */
.js .cards li.extra { display: none; }
.more .fade .p-only { display: none; }
.block.open .cards li.extra { display: block; animation: enter 240ms var(--ease); }
.more { position: relative; display: block; width: 100%; height: 48px; padding: 0; border: 0; background: none; }
.more .fade { position: absolute; inset: 0; display: grid; text-align: start; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--s2); opacity: .35; overflow: hidden; pointer-events: none; }
.more .fade::after { content: ""; position: absolute; inset: 0; background: linear-gradient(color-mix(in srgb, var(--tint) 0%, transparent), color-mix(in srgb, var(--tint) 90%, transparent)); }
.more .chev { position: absolute; left: 50%; bottom: calc(-1 * var(--s2)); translate: -50% 0; width: 32px; height: 32px; border-radius: var(--r-pill); background: var(--card); border: 1px solid var(--hair); display: flex; align-items: center; justify-content: center; color: var(--ink); transition: transform var(--press) var(--ease); }
.more:active .chev { transform: scale(.97); }
.block.open .more { display: none; }

/* Tool page */
main.tool { display: flex; flex-direction: column; gap: var(--s5); padding: var(--s5) var(--s7) var(--s7); }
.crumb { display: inline-flex; align-items: center; min-height: 24px; gap: var(--s1); align-self: flex-start; color: var(--muted); text-decoration: none; }
.tool h1 { margin: 0; text-align: center; font-size: var(--fs-h1); line-height: 1.2; letter-spacing: -0.02em; }
.drop { position: relative; height: 480px; border: 2px dashed var(--dash); border-radius: var(--r-block); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s4); color: var(--muted); transition: transform var(--press) var(--ease), border-color 160ms ease, background-color 160ms ease; }
.drop.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, transparent); transform: scale(1.01); }
.work.over .tiles { outline: 2px dashed var(--brand); outline-offset: var(--s2); border-radius: var(--r-card); }
.drop .over-label { display: none; color: var(--brand); font-weight: 700; }
.drop.over .over-label { display: block; }
.drop.over .idle { display: none; }
.idle { display: flex; flex-direction: column; align-items: center; gap: var(--s4); }
.noscript { max-width: 400px; margin: 0; padding: 0 var(--s4); text-align: center; color: var(--body); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); height: 48px; padding: 0 var(--s5); border: 0; border-radius: var(--r-pill); background: var(--btn); color: var(--btn-fg); font-size: var(--fs-button); font-weight: 700; text-decoration: none; transition: transform var(--press) var(--ease), filter 160ms ease; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--hair); }
.btn.full { width: 100%; }

.work { display: flex; gap: var(--s6); align-items: flex-start; }
.work[hidden], .drop[hidden], .wait[hidden], .done[hidden] { display: none; }
.tiles { flex: 1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s5) var(--s4); align-content: start; margin: 0; padding: 0; list-style: none; animation: enter 240ms var(--ease); }
.tile { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.tile.enter { animation: enter 240ms var(--ease) backwards; }
.tile.leave { animation: leave 160ms var(--ease) forwards; }
.tile .bar { display: flex; justify-content: space-between; align-items: center; height: 24px; color: var(--muted); }
.tile .grip { position: relative; cursor: grab; display: flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; padding: 0; border: 0; background: none; color: inherit; touch-action: none; }
/* On a touch screen the grip takes a 48 by 44 press area (44px or more: house principle 9) with the same 24px look: the area
   grows into the gap above the tile and the side gaps, and stops 8px under the bar, at the top of the page preview. */
@media (pointer: coarse) { .tile .grip::after { content: ""; position: absolute; inset: calc(-1 * var(--s3)) calc(-1 * var(--s3)) calc(-1 * var(--s2)); } }
.tile .x { display: flex; padding: var(--s1); border: 0; background: none; color: inherit; border-radius: var(--r-pill); transition: transform var(--press) var(--ease); }
.tile .x:active { transform: scale(.97); }
.sheet { position: relative; height: 140px; background: var(--sheet); border: 1px solid var(--hair); border-radius: var(--r-card); overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 0; width: 100%; transition: border-color 160ms ease, box-shadow 160ms ease; }
.sheet canvas, .sheet img { max-width: 100%; max-height: 100%; display: block; transition: transform 200ms var(--ease-move); }
.sheet .lockmsg { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--s2); background: var(--card); color: var(--warn); font-size: var(--fs-label); font-weight: 600; display: flex; gap: var(--s1); align-items: center; }
.tile.locked .sheet { border: 2px solid var(--warn); }
.tile.sel .sheet { border: 2px solid var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.tile.sel .mark { display: flex; }
.mark { display: none; position: absolute; top: var(--s2); right: var(--s2); width: var(--s5); height: var(--s5); border-radius: var(--r-pill); background: var(--brand); color: var(--btn-fg); align-items: center; justify-content: center; animation: enter 160ms var(--ease); }
.tile .name { font-size: var(--fs-label); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.tile .meta { min-height: 1lh; font-size: var(--fs-label); color: var(--muted); font-variant-numeric: tabular-nums; }
.tile.dragging { position: relative; z-index: 30; cursor: grabbing; background: var(--bg); border-radius: var(--r-card); }
.tile.dragging .x { visibility: hidden; }
.tile.dragging .sheet { box-shadow: 0 8px 24px var(--shadow), 0 2px 6px var(--shadow-near); }
/* A tile picked up with a press on its grip (a reorder with no drag): the held-tile shadow and a brand edge until the next press. */
.tile.held .grip { color: var(--brand); }
.tile.held .sheet { border: 2px solid var(--brand); box-shadow: 0 8px 24px var(--shadow), 0 2px 6px var(--shadow-near); }
.tile.add .sheet { border: 2px dashed var(--dash); background: transparent; flex-direction: column; gap: var(--s2); color: var(--muted); font-size: var(--fs-body); cursor: pointer; transition: transform var(--press) var(--ease), border-color 160ms ease; }
.tile.add .sheet:active { transform: scale(.97); }
.panel { width: 240px; flex: none; display: flex; flex-direction: column; gap: var(--s4); position: sticky; top: 24px; }
.field { display: flex; flex-direction: column; gap: var(--s1); }
.field label, .field .lab { font-size: var(--fs-label); font-weight: 600; color: var(--body); }
.field input, .field select { height: 40px; padding: 0 var(--s3); border: 1px solid var(--edge); border-radius: var(--r-card); background: var(--field); font-size: var(--fs-body); }
.field input:-webkit-autofill { -webkit-text-fill-color: var(--ink); caret-color: var(--ink); }
.field .err { font-size: var(--fs-label); color: var(--error); }
.seg { display: flex; gap: var(--s1); padding: var(--s1); border: 1px solid var(--hair); border-radius: var(--r-pill); }
.seg button { flex: 1; height: 32px; border: 0; border-radius: var(--r-pill); background: none; color: var(--body); font-size: var(--fs-label); font-weight: 600; transition: background-color 160ms ease, transform var(--press) var(--ease); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg button:active { transform: scale(.97); }
.sigpad { width: 100%; height: 120px; border: 1px solid var(--edge); border-radius: var(--r-card); background: var(--sheet); touch-action: none; display: block; }
.sig-actions { display: flex; justify-content: flex-end; }
.linkbtn { border: 0; background: none; padding: var(--s1) 0; color: var(--muted); font-size: var(--fs-label); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.panel .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
/* An error line: under the drop button, or above the main button. It stays until the next action. */
.msg { margin: 0; font-size: var(--fs-label); color: var(--error); }
.drop .msg { max-width: 400px; padding: 0 var(--s4); text-align: center; }
.msg:empty { display: none; }

.wait { height: 400px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s5); }
.wait .bento { color: var(--brand); }
.wait .bento path { opacity: .2; transition: opacity 240ms var(--ease); }
.wait .bento path.on { opacity: 1; }
.wait .bento path.next { animation: breathe 1200ms ease-in-out infinite alternate; }
.wait-title { font-size: var(--fs-h2); font-weight: 700; }
.wait-sub { color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1.5em; }

.done { display: flex; flex-direction: column; gap: var(--s5); }
.result { display: flex; gap: var(--s5); align-items: center; justify-content: center; padding: var(--s5); border: 1px solid var(--hair); border-radius: var(--r-block); animation: enter-card 280ms var(--ease); }
.result .preview { width: 160px; height: 208px; flex: none; background: var(--sheet); border: 1px solid var(--hair); border-radius: var(--r-card); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.result .preview canvas, .result .preview img { max-width: 100%; max-height: 100%; }
.result .info { display: flex; flex-direction: column; gap: var(--s2); width: 400px; max-width: 100%; }
.result .fname { font-size: var(--fs-h2); font-weight: 700; overflow-wrap: anywhere; }
.result .fmeta { color: var(--muted); font-variant-numeric: tabular-nums; }
.result .acts { display: flex; gap: var(--s3); margin-top: var(--s2); flex-wrap: wrap; }
.more-tools { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); border-radius: var(--r-block); background: var(--tint); }
.more-tools .cards { --cols: 6; }
footer { padding: var(--s5) var(--s7) var(--s7); color: var(--muted); font-size: var(--fs-label); text-align: center; }

@keyframes enter { from { opacity: 0; transform: scale(.97); } }
@keyframes enter-card { from { opacity: 0; transform: scale(.96); } }
@keyframes leave { to { opacity: 0; transform: scale(.97); } }
@keyframes pop { from { opacity: 0; transform: scale(.95); } }
@keyframes breathe { from { opacity: .2; } to { opacity: .6; } }

/* Hover only where a pointer can hover: a tap leaves no ring on a phone. */
@media (hover: hover) {
  .tabs a:hover { color: var(--ink); }
  .card:hover { box-shadow: 0 0 0 1px var(--hair); }
  .crumb:hover { color: var(--ink); }
  .btn:hover { filter: brightness(1.08); }
  .tile .x:hover { color: var(--ink); background: var(--hair); }
  .tile.add .sheet:hover { border-color: var(--brand); color: var(--ink); }
  .block h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
  .lang li a:hover, .results a:hover { background: var(--hair); }
}

/* Phone */
@media (max-width: 719px) {
  .top { height: 56px; padding: 0 var(--s4); }
  .hero { gap: var(--s4); padding: var(--s5) var(--s4) var(--s2); }
  .hero h1 { text-align: left; font-size: var(--fs-h1-small); }
      .bento-row { grid-template-columns: 1fr; padding: var(--s4) var(--s4) 0; }
  .bento-row:last-of-type { padding-bottom: var(--s5); }
  .block { padding: var(--s4); --cols: 2 !important; }
  .js .block:not(.open) .cards li.p-extra { display: none; }
  .more .fade .p-only { display: flex; }
  main.tool { padding: var(--s4); gap: var(--s4); }
  /* While the fixed bottom panel shows, the footer keeps room for it (app.ts measures the panel into --panel-h). */
  body:has([data-work]:not([hidden])) footer { padding-bottom: calc(var(--panel-h, 0px) + var(--s5)); }
  /* A focused tile scrolls into the part of the page above the fixed panel. */
  html:has([data-work]:not([hidden])) { scroll-padding-bottom: var(--panel-h, 0px); }
  .tool h1 { text-align: left; font-size: var(--fs-h1-small); }
  .drop { height: 360px; }
  .drop .idle span { display: none; }
  .work { flex-direction: column; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s3); width: 100%; }
  .sheet { height: 144px; }
  .panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; z-index: 15; padding: var(--s4) var(--s4) var(--s5); background: var(--bg); border-top: 1px solid var(--hair); gap: var(--s3); max-height: 60dvh; overflow: auto; padding-bottom: calc(var(--s5) + env(safe-area-inset-bottom)); }
  .result { flex-direction: column; align-items: stretch; }
  .result .preview { align-self: center; }
  .result .acts { flex-direction: column; }
  .result .acts .btn { width: 100%; }
  .more-tools { padding: var(--s4); }
  .more-tools .cards { --cols: 2; }
  footer { padding: var(--s5) var(--s4) var(--s6); }
}
@media (max-width: 1023px) and (min-width: 720px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .top { padding: 0 var(--s5); }
  /* The 47:27 cells are too narrow for 3 and 2 card columns here: the blocks stack, as on a phone. */
  .row-a, .row-b { grid-template-columns: 1fr; }
  .block { --cols: 3 !important; }
  .more-tools .cards { --cols: 3; }
}
/* Next to the 240px panel, 4 tiles are too narrow for names and previews below 900px. */
@media (max-width: 899px) and (min-width: 720px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 359px) {
  .block { --cols: 1 !important; }
  .more-tools .cards { --cols: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-delay: 0s !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-property: opacity, color, background-color, border-color !important; transition-duration: 160ms !important; }
  .card:active, .btn:active, .tile .x:active, .tile.add .sheet:active, .seg button:active, .more:active .chev { transform: none; }
  .drop.over { transform: none; }
  .wait .bento path.next { animation: none; opacity: .5; }
}

/* iOS zooms into a field with text under 16px (house UI rules section 4). */
@media (max-width: 1023px) { .field input, .field select, .search input { font-size: var(--fs-button); } }

/* Phone menu and footer */
.phone-acts { display: none; gap: var(--s2); }
.icon-btn { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-pill); background: radial-gradient(circle, var(--hair) 18px, transparent 18.5px); color: var(--ink); transition: transform var(--press) var(--ease); }
.icon-btn:active { transform: scale(.97); }
.menu-sheet { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; padding: var(--s4) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom)); border: 0; background: var(--bg); color: var(--ink); flex-direction: column; gap: var(--s5); }
.menu-sheet[open] { display: flex; animation: enter 240ms var(--ease); }
.menu-sheet::backdrop { background: color-mix(in srgb, var(--ink) 30%, transparent); }
.sheet-top { display: flex; align-items: center; justify-content: space-between; }
.sheet-top .brand { width: auto; }
.sheet-groups { display: flex; flex-direction: column; gap: var(--s2); }
/* The current group: the same 2px brand line as the current header tab, under the label. */
.sheet-groups a[aria-current="page"] .label { box-shadow: inset 0 -2px 0 var(--brand); }
.sheet-groups a { display: flex; align-items: center; gap: var(--s3); min-height: 48px; text-decoration: none; font-size: var(--fs-h2); font-weight: 700; }
.sheet-lang .lab { display: flex; align-items: center; gap: var(--s2); color: var(--muted); font-size: var(--fs-label); font-weight: 600; }
.sheet-lang ul, .foot-lang { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: var(--s2) 0 0; padding: 0; list-style: none; }
.sheet-lang a, .foot-lang a { display: inline-block; padding: var(--s2) 0; text-decoration: none; color: var(--body); }
.sheet-lang a[aria-current="true"], .foot-lang a[aria-current="true"] { color: var(--ink); font-weight: 700; }
footer { display: flex; flex-direction: column; align-items: center; gap: var(--s2); }
.foot-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2) var(--s5); }
.foot-legal a { display: inline-flex; align-items: center; min-height: 24px; color: var(--muted); text-decoration: none; }
@media (hover: hover) { .foot-legal a:hover, .foot-lang a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; } }
/* Below 1024px four group tabs do not fit beside the mark: the header works as on a phone (search and menu buttons;
   the menu sheet holds the search, the groups and the languages). */
@media (max-width: 1023px) {
  .brand { width: auto; }
  .tabs, .top-right { display: none; }
  .phone-acts { display: flex; }
}
.num { position: relative; display: flex; }
.num input { flex: 1; min-width: 0; padding-right: var(--s7); }
.num .unit { position: absolute; right: var(--s3); top: 50%; translate: 0 -50%; color: var(--muted); font-size: var(--fs-label); pointer-events: none; }
/* At about 200% zoom of a 390px phone (195px) the mark, the name and two 44px buttons do not fit: the name hides
   (the link keeps it as its accessible name) and the gaps get smaller. */
@media (max-width: 259px) {
  .top { gap: var(--s2); padding: 0 var(--s2); }
  .top .brand > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
