:root {
  color-scheme: light;
  --paper: #faf7f0;
  --card: #fffefa;
  --ink: #23201a;
  --muted: #5f584a;
  --line: #e6dfd1;
  --pine: #2c3a2a;
  --pine-soft: #3a4a37;
  --pine-ink: #f2efe6;
  --leaf: #4c6e46;
  --leaf-soft: #e9efe3;
  --amber: #94660f;
  --amber-soft: #f7edda;
  --clay-soft: #f3e7e0;
  --radius: 22px;
  --tile: 14px;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  overscroll-behavior-x: none;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  overscroll-behavior-x: none;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input, textarea { font: inherit; }
p, h3, blockquote { text-wrap: pretty; }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}

/* ============ gate ============ */
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--pine);
}

.gate-card {
  width: min(420px, 100%);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 34px 30px;
  text-align: left;
}

.gate-card h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 40px;
  margin: 4px 0 10px;
  letter-spacing: -0.01em;
}

.gate-sub { color: var(--muted); font-size: 14.5px; margin: 0 0 18px; }

.gate-row { display: flex; gap: 10px; }

.gate-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  background: var(--card);
}

.gate-row button {
  border: 0;
  border-radius: 12px;
  padding: 11px 22px;
  background: var(--pine);
  color: var(--pine-ink);
  font-weight: 600;
  cursor: pointer;
}

.gate-error { color: #a04b3a; font-size: 13.5px; margin: 12px 0 0; }

/* ============ shell ============ */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  padding: 16px;
  gap: 16px;
}

.sidebar {
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  padding: 20px 16px;
  background: var(--pine);
  color: var(--pine-ink);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.1;
  margin-bottom: 26px;
  padding: 4px 6px;
}

.brand-mark {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--pine-soft);
  color: var(--pine-ink);
  display: grid;
  place-items: center;
}

.brand-mark svg { width: 26px; height: 26px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }

.side-nav a {
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--pine-ink);
  opacity: 0.78;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.side-nav a:hover { opacity: 1; background: var(--pine-soft); }
.side-nav a.is-current { opacity: 1; background: var(--pine-soft); font-weight: 600; }

.nav-count {
  font-size: 11px;
  font-weight: 700;
  background: var(--amber);
  color: #fff;
  border-radius: 999px;
  padding: 1px 8px;
}

.side-foot {
  margin-top: auto;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.55;
  padding: 0 6px;
}

/* ============ workspace ============ */
.workspace { min-width: 0; padding: 10px 26px 80px; max-width: 780px; }

.workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}

.workspace-head .eyebrow { margin: 0; }

.head-tools { display: flex; align-items: center; gap: 10px; }

.clock-chip {
  font-size: 12px;
  font-weight: 600;
  background: var(--leaf-soft);
  color: var(--leaf);
  border-radius: 999px;
  padding: 5px 14px;
  white-space: nowrap;
}

.help-btn {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pine);
  color: var(--pine-ink);
  display: grid;
  place-items: center;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1;
}

.help-btn:hover { background: var(--pine-soft); }

/* ============ hero ============ */
.hero {
  background: var(--pine);
  color: var(--pine-ink);
  border-radius: var(--radius);
  padding: clamp(26px, 5vw, 44px) clamp(22px, 5vw, 40px);
  margin: 0 0 36px;
}

.hero-eyebrow { color: var(--pine-ink); opacity: 0.55; }

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 6vw, 50px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 6px 0 14px;
  text-wrap: balance;
}

.hero-sub {
  font-size: 15.5px;
  line-height: 1.65;
  opacity: 0.82;
  max-width: 52ch;
  margin: 0 0 18px;
}

.hero-cues { display: flex; gap: 10px; flex-wrap: wrap; }

.hero-cues a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--pine-ink);
  text-decoration: none;
  border-radius: 999px;
  padding: 9px 18px;
  white-space: nowrap;
}

.hero-cues a:first-child { background: var(--leaf); border: 1px solid var(--leaf); }
.hero-cues a:first-child:hover { filter: brightness(1.12); }

.hero-cues a + a { background: transparent; border: 1px solid rgba(242, 239, 230, 0.6); }
.hero-cues a + a:hover { background: rgba(242, 239, 230, 0.14); }

.view { display: none; }
.view.is-active { display: block; }

.story-eyebrow { color: var(--leaf); }

.chapter-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 6vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
  text-wrap: balance;
}

.story p {
  font-size: 16.5px;
  line-height: 1.7;
  max-width: 62ch;
  margin: 0 0 16px;
}

.story a { color: var(--leaf); text-decoration-color: rgba(88, 123, 82, 0.4); }

.section-eyebrow { margin: 34px 0 14px; }

.soft-note { color: var(--muted); font-size: 14px; max-width: 60ch; margin: 26px 0 0; }
.soft-note a { color: var(--leaf); }

/* ============ arrangement ============ */
.aspiration {
  font-family: var(--serif);
  font-size: clamp(21px, 3vw, 26px);
  line-height: 1.45;
  margin: 26px 0;
  padding: 22px 26px;
  background: var(--leaf-soft);
  border-radius: var(--radius);
  color: var(--ink);
  text-wrap: balance;
}

.callout {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--tile);
  padding: 16px 20px;
  font-size: 14.5px;
  max-width: 62ch;
  margin: 0 0 8px;
}

.callout--pending {
  background: var(--amber-soft);
  border-color: transparent;
  margin-top: 22px;
}

.callout--pending a { color: var(--amber); font-weight: 600; }

.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.role-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--tile);
  padding: 18px 20px;
}

