/* Hanger count, in the danielk.am single-page app style of the location explorers.
   Colours come from tokens.css, a byte-identical copy of the brand palette. Add roles here, never new brand values. */
:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  --gutter: 48px;
  /* How far a count can be trusted. These three are status colours with a meaning of their own, the one exception to
     "no new hex values": green counted, yellow taken on trust, red look yourself. */
  --level-high: #15803D;
  --level-high-soft: #E8F6ED;
  --level-mid: #CA8A04;
  --level-mid-soft: #FDF6DD;
  --level-low: #DC2626;
  --level-low-soft: #FDECEC;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, summary { font: inherit; }
a { color: var(--color-brand); text-underline-offset: 4px; }
a:hover { color: var(--color-brand-hover); }
button, a, summary, input, label { touch-action: manipulation; }
button, summary, .pick { cursor: pointer; }
button, .pick { background: var(--color-brand); color: var(--color-white); border: 1px solid var(--color-brand); border-radius: 9px; padding: 13px 19px; font-weight: 650; min-height: 46px; }
button:hover, .pick:hover { background: var(--color-brand-hover); }
button:disabled { cursor: wait; opacity: .6; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.finder:has(#photos:focus-visible) .pick { outline: 3px solid var(--color-focus); outline-offset: 3px; }
input { width: 100%; min-width: 0; padding: 14px; border: 1px solid var(--color-border-strong); border-radius: 9px; background: var(--white); color: var(--ink); font-size: 16px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(38px, 5vw, 66px); line-height: 1.04; letter-spacing: -2.7px; font-weight: 550; margin-bottom: 20px; }
h2 { font-weight: 550; letter-spacing: -.8px; }
h3 { line-height: 1.35; letter-spacing: -.2px; }
p { line-height: 1.6; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; left: 10px; top: -70px; background: var(--ink); color: var(--color-white); padding: 12px; z-index: 10000; }
.skip:focus { top: 10px; color: var(--color-white); }

.masthead, main, footer { max-width: 1320px; margin: auto; padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.masthead { height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 7px; text-decoration: none; color: var(--ink); font-weight: 700; letter-spacing: -.4px; font-size: 18px; min-height: 44px; }
.brand:hover { color: var(--ink); }
.brand-name { display: flex; flex-direction: column; gap: 3px; line-height: 1.15; }
.brand-name strong { font-weight: 700; }
.brand-name small { font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.brand-mark { display: block; width: 42px; height: 42px; object-fit: contain; flex-shrink: 0; margin-right: 5px; }
.about-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; text-decoration: none; color: var(--ink); white-space: nowrap; }

.intro { display: flex; justify-content: space-between; padding: 56px 0 30px; gap: 36px; }
.eyebrow { font-size: 10px; letter-spacing: 2.1px; font-weight: 750; text-transform: uppercase; margin-bottom: 13px; }
.lede { max-width: 620px; color: var(--muted); font-size: 17px; margin-bottom: 0; }
.intro-art { align-self: center; flex-shrink: 0; width: clamp(140px, 14vw, 190px); height: auto; }

.finder { padding: 26px 28px 15px; background: var(--color-brand-soft); border: 1px solid var(--color-border); border-radius: 15px; }
.finder label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 9px; }
.finder-label { font-size: 14px; font-weight: 650; margin: 0 0 9px; }
.help, .small { font-size: 12px; color: var(--muted); line-height: 1.6; }
.help { margin: 9px 0; }
.finder-tools { display: flex; gap: 12px 18px; align-items: flex-end; flex-wrap: wrap; }
.finder .pick { display: inline-flex; align-items: center; justify-content: center; margin: 0; font-size: 14px; color: var(--color-white); }
.finder .order { flex: 1; min-width: 220px; max-width: 340px; margin: 0; }
.finder .order input { margin-top: 7px; }
.optional { font-weight: 400; color: var(--muted); }
#signin { max-width: 560px; }
#signin .finder-tools input { flex: 1; min-width: 200px; }
.secondary { background: var(--color-white); color: var(--ink); border-color: var(--color-border-strong); font-size: 13px; }
.secondary:hover { background: var(--color-brand-soft-hover); }
.link { background: none; border-color: transparent; color: var(--color-brand); padding: 8px 6px; min-height: 44px; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; }
.link:hover { background: var(--color-brand-soft-hover); color: var(--color-brand-hover); }
.error { color: var(--level-low); font-weight: 650; font-size: 14px; margin: 10px 0 0; }
.notice { display: grid; gap: 8px; justify-items: start; background: var(--level-mid-soft); border-left: 3px solid var(--level-mid); padding: 10px 14px; border-radius: 4px; font-size: 13px; margin: 10px 0 0; }
.notice p { margin: 0; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(300px, .86fr); gap: 28px; align-items: start; margin-top: 30px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-heading .eyebrow { margin-bottom: 8px; }
.section-heading h2 { font-size: 25px; margin: 0; overflow-wrap: anywhere; }
.section-heading .small { white-space: nowrap; }
.list-panel { min-width: 0; }
.side-panel { position: sticky; top: 20px; min-width: 0; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-top: 12px; scroll-margin: 18px; }
.card h3, .card h2 { font-size: 16px; margin: 0 0 12px; overflow-wrap: anywhere; letter-spacing: -.2px; font-weight: 650; }
.empty { padding: 32px 22px; border: 1px dashed var(--color-border-strong); border-radius: 12px; font-size: 14px; margin-top: 15px; }
.figure { font-size: 19px; font-weight: 650; line-height: 1.35; letter-spacing: -.3px; margin-bottom: 10px; }
.total .figure { font-size: 22px; }
.total p { margin-bottom: 8px; font-size: 14px; }
.total p:last-child { margin-bottom: 0; }
.total .small, .photo .small { font-size: 12px; }
.compare { font-weight: 650; border-left: 3px solid var(--color-brand); padding-left: 12px; }
.key .eyebrow { margin-bottom: 12px; }

.card-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 14px; margin-bottom: 12px; }
.card-top h3 { margin: 0; }
.status { font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 20px; background: var(--color-brand-soft); color: var(--color-blue-ink); white-space: nowrap; }
.status.done { background: var(--level-high-soft); color: var(--level-high); }
.status.failed { background: var(--level-low-soft); color: var(--level-low); }
.status.busy::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; border: 2px solid var(--color-brand); border-top-color: transparent; animation: spin .9s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .status.busy::before { animation: none; } }

.frame { container-type: inline-size; position: relative; border-radius: 9px; overflow: hidden; background: var(--color-border); line-height: 0; margin-bottom: 14px; }
.frame img { width: 100%; height: auto; display: block; }
.mark { position: absolute; min-height: 0; padding: 0; background: transparent; border: 3px solid; border-radius: 2px; box-shadow: 0 0 0 1px var(--color-white); }
.mark:hover { background: color-mix(in srgb, var(--color-white) 18%, transparent); }
.mark.high { border-color: var(--level-high); }
.mark.mid { border-color: var(--level-mid); }
.mark.low { border-color: var(--level-low); }
.mark.picked { box-shadow: 0 0 0 3px var(--color-white), 0 0 0 6px var(--color-focus); z-index: 2; }
.mark .tag { position: absolute; left: -3px; bottom: 100%; padding: 0 4px; font-size: 11px; font-weight: 700; line-height: 1.4; white-space: nowrap; color: var(--color-white); border-radius: 2px 2px 0 0; }
/* On a narrow photo the tags of neighbouring groups would overlap, so they show the group number only. The count is in the list below. */
@container (max-width: 700px) { .mark .tag .count { display: none; } }
.mark.high .tag { background: var(--level-high); }
.mark.mid .tag { background: var(--level-mid); color: var(--color-ink); }
.mark.low .tag { background: var(--level-low); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 20px; border: 1px solid; }
.chip.high, .swatch.high { border-color: var(--level-high); background: var(--level-high-soft); }
.chip.mid, .swatch.mid { border-color: var(--level-mid); background: var(--level-mid-soft); }
.chip.low, .swatch.low { border-color: var(--level-low); background: var(--level-low-soft); }

.groups { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.group { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 12px; padding: 6px 8px 6px 12px; border-left: 3px solid; border-radius: 4px; font-size: 13px; line-height: 1.5; }
.group.high { border-color: var(--level-high); background: var(--level-high-soft); }
.group.mid { border-color: var(--level-mid); background: var(--level-mid-soft); }
.group.low { border-color: var(--level-low); background: var(--level-low-soft); }
.group.picked { outline: 3px solid var(--color-focus); outline-offset: 1px; }
.group-text { min-width: 0; flex: 1 1 240px; padding: 6px 0; }
.photo > .secondary { margin-bottom: 12px; }
.photo > p:last-child { margin-bottom: 0; }

.legend { padding: 0; margin: 0; list-style: none; display: grid; gap: 10px; font-size: 13px; line-height: 1.5; }
.legend li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; }
.swatch { width: 18px; height: 18px; border: 3px solid; border-radius: 3px; margin-top: 1px; }

.about { display: grid; grid-template-columns: .8fr 1.2fr; border-top: 1px solid var(--line); margin-top: 56px; padding: 35px 0; gap: 30px; }
.about h2 { font-size: 30px; line-height: 1.15; }
.about p:not(.eyebrow) { font-size: 14px; color: var(--muted); max-width: 640px; }
.about p strong { color: var(--ink); }
.questions { margin-top: 0; }
.questions h3 { font-size: 16px; margin-bottom: 8px; }
.questions h3:not(:first-child) { margin-top: 24px; }
.about p.source-summary { border-left: 3px solid var(--color-brand); padding-left: 14px; color: var(--ink); }

footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 23px; padding-bottom: max(30px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
footer span { font-weight: 650; }
footer p { margin: 0; max-width: 560px; }

dialog { width: min(96vw, 1100px); max-height: 92vh; border: 1px solid var(--color-border); border-radius: 15px; padding: 18px; color: var(--ink); }
dialog::backdrop { background: color-mix(in srgb, var(--color-ink) 60%, transparent); }
dialog form { display: flex; justify-content: flex-end; }
#zoom-text { margin: 10px 0; font-size: 13px; color: var(--muted); }
.zoom-scroll { overflow: auto; max-height: 68vh; border-radius: 9px; }
.zoom-scroll img { display: block; max-width: none; }

@media (max-width: 900px) {
  :root { --gutter: 24px; }
  .intro { padding-top: 36px; align-items: center; }
  .intro-art { width: 150px; }
  .workspace { gap: 18px; }
  .finder { padding: 22px; }
}
@media (max-width: 650px) {
  :root { --gutter: 18px; }
  .masthead { height: 74px; }
  .brand { font-size: 15px; gap: 4px; }
  .brand-mark { width: 34px; height: 34px; }
  .about-link { font-size: 12px; }
  .intro { padding: 31px 0 24px; }
  .intro-art { display: none; }
  h1 { font-size: 40px; letter-spacing: -2px; }
  .lede { font-size: 15px; }
  .finder { padding: 18px 15px; }
  .finder-tools { gap: 12px; }
  .finder .pick, .finder .order, #signin .finder-tools button { flex: 1 1 100%; max-width: none; }
  .workspace { display: flex; flex-direction: column; gap: 23px; margin-top: 24px; }
  .side-panel { position: static; order: -1; width: 100%; }
  .list-panel { width: 100%; }
  .card { padding: 16px; }
  .about { grid-template-columns: 1fr; gap: 6px; margin-top: 40px; padding: 28px 0; }
  .about h2 { font-size: 26px; }
  footer { flex-direction: column; gap: 8px; }
}
