/* Layout: a single column; the landscape is the hero, details beside it on wide
   screens, examples as a scroll-snap strip at the bottom. Cool paper and
   slate ink, a dusk-blue accent, amber only for the favorite star. */
:root {
  --bg: #eef1f2;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #5a6772;
  --line: #d5dce0;
  --accent: #2f4e7a;
  --accent-ink: #ffffff;
  --star: #d9971c;
  --scrim: rgba(12, 18, 24, 0.72);
  --display: "Young Serif", Georgia, "Times New Roman", serif;
  --body: "Figtree", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  /* bit map namespace colors */
  --ns-global: #9aa19c; --ns-global-extra: #ab9f91; --ns-sky: #8fb8d8; --ns-celestial: #e2a43c; --ns-mountains: #6f7f98;
  --ns-hills: #8fae6e; --ns-trees: #3f6b4a; --ns-vegetation: #c1b36a; --ns-fog: #b9a9c9;
  --cell-ink: #ffffff;
  --glow: 0.6;
  color-scheme: light;
}
/* Dark: follows the system unless the visitor picked a theme (data-theme). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f151c; --panel: #16202a; --ink: #e5ecf1; --muted: #8fa0ad; --line: #26323d;
    --accent: #8db4e8; --accent-ink: #0f151c; --star: #f0b545; --scrim: rgba(4, 7, 10, 0.8);
    --ns-global: #59615c; --ns-global-extra: #6f665b; --ns-sky: #5f8fb4; --ns-celestial: #c98a22; --ns-mountains: #5a6a86;
    --ns-hills: #6d8f4f; --ns-trees: #4f8a5e; --ns-vegetation: #a39553; --ns-fog: #8f7fa3;
    --cell-ink: #f4f7f5;
    --glow: 0.45;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f151c; --panel: #16202a; --ink: #e5ecf1; --muted: #8fa0ad; --line: #26323d;
  --accent: #8db4e8; --accent-ink: #0f151c; --star: #f0b545; --scrim: rgba(4, 7, 10, 0.8);
  --ns-global: #59615c; --ns-global-extra: #6f665b; --ns-sky: #5f8fb4; --ns-celestial: #c98a22; --ns-mountains: #5a6a86;
  --ns-hills: #6d8f4f; --ns-trees: #4f8a5e; --ns-vegetation: #a39553; --ns-fog: #8f7fa3;
  --cell-ink: #f4f7f5;
  --glow: 0.45;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; }
[hidden] { display: none !important; }

/* a soft, blurred wash of the current landscape behind the page */
.glow { position: fixed; inset: 0; z-index: -1; overflow: hidden; opacity: var(--glow); pointer-events: none; }
.glow::before { content: ""; position: absolute; inset: -12%; background: var(--glow-img, none) center / cover no-repeat; filter: blur(56px) saturate(1.35); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; }
code { font-family: var(--mono); font-size: 0.86em; word-break: break-all; }

/* header */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 14px max(20px, env(safe-area-inset-left)); padding-top: calc(14px + env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.wordmark { font-family: var(--display); font-size: 22px; color: var(--ink); text-decoration: none; }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 6px 12px; border-radius: 999px; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.site { margin-left: auto; color: var(--muted); text-decoration: none; font-weight: 500; }
.site:hover { color: var(--ink); }
.gh { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
.gh:hover { color: var(--ink); }

main { max-width: 1160px; margin: 0 auto; padding-inline: 20px; padding-block: 40px 24px; }

/* hero and search */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 14px; max-width: 760px; margin-inline: auto; text-align: center; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.01em; }
.lede { color: var(--muted); margin: 0; max-width: 62ch; }
.search { display: flex; gap: 8px; margin-top: 10px; width: 100%; max-width: 640px; }
.field { position: relative; flex: 1; display: flex; min-width: 0; }
.search input { flex: 1; min-width: 0; padding: 14px 44px 14px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 15px var(--mono); }
.clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 20px; line-height: 1; display: grid; place-items: center; }
.clear:hover { color: var(--ink); background: var(--line); }
.primary { background: var(--accent); color: var(--accent-ink); border: 0; padding: 12px 20px; border-radius: 10px; font-weight: 600; }
.primary:hover { filter: brightness(1.08); }
.try { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; text-align: left; }
.chip b { font-weight: 600; font-size: 14px; }
.chip code { color: var(--muted); font-size: 11px; }
.chip:hover { border-color: var(--accent); }