.role-card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 23px;
  margin: 2px 0 8px;
}

.role-card .eyebrow { color: var(--leaf); }
.role-body { font-size: 14px; margin: 0 0 10px; }

.role-how {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.chain-card {
  margin: 22px 0 8px;
  background: var(--pine);
  color: var(--pine-ink);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.chain-card .eyebrow { color: var(--pine-ink); opacity: 0.6; }

.chain {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.chain-node {
  font-family: var(--serif);
  font-size: 20px;
  background: var(--pine-soft);
  border-radius: 999px;
  padding: 6px 18px;
}

.chain-arrow { opacity: 0.5; }
.chain-note { font-size: 14px; opacity: 0.9; margin: 6px 0 0; max-width: 52ch; }

.loop-svg {
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 8px auto 6px;
  color: var(--pine-ink);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--tile);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.stat span { font-size: 12px; color: var(--muted); line-height: 1.4; }

.date-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.date-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--tile);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.date-card strong { font-family: var(--serif); font-weight: 400; font-size: 21px; }
.date-card span { font-size: 12px; line-height: 1.4; }
.date-card em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--leaf); }
.date-card.is-past { opacity: 0.55; }
.date-card.is-past em { color: var(--muted); }

/* ============ timeline ============ */
.timeline { display: flex; flex-direction: column; }

.beat {
  padding: 20px 2px;
  border-bottom: 1px solid var(--line);
  max-width: 62ch;
}

.beat:last-child { border-bottom: 0; }

.beat-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.beat-n {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--muted);
}

.beat-when {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--leaf);
}

.beat h3 { font-family: var(--serif); font-weight: 400; font-size: 24px; margin: 8px 0 6px; }
.beat p { font-size: 14.5px; color: var(--muted); margin: 0; }
.beat--done h3 { text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: var(--muted); }
.beat--done { opacity: 0.72; }

/* ============ tags ============ */
.tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.tag--money { background: var(--leaf-soft); color: var(--leaf); }
.tag--agreement { background: var(--amber-soft); color: var(--amber); }
.tag--logistics { background: var(--clay-soft); color: #8c5a45; }
.tag--expectations { background: #e8e4f2; color: #6b5e93; }
.tag--waiting { background: var(--amber-soft); color: var(--amber); }
.tag--done { background: var(--line); color: var(--muted); }
.tag--now { background: var(--leaf); color: #fff; }

/* ============ money ============ */
.money-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}

.money-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--tile);
  padding: 18px 20px;
}

.money-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14.5px;
}

.money-line strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.money-total { border-bottom: 0; }
.money-total strong { color: var(--leaf); }
.money-note { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }

/* ============ expectations ============ */
.expect-list { display: flex; flex-direction: column; gap: 12px; }

.expect {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--tile);
  padding: 16px 20px;
  max-width: 640px;
}

.expect--pending { background: var(--amber-soft); border-color: transparent; }

.expect-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.expect h3 { font-family: var(--serif); font-weight: 400; font-size: 21px; margin: 0; }
.expect-source { font-size: 11px; color: var(--muted); white-space: nowrap; letter-spacing: 0.06em; text-transform: uppercase; }
.expect p { font-size: 14.5px; margin: 8px 0 0; }

/* ============ the work ============ */
.work-level { color: var(--leaf); margin: 30px 0 12px; }
.work-list > .work-level:first-child { margin-top: 4px; }

.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.work-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--tile);
  padding: 14px 18px;
}

.work-card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  margin: 0 0 4px;
}

.work-items { list-style: none; margin: 0; padding: 0; }

.work-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
  line-height: 1.5;
}

.work-item:last-child { border-bottom: 0; padding-bottom: 2px; }

.tag--handy { background: var(--leaf-soft); color: var(--leaf); flex: none; }

/* ============ still open ============ */
.open-list { display: flex; flex-direction: column; gap: 12px; }

.open-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--tile);
  padding: 16px 20px;
  max-width: 640px;
}

.open-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.open-item h3 { font-family: var(--serif); font-weight: 400; font-size: 21px; margin: 0; }
.open-item p { font-size: 15px; color: var(--ink); line-height: 1.6; margin: 8px 0 0; }

/* ============ agreement ============ */
.draft-banner {
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--tile);
  padding: 12px 18px;
  margin: 0 0 20px;
}

.agree-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.agree-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--tile);
  padding: 15px 18px;
}

.agree-card .eyebrow { color: var(--leaf); }
.agree-card p:not(.eyebrow) { font-size: 13.5px; margin: 0; }
.agree-card a { color: var(--amber); font-weight: 600; }

/* ============ reference ============ */
.contact-list { display: flex; flex-direction: column; gap: 10px; }

.contact {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--tile);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 6px 16px;
  align-items: baseline;
  max-width: 640px;
}

.contact strong { font-family: var(--serif); font-weight: 400; font-size: 18px; }
.contact span { font-size: 14px; color: var(--ink); }
.contact em { font-style: normal; font-size: 13.5px; font-weight: 600; color: var(--leaf); white-space: nowrap; }

.doc-list { display: flex; flex-direction: column; gap: 10px; }

.doc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--tile);
  padding: 14px 18px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 640px;
}

.doc:hover { border-color: var(--leaf); }
.doc strong { font-size: 14.5px; }
.doc span { font-size: 12.5px; color: var(--muted); }

.ref-notes p {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.65;
  max-width: 62ch;
  margin: 0 0 12px;
}

/* ============ ask ============ */
.ask-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  max-width: 640px;
}

