/* IBM Plex Sans, kept with the app (fonts/OFL.txt is its licence). One file holds every weight
   from 100 to 700 for Latin text; anything outside that falls back to the device's own font. */
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-stretch: 100%; font-display: swap;
  src: url("fonts/ibm-plex-sans-latin.b2c9031d9fd6.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* The "Signal" palette: cool white page, clear blue accent. Every colour in the app comes
     from these names, so a future colour theme is one more block like this one. */
  --bg: #e9edf3; --card: #ffffff; --ink: #14181f; --soft: #5b6472; --line: #c5cdd9;
  --lift: 0 1px 2px rgb(20 30 50 / .07), 0 2px 6px rgb(20 30 50 / .06);
  --accent: #2457d6; --accent-ink: #ffffff; --wash: #e6ecf8;
  --red: #b3261e; --amber: #8a5a00; --green: #1e6b3a;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
/* Dark colours apply when the device asks for them, unless the person chose Light in Settings,
   and always when they chose Dark. The two blocks below must hold the same values. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151b; --card: #1b2029; --ink: #e7eaf0; --soft: #98a2b3; --line: #2d3442;
    --accent: #8fb0ff; --accent-ink: #0b1430; --wash: #222a3a;
    --red: #ff8a80; --amber: #f0b955; --green: #7fd29b; --lift: none;
  
  }
}
:root[data-theme="dark"] {
  --bg: #12151b; --card: #1b2029; --ink: #e7eaf0; --soft: #98a2b3; --line: #2d3442;
  --accent: #8fb0ff; --accent-ink: #0b1430; --wash: #222a3a;
  --red: #ff8a80; --amber: #f0b955; --green: #7fd29b; --lift: none;

  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .75rem; text-wrap: balance; }
h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); margin: 1.75rem 0 .5rem; font-weight: 650; }
h2 .n { font-weight: 500; opacity: .8; margin-left: .25rem; }
code, pre { font-family: ui-monospace, Consolas, monospace; font-size: .875rem; }
pre { background: var(--wash); padding: .75rem; border-radius: 8px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: .5rem 0 1rem; }
time { color: var(--soft); font-size: .85rem; white-space: nowrap; }
.quiet { color: var(--soft); }
.lead { max-width: 65ch; }
.late { color: var(--red); font-weight: 600; }

/* top bar */
:root { --top-h: 3.25rem; --side-w: 16.5rem; }
.top { display: flex; align-items: center; gap: .75rem; height: var(--top-h); padding: 0 max(1rem, env(safe-area-inset-left)); background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 6; }
/* The logo: "relay" with the l drawn as a relay's switch arm, leaning toward the contact it is about to close on.
   The arm is one shape used as a mask over the accent colour, so it follows the theme. Sizes are in em, so it
   scales with font-size. The shape's box is 48 x 84 for a 108px word: 82 above the baseline and 2 below it, the
   same overshoot the round letters have. --arm-small swaps the contact ring for a dot, for the small top-bar size. */
:root {
  --arm: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 84'%3E%3Cpath fill-rule='evenodd' d='M22.292 77.809 45.622 12.469A9.335 9.335 0 0 0 28.038 6.191L4.708 71.531A9.335 9.335 0 0 0 22.292 77.809ZM17.2 74.67a3.7 3.7 0 1 0-7.4 0 3.7 3.7 0 1 0 7.4 0Z'/%3E%3Ccircle cx='11.3' cy='9.63' r='7' fill='none' stroke='black' stroke-width='5.25'/%3E%3C/svg%3E");
  --arm-small: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 84'%3E%3Cpath d='M22.292 77.809 45.622 12.469A9.335 9.335 0 0 0 28.038 6.191L4.708 71.531A9.335 9.335 0 0 0 22.292 77.809Z'/%3E%3Ccircle cx='11.3' cy='9.6' r='8.75'/%3E%3C/svg%3E");
}
.logo { display: inline-flex; align-items: baseline; font-weight: 700; letter-spacing: -.025em; line-height: 1; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo .baton { display: inline-block; flex: none; width: .4444em; height: .7778em; margin: 0 .074em 0 .083em; position: relative; top: .0185em; background: var(--accent); -webkit-mask: var(--arm) center / 100% 100% no-repeat; mask: var(--arm) center / 100% 100% no-repeat; }
.brand { font-size: 1.45rem; margin-right: .5rem; padding-bottom: .1rem; }
.brand .baton { -webkit-mask-image: var(--arm-small); mask-image: var(--arm-small); }
.navtoggle { display: none; background: none; border: 0; padding: .35rem; border-radius: 7px; cursor: pointer; color: var(--soft); line-height: 0; }
.count { background: var(--red); color: #fff; border-radius: 99px; padding: 0 .4rem; font-size: .75rem; }
.search { flex: 1 1 auto; min-width: 0; }
.search input { width: min(22rem, 100%); }

/* sidebar: the folder tree */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); align-items: start; }
.side { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h)); overflow-y: auto; padding: .75rem .6rem 2rem; border-right: 1px solid var(--line); background: var(--card); font-size: .925rem; }
.side h2 { margin: 1.1rem .5rem .35rem; }
.side .item, .side summary { display: flex; align-items: center; gap: .45rem; padding: .32rem .5rem; border-radius: 7px; color: var(--ink); min-height: 2rem; }
.side .item:hover, .side summary:hover { background: var(--wash); text-decoration: none; }
.side .item.on, .side summary.on { background: var(--wash); font-weight: 650; }
.side .item .n, .side .item .count { margin-left: auto; }
.side .item .n { color: var(--soft); font-size: .8rem; font-weight: 500; }
.side .item span:first-of-type, .side summary a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side summary { list-style: none; cursor: pointer; }
.side summary::-webkit-details-marker { display: none; }
.side summary a { color: var(--ink); flex: 1 1 auto; }
.side summary a:hover { text-decoration: underline; }
.side .ico { flex: none; color: var(--soft); }
.side .caret { flex: none; color: var(--soft); transition: transform .12s; }
.side details[open] > summary .caret { transform: rotate(90deg); }
.side .leaf { margin-left: 1.15rem; padding-left: .6rem; border-left: 1px solid var(--line); border-radius: 0 7px 7px 0; }
.scrim { display: none; }
@media (prefers-reduced-motion: reduce) { .side .caret { transition: none; } }
.me { position: relative; }
.me summary { cursor: pointer; list-style: none; padding: .35rem .6rem; border-radius: 7px; color: var(--soft); }
.me summary::-webkit-details-marker { display: none; }
.me .menu { position: absolute; right: 0; top: 2.3rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .4rem; min-width: 12rem; box-shadow: 0 8px 24px rgb(0 0 0 / .14); display: grid; }
.me .menu a, .me .menu .link { padding: .45rem .6rem; border-radius: 6px; color: var(--ink); text-align: left; }
.me .menu a:hover, .me .menu .link:hover { background: var(--wash); text-decoration: none; }

