:root {
  --ink: #1F2328; --soft: #4A5157; --quiet: #5A6166; --line: #E6E8E7; --bg: #FBFBFA; --card: #FFFFFF;
  --teal: #0B5E5E; --teal-bg: #E1ECE9; --amber: #7A4F10; --amber-bg: #F3ECE1; --grey-bg: #EEF1F0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
a { color: var(--teal); }
a:hover { color: #083F3F; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-size: 18px; font-weight: 700; text-decoration: none; }
.tools { margin-left: auto; display: flex; gap: 4px; }
.tool { width: 38px; height: 38px; border: 0; border-radius: 8px; background: none; color: var(--soft); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.tool:hover, .tool:focus-visible { background: var(--grey-bg); color: var(--teal); }
.band { background: var(--amber-bg); color: var(--amber); padding: 8px 24px; font-size: 14px; font-weight: 600; }
.crumbs { max-width: 1180px; margin: 0 auto; padding: 14px 24px 0; font-size: 14px; color: var(--quiet); display: flex; gap: 8px; flex-wrap: wrap; min-height: 14px; }
.crumbs [aria-current] { color: var(--ink); }
main { max-width: 1180px; margin: 0 auto; padding: 16px 24px 40px; outline: none; display: flex; flex-direction: column; gap: 16px; }
h1 { font-size: 26px; margin: 0; }
h2 { font-size: 13px; font-weight: 600; color: var(--quiet); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 10px; }
h2.sub { margin: 8px 0 0; }
h3 { font-size: 14px; margin: 12px 0 6px; }
.quiet { color: var(--quiet); margin: 0; }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.status { margin: 0; color: var(--soft); }
.next { margin: 0; }
.asof { margin: 8px 0 0; font-size: 12px; color: var(--quiet); }
.message { max-width: 560px; margin: 48px auto; text-align: center; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.search { display: flex; gap: 10px; }
.search input, .filter input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; border: 1px solid #C9CFCC; border-radius: 8px; font: inherit; font-size: 16px; background: var(--card); }
.filter input { height: 40px; font-size: 15px; max-width: 360px; }
.go { height: 44px; padding: 0 20px; border: 0; border-radius: 8px; background: var(--teal); color: #fff; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; }
.go:hover { color: #fff; background: #083F3F; }
.go.ghost { background: var(--card); color: var(--teal); border: 1px solid #C9CFCC; }
.go.ghost:hover { border-color: var(--teal); }
button.link { border: 0; background: none; color: var(--teal); font: inherit; font-weight: 600; cursor: pointer; padding: 6px 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tiles.small { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tiles.apts { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); min-height: 44px; }
.tiles.small .tile { padding: 12px 14px; gap: 2px; }
.tile:hover, .tile:focus-visible { border-color: var(--teal); color: var(--ink); }
.tile.soon { opacity: .55; cursor: default; background: transparent; }
.tile.soon:hover { border-color: var(--line); }
.tile.soon .ic { background: var(--grey-bg); color: var(--quiet); }
.tile.soon .cap { color: var(--quiet); font-weight: 400; }
.tile .ic { width: 44px; height: 44px; border-radius: 10px; background: var(--teal-bg); color: var(--teal); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.tile .tt { font-size: 16px; font-weight: 600; }
.tiles.small .tile .tt { font-size: 14px; }
.tile .cap { font-size: 13px; color: var(--teal); font-weight: 500; }
.tiles.small .tile .cap { color: var(--quiet); font-weight: 400; }
.tile .apt-l { font-size: 12px; font-weight: 700; color: var(--quiet); text-transform: uppercase; letter-spacing: .03em; }
.tile.apt { align-items: center; padding: 10px 0; }

.segs { display: inline-flex; gap: 4px; background: var(--grey-bg); padding: 4px; border-radius: 8px; align-self: flex-start; }
.seg { border: 0; background: none; padding: 6px 14px; border-radius: 6px; font: inherit; font-size: 14px; color: var(--soft); cursor: pointer; }
.seg.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.fold { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; }
.fold > summary { cursor: pointer; padding: 14px 0; font-weight: 600; color: var(--teal); list-style-position: inside; }
.fold .fold { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 0; }
.fold .fold > summary { color: var(--ink); font-weight: 500; }
.fold-body { padding-bottom: 14px; }
.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
ol.plain li { padding-left: 12px; border-left: 2px solid #C9CFCC; }
.doc { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: baseline; }
.doc .date { margin-right: 0; }
.doc.key { background: #E6F0EE; border-radius: 8px; padding: 6px 10px; margin: 0 -10px; font-weight: 600; }
.doc .chip { font-size: 11px; }
ol.plain .date { display: inline-block; min-width: 96px; }
.visit > summary { cursor: pointer; color: var(--teal); }
.visit > summary .count { color: var(--quiet); }
.visit > ul { margin: 8px 0 4px 18px; }
.date { color: var(--quiet); font-size: 13px; white-space: nowrap; margin-right: 6px; }
.what { font-weight: 600; }
.facts { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.facts dt { color: var(--quiet); }
.facts dd { margin: 0; }
.frame { width: 100%; height: 600px; border: 1px solid var(--line); border-radius: 8px; }

.stages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.stage-head { display: flex; gap: 8px; align-items: center; }
.items { list-style: none; margin: 6px 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.item { display: flex; gap: 8px; align-items: baseline; }
.item.in { color: var(--soft); }
.item .mark { width: 14px; flex: none; text-align: center; }
.item.in .mark { color: #2E7D4F; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 1px solid #B9C0BD; background: #fff; flex: none; }
.dot.done { background: #2E7D4F; border-color: #2E7D4F; }
.dot.open { background: #D98A1F; border-color: #D98A1F; }
.dot.waived { background: #C9CFCC; border-color: #C9CFCC; }

.panel textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin: 4px 0 8px; }
.suggest { margin: 14px 0 0; font-size: 13px; }
.overlay { position: fixed; inset: 0; background: rgba(20,20,19,.35); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.panel { background: var(--card); border-radius: 12px; padding: 22px; max-width: 420px; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { font-size: 18px; color: var(--ink); text-transform: none; letter-spacing: 0; margin: 0; }
.panel p { margin: 0; }

@media (max-width: 760px) {
  .top, .crumbs { padding-left: 16px; padding-right: 16px; }
  main { padding: 12px 16px 32px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .tile { padding: 14px; }
  h1 { font-size: 22px; }
}

/* 25 Nov: one horizontal tile per choice */
.rows { display: flex; flex-direction: column; gap: 10px; }
.rows .tile { flex-direction: row; align-items: center; gap: 14px; padding: 14px 18px; }
.rows .tile .ic { margin: 0; width: 40px; height: 40px; flex: none; }
.rows .tile .body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.rows .tile .chev { color: #9AA3A0; font-size: 22px; line-height: 1; }
.rows.compact { gap: 6px; }
.rows.compact .tile { padding: 10px 16px; }
.rows.compact .tile .tt { font-size: 15px; }
.chip { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--grey-bg); color: #3D4448; vertical-align: 2px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { border-radius: 6px; }
.row .segs { align-self: auto; }

/* 25 Nov, batch 2 */
.filters2 { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; align-items: center; }
.flabel { font-size: 13px; font-weight: 600; color: var(--soft); }
.segs.wrap { flex-wrap: wrap; }
.frame { height: 75vh; min-height: 480px; }
/* Inside Teams, Teams already shows the name and icon: keep only the tools, beside the trail. */
body.framed .top { position: absolute; top: 0; right: 16px; border: 0; background: none; padding: 8px 0; }
body.framed .top .brand { display: none; }
body.framed .crumbs { padding-top: 16px; padding-right: 110px; min-height: 46px; }  /* clears the two tool buttons, even on Home where the trail is empty */
@media (max-width: 760px) { .filters2 { grid-template-columns: 1fr; } }

/* Section colours (James chose option A, 25 Nov): muted, one per section; on Home's rows and on the section's own pages. */
.tone-duties, body[data-tone="duties"] { --tone: #0B5E5E; --tone-bg: #E3ECEA; }
.tone-logs, body[data-tone="logs"] { --tone: #2F4F75; --tone-bg: #E4EAF2; }
.tone-ops, body[data-tone="ops"] { --tone: #7A5A1C; --tone-bg: #F2EBDD; }
.tone-works, body[data-tone="works"] { --tone: #8A3F25; --tone-bg: #F4E6E0; }
.tone-apts, body[data-tone="apts"] { --tone: #4A6A2E; --tone-bg: #E8EEE2; }
.tone-legal, body[data-tone="legal"] { --tone: #5B3F72; --tone-bg: #ECE6F0; }
.tile[class*="tone-"] .ic, body[data-tone] main .tile:not(.soon) .ic { background: var(--tone-bg); color: var(--tone); }
.rows > .tile[class*="tone-"] { border-left: 4px solid var(--tone); }
body[data-tone] main > h1 { border-left: 4px solid var(--tone); padding-left: 12px; }