.ask-form textarea {
  width: 100%;
  border: 0;
  resize: vertical;
  background: transparent;
  outline: none;
  font-size: 15px;
  min-height: 64px;
}

.ask-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.ask-hint { font-size: 12.5px; color: var(--muted); }

.ask-actions button {
  border: 0;
  border-radius: 999px;
  padding: 9px 26px;
  background: var(--pine);
  color: var(--pine-ink);
  font-weight: 600;
  cursor: pointer;
}

.asked-item {
  background: var(--leaf-soft);
  border-radius: var(--tile);
  padding: 12px 16px;
  margin-bottom: 10px;
  max-width: 640px;
}

.asked-item p { margin: 0; font-size: 14.5px; }
.asked-item em { font-style: normal; font-size: 12px; color: var(--muted); }

.answer-list .empty-note { color: var(--muted); font-size: 14px; max-width: 56ch; }

.answer {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--tile);
  padding: 16px 20px;
  margin-bottom: 12px;
  max-width: 640px;
}

.answer h3 { font-family: var(--serif); font-weight: 400; font-size: 20px; margin: 0 0 8px; }
.answer p { font-size: 14.5px; margin: 0 0 8px; }
.answer em { font-style: normal; font-size: 12px; color: var(--muted); }

/* ============ bottom tab bar ============ */
.tab-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: var(--pine);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
  align-items: flex-start;
}

.tab-bar a {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--pine-ink);
  opacity: 0.55;
  padding: 2px 0;
}

.tab-bar a.is-current { opacity: 1; }