/* result */
.result { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-top: 36px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12); }
.frame { position: relative; margin: 0; overflow: hidden; border-radius: 15px 0 0 15px; background: var(--panel); aspect-ratio: 4 / 3; max-width: 100%; }
.frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: var(--panel); }
.details { display: grid; align-content: start; gap: 18px; min-width: 0; padding: 22px; background: var(--panel); border-left: 1px solid var(--line); border-radius: 0 15px 15px 0; }
.ref { margin: 0; display: grid; gap: 12px; }
.ref dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.ref dd { margin: 2px 0 0; min-width: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
#star[aria-pressed="true"] { color: var(--star); border-color: var(--star); }
#star[aria-pressed="true"] svg path { fill: var(--star); stroke: var(--star); }
.status { margin: 0; min-height: 1.5em; font-size: 14px; color: var(--muted); }

/* strips: favorites and examples */
.strip { margin-top: 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.strip h2 { font-size: 24px; }
.strip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nav { display: flex; gap: 8px; }
.round { width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 20px; line-height: 1; display: grid; place-items: center; }
.round:hover { border-color: var(--accent); }
.thumbs, .carousel { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 280px); gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 8px; scrollbar-width: thin; }
.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.tile { scroll-snap-align: start; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; padding: 0; text-align: left; display: grid; }
.tile:hover { border-color: var(--accent); }
.tile .thumb { aspect-ratio: 4 / 3; max-width: 100%; background: var(--line); display: block; width: 100%; object-fit: cover; }
.tile .cap { padding: 10px 12px; display: grid; gap: 2px; }
.tile .cap b { font-weight: 600; font-size: 14px; }
.tile .cap code { color: var(--muted); font-size: 11px; }

/* lightbox: an in-page div over a scrim */
.lightbox { position: fixed; inset: 0; z-index: 20; background: var(--scrim); display: grid; place-items: center; padding: 20px; }
.lb-panel { position: relative; width: min(1100px, 100%); max-height: 100%; overflow: auto; background: var(--panel); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
.lb-panel img { display: block; width: 100%; aspect-ratio: 4 / 3; max-width: 100%; object-fit: cover; background: var(--line); }
.lb-close { position: absolute; top: 12px; right: 12px; z-index: 1; }
.lb-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; }
.lb-meta h3 { font-size: 22px; }
.lb-meta code { color: var(--muted); }
.lb-meta > div:first-child { min-width: 0; flex: 1 1 320px; }

.foot { max-width: 1160px; margin: 0 auto; padding: 24px 20px calc(32px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* bit map tab */
.bits-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; max-width: 920px; }
.bits-head { display: grid; gap: 10px; }
.bits-head h1 { font-size: clamp(28px, 4.5vw, 40px); }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.bit-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; display: grid; gap: 2px; min-width: 0; }
.stat b { font-family: var(--mono); font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.grid-scroll, .table-scroll { overflow-x: auto; }
.bits { display: grid; grid-template-columns: 34px repeat(16, minmax(20px, 1fr)); gap: 3px; min-width: 380px; }
.rowlabel, .collabel { font-family: var(--mono); font-size: 11px; color: var(--muted); display: flex; align-items: center; justify-content: flex-end; padding-right: 4px; font-variant-numeric: tabular-nums; }
.collabel { justify-content: center; padding-right: 0; }
.cell { aspect-ratio: 1; max-width: 100%; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10px; color: var(--cell-ink); font-variant-numeric: tabular-nums; }
.cell:hover, .cell:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.hint { font-family: var(--mono); font-size: 12px; color: var(--muted); min-height: 1.5em; }
.table-scroll { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ns { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; }
.fields { color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
  .bar { gap: 12px; flex-wrap: wrap; }
  .gh span { display: none; }
  .result { grid-template-columns: minmax(0, 1fr); }
  .details { border-left: 0; border-top: 1px solid var(--line); border-radius: 0 0 15px 15px; }
  .frame { border-radius: 15px 15px 0 0; }
  .search { flex-direction: column; }
  /* the example chips become one swipeable row instead of a tall stack */
  .try { width: 100%; }
  .chips { flex-wrap: nowrap; justify-content: flex-start; width: 100%; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }


/* discoverer credit */
.tile .cap .by { color: var(--muted); font-size: 12px; }
.lb-by { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* gallery suggestion: a small floating form, opened from the result card */
.suggest { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 16; width: min(360px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
.suggest form { display: grid; gap: 8px; padding: 18px; }
.suggest h3 { font-size: 20px; }
.sg-note { margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.sg-preview { display: block; width: 100%; aspect-ratio: 4 / 3; max-width: 100%; object-fit: cover; border-radius: 10px; background: var(--line); }
.suggest label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-top: 4px; }
.suggest input { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 15px var(--body); min-width: 0; }
.suggest .actions { justify-content: flex-end; }
.suggest .primary { padding: 8px 18px; }

/* theme switch: system, light, dark */
.theme-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); padding: 0; }
.theme-btn:hover { color: var(--ink); border-color: var(--accent); }
.theme-btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* algorithm page: a quiet gallery. Each room hangs one framed line drawing
   beside its placard; the foyer and the exit frame the walk. */
:root { --wall: #f6f7f6; --frame: #1d242b; --mat: #fbfbfa; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --wall: #121a22; --frame: #3a4652; --mat: #0e141a; } }
:root[data-theme="dark"] { --wall: #121a22; --frame: #3a4652; --mat: #0e141a; }
.museum { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(72px, 12vw, 140px); padding-block: 24px 40px; }
.foyer { display: grid; justify-items: center; gap: 18px; max-width: 720px; margin-inline: auto; text-align: center; }
.foyer h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.05; letter-spacing: -0.01em; }
.foyer .lede { margin: 0; font-size: 18px; color: var(--muted); max-width: 62ch; }
.foyer-note { margin: 0; font-size: 15px; color: var(--muted); max-width: 60ch; }
.foyer-note a, .placard a { color: var(--accent); }
.epigraph { font-size: 22px; margin: 10px 0; color: var(--ink); }
.floorplan { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); width: 100%; margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.floorplan a { display: grid; gap: 2px; padding: 14px 4px; text-decoration: none; color: var(--muted); border-left: 1px solid var(--line); }
.floorplan a:first-child { border-left: 0; }
.floorplan a:hover { color: var(--ink); background: color-mix(in srgb, var(--panel) 60%, transparent); }
.floorplan b { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--ink); }
.floorplan span { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }

.room { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px 48px; align-items: start; scroll-margin-top: 90px; }
.room-no { grid-column: 1 / -1; font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 14px; }
.room-no::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.room:nth-of-type(even) .exhibit { order: 2; }
.exhibit { margin: 0; display: grid; gap: 14px; position: sticky; top: 96px; }
.exhibit svg { background: var(--mat); border: 1px solid var(--line); outline: 6px solid var(--wall); box-shadow: 0 0 0 7px var(--frame), 0 22px 50px rgba(10, 16, 22, 0.18); padding: 18px; margin: 7px; width: calc(100% - 14px); }
.exhibit figcaption { font-size: 13px; color: var(--muted); font-style: italic; padding-inline: 8px; max-width: 60ch; }
.placard { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 26px 26px 22px; display: grid; gap: 12px; box-shadow: 0 1px 0 var(--line); }
.placard h2 { font-size: 30px; line-height: 1.1; }
.placard .medium { margin: 0; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--muted); }
.placard > p { margin: 0; font-size: 15px; }
.formulas { margin: 6px 0 0; display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.formulas dt { overflow-x: auto; padding: 8px 0 0; }
.formulas dd { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.museum math { font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math", serif; font-size: 1.15em; }
.placard .spec { font-family: var(--mono); font-size: 12px; justify-self: start; }
.placard .spec::after { content: " ↗"; }
.exit { display: grid; justify-items: center; gap: 12px; text-align: center; padding-top: 24px; border-top: 1px solid var(--line); }
.exit p { margin: 0; color: var(--muted); }
.exit-link { text-decoration: none; }

/* the line drawings: ink strokes, dashed guides, one accent */
.fig { display: block; height: auto; max-width: 100%; }
.fig .ink { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.fig .thin { stroke-width: 1; }
.fig .guide { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 5; }
.fig .contour { fill: none; stroke: var(--muted); stroke-width: 0.8; opacity: 0.75; }
.fig .rule { stroke: var(--line); stroke-width: 1; }
.fig .acc { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fig .acc.thin { stroke-width: 1.1; }
.fig .shadow { fill: none; stroke: var(--accent); stroke-width: 3.4; stroke-linecap: round; opacity: 0.85; }
.fig .trunk { stroke-width: 2.4; }
.fig .mesh { fill: none; stroke: var(--muted); stroke-width: 0.6; opacity: 0.55; }
.fig .hatch { stroke: var(--ink); stroke-width: 0.9; }
.fig .nostroke { stroke: none; }
.fig .dot { fill: var(--ink); stroke: none; }
.fig .dot.hollow { fill: var(--mat); stroke: var(--ink); stroke-width: 1.3; }
.fig .dot.accent { fill: var(--accent); }
.fig text { fill: var(--ink); font: italic 16px "STIX Two Text", Georgia, "Times New Roman", serif; }
.fig text.acc-text { fill: var(--accent); }
.fig text.note { font: 11px var(--mono); font-style: normal; fill: var(--muted); letter-spacing: 0.02em; }

@media (max-width: 900px) {
  .room { grid-template-columns: minmax(0, 1fr); }
  .room:nth-of-type(even) .exhibit { order: 0; }
  .exhibit { position: static; }
  .floorplan { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .floorplan a:nth-child(3n + 1) { border-left: 0; }
  .floorplan a:nth-child(n + 4) { border-top: 1px solid var(--line); }
}
.fig text tspan.sub { font-size: 0.72em; }
.fig .mat-fill { stroke: none; }
.fig .tuft { stroke: var(--ink); stroke-width: 0.8; stroke-linecap: round; opacity: 0.8; }
.fig .mat-bg { fill: var(--mat); stroke: none; }
.floorplan span { text-wrap: balance; }

/* authorship: a byline with a footnote, and the collapsed note it opens */
.byline { margin: 0; font-family: var(--display); font-size: 17px; }
.byline a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.fn { font-family: var(--mono); font-size: 11px; margin-left: 2px; }
.fn a { color: var(--accent); border: 0; text-decoration: none; }
.citations { display: grid; gap: 10px; max-width: 760px; margin-inline: auto; width: 100%; }
.citations details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.citations summary { cursor: pointer; padding: 12px 0; font-size: 14px; color: var(--muted); }
.citations summary:hover { color: var(--ink); }
.cite-body { display: grid; gap: 12px; padding-bottom: 18px; font-size: 14px; }
.cite-body p { margin: 0; }
.cite-body a { color: var(--accent); }
.cite-body blockquote { margin: 0; padding: 10px 14px; border-left: 2px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; }
.formulas math { font-size: 1.05em; }
.cite-body h3 { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.cite-body blockquote cite { display: block; margin-top: 6px; font-style: normal; font-size: 11px; color: var(--muted); opacity: 0.8; }

/* download menu: standard, vector, and social banners */
.dl { position: relative; }
.icon-btn .caret { font-size: 11px; color: var(--muted); }
.dl-menu { position: absolute; z-index: 12; left: 0; top: calc(100% + 6px); min-width: 230px; display: grid; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22); }
.dl-menu button { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; }
.dl-menu button:hover, .dl-menu button:focus-visible { background: color-mix(in srgb, var(--accent) 12%, transparent); outline: none; }
.dl-menu span { display: grid; font-size: 14px; font-weight: 500; }
.dl-menu small { font-size: 12px; font-weight: 400; color: var(--muted); font-family: var(--mono); }
.dl-menu svg.line path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.dl-menu svg.brand path { stroke: none; }
.dl-menu svg.linkedin path { fill: #0a66c2; }
.dl-menu svg.facebook path { fill: #0866ff; }
.dl-menu svg.x path { fill: currentColor; }
.dl-sep { padding: 8px 10px 4px; border-top: 1px solid var(--line); margin-top: 4px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* banner crop: the whole landscape, a draggable band, the rest dimmed */
.crop-panel { width: min(760px, 100%); max-height: 100%; overflow: auto; display: grid; gap: 14px; padding: 20px; background: var(--panel); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
.crop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.crop-head h3 { font-size: 22px; }
.crop-size { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.crop-stage { position: relative; overflow: hidden; border-radius: 10px; touch-action: none; cursor: ns-resize; user-select: none; background: var(--line); }
.crop-stage img { display: block; width: 100%; aspect-ratio: 4 / 3; max-width: 100%; pointer-events: none; }
.crop-band { position: absolute; left: 0; right: 0; border-top: 2px solid #fff; border-bottom: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(8, 12, 16, 0.55); cursor: grab; }
.crop-band:active { cursor: grabbing; }
.crop-band:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.crop-band::before, .crop-band::after { content: ""; position: absolute; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: #fff; }
.crop-band::before { top: -3px; }
.crop-band::after { bottom: -3px; }
.crop-hint { margin: 0; font-size: 13px; color: var(--muted); }
.crop-actions { justify-content: flex-end; }
