/* Upper Lip - an old barbershop: cream paper, oxblood and navy stripes, a brass tape measure. */
:root {
  --bg: #f6f0e2; --paper: #fffaf0; --card: #f1e8d4; --ink: #1d2433; --muted: #55596a; --line: #d9ccb0;
  --red: #8c2132; --red-ink: #ffffff; --navy: #22325a; --navy-ink: #ffffff; --brass: #b8862b; --brass-soft: #f3e2b8;
  --tape: #f2c94c; --tape-edge: #c99a1c; --tape-ink: #2a2310; --glyph: #3b2a1e;
  --s-start: #d8e4ef; --s-itchy: #e9dcc2; --s-awkward: #f0c9b8; --s-shape: #d6e2c8; --s-full: #c9d3ea;
  --ok: #24613a; --ok-bg: #e2f0e4; --warn: #8a2c16; --warn-bg: #fbe3dc; --note: #6b4e0f; --note-bg: #fbf0d2;
  --v-on: #1f5e38; --v-stretch: #7a4b00; --v-rethink: #8c2132;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 6px 20px rgba(60, 40, 10, 0.07);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #11151f; --paper: #1a2030; --card: #232a3c; --ink: #f2ead8; --muted: #b9b4a6; --line: #39425a;
  --red: #e0707f; --red-ink: #1a0d10; --navy: #9db4ec; --navy-ink: #111827; --brass: #e2b45a; --brass-soft: #3a3020;
  --tape: #d9b13c; --tape-edge: #a8841f; --tape-ink: #1d1708; --glyph: #f2ead8;
  --s-start: #2b3a4f; --s-itchy: #44392a; --s-awkward: #4d3029; --s-shape: #2f4130; --s-full: #303a5a;
  --ok: #8fd6a4; --ok-bg: #1d3326; --warn: #ffb4a0; --warn-bg: #3d1f18; --note: #f0d38a; --note-bg: #3a2f14;
  --v-on: #8fd6a4; --v-stretch: #f0c060; --v-rethink: #f08c99;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
h1, h2, h3 { font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif; line-height: 1.2; overflow-wrap: anywhere; }
a { color: var(--navy); }
.hidden { display: none !important; }
.small { font-size: 0.88rem; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header with a barber-pole stripe under it */
.bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--paper); border-bottom: 6px solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--red) 0 10px, var(--paper) 10px 20px, var(--navy) 20px 30px, var(--paper) 30px 40px) 6; flex-wrap: nowrap; }
.back { text-decoration: none; font-size: 0.9rem; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; font-family: Georgia, serif; font-size: 1.15rem; }
.brand strong { white-space: nowrap; }
.logo { width: 30px; height: 30px; flex: none; }
.lg-ring { fill: var(--brass-soft); stroke: var(--brass); stroke-width: 2; }
.lg-stache { fill: var(--glyph); }
.session { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; border: 1.5px solid var(--navy); background: transparent; color: var(--navy);
  padding: 6px 14px; font: inherit; font-size: 0.9rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.pill:hover:not(:disabled) { background: var(--card); }
.pill.solid { background: var(--navy); color: var(--navy-ink); }
.pill.solid:hover:not(:disabled) { background: var(--navy); filter: brightness(1.1); }
.pill.ghost { border-color: var(--line); color: var(--ink); cursor: default; }
.pill.tiny { padding: 3px 10px; font-size: 0.8rem; }
.pill.big { padding: 10px 22px; font-size: 1rem; }
.pill:disabled { opacity: 0.5; cursor: not-allowed; }

main { max-width: 1120px; margin: 0 auto; padding: 0 16px 40px; }
.hero { padding: 22px 0 6px; }
.kicker { display: inline-block; margin: 0 0 10px; padding: 6px 12px; border-radius: 8px; background: var(--brass-soft); color: var(--ink); font-size: 0.86rem; border-left: 4px solid var(--brass); }
.hero h1 { font-size: clamp(1.7rem, 4.6vw, 2.7rem); margin: 4px 0 8px; }
.lede { max-width: 760px; margin: 0 0 12px; }
.samples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { border-radius: 999px; border: 1.5px dashed var(--red); background: var(--paper); color: var(--ink); padding: 5px 12px; font: inherit; font-size: 0.86rem; cursor: pointer; }
.chip.on { border-style: solid; background: var(--red); color: var(--red-ink); }

.layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-top: 16px; box-shadow: var(--shadow); min-width: 0; }
.layout .panel { margin-top: 0; }
.ph { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; margin: 0 0 10px; }
.step-no { display: inline-flex; width: 30px; height: 30px; flex: none; border-radius: 50%; align-items: center; justify-content: center; background: var(--red); color: var(--red-ink); font-family: Georgia, serif; font-size: 1rem; }
.sub { font-size: 1.05rem; margin: 16px 0 6px; }
.lbl { display: block; font-size: 0.86rem; font-weight: 600; margin: 10px 0 4px; color: var(--ink); }
input[type="text"], input[type="date"], textarea, select { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 0; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brass); outline-offset: 1px; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.note { background: var(--note-bg); color: var(--note); border-radius: 8px; padding: 8px 10px; }