.tab-bar svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-bar span {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tab-bar a.is-current span { font-weight: 700; }

.tab-badge {
  position: absolute;
  top: -3px;
  right: calc(50% - 20px);
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  background: var(--amber);
  color: #fff;
  border-radius: 999px;
  padding: 1px 5px;
  line-height: 1.3;
}

/* ============ mobile ============ */
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    /* auto row for the bar, rest to the page — otherwise stretch hands
       short pages' leftover height to the sidebar row (the giant green
       header Mike found on Ask). */
    grid-template-rows: auto 1fr;
    align-content: start;
    padding: 0;
    gap: 0;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: auto;
    min-width: 0;
    border-radius: 0;
    padding: 10px 16px;
    flex-direction: row;
    align-items: center;
  }

  .brand { margin-bottom: 0; font-size: 16px; }
  .brand br { display: none; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .brand-mark svg { width: 21px; height: 21px; }

  .side-nav, .side-foot { display: none; }

  .tab-bar { display: flex; }

  .workspace { padding: 18px 18px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .workspace-head { padding: 2px 0 14px; margin-bottom: 22px; flex-wrap: wrap; }

  .role-grid, .stat-strip, .date-strip, .money-cards, .agree-grid { grid-template-columns: 1fr 1fr; }
  .role-grid, .money-cards, .agree-grid, .work-grid { grid-template-columns: 1fr; }

  .contact { grid-template-columns: 1fr; gap: 2px; }
  .contact em { white-space: normal; }
}

@media (max-width: 480px) {
  .stat-strip, .date-strip { grid-template-columns: 1fr 1fr; }
  .chain-node { font-size: 17px; padding: 5px 14px; }
}

/* ============ hero photo ============ */
.hero--photo {
  background:
    linear-gradient(100deg, rgba(38, 58, 36, 0.84) 0%, rgba(44, 74, 42, 0.55) 55%, rgba(52, 88, 48, 0.32) 100%),
    url("assets/house-front.jpg") center 62% / cover no-repeat;
}

.hero--photo .hero-title,
.hero--photo .hero-sub,
.hero--photo .hero-eyebrow { text-shadow: 0 1px 14px rgba(23, 32, 21, 0.45); }

.hero--photo .hero-sub { opacity: 0.92; }

/* The greeting hero has no cue buttons under it, so .hero-sub's
   18px cue-spacing margin became a dead band stacked on top of the
   hero's own 44px padding — a hand-width of empty photo under every
   greeting. Any header block now ends flush with its padding, whatever
   its last line happens to be. */
.hero > :last-child,
.wk-head > :last-child,
.gate-card > :last-child { margin-bottom: 0; }

/* ============ fix-the-record ============ */
.fix-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(35, 32, 26, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.modal {
  width: min(460px, 100%);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
}

.modal h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  margin: 2px 0 8px;
}

.modal-body { font-size: 14px; color: var(--muted); margin: 0 0 14px; }

.modal textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--tile);
  background: var(--card);
  padding: 12px 14px;
  resize: vertical;
  min-height: 90px;
  outline: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.btn-ghost {
  border: 1px solid var(--line);
  background: none;
  border-radius: 999px;
  padding: 9px 20px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.btn-solid {
  border: 0;
  background: var(--pine);
  color: var(--pine-ink);
  border-radius: 999px;
  padding: 9px 22px;
  cursor: pointer;
  font-weight: 600;
}

/* ============ still-open filters ============ */
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.fchip {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.fchip .n { font-size: 11px; opacity: 0.7; margin-left: 4px; }

.fchip.is-on {
  background: var(--pine);
  border-color: var(--pine);
  color: var(--pine-ink);
}

/* ============ ask answers ============ */
.ask-answer {
  background: var(--leaf-soft);
  border-radius: var(--tile);
  padding: 16px 20px;
  margin: 14px 0 4px;
  max-width: 640px;
}

.ask-answer .eyebrow { color: var(--leaf); }
.ask-answer p { font-size: 14.5px; margin: 4px 0 12px; }

.ask-answer .aa-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.aa-go {
  display: inline-block;
  background: var(--pine);
  color: var(--pine-ink);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.aa-quiet {
  background: none;
  border: 0;
  padding: 8px 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ask-answer--stuck { background: var(--amber-soft); }
.ask-answer--stuck .eyebrow { color: var(--amber); }

/* ============ accessibility ============ */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 2px;
  border-radius: 4px;
}

.beyond-note { font-size: 14px; color: var(--muted); margin: 18px 0 0; }

.modal-alt { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.modal-alt .fix-link { color: var(--leaf); font-size: 13px; }
.modal-status { margin: 12px 0 0; font-size: 13.5px; font-weight: 600; color: var(--leaf); }

/* hero cues stay side by side on mobile */
@media (max-width: 900px) {
  .hero-cues { flex-wrap: nowrap; }
  .hero-cues a {
    flex: 1;
    text-align: center;
    font-size: 12.5px;
    padding: 9px 8px;
  }
}

/* keyboard open: get the tab bar out of the way of the field being typed in */
body.is-typing .tab-bar { display: none !important; }
body.is-typing .workspace { padding-bottom: 24px; }

/* ============ mobile header + hero cue fixes ============ */
@media (max-width: 900px) {
  .workspace-head {
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    padding: 4px 0 14px;
  }

  .workspace-head .eyebrow {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 10px;
    letter-spacing: 0.1em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .head-tools { flex: none; gap: 8px; }

  .clock-chip {
    font-size: 11px;
    padding: 5px 11px;
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 380px) {
  .hero-cues a { font-size: 11.5px; padding: 8px 6px; }
  .hero-cues { gap: 8px; }
}

/* ============ this week (the front door) ============ */
.wk-head { margin-bottom: 6px; }

.wk-sub {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 6px 0 0;
}

.wk-ask-title { margin: 0; }
.wk-ask-when { margin: 8px 0 0; font-size: 14px; }

.wk-coming { display: flex; flex-direction: column; }

.wk-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: baseline;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

.wk-row:last-child { border-bottom: 0; }

.wk-row strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 17px;
  white-space: nowrap;
}

.wk-row span { color: var(--muted); }

.wk-new { display: flex; flex-direction: column; gap: 8px; }

.wk-new-link {
  display: block;
  background: var(--card, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14.5px;
  color: inherit;
  text-decoration: none;
}

.wk-new-link:hover { background: var(--leaf-soft); }
.wk-new-link em { font-style: normal; color: var(--leaf); font-weight: 600; }

/* ============ the value card (money) ============ */
.value-card {
  background: var(--leaf-soft);
  border-radius: 16px;
  padding: 20px 22px;
  margin: 22px 0 18px;
}

.value-card .eyebrow { color: var(--leaf); }

.value-line {
  font-family: var(--serif);
  font-size: 27px;
  margin: 4px 0 10px;
}

.value-line s {
  color: var(--muted);
  text-decoration-thickness: 1.5px;
}

.value-arrow { color: var(--leaf); margin: 0 4px; }
.value-line strong { font-weight: 400; color: var(--leaf); }

.value-body { font-size: 14.5px; margin: 0; max-width: 60ch; }

@media (max-width: 480px) {
  .wk-row { grid-template-columns: 76px 1fr; gap: 10px; }
  .value-line { font-size: 22px; }
}

/* ============ who: tap your name ============ */
.who-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.who-btn {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 10px;
  font-family: var(--serif);
  font-size: 20px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.who-btn:hover { background: var(--leaf-soft); border-color: var(--leaf); }

.who-nevermind {
  display: block;
  margin: 16px auto 0;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 13.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.who-chip {
  background: var(--leaf-soft);
  color: var(--leaf);
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.who-chip:hover { filter: brightness(0.96); }


/* ============ breadcrumb home ============ */
.crumb {
  font-size: 13px;
  font-weight: 600;
  color: var(--leaf);
  text-decoration: none;
  white-space: nowrap;
}

.crumb:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ============ timeline: done is done ============ */
.beat--compact {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  opacity: 0.6;
}

.beat--compact .beat-check {
  color: var(--leaf);
  font-weight: 700;
  font-size: 13px;
}

.beat--compact .beat-when {
  font-size: 12px;
  padding: 0;
}

.beat--compact h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 16.5px;
  margin: 0;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--muted);
}

/* ============ expectations: titles stack cleanly ============ */
@media (max-width: 600px) {
  .expect-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
  .expect h3 { font-size: 19px; }
}

/* ============ the chat: the house answers ============ */
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 48vh;
  overflow-y: auto;
  padding: 4px 2px 12px;
  margin-bottom: 6px;
}

.bubble {
  max-width: 52ch;
  padding: 10px 15px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.55;
}

.bubble--me {
  align-self: flex-end;
  background: var(--pine);
  color: var(--pine-ink);
  border-bottom-right-radius: 5px;
}

.bubble--house {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}

.bubble--typing { color: var(--muted); letter-spacing: 2px; }

/* ============ requests waiting ============ */
.req-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }

.req-card {
  background: var(--amber-soft);
  border-radius: var(--tile);
  padding: 14px 18px;
}

.req-summary { font-size: 14.5px; font-weight: 600; margin: 0 0 4px; }

.req-meta { font-size: 12.5px; color: var(--muted); margin: 0; }

.req-actions { display: flex; gap: 8px; margin-top: 10px; }

.req-actions button {
  border: 0;
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.req-approve { background: var(--leaf); color: #fff; }
.req-approve:hover { filter: brightness(1.08); }

.req-decline { background: transparent; border: 1px solid var(--line) !important; color: var(--muted); }
.req-decline:hover { background: var(--card); }

/* ============ the center home button ============ */
.tab-bar a.tab-home { opacity: 1; }

.tab-home-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--leaf);
  display: grid;
  place-items: center;
  margin-top: -20px;
  border: 3px solid var(--paper);
  box-shadow: 0 2px 10px rgba(23, 32, 21, 0.35);
}

.tab-bar .tab-home-btn svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  stroke-width: 2;
}

.tab-home.is-current .tab-home-btn { filter: brightness(1.15); }

.tab-home span:last-child {
  font-size: 9.5px;
  font-weight: 700;
}

/* ============ requests waiting banner (This Week, admins) ============ */
.req-banner {
  display: block;
  background: var(--amber-soft);
  color: var(--amber);
  border-radius: var(--tile);
  padding: 13px 18px;
  margin: 0 0 22px;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
}

.req-banner:hover { filter: brightness(0.97); }

/* ============ who's opened it (admin devices only) ============ */
.seen-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--tile);
  padding: 16px 18px;
  margin: 0 0 22px;
}

.seen-card .eyebrow { margin: 0 0 10px; }

.seen-list { display: grid; gap: 8px; }

.seen-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  font-size: 14.5px;
}

.seen-row span { color: var(--muted); font-size: 13px; text-align: right; }
.seen-row--never span { color: var(--amber); font-weight: 700; }

/* ============ your requests: outcomes ============ */
.req-card--applied { background: var(--leaf-soft); }
.req-card--declined { background: var(--card); border: 1px solid var(--line); }

.mine-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 9px;
  margin-right: 6px;
}