main { max-width: 68rem; margin: 0 auto; padding: 1.25rem max(1.25rem, env(safe-area-inset-left)) 4rem; width: 100%; }
main.wide { max-width: 100rem; }
.hint { color: var(--soft); font-size: .8rem; }
.btn.small { padding: .2rem .55rem; font-size: .85rem; }
.headline { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.crumbs { color: var(--soft); font-size: .9rem; margin: 0 0 .25rem; }
.flash { padding: .6rem .8rem; border-radius: 8px; background: var(--wash); margin: 0 0 1rem; }
.flash.error { background: color-mix(in srgb, var(--red) 14%, var(--card)); color: var(--red); }

/* controls */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; min-width: 0; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea { width: 100%; resize: vertical; }
.btn { display: inline-block; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .8rem; cursor: pointer; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--soft); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.quiet { border-color: transparent; background: none; color: var(--soft); }
.link { background: none; border: 0; cursor: pointer; width: 100%; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }

.quick, .addline { display: flex; gap: .5rem; margin: .5rem 0 1rem; flex-wrap: wrap; }
.quick input[name], .addline input[name="text"], .addline input[name="name"] { flex: 1 1 14rem; }
.inline { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; color: var(--soft); }

/* rows */
.rows, .checklist, .activity ul { list-style: none; margin: 0; padding: 0; }
.rows { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rows > li { padding: .6rem .8rem; border-top: 1px solid var(--line); }
.rows > li:first-child { border-top: 0; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.row .title { font-weight: 550; color: var(--ink); flex: 1 1 16rem; }
.row.is-closed .title { color: var(--soft); text-decoration: line-through; }
.row.nested { padding-left: 2.2rem; background: color-mix(in srgb, var(--wash) 45%, var(--card)); }
.row.nested.deep { padding-left: 3.6rem; }
.row.project .title { font-weight: 700; }
.closed { margin-top: 1.75rem; }
.closed > summary { cursor: pointer; color: var(--soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 650; margin-bottom: .5rem; }
.group h2 a { color: inherit; }
.row.unread .title { font-weight: 750; }
.row.unread { box-shadow: inset 3px 0 0 var(--accent); }
.meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; color: var(--soft); font-size: .875rem; }
.group.overdue h2 { color: var(--red); }
.tag { background: var(--wash); border-radius: 99px; padding: .05rem .55rem; font-size: .8rem; color: var(--ink); white-space: nowrap; }
.tag.urgent { background: var(--red); color: #fff; }
.tag.going, .tag.assigned { background: color-mix(in srgb, var(--accent) 18%, var(--card)); }
.tag.mentioned, .tag.reply { background: color-mix(in srgb, var(--amber) 22%, var(--card)); }
.tag.done { background: color-mix(in srgb, var(--green) 20%, var(--card)); }
.tag.cat-growth { background: color-mix(in srgb, var(--green) 18%, var(--card)); }
.tag.cat-efficiency { background: color-mix(in srgb, var(--accent) 16%, var(--card)); }
.tag.cat-admin { background: color-mix(in srgb, var(--amber) 18%, var(--card)); }
.due { white-space: nowrap; }
.dot { width: 1.25rem; height: 1.25rem; flex: none; border-radius: 50%; border: 2px solid var(--line); }
.dot.done { background: var(--green); border-color: var(--green); }
.dot.in_progress { border-color: var(--accent); }
.dot.waiting { border-color: var(--amber); border-style: dashed; }
.tick { margin: 0; flex: none; line-height: 0; }
.tick button { width: 1.35rem; height: 1.35rem; border-radius: 50%; border: 2px solid var(--soft); background: none; cursor: pointer; padding: 0; position: relative; }
.tick button:hover:not(:disabled) { border-color: var(--green); background: color-mix(in srgb, var(--green) 20%, transparent); }
.tick button:disabled { opacity: .4; cursor: default; }
.tick button.checked { background: var(--green); border-color: var(--green); }
.tick button.checked::after { content: ""; position: absolute; left: .38rem; top: .14rem; width: .3rem; height: .62rem; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.bar { display: inline-block; width: 4.5rem; height: .4rem; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar.wide { width: 9rem; }
.bar i { display: block; height: 100%; background: var(--green); }

/* record pages */
.page { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 2rem; align-items: start; }
.statusbar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.steps { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 0 .5rem; }
.chip { border-radius: 99px; padding: .2rem .75rem; font-weight: 600; font-size: .9rem; background: var(--wash); }
.chip.in_progress, .chip.active { background: color-mix(in srgb, var(--accent) 20%, var(--card)); }
.chip.waiting, .chip.on_hold, .chip.proposed { background: color-mix(in srgb, var(--amber) 24%, var(--card)); }
.chip.done { background: color-mix(in srgb, var(--green) 22%, var(--card)); }
.chip.cancelled, .chip.dropped { color: var(--soft); text-decoration: line-through; }
.waitbox form { display: flex; gap: .4rem; margin-top: .5rem; flex-wrap: wrap; }
.waitbox[open] { flex-basis: 100%; }
.description { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .2rem 1rem; overflow-wrap: anywhere; }
.checklist { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.checklist li { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.checklist li:first-child { border-top: 0; }
.checklist .text { flex: 1 1 12rem; }
.checklist li.done .text { color: var(--soft); text-decoration: line-through; }
.lineedit summary { cursor: pointer; color: var(--soft); font-size: .8rem; }
.lineedit[open] { flex-basis: 100%; }
.lineedit form { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.lineedit input[name="text"] { flex: 1 1 12rem; }
.addline { margin-top: .6rem; }

/* task page: details on the left, the comment thread on the right */
.taskpage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(20rem, 27rem); gap: 1.75rem; align-items: start; }
.titleedit > summary { list-style: none; cursor: default; display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.titleedit > summary::-webkit-details-marker { display: none; }
.titleedit > summary h1 { margin: 0 0 .5rem; }
.titleedit > summary .btn { cursor: pointer; }
.titleedit[open] > summary .btn { display: none; }
.titleedit .fields { margin: 0 0 1rem; }
.props { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1.5rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; margin-bottom: .75rem; }
.props label, .props .flags { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); align-items: center; gap: .5rem; font-size: .9rem; }
.props label > span:first-child, .props .flags > span:first-child { color: var(--soft); }
.props select, .props input[type="date"] { width: 100%; padding: .35rem .5rem; }
.props .checks { display: flex; gap: .3rem 1rem; flex-wrap: wrap; }
.props label.check { display: flex; grid-template-columns: none; gap: .35rem; color: var(--ink); }
.props .autosave-note { grid-column: 1 / -1; margin: 0; }
.props.saving { opacity: .6; pointer-events: none; }
.taskpage .facts { grid-template-columns: 7.5rem 1fr; background: none; border: 0; padding: 0 1rem; }
.inlineform { display: inline; margin-left: .4rem; }
.log { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.log li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .75rem; padding: .35rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.log li:first-child { border-top: 0; }
.closeout { margin-top: 2rem; }

.thread.panel { position: sticky; top: calc(var(--top-h) + 1.25rem); height: calc(100vh - var(--top-h) - 2.5rem); height: calc(100dvh - var(--top-h) - 2.5rem); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.thread.panel > h2 { margin: 0; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.thread.panel .scroll { flex: 1 1 auto; overflow-y: auto; padding: .9rem 1rem .4rem; background: var(--bg); }
.thread.panel .newcomment { margin: 0; padding: .75rem 1rem; border-top: 1px solid var(--line); }
.thread .send { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

.comment { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .6rem .9rem; margin-bottom: .6rem; }
.comment.reply { margin: .5rem 0 0 1.25rem; background: color-mix(in srgb, var(--wash) 45%, var(--card)); }
.comment .by { margin: 0; font-size: .9rem; }
.comment .body { overflow-wrap: anywhere; }
.comment .body p { margin: .3rem 0; }
.mention { color: var(--accent); }
.replybox summary { cursor: pointer; color: var(--soft); font-size: .85rem; }
.replybox form, .newcomment { display: grid; gap: .5rem; justify-items: start; margin-top: .4rem; }
.activity { margin-top: 1.5rem; }
.activity > summary { cursor: pointer; color: var(--soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.activity li { padding: .3rem 0; border-top: 1px solid var(--line); font-size: .9rem; overflow-wrap: anywhere; }
.activity .rows { margin-top: .5rem; }

aside { position: sticky; top: 4.5rem; display: grid; gap: .75rem; }
.facts { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; font-size: .9rem; }
.facts dt { color: var(--soft); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.fields { display: grid; gap: .7rem; margin-top: .75rem; }
.fields label { display: grid; gap: .2rem; font-size: .85rem; color: var(--soft); }
.fields label.check, .checks { display: flex; align-items: center; gap: .4rem 1rem; flex-wrap: wrap; color: var(--ink); font-size: .95rem; }
.fields.wide { max-width: 44rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; align-items: end; }
.callout { background: var(--card); border: 1px solid var(--accent); border-radius: 12px; padding: .25rem 1rem 1rem; margin: 1.25rem 0; }
.token { font-weight: 700; user-select: all; }
.signin { max-width: 26rem; margin: 8vh auto 0; }
.signin .logo { font-size: 3.4rem; margin: 0; }
.signin .tagline { color: var(--soft); margin: .6rem 0 1.75rem; }
.devlogin { display: flex; gap: .5rem; flex-wrap: wrap; }
.devlogin small { color: var(--soft); }

@media (max-width: 1150px) {
  .taskpage { grid-template-columns: 1fr; }
  .thread.panel { position: static; height: auto; max-height: none; }
  .thread.panel .scroll { overflow: visible; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .navtoggle { display: block; }
  .side { position: fixed; left: 0; top: var(--top-h); z-index: 5; width: min(var(--side-w), 86vw); transform: translateX(-102%); visibility: hidden; transition: transform .16s, visibility 0s .16s; }
  .nav-open .side { transform: none; visibility: visible; transition: transform .16s; box-shadow: 0 8px 24px rgb(0 0 0 / .18); }
  .nav-open .scrim { display: block; position: fixed; inset: var(--top-h) 0 0 0; background: rgb(0 0 0 / .35); z-index: 4; }
  .page { grid-template-columns: 1fr; gap: 1rem; }
  aside { position: static; }
  .pair { grid-template-columns: 1fr; }
  .steps { margin-left: 0; }
  .props { grid-template-columns: 1fr; }
  .log li { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* settings, favorites, repeat, files, mentions (added 12/1) */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.settings { margin-bottom: 2rem; }
.choices { border: 0; padding: 0; margin: 0; display: flex; gap: .4rem 1.1rem; flex-wrap: wrap; }
.choices legend { padding: 0; margin-bottom: .3rem; font-size: .85rem; color: var(--soft); }
.manage > li { display: block; }
.manage .inline { margin: 0; flex-wrap: wrap; color: var(--ink); }
.manage .inline input[name="name"] { flex: 0 1 18rem; padding: .3rem .5rem; }
.manage input.strong { font-weight: 650; }
.manage .sub { list-style: none; margin: .5rem 0 0 1.25rem; padding: 0 0 0 .75rem; border-left: 1px solid var(--line); display: grid; gap: .35rem; }
.treehead { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.treetools { display: flex; gap: .1rem; }
.treetools button, .treetools a { background: none; border: 0; padding: .2rem; border-radius: 5px; color: var(--soft); cursor: pointer; line-height: 0; }
.treetools button:hover, .treetools a:hover { background: var(--wash); color: var(--ink); }
.star { margin: 0; line-height: 0; }
.star button { background: none; border: 0; padding: .15rem; cursor: pointer; color: var(--soft); border-radius: 6px; }
.star button svg { fill: none; }
.star button.on { color: var(--amber); }
.star button.on svg { fill: currentColor; }
.star button:hover { color: var(--amber); }
.extras { display: grid; gap: .5rem; margin-bottom: .75rem; }
.extra { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .55rem 1rem; font-size: .9rem; }
.extra > summary { cursor: pointer; display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .5rem; }
.extra > summary span { color: var(--soft); }
.extra > summary b { font-weight: 500; }
.extra .fields { margin: .75rem 0 .25rem; max-width: 34rem; }
.repeatform .line { display: flex; align-items: center; gap: .5rem; }
.repeatform .line input { width: 5rem; }
.picklist { display: grid; gap: .3rem; max-height: 14rem; overflow-y: auto; padding: .25rem 0; }
.attached { list-style: none; margin: .35rem 0 0; padding: 0; display: grid; gap: .15rem; font-size: .9rem; }
.attached li { overflow-wrap: anywhere; }
.attachbox { width: 100%; }
.attachbox[open] { display: grid; gap: .5rem; }
.attachbox label { display: grid; gap: .2rem; font-size: .85rem; color: var(--soft); }
.attachbox input { width: 100%; }
.newcomment { position: relative; }
.replybox form { position: relative; }
.mentionmenu { list-style: none; margin: -.3rem 0 0; padding: .3rem; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgb(0 0 0 / .14); z-index: 3; }
.mentionmenu li { display: flex; justify-content: space-between; gap: .75rem; padding: .35rem .55rem; border-radius: 6px; cursor: pointer; }
.mentionmenu li.on, .mentionmenu li:hover { background: var(--wash); }
.mentionmenu li b { font-weight: 600; }
.mentionmenu li span { color: var(--soft); font-size: .85rem; white-space: nowrap; }

/* Rules and Guidelines; people and groups */
.guiderow .why { flex-basis: 100%; color: var(--soft); font-size: .9rem; }
.prose { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .5rem 1.5rem 1.25rem; max-width: 50rem; overflow-wrap: anywhere; line-height: 1.6; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { text-transform: none; letter-spacing: 0; color: var(--ink); margin: 1.5rem 0 .4rem; }
.prose h2 { font-size: 1.3rem; } .prose h3 { font-size: 1.1rem; } .prose h4, .prose h5, .prose h6 { font-size: 1rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: .2rem 0; }
.prose table { border-collapse: collapse; margin: .75rem 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: .35rem .6rem; text-align: left; vertical-align: top; }
.prose th { background: var(--wash); }
.prose blockquote { margin: .75rem 0; padding: .1rem 1rem; border-left: 3px solid var(--accent); background: var(--wash); border-radius: 0 8px 8px 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
.callout.ack { padding-top: .5rem; }
.passage .body { color: var(--ink); }
textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
.person > summary { cursor: pointer; }
.person .fields { margin: .75rem 0 .5rem; max-width: 46rem; }
.accessgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .5rem .75rem; }
.accessgrid label { display: grid; gap: .2rem; font-size: .85rem; color: var(--soft); }

/* purchase orders and transfers */
.steps-track { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; padding: 0; margin: 0 0 .9rem; font-size: .8rem; }
.steps-track li { padding: .2rem .65rem; border-radius: 99px; background: var(--wash); color: var(--soft); white-space: nowrap; }
.steps-track li.now { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .55rem .75rem; margin: .5rem 0 .75rem; }
.formgrid label { display: grid; gap: .2rem; font-size: .85rem; color: var(--soft); }
.formgrid input, .formgrid select { width: 100%; padding: .35rem .5rem; }
.shipform { display: grid; gap: .5rem; justify-items: start; }
.shipform .formgrid { width: 100%; }
.shipform.card { margin-bottom: .5rem; }
.row.ship .lineedit[open] { flex-basis: 100%; }
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.grid { border-collapse: collapse; width: 100%; font-size: .9rem; }
.grid th, .grid td { padding: .45rem .8rem; text-align: left; border-top: 1px solid var(--line); vertical-align: top; }
.grid thead th { border-top: 0; color: var(--soft); font-weight: 600; font-size: .8rem; white-space: nowrap; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid td.ok { color: var(--green); font-weight: 600; }
.grid td.part { color: var(--amber); font-weight: 600; }
.missing { margin: 0 0 .5rem; color: var(--soft); font-size: .9rem; }
.docform input[type="file"] { flex: 1 1 12rem; }
.docform input[type="url"] { flex: 1 1 12rem; }
.closeout > summary { list-style: none; }
.closeout > summary::-webkit-details-marker { display: none; }
.quotes { margin: .25rem 0 .75rem; padding-left: 1.1rem; display: grid; gap: .3rem; font-size: .9rem; }

/* My work dashboard */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: .25rem 0 1rem; }
.tile { display: grid; gap: .1rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .7rem 1rem; color: var(--ink); }
.tile:hover { border-color: var(--soft); text-decoration: none; }
.tile span { color: var(--soft); font-size: .85rem; }
.tile b { font-size: 1.9rem; line-height: 1.15; font-weight: 650; font-variant-numeric: tabular-nums; }
.tile.bad b { color: var(--red); }
.dash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; min-width: 0; overflow: hidden; scroll-margin-top: calc(var(--top-h) + 1rem); }
.panel > h2 { margin: 0; padding: .7rem .9rem; display: flex; align-items: center; gap: .4rem; border-bottom: 1px solid var(--line); }
.panel > h2 .more { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .85rem; }
.panel .rows { border: 0; border-radius: 0; max-height: 23rem; overflow-y: auto; }
.panel .row .title { flex-basis: 12rem; }
@media (max-width: 1100px) { .dash { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* dialogs: New task, New project */
.modal { border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); padding: 1.1rem 1.25rem 1.1rem; width: min(46rem, calc(100vw - 2rem)); max-height: calc(100dvh - 3rem); overflow-y: auto; box-shadow: 0 18px 60px rgb(0 0 0 / .3); }
.modal.small { width: min(34rem, calc(100vw - 2rem)); }
.modal::backdrop { background: rgb(0 0 0 / .45); }
.modal .fields { margin-top: 0; max-width: none; }
.modal .fields > p:last-child { margin-bottom: 0; }
.modalhead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.modalhead h2 { margin: 0; font-size: 1.25rem; text-transform: none; letter-spacing: 0; color: var(--ink); }

/* sidebar foot (Rulesets), inbox buttons, lists inside a project */
.side { display: flex; flex-direction: column; }
.side > * { flex: none; }
.side .foot { margin-top: auto; padding-top: .75rem; }
.side .foot .item { border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; padding-top: .6rem; }
.inbox .meta { flex: 1 1 100%; }
.inbox .inlineform { margin-left: auto; }
.sublist h3 { display: flex; align-items: center; gap: .4rem; font-size: .95rem; margin: 1rem 0 .4rem; }
.sublist h3 .n { color: var(--soft); font-weight: 500; }
.sublist .quick { margin: .4rem 0 0; }

/* Sections lift off the page a little in the light theme (--lift is none in dark). */
.rows, .description, .checklist, .props, .thread.panel, .facts, .callout, .card, .extra, .prose,
.tablewrap, .tile, .panel { box-shadow: var(--lift); }
/* The small facts block on a task page stays unboxed. Where it opens the page and is followed by
   the editable rows (purchase orders, transfers), it is a section of its own. */
.taskpage .facts { box-shadow: none; }
.taskpage .facts:has(+ .extras) { background: var(--card); border: 1px solid var(--line); padding: .8rem 1rem; box-shadow: var(--lift); margin-bottom: .75rem; }

/* The file viewer: photos and PDFs open over the page. It is dark in both themes so a picture reads true. */
.lightbox { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0e1116; color: #e7eaf0; overflow: hidden; }
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox::backdrop { background: rgb(0 0 0 / .6); }
.lb-bar { flex: none; display: flex; align-items: center; gap: .5rem .75rem; flex-wrap: wrap; padding: .5rem .75rem; background: #1b2029; border-bottom: 1px solid #2d3442; }
.lb-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-count { color: #98a2b3; font-size: .875rem; white-space: nowrap; }
.lb-tools { margin-left: auto; display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.lb-tools button, .lb-tools a { font: inherit; font-size: .875rem; line-height: 1; min-width: 2.2rem; height: 2.2rem; padding: 0 .65rem; display: inline-flex; align-items: center; justify-content: center; background: #262d3a; color: #e7eaf0; border: 1px solid #3a4354; border-radius: 8px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.lb-tools button:hover, .lb-tools a:hover { background: #323b4b; }
.lb-tools button:focus-visible, .lb-tools a:focus-visible { outline: 2px solid #8fb0ff; outline-offset: 1px; }
.lb-tools button[hidden] { display: none; }
.lb-tools [data-lb="prev"], .lb-tools [data-lb="next"], .lb-tools [data-lb="in"], .lb-tools [data-lb="out"], .lb-tools [data-lb="close"] { font-size: 1.2rem; padding: 0; }
.lb-pct { min-width: 3.4rem; text-align: center; font-size: .875rem; font-variant-numeric: tabular-nums; color: #c7cedb; }
.lb-gap { width: .4rem; }
.lb-stage { flex: 1 1 auto; min-height: 0; overflow: auto; }
.lb-stage.image { cursor: grab; }
.lb-stage.dragging { cursor: grabbing; }
.lb-canvas { box-sizing: border-box; display: flex; width: max-content; height: max-content; min-width: 100%; min-height: 100%; padding: 12px; }
.lb-canvas img { display: block; margin: auto; max-width: none; height: auto; user-select: none; -webkit-user-drag: none; }
.lb-pdf { display: block; width: 100%; height: 100%; border: 0; background: #525659; }
.lightbox.pdf [data-lb="in"], .lightbox.pdf [data-lb="out"], .lightbox.pdf [data-lb="fit"], .lightbox.pdf [data-lb="actual"], .lightbox.pdf .lb-pct { display: none; }
