:root {
  --bg: #f5f6f8; --panel: #fff; --panel2: #fafbfc; --text: #1b2130; --muted: #667085; --line: #e3e6eb; --hover: #f0f2f5;
  --accent: #3657d6; --accent-ink: #fff; --accent-soft: #e8edfc;
  --crit: #d92d20; --high: #e8590c; --med: #c99400; --low: #7a8699;
  --red: #e5484d; --amber: #f2a01d; --green: #2f9e66; --block: #6e56cf;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.08);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --panel: #1a1e26; --panel2: #161a21; --text: #e6e9ef; --muted: #9099a8; --line: #2a303b; --hover: #222833;
    --accent: #6f8cff; --accent-ink: #0d1020; --accent-soft: #1f2846;
    --crit: #ff6b5e; --high: #ff8f4d; --med: #e6b93a; --low: #8a94a6;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 15px; margin: 0; }
h3 { font-size: 13px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
a { color: var(--accent); }

/* ---------- controls */
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--crit); }
.btn.sm { padding: 3px 8px; font-size: 12px; }
.btn.icon { padding: 3px 8px; min-width: 30px; }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], select, textarea {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 9px; min-width: 0; width: 100%;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
label.fld { display: flex; flex-direction: column; gap: 4px; }
label.fld > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ---------- shell */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.brand i { display: grid; grid-template-columns: 8px 8px; gap: 2px; }
.brand i b { width: 8px; height: 8px; border-radius: 2px; }
nav.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
nav.tabs a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-weight: 500; }
nav.tabs a:hover { background: var(--hover); color: var(--text); }
nav.tabs a.on { background: var(--accent-soft); color: var(--accent); }
.spacer { flex: 1; }
.timerpill { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 4px 3px 10px; background: var(--panel2); max-width: 340px; }
.timerpill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--crit); animation: pulse 1.4s infinite; flex: none; }
.timerpill .tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.timerpill .el { font-variant-numeric: tabular-nums; font-weight: 600; }
@keyframes pulse { 50% { opacity: .3; } }
.me { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 180px; padding: 6px; display: none; }
.menu.open { display: block; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.menu button:hover { background: var(--hover); }
main { padding: 18px clamp(12px, 2vw, 32px) 60px; max-width: 2000px; margin: 0 auto; }
.vhead { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 16px; }
.filters label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); font-weight: 500; }
.filters select, .filters input { width: auto; min-width: 120px; max-width: 200px; padding: 4px 8px; }
.filters input[type=search] { min-width: 170px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; }

