:root {
  --accent: #0f766e;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --side: #111827;
  --side-fg: #cbd5e1;
  --fg: #0f172a;
  --muted: #64748b;
  --line: #e5e7eb;
  --soft: #f1f5f9;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #16a34a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 1px rgba(15, 23, 42, .03);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17; --panel: #131a26; --side: #070a10; --fg: #e5e7eb; --muted: #8b98ab;
    --line: #243044; --soft: #1a2333; --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--fg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 2px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0; }
h3 { font-size: 14px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.pad { padding: 14px; }

/* shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-fg); padding: 16px 12px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; color: #fff; padding: 0 4px; }
.brand small { display: block; color: #64748b; font-size: 11px; }
.brand.big { color: var(--fg); margin-bottom: 18px; }
.brand.big small { color: var(--muted); }
.logo { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.proj-switch { display: block; padding: 0 4px; }
.proj-switch .lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin-bottom: 4px; }
.proj-switch select { width: 100%; background: #1f2937; color: #fff; border: 1px solid #334155; border-radius: 8px; padding: 8px; font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin: 10px 8px 4px; }
.nav a { color: var(--side-fg); padding: 7px 8px; border-radius: 7px; display: flex; align-items: center; gap: 9px; }
.nav a i { font-style: normal; width: 18px; text-align: center; opacity: .7; font-size: 12px; font-weight: 700; }
.nav a.sub { padding-left: 22px; font-size: 13px; }
.nav a:hover { background: #1f2937; text-decoration: none; color: #fff; }
.nav a.on { background: var(--accent); color: #fff; }
.nav a.on i { opacity: 1; }
.soon { font-style: normal; font-size: 10px; background: #334155; color: #cbd5e1; border-radius: 4px; padding: 0 5px; margin-left: auto; }
.me { margin-top: auto; border-top: 1px solid #1f2937; padding: 10px 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.me a { color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.me small { display: block; color: #64748b; font-size: 11px; }
.link { background: none; border: 0; color: #94a3b8; cursor: pointer; font: inherit; font-size: 12px; }
.main { padding: 22px 28px 60px; min-width: 0; }
.burger { display: none; }

/* page */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .back { font-size: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow-x: auto; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.grid-side { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash.err { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.warn { color: var(--warn); font-weight: 600; font-size: 12px; margin-top: 8px; }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); border-radius: 8px; padding: 7px 12px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { border-color: #cbd5e1; background: var(--soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 3px 8px; font-size: 12px; }
.btn.wide { width: 100%; justify-content: center; margin-top: 8px; }
input, select, textarea { font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
input[type=color] { padding: 2px; height: 36px; }
input[type=checkbox] { width: auto; }
textarea { resize: vertical; line-height: 1.55; }
textarea[readonly], input[readonly] { background: var(--soft); }
.fld { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
.fld > input, .fld > select, .fld > textarea { font-weight: 400; font-size: 14px; }
.fld-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fld-tools { display: flex; gap: 8px; align-items: center; }
.counter { font-weight: 400; font-size: 12px; }
.counter.over { color: var(--danger); font-weight: 700; }
.form h3 { margin-top: 0; }
.form.narrow { max-width: 460px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; color: var(--fg); font-size: 13px; }
.checks { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; }
label.inl { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }

/* pills & tags */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 1px 9px; border-radius: 99px; background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 75%, var(--fg)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); white-space: nowrap; }
.pill b { font-weight: 700; }
.acc { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.acc b { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; }
.mtag { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; font-size: 10px; font-weight: 800; color: #fff; flex: none; }
.mtag.m-posts { background: #0a66c2; }
.mtag.m-articles { background: #0f766e; }
.mtag.m-guest { background: #b45309; }
.horizon { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--soft); color: var(--muted); }
.horizon b { color: var(--fg); }
.horizon.ok { background: #ecfdf5; color: #047857; }
.horizon.mid { background: #fffbeb; color: #b45309; }
.horizon.low { background: #fef2f2; color: #b91c1c; }
.horizon.empty { background: #fef2f2; color: #b91c1c; }
@media (prefers-color-scheme: dark) {
  .horizon.ok { background: #052e22; color: #6ee7b7; } .horizon.mid { background: #2d1f05; color: #fcd34d; }
  .horizon.low, .horizon.empty { background: #2c0d0d; color: #fca5a5; } .horizon b { color: inherit; }
  .flash { background: #052e22; color: #a7f3d0; border-color: #065f46; } .flash.err { background: #2c0d0d; color: #fecaca; border-color: #7f1d1d; }
}

/* dashboard */
.stat { color: var(--fg); display: flex; flex-direction: column; gap: 10px; }
.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat-h { font-weight: 700; display: flex; gap: 8px; align-items: center; }
.stat-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.acc-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.acc-row:last-child { border-bottom: 0; }
.day-sep { font-size: 12px; font-weight: 700; color: var(--muted); margin: 10px 0 4px; text-transform: capitalize; }
.day-row { display: grid; grid-template-columns: 18px 42px 130px 1fr auto auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 7px; color: var(--fg); font-size: 13px; }
.day-row:hover { background: var(--soft); text-decoration: none; }
.day-row .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.day-row .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-row .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* tabs & filters */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs a.on { color: var(--fg); border-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--fg); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters input:not([type=checkbox]), .filters select { width: auto; min-width: 150px; }
.filters input[name=q] { min-width: 220px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 12px; margin-bottom: 10px; }

/* table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--soft); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.tbl tr.archived { opacity: .55; }
.rowlink { color: var(--fg); font-weight: 500; }
.status-quick select { width: auto; padding: 3px 8px; font-size: 12px; border-radius: 99px; border-color: color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 12%, var(--panel)); font-weight: 600; }

/* queue */
.queue { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(290px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.qcol { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.qcol header { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.qname { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.qname b { font-size: 15px; }
.li { font-size: 12px; }
.qitem { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; background: var(--panel); }
.qitem:hover { border-color: var(--c); }
.qitem.overdue { border-color: #fca5a5; background: color-mix(in srgb, #ef4444 5%, var(--panel)); }
.qlink { color: var(--fg); display: block; }
.qlink:hover { text-decoration: none; }
.qdate { font-size: 12px; font-weight: 700; color: var(--muted); }
.late { color: var(--danger); font-style: normal; margin-left: 4px; }
.qtitle { font-size: 13px; margin-top: 2px; }
.qmeta { display: flex; gap: 10px; font-size: 11px; margin-top: 4px; }
.qadd { text-align: center; padding: 8px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 13px; }
.qadd:hover { border-color: var(--c); color: var(--fg); text-decoration: none; }
.qdone summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.qdone a { display: block; font-size: 12px; padding: 3px 0; color: var(--muted); }

/* calendar */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.cal-head h2 { min-width: 150px; text-align: center; font-size: 18px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal-dow { background: var(--soft); padding: 6px 8px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.cal-day { background: var(--panel); min-height: 118px; padding: 4px 5px 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.out { background: var(--soft); }
.cal-day.out .daybtn { opacity: .45; }
.cal-day.past .chip { opacity: .75; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-num { display: flex; justify-content: space-between; align-items: center; }
.daybtn { border: 0; background: none; font: inherit; font-weight: 700; font-size: 12px; color: var(--fg); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.daybtn:hover { background: var(--soft); }
.cal-day.today .daybtn { background: var(--accent); color: #fff; }
.plus { opacity: 0; font-weight: 700; padding: 0 6px; border-radius: 5px; color: var(--muted); }
.cal-day:hover .plus { opacity: 1; }
.plus:hover { background: var(--soft); text-decoration: none; }
.chip { display: flex; align-items: center; gap: 4px; font-size: 11.5px; line-height: 1.3; padding: 3px 6px; border-radius: 5px; background: color-mix(in srgb, var(--c) 11%, var(--panel)); border-left: 3px solid var(--c); color: var(--fg); overflow: hidden; white-space: nowrap; min-width: 0; }
.chip:hover { text-decoration: none; background: color-mix(in srgb, var(--c) 22%, var(--panel)); }
.chip .sdot { width: 7px; height: 7px; border-radius: 50%; background: var(--s); flex: none; }
.chip em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip b { font-weight: 700; flex: none; }
.chip span { overflow: hidden; text-overflow: ellipsis; }
.chip .mtag { width: 14px; height: 14px; font-size: 8px; }
.more { border: 0; background: none; font: inherit; font-size: 11px; color: var(--accent); cursor: pointer; text-align: left; padding: 0 6px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { background: var(--panel); border-radius: 12px; width: min(760px, 100%); max-height: 85vh; overflow: auto; padding: 18px 20px; position: relative; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-x { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }
.modal-card h3 { margin: 0 0 10px; text-transform: capitalize; }
.modal-card .actions { margin-top: 12px; }

/* item */
.item-grid { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.item-main { min-width: 0; }
.item-side { position: sticky; top: 16px; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.file { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); display: flex; flex-direction: column; }
.thumb { aspect-ratio: 4 / 3; background: var(--soft); display: grid; place-items: center; position: relative; overflow: hidden; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .play { position: absolute; color: #fff; font-size: 26px; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.thumb .ext { font-weight: 800; color: var(--muted); }
.fname { font-size: 12px; padding: 6px 8px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); font-weight: 500; }
.fmeta { display: flex; align-items: center; gap: 4px; padding: 4px 8px 8px; font-size: 11px; font-weight: 400; }
.fmeta .muted { margin-right: auto; }
.drop { border: 2px dashed var(--line); border-radius: 8px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 14px; cursor: pointer; min-height: 120px; color: var(--muted); font-weight: 500; position: relative; }
.drop:hover, .drop.over { border-color: var(--accent); color: var(--fg); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.picked { font-size: 11px; color: var(--accent); margin-top: 6px; word-break: break-all; }
.activity summary { cursor: pointer; font-weight: 600; }
.activity { margin-top: 16px; }
.act { font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }

/* admin */
.status-row { display: grid; grid-template-columns: 38px 1fr 56px auto auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.status-row.new { grid-template-columns: 38px 1fr auto auto; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.status-row input { padding: 5px 7px; }
.status-row .num { padding: 5px 4px; }
.status-del { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; background: #fef2f2; padding: 8px; border-radius: 8px; margin-bottom: 8px; }
.status-del select { width: auto; }
.pwbox { margin-bottom: 16px; border-color: var(--accent); }
.pwbox code { font-size: 16px; background: var(--soft); padding: 3px 8px; border-radius: 6px; margin: 0 6px; }

/* login */
.login-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #134e4a 0, #0b1220 60%); }
.login { background: var(--panel); padding: 28px; border-radius: 14px; width: min(380px, calc(100% - 32px)); box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }

/* responsive */
@media (max-width: 1100px) {
  .grid3 { grid-template-columns: 1fr 1fr; }
  .grid-side, .item-grid { grid-template-columns: 1fr; }
  .item-side { position: static; }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .burger { display: inline-block; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 10px; margin-bottom: 10px; font-size: 16px; color: var(--fg); }
  .main { padding: 14px 16px 50px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .cal-day { min-height: 70px; }
  .chip span, .chip em, .chip .mtag { display: none; }
  .day-row { grid-template-columns: 18px 40px 1fr auto; }
  .day-row .what, .day-row .muted { display: none; }
}

/* 0.2.0 */
.mb { margin-bottom: 16px; }
.cbadge { font-size: 11px; font-weight: 700; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 99px; padding: 0 7px; white-space: nowrap; }
.badges { display: inline-flex; gap: 6px; align-items: center; }
.day-row { grid-template-columns: 18px 42px 130px 1fr auto auto; }
.rowlinks { display: flex; gap: 10px; font-size: 12px; margin-top: 3px; flex-wrap: wrap; }
.qdone-row { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; padding: 3px 0; }
.qdone-row a { display: inline; padding: 0; }
.acc-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px;
  background: color-mix(in srgb, var(--c) 10%, var(--panel)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); border-left: 5px solid var(--c); }
.draft-box { background: var(--soft); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.draft-box .inline { display: flex; gap: 8px; }
.draft-box input { font-weight: 400; font-size: 14px; }
.item-side hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.item-side h3 { margin-bottom: 8px; }
.comments { margin-top: 18px; max-width: calc(100% - 318px); }
.comments h2 { margin-bottom: 12px; }
.comment { border: 1px solid var(--line); border-left: 4px solid #f59e0b; border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; }
.comment.resolved { border-left-color: #16a34a; opacity: .65; }
.c-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.c-tools { margin-left: auto; display: flex; gap: 4px; }
.c-body { white-space: pre-wrap; margin-top: 4px; }
.c-form { margin-top: 12px; }
.c-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.c-actions select { width: auto; }
.hint { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; padding: 10px 14px; }
.wide-side { grid-template-columns: 1fr 400px; }
.proj-access { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 0 0 8px; }
.proj-mods { display: flex; flex-direction: column; gap: 3px; padding: 6px 0 0 22px; }
.proj-mods.off { display: none; }
.acc-pick { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
a.pill:hover { text-decoration: none; filter: brightness(.95); }
a.stat-h { color: var(--fg); }
@media (prefers-color-scheme: dark) { .cbadge { background: #2d1f05; border-color: #78350f; color: #fcd34d; } }
@media (max-width: 1100px) { .comments { max-width: none; } .wide-side { grid-template-columns: 1fr; } }
