[hidden] { display: none !important; }
:root {
  --bg: #000;
  --raise: #0f0f0f;
  --raise-2: #181818;
  --line: #262626;
  --line-2: #3a3a3a;
  --fg: #fff;
  --mute: #8e8e8e;
  --dim: #5c5c5c;
  --red: #ff4d4f;
  --red-bg: #2a0b0c;
  --font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --max: 1080px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-variation-settings: 'wdth' 100; font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wide { font-variation-settings: 'wdth' 125; font-weight: 800; text-transform: uppercase; letter-spacing: .01em; line-height: .95; }
.mute { color: var(--mute); }
.red { color: var(--red); }

/* ---------- top bar ---------- */
.bar { border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; background: var(--bg); }
.bar-in { max-width: var(--max); margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 28px; height: 60px; }
.mark { font-size: 19px; text-decoration: none; white-space: nowrap; }
.mark span { font-variation-settings: 'wdth' 75; font-weight: 400; color: var(--mute); margin-left: 5px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { text-decoration: none; padding: 6px 10px; font-size: 15px; color: var(--mute); white-space: nowrap; }
.nav a:hover { color: var(--fg); }
.nav a[aria-current] { color: var(--fg); }
.me-link { font-size: 14px; color: var(--mute); text-decoration: none; }
.me-link:hover { color: var(--fg); }
.tabbar { display: none; }

main { max-width: var(--max); margin: 0 auto; padding: 40px 20px 120px; }

@media (max-width: 760px) {
  .nav, .me-link { display: none; }
  .bar-in { height: 52px; }
  main { padding: 24px 16px 120px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { text-decoration: none; color: var(--mute); font-size: 11px; display: grid; justify-items: center; gap: 3px; padding: 9px 0 8px; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current] { color: var(--fg); }
}

/* ---------- page headers ---------- */
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 28px; }
.page-h h1 { margin: 0; font-size: clamp(30px, 5.5vw, 52px); }
.page-h p { margin: 8px 0 0; color: var(--mute); max-width: 60ch; }
.crumb { font-size: 14px; color: var(--mute); text-decoration: none; display: inline-block; margin-bottom: 10px; }
.crumb:hover { color: var(--fg); }
h2.sec { font-size: 14px; font-weight: 600; color: var(--mute); margin: 36px 0 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
h2.sec .n { font-weight: 400; }

/* ---------- buttons ---------- */
.btn { background: var(--fg); color: var(--bg); border: 1px solid var(--fg); padding: 10px 18px; cursor: pointer; font-weight: 600; font-size: 15px; white-space: nowrap; border-radius: 0; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn:hover { background: #d9d9d9; border-color: #d9d9d9; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--fg); background: transparent; }
.btn.sm { padding: 6px 12px; font-size: 14px; }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn svg { width: 16px; height: 16px; }
.link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; font-size: inherit; }
.link:hover { text-decoration-color: var(--fg); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chipset { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: transparent; border: 1px solid var(--line-2); color: var(--mute); padding: 4px 10px; font-size: 13px; cursor: pointer; }
.chip:hover { color: var(--fg); border-color: var(--fg); }
.chip[aria-pressed=true] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ---------- dashboard ---------- */
.hello { margin: 0 0 32px; }
.hello h1 { font-size: clamp(34px, 7vw, 68px); margin: 0; }
.hello p { margin: 10px 0 0; color: var(--mute); }
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--raise); border: 1px solid var(--line); padding: 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; text-decoration: none; }
a.tile:hover { border-color: var(--line-2); }
.tile h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--mute); display: flex; justify-content: space-between; gap: 8px; }
.tile .big { font-size: 40px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tile .sub { color: var(--mute); font-size: 14px; }
.tile .foot { margin-top: auto; padding-top: 6px; }
.t-day { grid-column: span 4; }
.t-att { grid-column: span 2; }
.t-third { grid-column: span 2; }
.t-team { grid-column: span 6; }
@media (max-width: 900px) { .t-day, .t-att { grid-column: span 6; } .t-third { grid-column: span 3; } }
@media (max-width: 560px) { .t-third { grid-column: span 6; } .tile { padding: 18px; } }
.next-up { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 4px; }
.next-up .lbl { font-size: 13px; color: var(--mute); }
.next-up .ttl { font-size: 20px; font-weight: 600; }
.att-item { display: flex; gap: 10px; text-decoration: none; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.att-item:last-child { border-bottom: 0; }
.dot { width: 8px; height: 8px; background: var(--mute); flex: 0 0 8px; margin-top: 8px; }
.dot.red { background: var(--red); }
.proj-mini { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.proj-mini:last-child { border-bottom: 0; }
.proj-mini .row { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.team-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; }
.team-row div { display: grid; gap: 6px; }

/* ---------- bars ---------- */
.meter { height: 4px; background: var(--line); position: relative; }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--fg); transition: width .4s; }
.meter i.over { background: var(--red); }
.meter.thick { height: 8px; }

/* ---------- my day ---------- */
.day-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.day-head h1 { margin: 0; font-size: clamp(30px, 6vw, 56px); }
.daynav { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.daynav button { background: none; border: 1px solid var(--line-2); color: var(--fg); width: 34px; height: 34px; cursor: pointer; display: grid; place-items: center; }
.daynav button:hover { border-color: var(--fg); }
.daynav button svg { width: 16px; height: 16px; }
.daynav span { color: var(--mute); padding: 0 8px; font-size: 15px; }
.cap { display: grid; gap: 10px; margin: 0 0 8px; }
.cap-line { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 15px; }
.notice { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); padding: 12px 16px; margin-top: 18px; font-size: 15px; }
.notice.red { border-color: #5c1a1c; background: var(--red-bg); }

.block-h { display: flex; justify-content: space-between; align-items: baseline; margin: 34px 0 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.block-h h2 { margin: 0; font-size: 18px; font-weight: 600; }
.block-h span { color: var(--mute); font-size: 14px; }
.block.drop-over .block-h { border-bottom-color: var(--fg); }
.plan { list-style: none; margin: 0; padding: 0; min-height: 12px; }
.plan .empty { padding: 14px 0; font-size: 15px; }
.prow { border-bottom: 1px solid var(--line); }
.prow.dragging { opacity: .35; }
.prow.drop-before { box-shadow: inset 0 2px 0 var(--fg); }
.prow-main { display: grid; grid-template-columns: 18px 26px 54px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 0; }
.grip { color: var(--dim); cursor: grab; display: grid; place-items: center; }
.grip svg { width: 14px; height: 14px; }
.chk { width: 24px; height: 24px; border: 1.5px solid var(--line-2); background: transparent; cursor: pointer; display: grid; place-items: center; padding: 0; }
.chk:hover { border-color: var(--fg); }
.chk svg { width: 14px; height: 14px; opacity: 0; stroke: var(--bg); }
.done .chk { background: var(--fg); border-color: var(--fg); }
.done .chk svg { opacity: 1; }
.done .p-title { color: var(--dim); text-decoration: line-through; text-decoration-color: var(--dim); }
.done .p-time, .done .est { color: var(--dim); }
.p-time { font-size: 14px; color: var(--mute); font-variant-numeric: tabular-nums; }
.p-title { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-size: 17px; line-height: 1.35; width: 100%; color: var(--fg); }
.p-meta { font-size: 13px; color: var(--mute); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.p-meta .late { color: var(--red); }
.est { font-size: 14px; color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.est.none { color: var(--dim); }
.p-more { padding: 2px 0 20px 110px; display: grid; gap: 16px; }
.p-more .howto { color: #cfcfcf; white-space: pre-wrap; font-size: 15px; margin: 0; border-left: 2px solid var(--line-2); padding-left: 14px; }
.p-more .lbl { font-size: 13px; color: var(--mute); margin-bottom: 6px; }
@media (max-width: 640px) {
  .prow-main { grid-template-columns: 26px minmax(0, 1fr) auto; gap: 4px 12px; }
  .grip { display: none; }
  .prow-main .chk { grid-row: span 2; align-self: start; margin-top: 2px; }
  .p-time { grid-column: 2; grid-row: 1; font-size: 13px; }
  .prow-main > div:nth-of-type(2) { grid-column: 2; grid-row: 2; }
  .prow-main .est { grid-column: 3; grid-row: 1 / span 2; }
  .p-more { padding-left: 38px; }
}
.empty { padding: 20px 0; color: var(--mute); }
.add-row { display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap; }

/* ---------- focus ---------- */
.focus { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; max-width: 820px; margin: 0 auto; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
.focus-top { display: flex; justify-content: space-between; align-items: center; color: var(--mute); font-size: 15px; }
.focus-top a { color: var(--mute); }
.focus-body { display: grid; align-content: center; gap: 22px; padding: 40px 0; }
.focus-body .ttl { font-size: clamp(34px, 7vw, 72px); margin: 0; }
.focus-body .howto { color: #cfcfcf; white-space: pre-wrap; max-width: 60ch; margin: 0; font-size: 17px; }
.timer { font-size: clamp(56px, 12vw, 120px); font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1; }
.timer.over { color: var(--red); }
.focus-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.focus-actions .btn { padding: 14px 24px; font-size: 16px; }
.focus-next { border-top: 1px solid var(--line); padding-top: 16px; color: var(--mute); font-size: 15px; }

/* ---------- generic lists, tables ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.trow { border-bottom: 1px solid var(--line); }
.trow-main { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 13px 0; }
.trow .chk { margin-top: 1px; }
.trow .t-title { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-size: 16px; color: var(--fg); }
.who { font-size: 12px; color: var(--mute); border: 1px solid var(--line-2); padding: 1px 7px; white-space: nowrap; align-self: center; }
.tl-week { font-size: 13px; color: var(--mute); padding: 22px 0 4px; }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-weight: 500; font-size: 13px; color: var(--mute); padding: 12px 12px 10px 0; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
td { padding: 13px 12px 13px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--raise); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border: 1px solid var(--line-2); color: var(--mute); white-space: nowrap; }
.badge.now { background: var(--red); border-color: var(--red); color: #000; }
.badge.soon { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.stock-in { width: 76px; background: transparent; border: 1px solid var(--line-2); padding: 5px 8px; text-align: right; }
.stock-in:focus { border-color: var(--fg); outline: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.filters select, .filters input { background: var(--bg); border: 1px solid var(--line-2); padding: 8px 10px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--raise); border: 1px solid var(--line); padding: 18px; }
.stat .v { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 14px; color: var(--mute); }
.spark { width: 100%; height: 56px; display: block; }

/* projects */
.proj { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.proj:hover .nm { text-decoration: underline; text-underline-offset: 4px; }
.proj .nm { font-size: 20px; font-weight: 600; }
.proj .side { display: grid; gap: 8px; text-align: right; font-size: 14px; color: var(--mute); }
@media (max-width: 640px) { .proj { grid-template-columns: 1fr; gap: 10px; } .proj .side { text-align: left; } }

/* routines */
.rh { display: grid; grid-template-columns: minmax(0, 1fr) 190px 60px 60px; gap: 14px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.rh .when, .rh .est { font-size: 14px; color: var(--mute); }
.rh .t-title { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-size: 16px; color: var(--fg); }
@media (max-width: 640px) { .rh { grid-template-columns: 1fr auto; } .rh .when { grid-column: 1; } .rh .est { display: none; } }

/* more */
.more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.more-grid a { background: var(--raise); border: 1px solid var(--line); padding: 22px; text-decoration: none; display: grid; gap: 6px; }
.more-grid a:hover { border-color: var(--line-2); }
.more-grid b { font-size: 18px; font-weight: 600; }
.more-grid span { color: var(--mute); font-size: 14px; }

/* settings */
.blocks-ed { display: grid; gap: 8px; margin-top: 12px; max-width: 520px; }
.blocks-ed .b { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 8px; }
.hours-ed { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 12px; max-width: 620px; }
.hours-ed label { display: grid; gap: 4px; font-size: 13px; color: var(--mute); }
@media (max-width: 560px) { .hours-ed { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
input.in, select.in { background: var(--bg); border: 1px solid var(--line-2); padding: 9px 10px; width: 100%; }
input.in:focus, select.in:focus { border-color: var(--fg); outline: none; }
.set-sec { max-width: 680px; }
.set-sec p { color: var(--mute); margin: 10px 0 0; }

/* ---------- dialog ---------- */
dialog { background: var(--raise); color: var(--fg); border: 1px solid var(--line-2); padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(0, 0, 0, .75); }
.dlg-h { padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.dlg-h h2 { margin: 0; font-size: 18px; font-weight: 600; }
.dlg-h button { background: none; border: 0; color: var(--mute); font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.dlg-h button:hover { color: var(--fg); }
.dlg-b { padding: 20px; display: grid; gap: 16px; }
.fld { display: grid; gap: 6px; }
.fld label { font-size: 14px; color: var(--mute); }
.fld .hint { font-size: 13px; color: var(--dim); }
.fld input, .fld select, .fld textarea { background: var(--bg); border: 1px solid var(--line-2); padding: 10px 11px; width: 100%; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--fg); outline: none; }
.fld textarea { min-height: 90px; resize: vertical; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .fld-row { grid-template-columns: 1fr; } }
.dlg-f { display: flex; justify-content: space-between; gap: 8px; padding: 0 20px 20px; flex-wrap: wrap; }
.err { color: var(--red); font-size: 14px; min-height: 1em; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); padding: 0 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; color: var(--mute); padding: 12px 12px; cursor: pointer; font-size: 15px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--fg); border-bottom-color: var(--fg); }
.pull-list { list-style: none; margin: 0; padding: 0 20px 20px; max-height: 55vh; overflow-y: auto; }
.pull-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pull-list .meta { font-size: 13px; color: var(--mute); }
.pull-list .meta .late { color: var(--red); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.2fr 1fr; }
.login-art { padding: 48px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); }
.login-art .big { font-size: clamp(64px, 12vw, 176px); }
.login-art p { max-width: 32ch; color: var(--mute); margin: 0; }
.login-form { padding: 48px; display: flex; align-items: center; }
.login-form form { width: 100%; max-width: 360px; display: grid; gap: 16px; }
.login-form h1 { font-size: 22px; margin: 0 0 4px; font-weight: 600; }
@media (max-width: 760px) { .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } .login-art { border-right: 0; border-bottom: 1px solid var(--line); padding: 32px 24px; gap: 40px; } .login-form { padding: 32px 24px; align-items: start; } }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); background: var(--fg); color: var(--bg); padding: 11px 18px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; display: flex; gap: 16px; align-items: center; max-width: calc(100vw - 32px); }
#toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { background: none; border: 0; color: var(--bg); text-decoration: underline; cursor: pointer; padding: 0; font-weight: 600; }
@media (max-width: 760px) { #toast { bottom: 84px; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