.mine-status--pending { background: var(--amber); color: #fff; }
.mine-status--applied { background: var(--leaf); color: #fff; }
.mine-status--declined { background: var(--line); color: var(--muted); }


/* Desktop layout follows UK26's centered workspace and simultaneous context.
   Text retains a readable measure; cards and sections use the available width. */
@media (min-width: 901px) {
  .app-shell {
    grid-template-columns: 216px minmax(0, 1fr);
    max-width: 1680px;
    margin: 0 auto;
    padding: 24px;
    gap: 28px;
  }
  .sidebar {
    top: 24px;
    height: calc(100dvh - 48px);
    overflow-y: auto;
    padding: 22px 16px;
  }
  .workspace {
    width: 100%;
    max-width: 1380px;
    justify-self: center;
    padding: 8px 24px 72px;
  }
  .workspace-head { margin-bottom: 26px; padding-bottom: 20px; flex-wrap: wrap; }
  .head-tools { margin-left: auto; flex-wrap: wrap; }
  .workspace-head .eyebrow { flex-shrink: 0; }
  .hero--photo {
    min-height: 290px;
    padding: 42px 46px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background-position: center 52%;
    margin-bottom: 32px;
  }
  .hero-title { font-size: clamp(50px, 4.3vw, 72px); }
  .hero-sub { font-size: 17px; max-width: 54ch; }
  .week-board {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    gap: clamp(24px, 3vw, 48px);
    align-items: start;
  }
  .week-summary, .week-schedule { min-width: 0; }
  .week-summary .chapter-title { font-size: clamp(38px, 3.3vw, 54px); text-wrap: pretty; }
  .week-summary .story p { margin-top: 14px; }
  .week-summary .callout { max-width: none; padding: 20px 24px; }
  .week-schedule {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 26px;
  }
  .week-schedule > .section-eyebrow { margin: 0 0 12px; color: var(--leaf); }
  .week-schedule .wk-row { grid-template-columns: 82px minmax(0, 1fr); gap: 14px; padding: 14px 0; }
  .wk-new { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .wk-new-link { padding: 16px 20px; }
  .wk-new-link em { float: right; margin-left: 10px; }
  .view > .story p { max-width: 78ch; }
  .view > .callout, .view > .soft-note { max-width: none; }
  .open-list, .expect-list, .timeline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
  }
  .open-item, .expect { max-width: none; height: 100%; padding: 22px 24px; }
  .open-item h3, .expect h3 { font-size: 25px; }
  .expect-head { flex-wrap: wrap; }
  .expect-source { white-space: normal; }
  .beat { max-width: none; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--tile); background: var(--card); height: 100%; }
  .beat:last-child { border-bottom: 1px solid var(--line); }
  .beat--compact { grid-column: 1 / -1; height: auto; padding: 14px 20px; }
  .role-card, .money-card, .agree-card { padding: 24px; }
  .role-body, .expect p, .agree-card p:not(.eyebrow), .beat p, .value-body { font-size: 16px; }
  .role-how, .money-note { font-size: 14px; }
  .money-line { gap: 20px; }
  .money-line strong { flex-shrink: 0; }
  .date-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat span, .date-card span { font-size: 14px; }
  .stat strong { font-size: 30px; }
  .contact-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .contact { max-width: none; grid-template-columns: minmax(0, 1fr); align-content: start; padding: 22px; }
  .contact strong { font-size: 24px; }
  .contact em { white-space: normal; overflow-wrap: anywhere; margin-top: 8px; }
  .doc, .ref-notes { max-width: none; }
  #view-ask { max-width: 880px; margin: 0 auto; }
  .ask-form, .ask-answer, .answer, .asked-item { max-width: none; }
  .eyebrow { font-size: 12px; }
}
@media (min-width: 901px) and (max-width: 1199px) {
  .app-shell { grid-template-columns: 196px minmax(0, 1fr); padding: 18px; gap: 16px; }
  .workspace { padding-left: 10px; padding-right: 10px; }
  .sidebar { top: 18px; height: calc(100dvh - 36px); }
  .week-board { grid-template-columns: 1fr; gap: 24px; }
  .hero--photo { padding: 32px; min-height: 260px; }
  .contact-list { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .open-list, .expect-list, .timeline { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .week-summary, .week-schedule { min-width: 0; }
  .contact em { white-space: normal; overflow-wrap: anywhere; }
}

/* Waiting details can be full phrases; never clip them inside a pill. */
.tag--waiting {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.sign-out { font-size: 13px; color: var(--muted); white-space: nowrap; }
span.who-chip { cursor: default; }
@media (max-width: 600px) { .clock-chip { display: none; } .who-chip { padding: 5px 9px; } .head-tools { gap: 9px; } }

/* Contextual discussion, following Strangeland's card-to-thread pattern. */
.open-item[data-item-id] { cursor: pointer; transition: border-color .15s, background .15s; }
.open-item[data-item-id]:hover { border-color: var(--leaf); }
.open-discuss { display: block; width: 100%; background: none; border: 0; border-top: 1px solid var(--line); padding: 14px 0 0; margin-top: 18px; text-align: left; color: var(--leaf); font-size: 14px; font-weight: 650; cursor: pointer; }
body.discussion-open { overflow: hidden; }
.discussion { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(640px,100%); height: 100dvh; max-width: 100%; max-height: 100dvh; padding: 0; border: 0; background: var(--paper); color: var(--ink); box-shadow: -16px 0 70px #17201526; }
.discussion[open] { display: flex; flex-direction: column; }
.discussion::backdrop { background: #18231685; }
.discussion-head { padding: 22px 30px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 16px; }
.discussion-head .eyebrow { margin: 0; color: var(--leaf); }
.discussion-close { border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--ink); width: 38px; height: 38px; font-size: 26px; cursor: pointer; flex: none; }
.discussion-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 30px; overscroll-behavior: contain; }
.discussion h2 { font-family: var(--serif); font-size: 38px; font-weight: 400; line-height: 1.1; margin: 0 0 18px; }
.discussion-context { font-size: 16px; line-height: 1.65; margin: 0 0 18px; }
.discussion-principle { background: var(--amber-soft); border-radius: 12px; font-size: 14px; padding: 14px 16px; margin: 0 0 30px; }
.discussion-comment { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 12px 0; }
.discussion-comment.is-mine { border-left: 3px solid var(--leaf); }
.comment-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.comment-meta time { color: var(--muted); font-size: 12px; }
.discussion-comment p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.6; margin: 10px 0 0; }
.discussion-empty { font-size: 16px; color: var(--muted); }
.discussion-form { border-top: 1px solid var(--line); background: var(--card); padding: 20px 30px max(20px,env(safe-area-inset-bottom)); }
.discussion-form label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 8px; }
.discussion-form textarea { width: 100%; resize: vertical; min-height: 80px; max-height: 25dvh; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px; color: var(--ink); font-size: 16px; }
.discussion-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.discussion-actions span { font-size: 12px; color: var(--muted); }
.discussion-actions button { white-space: nowrap; }
#discussionStatus, #discussionLoadStatus { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
#discussionStatus:empty, #discussionLoadStatus:empty { display: none; }
.discussion button:disabled { opacity: .6; cursor: wait; }
@media(max-width:600px) { .discussion-head { padding: 16px 20px; } .discussion-scroll { padding: 22px 20px; } .discussion-form { padding: 16px 20px max(16px,env(safe-area-inset-bottom)); } .discussion h2 { font-size: 32px; } .discussion-actions span { display: none; } .discussion-actions { justify-content: flex-end; } }

/* Stable page geometry: the scrollbar never changes the content's left edge. */
html { overflow-y: scroll; scrollbar-gutter: stable; scroll-behavior: auto; }
:root { --motion-quick: 150ms; --motion-standard: 260ms; --motion-ease: cubic-bezier(.22,1,.36,1); }
@media (min-width: 901px) {
  .app-shell { max-width: none; margin: 0; padding: 16px; gap: 24px; grid-template-columns: 224px minmax(0,1fr); align-items: start; }
  .sidebar { top: 16px; height: calc(100dvh - 32px); }
  .workspace { max-width: none; justify-self: stretch; padding: 8px clamp(20px,2vw,40px) 72px; }
  .workspace-head { display: grid; grid-template-columns: minmax(0,1fr) auto; min-height: 61px; align-items: center; flex-wrap: nowrap; }
  .workspace-head .eyebrow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .head-tools { margin-left: 0; flex-wrap: nowrap; }
  #view-ask { margin: 0; max-width: 960px; }
  .role-grid,.money-cards,.agree-grid,.work-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .role-card,.money-card,.agree-card,.open-item,.expect,.beat { min-width: 0; }
  .open-item { display: flex; flex-direction: column; }
  .open-discuss { margin-top: auto; padding-top: 16px; }
  .open-item > p { margin-bottom: 20px; }
  .side-foot { padding-top: 18px; }
}
@media (min-width:901px) and (max-width:1199px) {
  .app-shell { grid-template-columns: 196px minmax(0,1fr); gap: 16px; }
  .workspace { padding-left: 16px; padding-right: 16px; }
  .clock-chip { display: none; }
}
.admin-preview { margin-top: 28px; padding: 18px 6px 0; border-top: 1px solid #ffffff25; }
.admin-preview label { display: block; font-size: 12px; color: var(--pine-ink); margin-bottom: 8px; }
.admin-preview select { width: 100%; min-width: 0; font: inherit; font-size: 14px; border: 1px solid #ffffff35; background: var(--pine-soft); color: var(--pine-ink); border-radius: 10px; padding: 10px; cursor: pointer; }
#previewStatus { font-size: 12px; margin: 8px 0 0; }
#previewStatus:empty { display: none; }
.preview-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; margin-bottom: 24px; border: 1px solid #b0803240; border-radius: 12px; background: var(--amber-soft); font-size: 14px; }
.preview-banner button { flex: none; border: 0; background: transparent; padding: 4px; color: var(--amber); text-decoration: underline; cursor: pointer; font: inherit; font-weight: 650; }
@media(max-width:900px) { .admin-preview { margin: 0; padding: 8px 14px; border: 0; max-width: 260px; } .admin-preview label { margin-bottom: 4px; } .admin-preview select { padding: 6px; } .preview-banner { flex-direction: column; align-items: flex-start; gap: 8px; } }

/* House motion: short, quiet entrances; directional navigation and drawers. */
.side-nav { position: relative; isolation: isolate; }
.side-nav a { position: relative; z-index: 1; transition: color var(--motion-quick),opacity var(--motion-quick),background var(--motion-quick); }
.nav-indicator { position: absolute; inset: 0 0 auto; border-radius: 10px; background: var(--pine-soft); opacity: 0; pointer-events: none; transition: transform var(--motion-standard) var(--motion-ease),height var(--motion-standard) var(--motion-ease); }
.side-nav a.is-current { background: transparent; }
button,select,.help-btn,.wk-new-link,.tab-bar a { transition: background var(--motion-quick),color var(--motion-quick),border-color var(--motion-quick),box-shadow var(--motion-quick),transform var(--motion-quick) var(--motion-ease); }
@media(hover:hover) { .wk-new-link:hover,.open-item:hover { transform: translateY(-2px); box-shadow: 0 5px 18px #263a2410; } .help-btn:hover,.discussion-close:hover { transform: rotate(-6deg); } }
button:active:not(:disabled),.help-btn:active,.wk-new-link:active { transform: scale(.98); }
.open-item { transition: transform var(--motion-standard) var(--motion-ease),box-shadow var(--motion-standard),border-color var(--motion-quick); }
.fchip.is-on { box-shadow: 0 2px 8px #263a2418; }
.discussion[open]::backdrop { animation: house-backdrop 220ms ease-out both; }
.discussion-comment { animation: house-comment 240ms var(--motion-ease) both; }
.discussion-close { line-height: 1; }
.gate-card { animation: house-arrive 400ms var(--motion-ease) both; }
.bubble { animation: house-comment 220ms var(--motion-ease) both; }
@keyframes house-arrive { from {opacity:0;transform:translateY(12px)} to {opacity:1;transform:translateY(0)} }
@keyframes house-comment { from {opacity:0;transform:translateY(6px)} to {opacity:1;transform:translateY(0)} }
@keyframes house-backdrop { from {background:#18231600} to {background:#18231685} }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } .open-item:hover,.wk-new-link:hover,button:active,.help-btn:hover { transform: none; } }

/* Review follow-ups: single-room work lists and reference notes use the canvas. */
@media(min-width:901px) {
  .work-card:only-child { grid-column: 1 / -1; }
  .work-card:only-child .work-items { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 30px; }
  .work-card { padding: 22px 24px; }
  .work-item { font-size: 16px; min-width: 0; }
  .work-t { overflow-wrap: anywhere; }
  .ref-notes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 32px; }
  .ref-notes p { max-width: none; padding: 16px 0; margin: 0; border-bottom: 1px solid var(--line); font-size: 16px; }
  .seen-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
  .seen-row { flex-direction: column; gap: 4px; }
  .seen-row span { text-align: left; }
}
@media(min-width:1200px) { .seen-list { grid-template-columns: repeat(4,minmax(0,1fr)); } }

/* Device-local display preferences. */
:root { --page-zoom: 1; }
:root[data-font="clean"] { --serif: Arial, Helvetica, sans-serif; --sans: Arial, Helvetica, sans-serif; }
:root[data-font="book"] { --serif: Georgia, "Times New Roman", serif; --sans: Georgia, "Times New Roman", serif; }
:root[data-palette="ocean"] { --paper:#f2f7f8; --card:#fcfefe; --ink:#192b34; --muted:#4b626e; --line:#d5e1e6; --pine:#233e4d; --pine-soft:#345363; --pine-ink:#f0f7fa; --leaf:#34637a; --leaf-soft:#e1edf3; }
:root[data-palette="plum"] { --paper:#faf5f5; --card:#fffdfc; --ink:#352631; --muted:#705b66; --line:#e8dbe1; --pine:#493245; --pine-soft:#61475b; --pine-ink:#fff2fa; --leaf:#794e6e; --leaf-soft:#f1e5ed; }
:root[data-contrast="true"] { --muted:var(--ink); --line:#82796d; --leaf:#294e2c; --amber:#704900; }
:root[data-contrast="true"] .side-nav a,:root[data-contrast="true"] .side-foot { color:var(--pine-ink); }
:root[data-motion="off"] *,:root[data-motion="off"] *::before,:root[data-motion="off"] *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
:root[data-motion="off"] .open-item:hover,:root[data-motion="off"] .wk-new-link:hover,:root[data-motion="off"] button:active { transform:none; }
.settings-button { border:1px solid var(--line); border-radius:999px; background:var(--card); color:var(--ink); padding:7px 11px; cursor:pointer; font-size:13px; white-space:nowrap; }
.settings-dialog { width:min(480px,calc(100% - 24px)); max-height:calc(100dvh / var(--page-zoom) - 32px); margin:auto; overflow:auto; padding:28px; border:1px solid var(--line); border-radius:22px; color:var(--ink); background:var(--paper); box-shadow:0 24px 90px #18231630; }
.settings-dialog::backdrop { background:#18231685; }
.settings-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.settings-heading h2 { font:400 36px/1.1 var(--serif); margin:0; }
.settings-heading button { border:0; background:var(--leaf-soft); color:var(--ink); border-radius:50%; width:36px; height:36px; font-size:25px; cursor:pointer; flex:none; }
.settings-intro,.settings-field small { color:var(--muted); font-size:14px; }
.settings-field { margin:22px 0; }
.settings-field label { display:flex; justify-content:space-between; font-weight:650; margin-bottom:8px; }
.settings-field input[type="range"] { width:100%; accent-color:var(--leaf); }
.settings-field select { width:100%; font:inherit; padding:11px; border:1px solid var(--line); border-radius:10px; background:var(--card); color:var(--ink); }
.settings-field small { display:block; margin-top:6px; }
.settings-check { display:flex; align-items:center; gap:10px; }
.settings-check input { width:18px; height:18px; accent-color:var(--leaf); }
.settings-actions { display:flex; justify-content:space-between; gap:12px; margin-top:26px; }
.settings-actions button { padding:10px 14px; border:1px solid var(--line); border-radius:10px; background:var(--card); color:var(--ink); cursor:pointer; }
.settings-actions #doneSettings { background:var(--pine); color:var(--pine-ink); }
.settings-status { min-height:1.5em; font-size:12px; color:var(--muted); margin-bottom:0; }
@media(min-width:901px) { .sidebar { height:calc(100dvh / var(--page-zoom) - 32px); overflow-y:auto; } }
.discussion { max-height:calc(100dvh / var(--page-zoom)); }
@media(max-width:1100px) { .settings-button span { display:none; } .settings-button { font-size:18px; padding:3px 9px; } }
@media(max-width:600px) { .head-tools { flex-wrap:wrap; } .settings-dialog { padding:20px; } }

/* House activity: full-bleed Metro tiles, based on the concept image. */
.seen-card { max-width:none; width:100%; padding:0; border:0; background:transparent; border-radius:0; margin:0 0 22px; container-type:inline-size; }
.seen-card > .eyebrow { display:flex; align-items:center; gap:20px; font-size:13px; letter-spacing:.15em; margin:0 0 12px; color:var(--ink); }
.seen-card > .eyebrow::after { content:""; height:1px; background:var(--ink); opacity:.3; flex:1; }
.seen-list { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.seen-row { --tile-color:var(--pine); position:relative; isolation:isolate; overflow:hidden; gap:0; padding:0; min-width:0; border:1px solid color-mix(in srgb,var(--tile-color) 80%,var(--pine-ink)); border-radius:18px; background:var(--tile-color); color:var(--pine-ink); box-shadow:0 3px 7px color-mix(in srgb,var(--pine) 8%,transparent); }
.seen-row:nth-child(4n+1) { --tile-color:color-mix(in srgb,var(--pine) 86%,black); }
.seen-row:nth-child(4n+2) { --tile-color:color-mix(in srgb,var(--pine) 55%,var(--leaf)); }
.seen-row:nth-child(4n+3) { --tile-color:color-mix(in srgb,var(--leaf) 85%,black); }
.seen-row:nth-child(4n+4) { --tile-color:color-mix(in srgb,var(--pine-soft) 80%,var(--leaf)); }
/* Fine concentric arcs echo a door knocker behind the activity count. */
.seen-row::before { content:""; position:absolute; z-index:-1; width:100px; height:100px; right:-25px; top:-35px; border:1px solid currentColor; border-radius:50%; opacity:.11; box-shadow:0 0 0 14px color-mix(in srgb,currentColor 35%,transparent),0 0 0 28px color-mix(in srgb,currentColor 20%,transparent); pointer-events:none; }
/* Keep activity secondary to the house content: a low, full-width strip. */
.seen-row { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:1fr auto; align-items:center; }

.seen-row .seen-name { font-family:var(--sans); font-size:22px; font-weight:550; letter-spacing:-.035em; line-height:1.15; padding:14px 0 14px 16px; }
.seen-metric { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; padding:12px 16px 10px 10px; margin:0; }
.seen-row .seen-number { color:inherit; font-size:32px; font-weight:400; line-height:1; letter-spacing:-.04em; font-variant-numeric:tabular-nums; text-align:center; }
.seen-row .seen-unit { color:inherit; font-size:9px; font-weight:650; line-height:1; letter-spacing:.08em; text-transform:uppercase; }
.seen-row .seen-last { grid-column:1/-1; align-self:stretch; color:inherit; font-size:12px; font-weight:450; line-height:1.4; text-align:left; text-transform:none; letter-spacing:0; border-top:1px solid #ffffff18; background:#0000000c; padding:8px 16px; margin:0; }
@container(max-width:800px) { .seen-list { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@container(max-width:420px) { .seen-row .seen-name { padding-left:12px; font-size:20px; } .seen-metric { padding-right:12px; } .seen-row .seen-number { font-size:28px; } .seen-row .seen-last { padding:8px 12px; } }
@container(max-width:270px) { .seen-list { grid-template-columns:1fr; } }