/* comb + barber pole verdict */
.comb-host svg, .tape-host svg { width: 100%; height: auto; display: block; }
.comb-host { margin-top: 12px; }
.comb-spine { fill: var(--navy); }
.tooth { fill: var(--card); stroke: var(--line); stroke-width: 1; }
.tooth-fill { fill: var(--red); }
.comb-label { font: 600 13px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; fill: var(--ink); }
.pole-card { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--card); }
.pole { width: 18px; height: 64px; flex: none; border-radius: 9px; border: 2px solid var(--brass); overflow: hidden; background: var(--paper); }
.pole span { display: block; width: 100%; height: 200%; background: repeating-linear-gradient(-45deg, var(--red) 0 7px, #ffffff 7px 14px, #2c3f6e 14px 21px, #ffffff 21px 28px); animation: pole 6s linear infinite; }
@keyframes pole { from { transform: translateY(-50%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .pole span { animation: none; } }
.pole-verdict { margin: 0; }
.pole-verdict b { font-family: Georgia, serif; font-size: 1.15rem; display: block; }
.v-on_track { color: var(--v-on); } .v-stretch { color: var(--v-stretch); } .v-rethink { color: var(--v-rethink); } .v-none { color: var(--muted); }

/* the tape */
.tape-host { margin: 8px 0 4px; }
.tape-body { fill: var(--tape); stroke: var(--tape-edge); stroke-width: 1.5; }
.tape-edge { fill: var(--tape-edge); }
.tick { stroke: var(--tape-ink); stroke-width: 1.2; } .tick.big { stroke-width: 2; } .tick.half { stroke-width: 0.8; }
.tick-num { font: 600 12px ui-monospace, Menlo, Consolas, monospace; fill: var(--tape-ink); } .tick-num.big { font-size: 13px; }
.stage-band.s-start { fill: var(--s-start); } .stage-band.s-itchy { fill: var(--s-itchy); } .stage-band.s-awkward { fill: var(--s-awkward); }
.stage-band.s-shape { fill: var(--s-shape); } .stage-band.s-full { fill: var(--s-full); }
.stage-name { font: 600 12px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; fill: var(--ink); }
.pin-line { stroke: var(--red); stroke-width: 2; stroke-dasharray: 3 3; }
.pin-head { fill: var(--red); }
.pin-day { font: 700 13px Georgia, serif; fill: var(--ink); }
.pin-mm { font: 12px ui-monospace, Menlo, Consolas, monospace; fill: var(--muted); }
.glyph-fill { fill: var(--glyph); }
.reach-ring { fill: none; stroke: var(--red); stroke-width: 2.5; }
.reach-mark.off { fill: var(--red); }
.reach-text { font: 700 13px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; fill: var(--ink); }

/* the style board: a barbershop price board */
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 12px; border-radius: 12px; background: var(--navy); }
:root[data-theme="dark"] .board { background: #0b1020; border: 1px solid var(--line); }
.style-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px 10px; border-radius: 10px; background: var(--paper); border: 2px solid transparent; text-align: center; min-width: 0; }
.style-card b { font-family: Georgia, serif; font-size: 1rem; }
.style-card .when { font-size: 0.82rem; font-weight: 600; color: var(--ink); }
.style-card .need { font-size: 0.76rem; color: var(--muted); }
.style-card.fit-no { opacity: 1; background: var(--card); }
.style-card.fit-no .when { color: var(--warn); }
.style-card.chosen { border-color: var(--red); }
.style-card.fallback { border-color: var(--brass); border-style: dashed; }
.stache-ic { display: block; height: auto; max-width: 100%; }
.stache-ic .glyph-fill { fill: var(--glyph); }
.card-tag { margin-top: 4px; font-size: 0.72rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.t-chosen { background: var(--red); color: var(--red-ink); }
.t-fallback { background: var(--brass-soft); color: var(--ink); border: 1px solid var(--brass); }

/* run area */
.runrow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.gate { background: var(--note-bg); color: var(--note); border-radius: 8px; padding: 8px 10px; margin: 10px 0 6px; }
.progress h3 { margin: 0 0 6px; }
.steps { list-style: none; padding: 0; margin: 0; }
.step { padding: 3px 0; color: var(--muted); } .step.active { color: var(--ink); font-weight: 600; } .step.done { color: var(--ok); }
.step-ic { display: inline-block; width: 16px; font-family: ui-monospace, Menlo, monospace; }
.raw { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--card); padding: 10px; border-radius: 8px; max-height: 360px; overflow: auto; }

/* the result */
.res-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.res-head h2 { margin: 0; font-size: 1.45rem; min-width: 0; }
.stamp { display: inline-block; padding: 4px 14px; border-radius: 6px; border: 2.5px solid currentColor; font-family: Georgia, serif; font-weight: 700; letter-spacing: 0.02em; background: var(--paper); transform: rotate(-2deg); white-space: nowrap; }
.summary { font-size: 1.02rem; }
.hook { font-family: Georgia, serif; font-size: 1.3rem; font-style: italic; text-align: center; margin: 14px 0; padding: 12px; border-top: 3px double var(--brass); border-bottom: 3px double var(--brass); color: var(--ink); }
.pagecard, .thanks { background: var(--card); border-radius: 12px; padding: 12px 16px; margin: 12px 0; }
.pagecard h3, .thanks h3 { margin-top: 0; }
.story { white-space: pre-wrap; }
.result h3 { font-size: 1.1rem; margin: 18px 0 8px; }
.asks, .updates { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.asks { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ask-card, .update-card { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.ask-card p, .update-card p { margin: 6px 0; overflow-wrap: anywhere; }
.ask-head, .upd-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 0.8rem; font-weight: 700; max-width: 100%; overflow-wrap: anywhere; }
.t-circle { background: var(--navy); color: var(--navy-ink); }
.t-stage { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.day-tag { font-family: ui-monospace, Menlo, monospace; font-weight: 700; background: var(--tape); color: var(--tape-ink); border-radius: 4px; padding: 1px 8px; font-size: 0.85rem; }
.update-card { border-left: 6px solid var(--line); }
.update-card.s-start { border-left-color: var(--s-start); } .update-card.s-itchy { border-left-color: var(--s-itchy); } .update-card.s-awkward { border-left-color: var(--s-awkward); }
.update-card.s-shape { border-left-color: var(--s-shape); } .update-card.s-full { border-left-color: var(--s-full); }
.photo { color: var(--muted); font-style: italic; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cardrow, .exports { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.exports { margin-top: 14px; }
.recon { list-style: none; padding: 0; margin: 0; }
.recon li { padding: 6px 10px; border-radius: 8px; margin: 4px 0; background: var(--ok-bg); color: var(--ok); }
.recon li.warn { background: var(--warn-bg); color: var(--warn); }
.recon li.note { background: var(--note-bg); color: var(--note); }
.recon li.none { background: var(--ok-bg); color: var(--ok); }
li.none { color: var(--muted); }

/* plans */
.planlist { list-style: none; padding: 0; margin: 10px 0 0; }
.hrow { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.hinfo { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.hinfo b { overflow-wrap: anywhere; }
.hbtns { display: flex; gap: 6px; flex: none; }
.stache-ic.mini { flex: none; background: var(--card); border-radius: 8px; padding: 4px; border: 2px solid var(--line); }
.stache-ic.mini.v-on_track { border-color: var(--v-on); } .stache-ic.mini.v-stretch { border-color: var(--v-stretch); } .stache-ic.mini.v-rethink { border-color: var(--v-rethink); }

.foot { max-width: 1120px; margin: 0 auto; padding: 10px 16px 40px; color: var(--muted); font-size: 0.86rem; }
.foot a { color: var(--navy); }
.toasts { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 50; width: min(92vw, 520px); }
.toast { padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); transition: opacity 0.5s; font-size: 0.92rem; }
.toast.err { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); }
.toast a { color: inherit; font-weight: 700; }
.toast.gone { opacity: 0; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .bar { gap: 8px; padding: 8px 12px; }
  .back { display: none; }
  .brand { font-size: 1rem; }
  .pill { padding: 5px 10px; font-size: 0.84rem; }
  .three { grid-template-columns: 1fr 1fr; }
  .three > div:last-child { grid-column: 1 / -1; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px; gap: 8px; }
  .cols { grid-template-columns: 1fr; }
  .panel { padding: 14px 14px; }
  .hrow { flex-wrap: wrap; }
  .hook { font-size: 1.12rem; }
}

/* the month in progress */
.today-cell { fill: var(--red); opacity: 0.18; }
.posted-box { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; cursor: pointer; }
.posted-box input { width: auto; margin: 0; }
.update-card.posted { opacity: 0.72; }
.update-card.posted .day-tag { text-decoration: line-through; }