/* ---------- stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.stat b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12px; }
.stat.warn b { color: var(--crit); }

/* ---------- cards & rows */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card > header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel2); flex-wrap: wrap; }
.card > header .counts { display: flex; gap: 10px; font-size: 12px; color: var(--muted); margin-left: auto; }
.card > header .counts .bad { color: var(--crit); font-weight: 600; }
.card .empty { padding: 14px; color: var(--muted); }
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.trow { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--hover); }
.trow.done .ttitle { text-decoration: line-through; color: var(--muted); }
.trow.first { background: color-mix(in srgb, var(--crit) 7%, transparent); }
.tmain { flex: 1; min-width: 0; }
.ttitle { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmeta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 2px; align-items: center; }
.sn { font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--muted); font-weight: 400; margin-right: 4px; }
.prio { flex: none; min-width: 40px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; border-radius: 7px; padding: 3px 6px; font-size: 13px; color: #fff; }
.prio.crit { background: var(--crit); } .prio.high { background: var(--high); } .prio.med { background: var(--med); } .prio.low { background: var(--low); }
.prio.na { background: var(--hover); color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-size: 11px; line-height: 18px; background: var(--panel2); color: var(--text); }
.rag { display: inline-block; border-radius: 4px; padding: 0 6px; font-size: 11px; font-weight: 600; color: #fff; margin-left: 4px; vertical-align: 1px; }
.rag.R { background: var(--red); } .rag.A { background: var(--amber); } .rag.G { background: var(--green); } .rag.B { background: var(--block); }
.due.u5, .due.u4 { color: var(--crit); font-weight: 600; }
.due.u3 { color: var(--high); font-weight: 600; }
.badge-next { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--crit); margin-right: 4px; }


/* ---------- table */
.tablewrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--panel2); position: sticky; top: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--hover); }
td.title { white-space: normal; min-width: 240px; font-weight: 500; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover, th.sorted { color: var(--text); }
th .arrow { margin-left: 4px; font-size: 10px; opacity: .45; }
th.sorted .arrow { opacity: 1; color: var(--accent); }
tr.dayhead td { background: var(--panel2); cursor: default; }
tr.dayhead td .muted { margin-left: 10px; font-size: 12px; }
tbody tr.dayhead:hover, tbody tr.editing:hover { background: none; }
tbody tr.editing { cursor: default; }
.logtime { display: flex; flex-direction: column; gap: 6px; border: 1px dashed var(--line); border-radius: 8px; padding: 8px; margin-bottom: 6px; }
tr.done td.title { text-decoration: line-through; color: var(--muted); }

/* ---------- modal */
/* The dialog fits the screen: header and footer stay put, the content scrolls inside. */
.overlay { position: fixed; inset: 0; background: rgba(10,14,22,.45); display: flex; justify-content: center; align-items: center; padding: clamp(8px, 2.5vh, 32px) clamp(8px, 2vw, 32px); z-index: 50; }
.dialog { background: var(--panel); border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.25); width: min(100%, 1500px); max-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.dialog.narrow { max-width: 420px; }
.dialog > header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex: none; }
.dialog .body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); flex: 1; min-height: 0; }
.dialog .body.single { grid-template-columns: 1fr; overflow: auto; }
.dialog .pane { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; overflow: auto; min-height: 0; }
.dialog .pane + .pane { border-left: 1px solid var(--line); background: var(--panel2); }
.dialog footer { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; flex: none; }
.discussion { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 260px; }
.discussion .chat { flex: 1; max-height: none; }
.preview { border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; display: flex; align-items: center; gap: 10px; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.toggles button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 2px 10px; cursor: pointer; font-size: 12px; }
.toggles button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 4px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
.check input { margin-top: 3px; }
.bar { height: 6px; background: var(--hover); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.bar.over i { background: var(--crit); }
.entries { max-height: max(180px, 25vh); overflow: auto; font-size: 12px; }
.entries div { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); align-items: center; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 340px; min-height: 120px; overflow: auto; padding-right: 4px; }
.msg { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; }
.msg.mine { background: var(--accent-soft); border-color: transparent; }
.msg .who { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.msg p { margin: 0; white-space: pre-wrap; word-wrap: break-word; }

/* ---------- auth / settings */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth form { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.err { color: var(--crit); font-size: 13px; min-height: 18px; }
.betachip { margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; vertical-align: middle;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.auth .authsub { margin-top: -8px; letter-spacing: .03em; }
.auth .authco { font-size: 18px; font-weight: 700; padding: 8px 12px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.brandco { margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--line); font-weight: 600; color: var(--muted); white-space: nowrap; }
.auth .authfoot { text-align: center; margin-top: 4px; font-size: 11px; }
/* ---------- Help (admins): contents on the left, sections on the right */
.help { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; max-width: 1100px; }
.htoc { position: sticky; top: 72px; display: flex; flex-direction: column; padding: 8px; }
.htoc a { padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13px; }
.htoc a:hover { background: var(--hover); }
.hbody { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hsec { scroll-margin-top: 72px; }
.hsec .pad { line-height: 1.55; font-size: 14px; }
.hsec p { margin: 0 0 10px; }
.hsteps, .hlist { margin: 0 0 10px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.haddr { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.hsec code { font-size: 13px; padding: 1px 6px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); overflow-wrap: anywhere; }
.haddr code { font-size: 14px; padding: 4px 10px; }
.htable { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.htable th, .htable td { white-space: normal; vertical-align: top; text-align: left; }
.htable th { width: 110px; }
@media (max-width: 760px) { .help { grid-template-columns: 1fr; } .htoc { position: static; flex-direction: row; flex-wrap: wrap; } }
.settings { display: grid; gap: 16px; }
.catgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.catlist div { display: flex; align-items: center; gap: 6px; padding: 5px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.catlist div span { flex: 1 1 130px; min-width: 0; }
select.mini { width: auto; max-width: 170px; padding: 2px 6px; font-size: 12px; }
.catlist .off span { color: var(--muted); text-decoration: line-through; }
.pad { padding: 12px 14px; }

#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 6px; align-items: center; }
#toast div { background: #1b2130; color: #fff; padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13px; }
#toast div.e { background: var(--crit); }

@media (min-width: 1700px) {
  .dialog .body { grid-template-columns: minmax(0, 1.6fr) minmax(420px, 1fr); }
}
@media (max-width: 860px) {
  /* Single column: the whole dialog body scrolls as one. */
  .dialog .body { display: block; overflow: auto; }
  .dialog .pane { overflow: visible; min-height: auto; }
  .dialog .pane + .pane { border-left: 0; border-top: 1px solid var(--line); }
  .discussion .chat { max-height: 50vh; }
  .cards { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .filters select, .filters input { min-width: 0; max-width: none; width: 100%; }
  .filters label { flex: 1 1 140px; }
  .timerpill { max-width: 100%; }
  /* Phones: dialogs take the whole screen. */
  .overlay { padding: 0; }
  .dialog, .dialog.narrow { width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; }
  .dialog > header, .dialog footer { padding: 10px 12px; }
  .dialog .pane { padding: 12px; }
  .top { padding: 8px 12px; gap: 8px; }
  nav.tabs { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  nav.tabs a { white-space: nowrap; }
  h1 { font-size: 18px; }
}
.trange { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; }
.codebadge { font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: 13px; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 2px 8px; }
.cfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 24px; margin: 14px 0 0; }
.cfacts dt { font-size: 12px; color: var(--muted); font-weight: 500; }
.cfacts dd { margin: 2px 0 0; white-space: pre-wrap; }
.cfacts .addr { grid-column: span 2; }
@media (max-width: 520px) { .cfacts .addr { grid-column: auto; } }
a.btn { text-decoration: none; color: inherit; display: inline-block; }
.catlist .cdesc { display: block; font-size: 11px; color: var(--muted); white-space: pre-wrap; text-decoration: none; }
.catlist .ctl { display: flex; align-items: center; gap: 6px; margin-left: auto; font-style: normal; white-space: nowrap; }
.rag.blk { font-weight: 700; }
.ragsel[data-v=G] { border-left: 4px solid var(--green); }
.ragsel[data-v=A] { border-left: 4px solid var(--amber); }
.ragsel[data-v=R] { border-left: 4px solid var(--red); }
.req { color: var(--crit); }
.recsum { font-size: 12px; color: var(--muted); padding: 2px 0; }
.recsum b { color: var(--text); }
.recsum .recwarn { margin-top: 6px; padding: 6px 10px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--high) 45%, var(--line)); background: color-mix(in srgb, var(--high) 10%, transparent); color: var(--text); line-height: 1.45; }
.stepsbox { gap: 6px; }
.steps { display: flex; flex-direction: column; }
.step { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.step input[type=checkbox] { width: 16px; height: 16px; margin: 0; flex: none; cursor: pointer; }
.step .stitle { flex: 1 1 160px; min-width: 0; word-break: break-word; }
.step.done .stitle { text-decoration: line-through; color: var(--muted); }
.step .sbtns { display: flex; gap: 2px; opacity: .35; }
.step:hover .sbtns, .step:focus-within .sbtns { opacity: 1; }
.step.editing input[type=text] { flex: 1 1 180px; }
.step.editing select, .step.editing input[type=date] { width: auto; }
.stepadd { display: flex; gap: 6px; flex-wrap: wrap; }
.stepadd input[type=text] { flex: 1 1 200px; }
.stepadd select, .stepadd input[type=date] { width: auto; }
.stepsall { color: var(--green); font-weight: 600; }
@media (hover: none) { .step .sbtns { opacity: 1; } }
.starthint { color: var(--accent); font-weight: 600; }
.preview .plan { font-size: 12px; margin-top: 3px; }
.toggles button:disabled { cursor: default; opacity: .7; }
/* work status: Not started / In progress / Completed with a progress bar */
.wstat { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; border: 1px solid currentColor; border-radius: 999px; padding: 0 8px 0 6px; line-height: 18px; white-space: nowrap; }
.wstat .wbar { width: 36px; height: 5px; border-radius: 999px; background: color-mix(in srgb, currentColor 18%, transparent); overflow: hidden; display: inline-block; flex: none; }
.wstat .wbar i { display: block; height: 100%; background: currentColor; border-radius: 999px; }
.wstat.not { color: var(--muted); border-color: var(--line); }
.wstat.prog { color: var(--accent); }
.wstat.prog.over { color: var(--crit); }
.wstat.done { color: var(--green); }
.wstat.closed { color: var(--muted); border-color: var(--line); }
.wstat.indet .wbar i { background: repeating-linear-gradient(45deg, currentColor 0 3px, transparent 3px 6px); }
.wstat.lg { font-size: 12px; line-height: 22px; padding: 0 10px 0 8px; }
.wstat.lg .wbar { width: 60px; height: 6px; }
td .wstat .wbar { width: 50px; }
.rowbtns { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
/* @mentions */
.mention { color: var(--accent); font-weight: 600; background: var(--accent-soft); border-radius: 4px; padding: 0 3px; }
.mention.me { color: #fff; background: var(--accent); }
.msg.tome { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.mentionwrap { position: relative; }
.mentionbox { position: absolute; left: 0; bottom: calc(100% + 4px); z-index: 60; min-width: 240px; max-width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); padding: 4px; }
.mentionbox .mi { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.mentionbox .mi.on, .mentionbox .mi:hover { background: var(--accent-soft); }
.chat { position: relative; }
.newdiv { display: flex; align-items: center; gap: 8px; color: var(--crit); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.newdiv::before, .newdiv::after { content: ''; flex: 1; border-top: 1px solid var(--crit); opacity: .6; }
/* nav badge */
.navbadge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 5px; border-radius: 999px; background: var(--crit); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; vertical-align: 1px; }
.navbadge:empty { display: none; }
.navbadge.at::before { content: '@ '; }
/* Discussion tab */
.disc { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 14px; height: calc(100vh - 150px); min-height: 420px; }
.disc .card { display: flex; flex-direction: column; min-height: 0; }
.dtabs { display: flex; gap: 2px; padding: 8px 8px 0; flex-wrap: wrap; }
.dtabs button { border: 0; background: none; padding: 6px 10px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.dtabs button.on { background: var(--accent-soft); color: var(--accent); }
.dtabs .cnt { font-weight: 700; }
.dsearch { padding: 8px; border-bottom: 1px solid var(--line); }
.dsearch input { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 9px; width: 100%; }
.threads { overflow: auto; flex: 1; }
.thread { padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.thread:hover { background: var(--hover); }
.thread.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.thread .trow1 { display: flex; align-items: center; gap: 6px; }
.thread .ttl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread.unread .ttl { font-weight: 700; }
.thread .trow2 { display: flex; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.thread .snip { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread.unread .snip { color: var(--text); }
.thread .ago { white-space: nowrap; }
.ubadge { background: var(--crit); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; }
.atbadge { background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 6px; line-height: 18px; }
.dconv .empty { margin: auto; }
.dhead { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel2); }
.dhead .dtitle { flex: 1; min-width: 0; }
.dhead .dback { display: none; }
.dchat { flex: 1; max-height: none; padding: 12px 14px; }
.dreply { padding: 10px 14px; border-top: 1px solid var(--line); }
@media (max-width: 860px) {
  .disc { grid-template-columns: 1fr; height: auto; }
  .disc.has-thread .dlist, .disc:not(.has-thread) .dconv { display: none; }
  .disc .dconv { height: calc(100vh - 140px); }
  .dhead .dback { display: inline-block; }
  .threads { max-height: none; }
}

/* ---------- profile pictures */
img.av { object-fit: cover; background: var(--hover); }
.av.sm { width: 20px; height: 20px; font-size: 9px; }
.av.lg { width: 52px; height: 52px; font-size: 18px; }
.av.xl { width: 120px; height: 120px; font-size: 40px; }
.msg .who { display: flex; align-items: center; gap: 6px; }
.dlgtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- Discussion: the page is list | conversation (General chat opens from the button at the top of the list,
   and is shown there when no conversation is chosen). In My Day it is one column: the list, or a conversation with ←. */
.disc { grid-template-columns: minmax(240px, 1fr) minmax(0, 3fr); }
.disc.onecol { grid-template-columns: minmax(0, 1fr); }
.disc.onecol.has-thread .dlist, .disc.onecol:not(.has-thread) .dconv { display: none; }
.disc.onecol .dhead .dback { display: inline-block; }
/* People panel: person tiles in a grid that fills the panel (one per row when it's narrow) */
.pplist { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; padding: 10px; align-content: start; }
.pprow { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); min-width: 0; }
.pprow:hover { background: var(--hover); }
.pprow.on { background: var(--accent-soft); border-color: var(--accent); }
.pprow .av.lg { width: 40px; height: 40px; font-size: 14px; flex: none; }
.ppmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }
.ppname { text-decoration: none; color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppname:hover b { text-decoration: underline; }
.ppname b { font-weight: 600; font-size: 13px; }
.ppmain > small { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppcontact { display: flex; flex-direction: column; margin-top: 3px; font-size: 11px; }
.ppcontact a { color: var(--accent); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppcontact a:hover { text-decoration: underline; }
.dgen-link { padding: 10px 8px 2px; }
.gchat { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; font-weight: 600; text-decoration: none; color: inherit; text-align: left; }
.gchat span:first-child { flex: 1; }
.gchat.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.dnew { padding: 8px; border-top: 1px solid var(--line); text-align: center; }
.thread .trow1 .av { width: 20px; height: 20px; font-size: 9px; }
.dconv { position: relative; }
@media (max-width: 860px) {
  .disc { grid-template-columns: 1fr; }
}

/* ---------- message box with attachments */
.composer { display: flex; flex-direction: column; gap: 6px; }
.composer .cbox { flex-wrap: nowrap; align-items: flex-end; }
.composer textarea { min-height: 0; }
.attbtn { cursor: pointer; font-size: 16px; padding: 4px 8px; }
.attlist { display: flex; flex-wrap: wrap; gap: 6px; }
.attlist:empty { display: none; }
.attchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 2px 4px 2px 8px; font-size: 12px; }
.attchip.up { opacity: .65; }
.attchip button { border: 0; background: none; cursor: pointer; color: var(--muted); }
.dropping { outline: 2px dashed var(--accent); outline-offset: -4px; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.attimg { margin: 0; max-width: 240px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.attimg img { display: block; max-width: 100%; max-height: 180px; object-fit: contain; margin: 0 auto; }
.attimg figcaption { display: flex; gap: 6px; align-items: center; font-size: 11px; padding: 3px 6px; }
.attimg figcaption span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.attfile { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 8px; max-width: 100%; }
.attfile .fname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--text); }
.ficon { font-size: 18px; }
.linkbtn { border: 0; background: none; color: var(--accent); cursor: pointer; font-size: 11px; font-weight: 600; padding: 0; }
.msg p a { color: var(--accent); word-break: break-all; }

/* ---------- People & profile */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.person { display: flex; flex-direction: column; }
.person .pad { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.pname { font-weight: 700; font-size: 15px; color: var(--text); text-decoration: none; }
.pname:hover { text-decoration: underline; }
.pabout { margin: 0; color: var(--text); font-size: 13px; white-space: pre-wrap; }
.pabout.full { margin: 10px 0; }
.pcontact { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.pcontact a { color: var(--accent); text-decoration: none; }
.pfoot { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--panel2); }
.profile { display: grid; gap: 16px; max-width: 1000px; }
.prohead { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.dpwrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dpwrap label.btn { cursor: pointer; }

/* ---------- Notes */
.newnote { padding: 12px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; max-width: 640px; }
.swatches { display: flex; gap: 6px; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw span { display: block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; background: var(--nc); }
.sw input:checked + span { border-color: var(--text); }
.sw input:focus-visible + span { outline: 2px solid var(--accent); }
.yellow { --nc: #fde68a; --nt: #3f3200; } .pink { --nc: #fbcfe8; --nt: #4a0d2b; } .blue { --nc: #bfdbfe; --nt: #0b2a55; }
.green { --nc: #bbf7d0; --nt: #08361c; } .purple { --nc: #ddd6fe; --nt: #2a1361; } .orange { --nc: #fed7aa; --nt: #4a2000; }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 16px; align-items: start; }
.note { position: relative; background: var(--nc); color: var(--nt); border-radius: 4px 4px 14px 4px; padding: 14px 14px 8px; box-shadow: 0 6px 14px rgba(0,0,0,.18); min-height: 150px; display: flex; flex-direction: column; gap: 10px; }
.note:nth-child(3n+1) { transform: rotate(-.6deg); } .note:nth-child(3n+2) { transform: rotate(.5deg); }
.note.pinned { box-shadow: 0 8px 18px rgba(0,0,0,.25), inset 0 3px 0 rgba(0,0,0,.15); }
.note .pin { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font-size: 18px; }
.note .nbody { flex: 1; white-space: pre-wrap; word-wrap: break-word; font-size: 14px; line-height: 1.45; }
.note .nbody .mention { background: rgba(255,255,255,.55); color: inherit; }
.note .nfoot { display: flex; align-items: center; gap: 6px; font-size: 11px; opacity: .85; }
.note .nfoot .btn { background: rgba(255,255,255,.5); border-color: transparent; color: inherit; }
.note textarea { background: rgba(255,255,255,.6); color: var(--nt); border-color: transparent; min-height: 110px; }
.note.editing { transform: none; }

/* ---------- Timesheet modes & month calendar */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 5px 12px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent-soft); color: var(--accent); }
.cal { padding: 10px; }
.calhead, .calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calhead div { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding-bottom: 4px; }
.calday { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; min-height: 64px; padding: 6px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; color: var(--text); }
.calday:hover { border-color: var(--accent); }
.calday.out { opacity: .35; }
.calday.off { background: var(--panel2); }
.calday.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.calday .dnum { font-size: 12px; color: var(--muted); }
.calday b { font-size: 13px; }
.calday .dbar { height: 4px; border-radius: 999px; background: var(--hover); overflow: hidden; margin-top: auto; }
.calday .dbar i { display: block; height: 100%; background: var(--accent); }
.sumrow { display: flex; justify-content: space-between; gap: 10px; padding: 7px 14px; border-bottom: 1px solid var(--line); }
.sumrow:last-child { border-bottom: 0; }
.sumrow:hover[data-open] { background: var(--hover); }
@media (max-width: 520px) { .calday { min-height: 48px; padding: 4px; } .calday b { font-size: 11px; } }

/* ---------- Client cards */
.ccard > header { cursor: pointer; }
.ccard > header h2 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard > header:hover h2 { text-decoration: underline; }
.ccard .cmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.ccard .cfoot { padding: 8px 14px; font-size: 12px; font-weight: 600; color: var(--accent); cursor: pointer; border-top: 1px solid var(--line); background: var(--panel2); }
.ccard .cfoot:hover { text-decoration: underline; }
.ccard.archived { opacity: .6; }

/* ---------- meetings */
.wstat.meet { color: var(--block); }
.meetchk { padding: 6px 10px; border: 1px dashed var(--line); border-radius: 8px; }
.pdesig { font-weight: 600; color: var(--text); opacity: .85; margin-top: 2px; }
/* clickable stand-up figures */
button.stat { font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
button.stat:hover { border-color: var(--accent); }
button.stat.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
button.stat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.statbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: 8px 12px; margin: -4px 0 16px; }
.devlist { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.devlist .row { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.steps-help { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; margin: 0 0 10px; }
.steps-help code { background: var(--hover); padding: 1px 5px; border-radius: 4px; }
.viewonly { background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12px; border-radius: 8px; padding: 6px 10px; }
.scopelist { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
/* Vacation */
table.vac th, table.vac td { padding: 4px 3px; text-align: center; }
table.vac th:first-child, table.vac td:first-child { text-align: left; position: sticky; left: 0; background: var(--panel); z-index: 1; min-width: 180px; padding-left: 10px; }
table.vac th { font-size: 11px; line-height: 1.2; }
table.vac th.off, table.vac td.off { background: var(--panel2); color: var(--muted); }
table.vac th.today { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
table.vac td.today { box-shadow: inset 0 0 0 1px var(--accent); }
.vname { display: flex; align-items: center; gap: 8px; }
.vname span { display: flex; flex-direction: column; line-height: 1.2; }
.vday { min-width: 28px; font-size: 10px; font-weight: 700; letter-spacing: -.02em; }
.vday.edit { cursor: pointer; }
.vday.edit:hover { background: var(--accent-soft); }
table.vac td.vday.on { background: color-mix(in srgb, var(--vc) 24%, transparent); color: var(--vc); }
table.vac td.vday.on.edit:hover { background: color-mix(in srgb, var(--vc) 38%, transparent); }
.vlegend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.vlegend span { display: inline-flex; align-items: center; gap: 6px; }
.vlegend i, th.vtype i { font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; color: var(--vc); background: color-mix(in srgb, var(--vc) 22%, transparent); }
.vtcount { color: var(--muted); min-width: 34px; }
/* Manager on profiles */
.mgrline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 6px 0; font-size: 13px; }
.mgrline .sep { width: 1px; height: 14px; background: var(--line); margin: 0 6px; }
.mgr { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; color: inherit; font-weight: 600; }
.mgr:hover { color: var(--accent); }
.mgr .av { width: 20px; height: 20px; font-size: 9px; }
.vmon { min-width: 46px; cursor: pointer; }
.vmon.on { background: color-mix(in srgb, var(--green) 18%, transparent); font-weight: 700; }
.vtot { font-weight: 700; }
th.clickable { cursor: pointer; }
th.clickable:hover { color: var(--accent); }
/* Morning plan */
.planlist { display: flex; flex-direction: column; gap: 4px; max-height: 55vh; overflow: auto; }
.planrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.planrow:hover { background: var(--accent-soft); }
.planrow input { width: auto; margin: 0; }
.planrow .pt { display: flex; flex-direction: column; min-width: 0; }
[hidden] { display: none !important; }
/* Folded task lists (Show N more) and Stand-up planned-by marker */
.foldbtn { display: block; width: 100%; padding: 8px 14px; border: 0; border-top: 1px dashed var(--line); background: transparent; color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; }
.foldbtn:hover { background: var(--hover); }
.foldbtn .muted { font-weight: 400; }
.plannedby { flex: none; font-size: 11px; color: var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 2px 8px; white-space: nowrap; }
.donecard header h2 { color: var(--green); }
/* My Day: stacked sections; two columns in wide mode */
.mdcols, .mdcol { display: flex; flex-direction: column; gap: 16px; }
.mdcol:empty { display: none; }
.mdcol > section { margin-top: 0 !important; }
/* Wide screen (account menu): use the full width of large monitors */
@media (min-width: 1400px) {
  body.wide main { max-width: none; }
  body.wide .cards { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
  body.wide .dialog { width: min(100%, 2100px); }
  body.wide .dialog .body:not(.single) { grid-template-columns: minmax(0, 1.7fr) minmax(420px, 1fr); } /* two-pane task window only; one-pane dialogs stay one column */
  body.wide .profile { max-width: 1400px; }
  body.wide .newnote { max-width: 900px; }
}
@media (min-width: 1800px) {
  body.wide .cards { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); }
}
/* Notes: who can see a note, the sharing picker, and the "Shared with you" heading */
.note .nvis { font-size: 11px; font-weight: 600; opacity: .8; }
.nshare { display: flex; flex-direction: column; gap: 8px; }
.nshare select { align-self: flex-start; max-width: 100%; }
.nshare .npeople { max-height: 150px; overflow: auto; }
.note .nshare .toggles button { background: rgba(255,255,255,.55); color: var(--nt); border-color: transparent; }
.note .nshare .toggles button.on { background: rgba(0,0,0,.65); color: #fff; }
.note .nshare select { background: rgba(255,255,255,.6); color: var(--nt); border-color: transparent; }
.nsec { font-size: 15px; margin: 26px 0 12px; }
/* All tasks: the table scrolls in a box that fills the window, header row frozen at the top of it */
body[data-view="tasks"] main { padding-bottom: 0; }
.tablewrap.fit { overflow: auto; overscroll-behavior: contain; }
.tablewrap.fit thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--line); }
.tcount { margin: -6px 0 8px; }
/* ---------- colour themes (account menu → Colour theme). "auto" (no attribute) follows Windows light/dark. */
:root[data-theme="light"], :root[data-theme="ocean"], :root[data-theme="forest"], :root[data-theme="sunset"], :root[data-theme="lavender"] {
  --bg: #f5f6f8; --panel: #fff; --panel2: #fafbfc; --text: #1b2130; --muted: #667085; --line: #e3e6eb; --hover: #f0f2f5;
  --accent: #3657d6; --accent-ink: #fff; --accent-soft: #e8edfc;
  --crit: #d92d20; --high: #e8590c; --med: #c99400; --low: #7a8699;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.08);
  color-scheme: light;
}
:root[data-theme="dark"], :root[data-theme="midnight"], :root[data-theme="graphite"] {
  --bg: #12151b; --panel: #1a1e26; --panel2: #161a21; --text: #e6e9ef; --muted: #9099a8; --line: #2a303b; --hover: #222833;
  --accent: #6f8cff; --accent-ink: #0d1020; --accent-soft: #1f2846;
  --crit: #ff6b5e; --high: #ff8f4d; --med: #e6b93a; --low: #8a94a6;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  color-scheme: dark;
}
:root[data-theme="ocean"] { --bg: #eef6f8; --panel2: #f6fbfc; --text: #10303a; --muted: #5b7680; --line: #d3e5ea; --hover: #e6f2f5; --accent: #0e7c86; --accent-soft: #dcf1f3; }
:root[data-theme="forest"] { --bg: #f1f5ef; --panel2: #f7faf5; --text: #1d2b1f; --muted: #627262; --line: #dbe5d6; --hover: #eaf1e6; --accent: #2f7d4f; --accent-soft: #e0f0e5; }
:root[data-theme="sunset"] { --bg: #fbf4ee; --panel: #fffdfb; --panel2: #fdf8f3; --text: #3a2418; --muted: #8a6a58; --line: #f0dfd2; --hover: #f8ece2; --accent: #d4572a; --accent-soft: #fbe5da; }
:root[data-theme="lavender"] { --bg: #f5f3fb; --panel2: #faf9fe; --text: #241f3a; --muted: #6e6890; --line: #e2def2; --hover: #efecf9; --accent: #7048e8; --accent-soft: #ece6fd; }
:root[data-theme="midnight"] { --bg: #0b1020; --panel: #121a2e; --panel2: #0f1628; --text: #e4e9f5; --muted: #8c97b3; --line: #23304d; --hover: #1a2540; --accent: #8b7cff; --accent-ink: #0b1020; --accent-soft: #231f4d; }
:root[data-theme="graphite"] { --bg: #161616; --panel: #1f1f1f; --panel2: #1b1b1b; --text: #ececec; --muted: #a0a0a0; --line: #333; --hover: #2a2a2a; --accent: #f0a63a; --accent-ink: #1a1200; --accent-soft: #3a2c12; }
/* theme picker */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.themecard { border: 2px solid var(--line); border-radius: 10px; padding: 0; overflow: hidden; cursor: pointer; background: none; text-align: left; }
.themecard.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.themecard .tprev { display: flex; flex-direction: column; gap: 5px; padding: 10px; height: 74px; }
.themecard .tprev i { display: block; height: 10px; border-radius: 4px; }
.themecard .tprev .tbar { display: flex; gap: 5px; }
.themecard b { display: block; padding: 6px 10px; font-size: 12px; background: var(--panel); border-top: 1px solid var(--line); }
/* questions shown on top of the task window */
.askover { z-index: 70; }
.askdlg { max-width: 480px; }
.askdlg .pane { padding: 16px; }
.askbtns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.eachchk { margin-top: -4px; }
/* Plan your day: the daily tasks that were added by themselves */
.planauto { background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; font-size: 13px; }
/* ---------- My Day "Time spent" chart. --viz: the chart's one colour (the theme accent, or a nearby step that passes
   the chart colour checks: lightness band, chroma floor, 3:1 against the panel). */
:root { --viz: var(--accent); }
@media (prefers-color-scheme: dark) { :root { --viz: #5b7cf0; } }
:root[data-theme="light"], :root[data-theme="forest"], :root[data-theme="sunset"], :root[data-theme="lavender"], :root[data-theme="midnight"] { --viz: var(--accent); }
:root[data-theme="dark"] { --viz: #5b7cf0; }
:root[data-theme="ocean"] { --viz: #0090a0; }
:root[data-theme="graphite"] { --viz: #c98500; }
.gantt { display: flex; flex-direction: column; padding: 4px 16px 12px; }
.ghead, .grow { display: grid; grid-template-columns: minmax(140px, 26%) minmax(0, 1fr) 64px; align-items: center; column-gap: 12px; }
.ghead { height: 26px; }
.gscale { position: relative; height: 100%; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gscale span { position: absolute; bottom: 4px; transform: translateX(-50%); white-space: nowrap; }
.grow { min-height: 30px; border-top: 1px solid var(--line); }
.grow:last-child { border-bottom: 1px solid var(--line); }
.grow:hover { background: var(--hover); }
.glabel { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; padding: 6px 0; }
.glabel:hover, .glabel:focus-visible { text-decoration: underline; outline: none; }
.glabel .sn { margin-right: 6px; }
.glane { position: relative; align-self: stretch; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: calc(100% / var(--hours)) 100%; box-shadow: inset -1px 0 0 var(--line); }
.gblock { position: absolute; top: 5px; bottom: 5px; background: var(--viz); border-radius: 3px; }
.gblock:hover { filter: brightness(1.12); }
.gblock.run { opacity: .7; }
.gblock:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.gnow { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--text); opacity: .5; }
.gtot { text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gnote { margin: 0 16px 12px; }
/* a narrow chart (e.g. My Day's middle column) labels every other hour so the times don't run together */
.tchart { container-type: inline-size; }
@container (max-width: 620px) { .gscale span.odd { display: none; } .gscale span { font-size: 11px; } }
/* week / month: a row per day */
@media (min-width: 641px) { .gdays .ghead, .gdays .grow { grid-template-columns: 96px minmax(0, 1fr) 64px; } }
.gdays .grow { min-height: 28px; }
.gdays .grow.goff .glabel { color: var(--muted); }
.gdays .grow.goff .glane { background-color: color-mix(in srgb, var(--line) 30%, transparent); }
.gdays .grow.gtoday .glabel { font-weight: 700; color: var(--accent); }
#vtip { position: fixed; z-index: 80; display: none; pointer-events: none; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.18); padding: 7px 10px; max-width: 320px; }
#vtip .v { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
#vtip .v::before { content: ''; width: 12px; height: 2px; border-radius: 1px; background: var(--viz); }
#vtip .l { font-size: 12px; color: var(--text); opacity: .85; }
#vtip .m { font-size: 11px; color: var(--muted); }
/* ---------- phones: task rows stack (title in full, then details, then buttons) and the day chart puts each
   task's name above its timeline, so nothing is squeezed into a narrow column */
@media (max-width: 640px) {
  .trow { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 8px; align-items: start; padding: 10px 12px; }
  .trow > .prio { min-width: 34px; padding: 2px 5px; margin-top: 1px; }
  .trow > :not(.prio):not(.tmain) { grid-column: 1 / -1; }            /* buttons and tags: a row of their own */
  .trow > .plannedby { justify-self: start; }
  .ttitle { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
  .ttitle .badge-next { display: block; margin-bottom: 1px; }
  .tmeta { gap: 4px 8px; }
  .rowbtns { justify-content: flex-start; gap: 6px; }
  .rowbtns .btn.sm { padding: 6px 10px; font-size: 13px; }
  .rowbtns .btn.icon.sm { min-width: 36px; margin-left: auto; }
  .card > header { padding: 10px 12px; row-gap: 4px; }
  .card > header > .muted.small { order: 3; flex-basis: 100%; }      /* hints go under the title */
  .card > header .counts { margin-left: auto; }
  /* day chart: name + total on one line, the timeline under it at full width */
  .gantt { padding: 4px 12px 10px; }
  .ghead { grid-template-columns: minmax(0, 1fr); height: 22px; }
  .ghead > span { display: none; }
  .grow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label tot" "lane lane"; row-gap: 2px; column-gap: 8px; padding: 6px 0 8px; }
  .glabel { grid-area: label; padding: 0; font-size: 13px; }
  .gtot { grid-area: tot; }
  .glane { grid-area: lane; height: 22px; }
  .gblock { top: 3px; bottom: 3px; }
  .gscale span.odd { display: none; }
  .gscale span:first-child { transform: none; }                     /* end labels stay inside the chart */
  .gscale span:last-child { transform: translateX(-100%); }
}
/* My Day and the Discussion page: a comfortable reading width, centred */
body[data-view="myday"] main, body.wide[data-view="myday"] main { max-width: 1200px; }
body[data-view="discussion"] main, body.wide[data-view="discussion"] main { max-width: 1400px; }
/* My Day: your day | Timesheet | Discussion — three equal columns on wide screens (using the whole width), one under
   the other otherwise. Discussion stays in view while the page scrolls. */
.mdwrap { display: flex; flex-direction: column; gap: 28px; }
.mdmain, .mdts, .mddisc { min-width: 0; }
/* Timesheet entries: time · duration · the task, with client / classifications and the note on lines of their own */
.tstable { width: 100%; }
.tstable tr.tsrow td { vertical-align: top; }
.tstable tr.tsrow.hasmeta td:not([rowspan]) { border-bottom: 0; padding-bottom: 2px; } /* the entry carries on in the row below */
.tstable tr.tsmeta td { padding-top: 0; white-space: normal; }
.tstable td.tstask { width: 100%; white-space: normal; min-width: 160px; }
.tsttl { font-weight: 500; cursor: pointer; }
.tsttl:hover { color: var(--accent); }
.tswhere { display: flex; flex-wrap: wrap; gap: 4px; }
.tswhere span { font-size: 11px; line-height: 18px; padding: 0 7px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.tsnote { margin-top: 5px; padding-left: 8px; border-left: 2px solid var(--line); font-size: 13px; line-height: 1.45; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.tswhere + .tsnote { margin-top: 6px; }
.tswhere:empty, .tsmeta .tsnote:first-child { margin-top: 0; }
.tstable td.tsact { padding-left: 4px; }
.tstable td.tsact .row { flex-wrap: nowrap; gap: 4px; }
.tstable th .muted { font-weight: 400; }
@media (max-width: 520px) {
  .tstable th, .tstable td { padding-left: 6px; padding-right: 6px; }
  .tstable td.tstask { min-width: 0; }
  .tstable td.sn { font-size: 11px; }
  .tstable th .muted { display: none; }
}
.mdts, .mddisc { border-top: 1px solid var(--line); padding-top: 18px; }
.mddisc .disc { height: 78vh; min-height: 460px; }
/* Fold a column to its heading (▾ / ▸ before the title) */
.mdcol > .vhead { align-items: center; }
/* My Day's own sections (Planned, Completed, Tasks you own, …) fold to their heading too */
.mdsec > header .secfold { flex: none; width: 26px; height: 26px; margin-left: -6px; margin-right: -4px; font-size: 12px; }
.mdsec > header h2 { cursor: pointer; }
.mdsec.folded > :not(header) { display: none; }
.mdsec.folded > header { border-bottom: 0; }
.mdsec.folded > header > .muted.small { display: none; }
.mdsec.folded > header h2 { color: var(--muted); }
.mdcol > .vhead > .mdfold { flex: none; width: 28px; height: 28px; margin-right: -4px; font-size: 13px; }
.mdcol.folded > :not(.vhead) { display: none; }
.mdcol.folded > .vhead > :not(h1):not(.mdfold) { display: none; }
.mdcol.folded > .vhead { cursor: pointer; margin-bottom: 0; }
.mdcol.folded > .vhead h1 { color: var(--muted); }
@media (min-width: 1500px) {
  /* side by side: the columns fill the window and each scrolls on its own, its heading pinned at the top */
  .mdwrap { display: grid; grid-template-columns: var(--mdcols, repeat(3, minmax(0, 1fr))); gap: 22px; height: var(--mdh, calc(100vh - 90px)); }
  .mdcol { min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; padding-right: 6px; }
  .mdcol > .vhead { position: sticky; top: 0; z-index: 4; background: var(--bg); padding-bottom: 10px; margin-bottom: 4px; }
  .mdts, .mddisc { border-top: 0; padding-top: 0; }
  .mddisc { display: flex; flex-direction: column; overflow: hidden; }
  .mddisc .disc { flex: 1; height: auto; min-height: 0; }
  /* folded: a narrow strip with the title running down it */
  .mdcol.folded { overflow: hidden; padding-right: 0; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
  .mdcol.folded > .vhead { writing-mode: vertical-rl; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 10px; height: 100%; padding: 10px 0; background: none; }
  .mdcol.folded > .vhead > .mdfold { writing-mode: horizontal-tb; margin: 0; }
  .mdcol.folded > .vhead h1 { font-size: 16px; white-space: nowrap; }
  .mdcol.folded:hover { border-color: var(--accent); }
  body[data-view="myday"] main, body.wide[data-view="myday"] main { max-width: none; }
}
/* Organization: Vacation | People — two columns on wide screens (People stays in view), one under the other otherwise */
.orgwrap { display: flex; flex-direction: column; gap: 24px; }
.orgvac { min-width: 0; }
.orgpeople { display: flex; flex-direction: column; height: 80vh; min-height: 460px; }
@media (min-width: 1300px) {
  .orgwrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
  .orgpeople { position: sticky; top: 64px; height: calc(100vh - 90px); }
  body.wide[data-view="organization"] main { max-width: none; }
}
.tsslot { margin-bottom: 16px; } /* the Time spent chart, under the timesheet heading in My Day */
.tsslot:empty { display: none; }
/* People directory inside the Discussion tab */
.dgen-link { display: flex; flex-direction: column; gap: 6px; }
.pdir { flex: 1; overflow: auto; padding: 12px; }
.pdir .people { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; align-content: start; }
.dhead .psearch { width: 220px; flex: none; align-self: center; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 9px; }
@media (max-width: 640px) { .dhead { flex-wrap: wrap; } .dhead .psearch { width: 100%; } }
/* a note shared with you that you hadn't seen */
.note .nnew { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 999px; background: var(--crit); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-transform: uppercase; letter-spacing: .03em; }
/* ---------- Edit / Add client */
.dialog.clientdlg { max-width: 680px; }
.clientdlg > header .codebadge { margin-right: 2px; }
.cform { display: flex; flex-direction: column; gap: 18px; padding: 18px 20px; }
.cform section { display: flex; flex-direction: column; gap: 8px; }
.cform section + section { border-top: 1px solid var(--line); padding-top: 16px; }
.cform h3 { margin: 0; }
.cform-id { display: grid; grid-template-columns: minmax(140px, 200px) minmax(0, 1fr); gap: 12px; align-items: start; }
.cform .fld small { font-size: 11px; }
.cform textarea { min-height: 76px; }
.cform-hint { margin: 2px 0 0; }
.clientdlg > footer .btn.danger { border-color: color-mix(in srgb, var(--crit) 40%, var(--line)); }
@media (max-width: 520px) { .cform { padding: 14px 12px; } .cform-id { grid-template-columns: 1fr; } }
/* ---------- Admins: edit a person's details (from People) */
.dialog.persondlg { max-width: 620px; }
.persondlg > header { gap: 10px; }
.pact { display: flex; gap: 4px; flex: none; margin-left: auto; }
/* ---------- People: Tiles / Org chart switch, and the org chart (a top-down tree, connectors drawn with borders) */
.dhead .pmode { align-self: center; flex: none; }
.ppbody { flex: 1; overflow: auto; }
.ppbody[hidden], .pplist[hidden] { display: none; }
.org { padding: 16px 12px 20px; min-width: max-content; }
.org ul { list-style: none; margin: 0; padding: 22px 0 0; display: flex; justify-content: center; position: relative; }
.org .otree { padding-top: 0; }
.org .otree + .otree { margin-top: 26px; }
.org li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 22px 6px 0; }
.org .otree > li { padding-top: 0; }
.org li::before, .org li::after { content: ''; position: absolute; top: 0; width: 50%; height: 22px; border-top: 1.5px solid var(--muted); }
.org li::before { right: 50%; }
.org li::after { left: 50%; border-left: 1.5px solid var(--muted); }
.org li:only-child::before { display: none; }
.org li:only-child::after { border-top: 0; }
.org li:first-child::before, .org li:last-child::after { border-top: 0; }
.org li:last-child::before { border-right: 1.5px solid var(--muted); border-radius: 0 8px 0 0; }
.org li:last-child:not(:only-child)::after { border: 0; }
.org li:first-child:not(:only-child)::after { border-radius: 8px 0 0 0; }
.org .otree > li::before, .org .otree > li::after { display: none; }
.org ul ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 22px; border-left: 1.5px solid var(--muted); }
.onode { display: flex; align-items: flex-start; gap: 8px; width: 210px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); text-align: left; }
.onode.me { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.onode.on { background: var(--accent-soft); }
.onode .av.lg { width: 36px; height: 36px; font-size: 13px; flex: none; }
.onmain { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.onname { font-weight: 600; font-size: 13px; text-decoration: none; color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onname:hover { text-decoration: underline; }
.onmain small { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oncount { color: var(--accent); font-weight: 600; }
.oloose { margin-top: 28px; border-top: 1px dashed var(--line); padding-top: 12px; }
.oloose h3 { margin: 0 0 8px; }
.oloose-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ochip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: inherit; font-size: 12px; background: var(--panel); }
.ochip:hover { background: var(--hover); }
.ochip.me { border-color: var(--accent); }
.pdir .people.orgmode { display: block; overflow: auto; }
@media (max-width: 640px) { .dhead .pmode { order: 3; } }
/* compact org chart: a manager's people as a list under their box, joined by a spine on the left */
.ogrp { display: flex; flex-direction: column; align-items: flex-start; }
.ostack { position: relative; display: flex; flex-direction: column; gap: 8px; margin: 10px 0 0 22px; padding-left: 16px; }
.ostack::before { content: ''; position: absolute; left: 0; top: -10px; bottom: 0; border-left: 1.5px solid var(--muted); }
.ostack > .onode { position: relative; box-shadow: none; }
.ostack > .onode::before { content: ''; position: absolute; left: -16px; top: 50%; width: 16px; border-top: 1.5px solid var(--muted); }
.ostack > .onode:last-child::after { content: ''; position: absolute; left: -18px; top: calc(50% + 1px); bottom: -1px; width: 4px; background: var(--panel); } /* end the spine at the last person */
/* a read-only value in a form (e.g. Department, set by an admin) */
.roval { padding: 6px 9px; border: 1px dashed var(--line); border-radius: 8px; min-height: 34px; display: flex; align-items: center; gap: 4px; }
/* Settings → Clients (admins) */
.setclients .catlist { max-height: 360px; overflow: auto; }
.setclients .codebadge { margin-right: 6px; }
.setclients .setclopts { flex-basis: 100%; gap: 14px; }
