/* Light and dark are picked per account in Customize; <html data-theme> holds the choice. */
:root {
  --bg: #f3f5f3; --surface: #fff; --surface-2: #eef1ee; --line: #dde3de; --text: #1b201c; --muted: #5f6762;
  --brand: #2f6b4f; --brand-ink: #fff; --brand-soft: #e2f0e7;
  --red: #b4322a; --red-soft: #fbe7e4; --amber: #9a6200; --amber-soft: #fbf0d9;
  --blue: #2659a8; --blue-soft: #e5edf9; --grey-soft: #eceeec; --star: #d99a06;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.05);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #141615; --surface: #1d201e; --surface-2: #252926; --line: #333834; --text: #e8eae7; --muted: #9aa19b;
  --brand: #5cb38a; --brand-ink: #0d1a13; --brand-soft: #1f3329;
  --red: #f07b70; --red-soft: #3a1f1c; --amber: #e5b04f; --amber-soft: #3a2f17;
  --blue: #7ea8ec; --blue-soft: #1d2a40; --grey-soft: #2a2e2b; --star: #e3a008; --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); min-height: 1.2em; margin: 4px 0; }

/* buttons & fields */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: 8px; cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn.danger { color: var(--red); }
.btn.wide { width: 100%; justify-content: center; padding: 10px; }
.btn:disabled { opacity: .55; cursor: default; }
input:not([type=checkbox]), select, textarea { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
textarea { width: 100%; resize: vertical; }
label { display: grid; gap: 4px; font-weight: 500; }

/* auth */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 20px; margin: 18px 0 4px; }
.auth-card form { display: grid; gap: 14px; margin-top: 16px; }
.auth-card:has(.join-info:not([hidden])) { max-width: 440px; }
.join-info { margin: 10px 0 0; padding: 10px 12px 10px 28px; background: var(--brand-soft); border-radius: 10px; display: grid; gap: 6px; font-size: 13.5px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }

/* layout */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.tab { border: 0; background: none; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab[aria-selected=true] { background: var(--brand-soft); color: var(--brand); }
.account { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; min-width: 210px; display: grid; }
.menu .who { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.menu button:hover { background: var(--surface-2); }
main.page { max-width: 1280px; margin: 0 auto; padding: 18px 16px 60px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; font-size: 22px; }
.page-head p { margin: 2px 0 0; }

/* toolbar */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input[type=search] { flex: 1 1 260px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 11px; cursor: pointer; font-size: 13px; }
.chip[aria-pressed=true] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .n { opacity: .65; margin-left: 4px; }

/* item rows */
.items { display: grid; gap: 8px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.item { border-left: 4px solid var(--c, var(--line)); }
.item-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 12px; }
.thumb { width: 56px; height: 56px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: 12px; text-align: center; border: 0; padding: 0; cursor: pointer; }
.thumb { position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb em { position: absolute; right: 3px; bottom: 3px; background: rgba(0,0,0,.65); color: #fff; font-style: normal; font-size: 11px; border-radius: 5px; padding: 0 5px; }
.desc { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); text-decoration: none; }
.desc:hover { text-decoration: underline; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; color: var(--muted); font-size: 13px; }
.meta .late { color: var(--red); font-weight: 600; }
.meta b { font-weight: 600; color: var(--text); }
.meta .ok { color: var(--brand); }
.meta .src { border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.meta .was { color: #c2410c; font-size: 12px; }
.stars { color: var(--star); letter-spacing: 1px; }
.stars .off { color: var(--line); }
.actions { display: flex; gap: 8px; align-items: center; }
.status { background: var(--cb); color: var(--c); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 600; border: 1px solid transparent; cursor: pointer; }
.detail { border-top: 1px solid var(--line); padding: 14px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
.detail h3 { margin: 0 0 10px; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.form-grid .span2 { grid-column: span 2; }
.form-grid .span4 { grid-column: 1 / -1; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.saved { color: var(--brand); font-size: 13px; }
.count { font-size: 12px; color: var(--muted); font-weight: 400; }

/* photos */
.drop { border: 1.5px dashed var(--line); border-radius: 10px; padding: 16px; text-align: center; color: var(--muted); cursor: pointer; display: block; font-weight: 400; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.drop input { display: none; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 10px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.photo .x { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; width: 24px; height: 24px; cursor: pointer; line-height: 1; }
.uploading { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* stats */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.kpi .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 13px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.panel h2 { font-size: 15px; margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
th:nth-child(-n+2), td:nth-child(-n+2) { text-align: left; }
td.note { text-align: left; white-space: pre-line; min-width: 180px; max-width: 280px; font-size: 13px; }
td.note[contenteditable=true]:focus { outline: 2px solid var(--brand); background: var(--surface-2); }
tr.total td { font-weight: 700; }
.zero { color: var(--line); }
.pct-bar { display: inline-block; width: 60px; height: 6px; border-radius: 3px; background: var(--surface-2); vertical-align: middle; margin-left: 6px; overflow: hidden; }
.pct-bar i { display: block; height: 100%; background: var(--brand); }

/* requests */
.req-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.req-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.req-card h3 { margin: 0 0 8px; font-size: 15px; }
.req-card ul { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 4px; }
.req-card li { display: flex; gap: 8px; align-items: center; }
.req-card li.done span { text-decoration: line-through; color: var(--muted); }
.req-card li span { flex: 1; }
.req-card li .x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px 6px; }
.req-card form { display: flex; gap: 6px; }
.req-card form input { flex: 1; }

/* members */
.member { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.member:last-child { border-bottom: 0; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--grey-soft); color: var(--muted); margin-left: 6px; }
.badge.owner { background: var(--brand-soft); color: var(--brand); }
.invite-box { display: flex; gap: 8px; margin-top: 8px; }
.invite-box input { flex: 1; font-family: ui-monospace, monospace; font-size: 12px; }
.inline-form { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto auto; gap: 10px; align-items: end; padding: 14px; }

/* dialog, toast, lightbox */
dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); padding: 22px; width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h2 { margin: 0 0 14px; font-size: 18px; }
dialog form { display: grid; gap: 12px; }
.lightbox { width: auto; max-width: 92vw; padding: 8px; background: #000; border: 0; }
.lightbox img { max-width: 90vw; max-height: 85vh; display: block; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 50; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.bad { background: var(--red); color: #fff; }
.empty { text-align: center; padding: 40px; color: var(--muted); }
.more { display: flex; justify-content: center; margin-top: 12px; }

@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .inline-form { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .item-row { grid-template-columns: 48px minmax(0, 1fr); gap: 10px; }
  .thumb { width: 48px; height: 48px; }
  .actions { grid-column: 1 / -1; flex-wrap: wrap; }
  .actions .btn.primary { flex: 1; justify-content: center; }
  .topbar-inner { gap: 10px; }
  .brand span { display: none; }
}

/* ---------- colour index ---------- */
/* Statuses, in the order of the status list. --c = text/accent, --cb = soft background. */
.st-0 { --c: #5b6470; --cb: #eceef1; }  /* Not started */
.st-1 { --c: #1d5fc4; --cb: #e3edfc; }  /* In progress */
.st-2 { --c: #c62828; --cb: #fde7e7; }  /* Urgent */
.st-3 { --c: #0f7d76; --cb: #dcf3f1; }  /* Ready to Post */
.st-4 { --c: #2e7d32; --cb: #e3f3e4; }  /* Post Completed */
.st-5 { --c: #6d5d4b; --cb: #efe9e2; }  /* Item Removed from Vine */
.st-6 { --c: #c2410c; --cb: #fdeadd; }  /* Old but should be done */
.st-7 { --c: #7b3fc4; --cb: #f0e7fb; }  /* Message Vine */
/* People: 25 colours to choose from in Customize (Blue, Pink, Green, Orange, Violet, Teal, Gold, Wine, Lime, Indigo, Red, Jade, Purple, Rust, Cyan, Brown, Magenta, Royal, Forest, Slate, Plum, Ocean, Olive, Coral, Lavender).
   Each has a light-theme and a dark-theme shade, both readable on that theme's background. */
.pc-0 { --p: #1f63c6; } .pc-1 { --p: #c2255c; } .pc-2 { --p: #237a36; } .pc-3 { --p: #b84a08; }
.pc-4 { --p: #6741d9; } .pc-5 { --p: #0b7285; } .pc-6 { --p: #876400; } .pc-7 { --p: #a61e4d; }
.pc-8 { --p: #4a7309; } .pc-9 { --p: #3b4fc4; } .pc-10 { --p: #c92a2a; } .pc-11 { --p: #087f5b; }
.pc-12 { --p: #9c36b5; } .pc-13 { --p: #a8431a; } .pc-14 { --p: #0d7590; } .pc-15 { --p: #7a5c3a; }
.pc-16 { --p: #b0246f; } .pc-17 { --p: #2f4fd6; } .pc-18 { --p: #2f7d32; } .pc-19 { --p: #56606b; }
.pc-20 { --p: #7e3a8c; } .pc-21 { --p: #1c6a87; } .pc-22 { --p: #646410; } .pc-23 { --p: #b83f2a; }
.pc-24 { --p: #6553c9; }
[data-theme="dark"] .st-0 { --c: #aab3bf; --cb: #2a2f36; } [data-theme="dark"] .st-1 { --c: #8db6f5; --cb: #1c2b44; } [data-theme="dark"] .st-2 { --c: #ff8a80; --cb: #451d1d; }
[data-theme="dark"] .st-3 { --c: #5fd3c9; --cb: #133836; } [data-theme="dark"] .st-4 { --c: #7fd486; --cb: #1a3a1d; } [data-theme="dark"] .st-5 { --c: #c9b8a3; --cb: #352e27; }
[data-theme="dark"] .st-6 { --c: #ffa66b; --cb: #44291a; } [data-theme="dark"] .st-7 { --c: #c39af5; --cb: #2f2142; }
[data-theme="dark"] .pc-0 { --p: #7cb0f7; } [data-theme="dark"] .pc-1 { --p: #f783ac; } [data-theme="dark"] .pc-2 { --p: #69db7c; } [data-theme="dark"] .pc-3 { --p: #ffa94d; }
[data-theme="dark"] .pc-4 { --p: #a48bfa; } [data-theme="dark"] .pc-5 { --p: #4fd1e0; } [data-theme="dark"] .pc-6 { --p: #f2c94c; } [data-theme="dark"] .pc-7 { --p: #ef8fae; }
[data-theme="dark"] .pc-8 { --p: #a9e34b; } [data-theme="dark"] .pc-9 { --p: #93a5ff; } [data-theme="dark"] .pc-10 { --p: #ff8787; } [data-theme="dark"] .pc-11 { --p: #38d9a9; }
[data-theme="dark"] .pc-12 { --p: #da77f2; } [data-theme="dark"] .pc-13 { --p: #ff9a6b; } [data-theme="dark"] .pc-14 { --p: #66d9e8; } [data-theme="dark"] .pc-15 { --p: #d2b48c; }
[data-theme="dark"] .pc-16 { --p: #f48fd0; } [data-theme="dark"] .pc-17 { --p: #7f9bff; } [data-theme="dark"] .pc-18 { --p: #8ce99a; } [data-theme="dark"] .pc-19 { --p: #b7c0ca; }
[data-theme="dark"] .pc-20 { --p: #d29be0; } [data-theme="dark"] .pc-21 { --p: #74c0e3; } [data-theme="dark"] .pc-22 { --p: #d4d46a; } [data-theme="dark"] .pc-23 { --p: #ff9e85; }
[data-theme="dark"] .pc-24 { --p: #b8acff; }
.person { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--p); }
.person i, .person-key i { width: 9px; height: 9px; border-radius: 50%; background: var(--p); display: inline-block; flex: none; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 5px; vertical-align: 1px; }
.count-pill { font-size: 13px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; vertical-align: 3px; color: var(--muted); }
.legend { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; margin-bottom: 10px; box-shadow: var(--shadow); }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.legend-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); width: 58px; }
.key { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.key b { font-weight: 700; opacity: .7; font-variant-numeric: tabular-nums; }
.status-key { background: var(--cb); color: var(--c); }
.person-key { background: var(--surface-2); color: var(--text); }
.key[aria-pressed=true] { border-color: currentColor; box-shadow: 0 0 0 1px currentColor inset; }
.person-key[aria-pressed=true] { color: var(--p); }
.key:hover { filter: brightness(.96); }
.showing { margin: 0 0 8px; font-size: 13px; }
@media (max-width: 620px) { .legend-label { width: 100%; } }

/* ---------- layout switcher ---------- */
.views { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px; width: fit-content; max-width: 100%; }
.view-btn { border: 0; background: none; padding: 6px 11px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.view-btn:hover { background: var(--surface-2); color: var(--text); }
.view-btn[aria-pressed=true] { background: var(--brand); color: var(--brand-ink); }
.items.view-table { display: block; }

.late { color: var(--red) !important; font-weight: 600; }
.mini-status { background: var(--cb); color: var(--c); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }

/* spreadsheet */
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-height: 75vh; overflow: auto; }
.sheet table { font-size: 13px; }
.sheet thead th { position: sticky; top: 0; z-index: 1; cursor: pointer; user-select: none; text-align: left; }
.sheet th.sorted { color: var(--text); }
.sheet td { text-align: left; padding: 6px 10px; }
.sheet td.num { color: var(--muted); text-align: right; }
.sheet td.item-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.sheet tbody tr { cursor: pointer; box-shadow: inset 4px 0 0 var(--c); }
.sheet tbody tr:hover { background: var(--surface-2); }

.work-group h2 { font-size: 15px; margin: 0 0 8px; }
.progress { height: 6px; background: var(--line); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--p); }
/* item dialog */
.item-dialog { width: min(1100px, calc(100vw - 24px)); padding: 12px; max-height: 92vh; }
.item-dialog .dialog-top { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.item-dialog .item { box-shadow: none; }

/* My work */
.kpi.st-2 .v, .kpi.st-6 .v, .kpi.st-4 .v { color: var(--c); }
.work-group { margin-bottom: 20px; }
.work-group .sub { font-size: 13px; font-weight: 400; margin-left: 6px; }
.work-list { display: grid; gap: 6px; }
.work-row { display: grid; grid-template-columns: 52px 44px minmax(0, 1fr) 52px auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--radius); padding: 8px 12px; box-shadow: var(--shadow); transition: opacity .35s, transform .35s; }
.thumb.small { width: 44px; height: 44px; font-size: 13px; font-weight: 700; cursor: default; }
.link-btn { border: 0; background: none; padding: 0; text-align: left; font-weight: 600; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-btn:hover { text-decoration: underline; }
.steps { display: inline-flex; gap: 8px; }
.step { color: var(--muted); }
.step.ok { color: var(--brand); font-weight: 600; }
.all-clear { text-align: center; padding: 50px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.all-clear div { font-size: 40px; }
.all-clear h2 { margin: 6px 0; }

/* Review library */
.library { columns: 3 340px; column-gap: 14px; }
.lib-card { break-inside: avoid; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--p); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.lib-body { padding: 12px 14px; }
.lib-item { font-size: 13px; color: var(--muted); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-item:hover { color: var(--blue); }
.lib-body h3 { margin: 10px 0 4px; font-size: 16px; }
.lib-review { white-space: pre-line; margin: 4px 0 10px; font-size: 14px; line-height: 1.55; }

@media (max-width: 620px) {
  .work-row { grid-template-columns: 52px 40px minmax(0, 1fr); }
  .work-row .actions { grid-column: 2 / -1; } /* the due date sits under the order date */
}

/* Amazon listing pictures are product shots on white: show the whole product. */
img[src^="/listing/"] { object-fit: contain !important; background: #fff; }
.thumb .initials { font-weight: 700; font-size: 14px; color: var(--muted); }

/* Long lists: rows off screen aren't drawn until they scroll into view, so scrolling
   through hundreds of items no longer leaves blank space while the page catches up. */
.item, .work-row { content-visibility: auto; contain-intrinsic-size: auto 84px; }

/* Scrolling inside a popup or a scroll box doesn't move the page behind it. */
dialog, .sheet { overscroll-behavior: contain; }
html:has(dialog[open]) { overflow: hidden; }

/* Review Library: one block per six-month review period */
.lib-period { margin-bottom: 26px; }
.lib-period h2 { font-size: 17px; margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }

/* checkbox with its label on one line (Members) */
label.check { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; margin-top: 4px; }
label.check input { width: auto; margin: 0; }
.inline-form label.check { padding-bottom: 9px; }

/* Customize window */
.custom-dialog { width: min(560px, calc(100vw - 32px)); }
.setting { margin-bottom: 18px; }
.setting h3 { margin: 0 0 8px; font-size: 14px; }
.setting .muted { margin: 0 0 10px; font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--surface-2); gap: 3px; }
.seg button { border: 0; background: none; padding: 7px 16px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--brand); color: var(--brand-ink); }
.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.swatch { display: grid; justify-items: center; gap: 3px; padding: 8px 4px 6px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; color: var(--p); font-weight: 600; font-size: 12px; }
.swatch i { width: 22px; height: 22px; border-radius: 50%; background: var(--p); }
.swatch small { color: var(--muted); font-weight: 500; font-size: 10.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch:hover:not(:disabled) { border-color: var(--p); }
.swatch[aria-checked="true"] { border: 2px solid var(--p); background: var(--surface-2); }
.swatch:disabled { cursor: not-allowed; opacity: .4; }
.row-btns.end { justify-content: flex-end; }
@media (max-width: 480px) { .swatches { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* My work: big order and due dates (OCT / 03 / 2026) */
.date-block { display: grid; justify-items: center; line-height: 1.05; padding: 4px 0; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); min-width: 52px; }
.date-block small { font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.date-block .mon { font-size: 12px; font-weight: 700; letter-spacing: .05em; color: var(--brand); }
.date-block b { font-size: 21px; font-weight: 800; }
.date-block .yr { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.date-block.late { border-color: var(--red); background: var(--red-soft); }
.date-block.late .mon, .date-block.late b { color: var(--red); }
.checks { display: grid; gap: 2px; }
input[readonly] { color: var(--muted); background: var(--surface-2); cursor: not-allowed; }

/* Review periods window (managers) */
.periods-dialog { width: min(620px, calc(100vw - 32px)); }
.periods-dialog > .muted { font-size: 13px; margin: -6px 0 12px; }
.period-row { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: end; padding: 8px 0; border-bottom: 1px solid var(--line); }
.period-row.current { background: var(--brand-soft); border-radius: 8px; padding: 8px; }
.period-row .tag { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--brand); }
.period-row.add { border-bottom: 0; margin-top: 6px; }
@media (max-width: 520px) { .period-row { grid-template-columns: 1fr 1fr; } }
.lib-review.expandable { cursor: pointer; }
.lib-review.expandable:not(.open)::after { content: ' Read more'; color: var(--brand); font-weight: 600; font-size: 13px; }
.lib-review.expandable:hover { color: var(--text); }

/* "Are you sure?" box */
.confirm-dialog { width: min(420px, calc(100vw - 32px)); }
.confirm-dialog p { margin: 0 0 6px; font-size: 15px; }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
[data-theme="dark"] .btn.danger-solid { color: #1a0d0b; }

/* Tab badge: reviews waiting to be posted */
.tab-count:not(:empty) { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 3px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: 11.5px; line-height: 17px; text-align: center; }

/* Review box: grammar underlines drawn in a copy of the text behind the transparent box */
.spell-wrap { position: relative; display: block; background: var(--surface); border-radius: 8px; }
.spell-wrap textarea { position: relative; z-index: 1; background: transparent; display: block; }
.spell-marks { position: absolute; z-index: 0; color: transparent; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; overflow: hidden; pointer-events: none; box-sizing: border-box; border: 0; }
.gx { background: none; color: transparent; text-decoration: underline wavy var(--blue); text-decoration-skip-ink: none; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.gx.k-spelling { text-decoration-color: var(--red); }
.grammar:empty { display: none; }
.grammar { font-size: 13px; background: var(--blue-soft); border-radius: 8px; padding: 8px 10px; }
.grammar ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.gx-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gx-head .muted { font-size: 12px; }
.gx-was { text-decoration: underline wavy var(--blue); text-underline-offset: 3px; }
.gx-was.k-spelling { text-decoration-color: var(--red); }
.gx-ok { margin: 0; color: var(--brand); }

/* Review window right side: photos, then the help guide */
.side { display: grid; gap: 16px; align-content: start; min-width: 0; }
.guide { background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; font-size: 13.5px; }
.guide summary { font-weight: 700; cursor: pointer; }
.guide h4 { margin: 12px 0 4px; font-size: 13px; }
.guide .small, .stat-filters .small { font-size: 12px; }
.guide-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.guide-rating { margin: 8px 0 0; }
.guide .chips { margin: 4px 0; align-items: center; }
.guide .chip { cursor: default; font-size: 12.5px; padding: 2px 9px; }
.guide .chip small { opacity: .7; margin-left: 3px; }
.chip.good { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.chip.mixed { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.chip.bad { background: var(--red-soft); color: var(--red); border-color: transparent; }
.chips-label { font-size: 12px; font-weight: 700; color: var(--muted); width: 56px; }
.specs { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 10px; margin: 0; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; overflow-wrap: anywhere; }

/* To post */
.post-list { display: grid; gap: 12px; }
.post-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--p); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.post-card .thumb { width: 72px; height: 72px; cursor: default; }
.post-card h3 { margin: 8px 0 2px; font-size: 15px; }
.post-card .desc { font-weight: 600; }
.post-photos { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.post-photos img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; display: block; }

/* Statistics */
.stat-filters select { padding: 3px 8px; font-size: 13px; }
.stat-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat-card { display: grid; gap: 6px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--p); border-radius: var(--radius); padding: 12px; cursor: pointer; box-shadow: var(--shadow); }
.stat-card:hover { border-color: var(--p); }
.stat-top { display: flex; justify-content: space-between; align-items: center; }
.stat-pct { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-line { font-size: 13px; }
.kpi .progress i { background: var(--brand); }
.stat-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 0 18px; }
.star-bars { padding: 12px 14px; display: grid; gap: 6px; }
.star-bar { display: grid; grid-template-columns: 80px minmax(0, 1fr) 36px; gap: 8px; align-items: center; }
.star-bar .bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.star-bar .bar i { display: block; height: 100%; background: var(--star); }
.star-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.status-table summary { padding: 12px 14px; font-weight: 700; cursor: pointer; }
@media (max-width: 860px) { .stat-two { grid-template-columns: 1fr; } }
.invite-compose { display: grid; gap: 10px; margin-top: 10px; }
.invite-compose textarea { font-size: 13.5px; line-height: 1.5; }
.grammar li .link-btn { display: inline; width: auto; padding: 0 4px; font-weight: 600; }
