*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #F7F7F5; --ink: #111110; --mid: #72716C; --rule: #CCCAC4;
  --fill: #FFFFFF; --fill-2: #EFEEEA; --shade: rgba(17,17,16,.32);
  --red: #C2402E; --green: #3E7B4F; --accent: #235aa0;
  --face: 'neue-haas-grotesk-display', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --doto: 'Doto', var(--face);
  --pad: 30px; --bar: 70px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121211; --ink: #ECEBE6; --mid: #8E8D88; --rule: #2E2D2A;
  --fill: #1C1C1A; --fill-2: #242422; --shade: rgba(0,0,0,.55);
  --red: #E0624F; --green: #6FB081;
  color-scheme: dark;
}
html, body { background: var(--bg); color: var(--ink); }
body { font-family: var(--face); font-size: 13px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }
img, video { display: block; max-width: 100%; }
::selection { background: var(--ink); color: var(--bg); }
html.sc-fade, html.sc-fade *, html.sc-fade *::before, html.sc-fade *::after {
  transition: background-color 1.5s ease, color 1.5s ease, border-color 1.5s ease, fill 1.5s ease, stroke 1.5s ease !important;
}

/* ── Type roles, as on samcedar.com ──
   Label  Doto 13px uppercase grey: page and section labels, kickers, counts
   Meta   Doto 11px uppercase grey: small data inside components
   Link   the site face 11px uppercase wide: anything you click */
.label { font-family: var(--doto); font-weight: 900; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--mid); }
.meta { font-family: var(--doto); font-weight: 900; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--mid); }
.link { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }

/* ── Top bar ── */
.top-bar {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 26px var(--pad); border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.top-left { display: flex; align-items: center; gap: 30px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.top-left .studio-tag { font-family: var(--doto); font-weight: 900; font-size: 13px; letter-spacing: .06em; color: var(--mid); }
.clock { font-family: var(--doto); font-weight: 900; font-size: 13px; letter-spacing: .2em; font-variant-numeric: tabular-nums; user-select: none; text-align: center; }
.top-nav { display: flex; justify-content: flex-end; align-items: center; gap: 30px; list-style: none; }
.top-nav a, .top-nav button.navlink { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; position: relative; padding-bottom: 2px; }
.top-nav a::after, .top-nav button.navlink::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 1px; background: var(--ink); transition: width .22s ease; }
.top-nav a:hover::after, .top-nav a.active::after, .top-nav button.navlink:hover::after { width: 100%; }

.theme-toggle { color: var(--mid); display: inline-flex; position: relative; top: -1px; }
.theme-toggle svg { width: 36px; height: 18px; display: block; overflow: visible; }
.theme-toggle .track { fill: none; stroke: currentColor; stroke-width: .75; }
.theme-toggle .knob { fill: currentColor; transition: transform .28s cubic-bezier(.2,.7,.2,1); }
:root[data-theme="dark"] .theme-toggle .knob { transform: translateX(18px); }
.theme-toggle .icon { fill: none; stroke: currentColor; stroke-width: .75; stroke-linecap: round; stroke-linejoin: round; transition: stroke .28s; }
:root:not([data-theme="dark"]) .theme-toggle .sun, :root[data-theme="dark"] .theme-toggle .moon { stroke: var(--bg); }

.top-nav .acct-av { display: none; width: 22px; height: 22px; font-size: 9px; border: 0; }
.timer-pill {
  display: inline-flex; align-items: center; gap: 10px; height: 28px; padding: 0 6px 0 12px;
  border: 1px solid var(--ink); border-radius: 999px; max-width: 280px;
}
.timer-pill .t { font-family: var(--doto); font-weight: 900; font-size: 12px; letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.timer-pill .what { font-size: 11px; color: var(--mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.timer-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); animation: blink 1.6s infinite; }
.timer-pill button { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); position: relative; flex: none; }
.timer-pill button::after { content: ''; position: absolute; inset: 6px; background: var(--bg); border-radius: 1px; }
@keyframes blink { 50% { opacity: .25; } }

/* ── Bars under the header (70px, centred content, as the site's full-width bars) ── */
.page-header {
  min-height: var(--bar); padding: 0 var(--pad); border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.page-header .left, .page-header .right { display: flex; align-items: center; gap: 18px; min-width: 0; }
.crumbs { display: flex; gap: 10px; align-items: center; min-width: 0; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { opacity: .5; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: var(--bg); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  height: 40px; padding: 0 22px; border-radius: 999px; white-space: nowrap; transition: opacity .2s;
}
.btn:hover { opacity: .85; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.ghost { background: none; color: var(--ink); border: 1px solid var(--rule); }
.btn.ghost:hover { border-color: var(--ink); opacity: 1; }
.btn.small { height: 30px; padding: 0 14px; font-size: 10px; }
.btn.danger { background: none; color: var(--red); border: 1px solid currentColor; }
.btn.accent { background: var(--accent); color: #fff; }
.quiet { color: var(--mid); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; transition: color .2s; }
.quiet:hover { color: var(--ink); }
.icon-btn { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--mid); transition: background .2s, color .2s; }
.icon-btn:hover { background: var(--fill-2); color: var(--ink); }
.icon-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.2; stroke-linecap: round; }

/* ── Fields ── */
.field { display: grid; gap: 8px; }
.field > span { font-family: var(--doto); font-weight: 900; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--mid); }
.input, .textarea, .select {
  width: 100%; background: var(--fill); border: 1px solid var(--rule); border-radius: 10px;
  padding: 11px 14px; font-size: 13px; outline: none; transition: border-color .2s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--ink); }
.textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check input { appearance: none; width: 16px; height: 16px; border: 1px solid var(--mid); border-radius: 4px; display: grid; place-items: center; flex: none; cursor: pointer; }
.check input:checked { background: var(--ink); border-color: var(--ink); }
.check input:checked::after { content: ''; width: 8px; height: 4px; border: solid var(--bg); border-width: 0 0 1.5px 1.5px; transform: translateY(-1px) rotate(-45deg); }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.check .switch input, .switch input { appearance: none; position: absolute; inset: 0; width: auto; height: auto; display: block; border: 1px solid var(--mid); border-radius: 999px; cursor: pointer; transition: background .2s, border-color .2s; }
.switch input:checked { background: var(--ink); border-color: var(--ink); }
.check .switch input::after { content: none; }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--mid); transition: transform .22s cubic-bezier(.2,.7,.2,1), background .2s; pointer-events: none; }
.switch:has(input:checked)::after { transform: translateX(16px); background: var(--bg); }

main { padding: 44px var(--pad) 80px; }

/* ── Sign in ── */
.signin { min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 40px var(--pad); }
.signin .box { width: 100%; max-width: 420px; display: grid; gap: 22px; }
.signin .lede { font-size: 20px; line-height: 1.45; letter-spacing: -.005em; }
.signin p.body { font-size: 13px; line-height: 1.75; color: var(--mid); }
.signin form { display: grid; gap: 12px; }

/* ── Projects home ── */
.section-label { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 18px; }
.section-label + .grid { margin-bottom: 56px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 220px;
  border-radius: 18px; overflow: hidden; background: var(--fill); border: 1px solid var(--rule);
  transition: transform .3s cubic-bezier(.2,.7,.2,1), border-color .2s; isolation: isolate;
}
.tile:hover { transform: translateY(-2px); border-color: var(--ink); }
.tile .art { position: absolute; inset: 0; z-index: -1; background: var(--accent); }
.tile .art img, .tile .art video { width: 100%; height: 100%; object-fit: cover; }
.tile .art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0) 70%); }
.tile .body { padding: 20px 22px; color: #fff; display: grid; gap: 6px; }
.tile .kicker { font-family: var(--doto); font-weight: 900; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.tile h3 { font-size: 22px; font-weight: 500; letter-spacing: -.01em; line-height: 1.15; }
.tile .stats { font-family: var(--doto); font-weight: 900; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; display: flex; gap: 14px; flex-wrap: wrap; }
.tile .badges { position: absolute; top: 16px; left: 18px; right: 18px; display: flex; justify-content: space-between; align-items: center; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 999px; font-family: var(--doto); font-weight: 900; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; background: rgba(255,255,255,.18); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.tile.new { border-style: dashed; background: none; align-items: center; justify-content: center; color: var(--mid); }
.tile.new:hover { color: var(--ink); }
.tile.new span { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.avatars { display: flex; }
.av {
  width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 10px; font-weight: 600; letter-spacing: 0; color: #fff; background: var(--mid); border: 1.5px solid var(--fill);
}
.avatars .av + .av { margin-left: -6px; }
.empty { border: 1px dashed var(--rule); border-radius: 18px; padding: 48px 30px; text-align: center; color: var(--mid); display: grid; gap: 16px; justify-items: center; }
.empty .lede { font-size: 17px; color: var(--ink); }

/* ── Project view ── */
body.has-bg { background: transparent; }
.project-bg { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
.project-bg img, .project-bg video { width: 100%; height: 100%; object-fit: cover; }
.project-bg .wash { position: absolute; inset: 0; background: var(--bg); }
body.has-bg .page-header { border-bottom-color: transparent; background: color-mix(in srgb, var(--bg) 78%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
body.has-bg .top-bar { border-bottom-color: transparent; }
.board-tabs { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.board-tabs::-webkit-scrollbar { display: none; }
.board-tab { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 999px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--mid); white-space: nowrap; border: 1px solid transparent; }
.board-tab:hover { color: var(--ink); }
.board-tab.on { color: var(--ink); border-color: var(--ink); }
.hours-chip { font-family: var(--doto); font-weight: 900; font-size: 12px; letter-spacing: .08em; }

.board { display: flex; gap: 16px; align-items: flex-start; overflow-x: auto; padding: 28px var(--pad) 40px; min-height: calc(100vh - 200px); scroll-snap-type: x proximity; scroll-padding: 0 var(--pad); }
.board::after { content: ''; flex: 0 0 1px; }
.list {
  flex: 0 0 290px; max-height: calc(100vh - 250px); display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--fill-2) 92%, transparent); border-radius: 16px; scroll-snap-align: start;
}
body.has-bg .list { background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 12px 10px 16px; cursor: grab; }
.list-head .name { font-family: var(--doto); font-weight: 900; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); outline: none; border-radius: 4px; flex: 1; min-width: 0; }
.list-head .name[contenteditable="true"]:focus { box-shadow: 0 0 0 1px var(--ink); padding: 0 4px; }
.list-head .count { color: var(--mid); }
.cards { flex: 1; overflow-y: auto; padding: 2px 10px 6px; display: grid; gap: 8px; align-content: start; min-height: 12px; }
.card {
  background: var(--fill); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: grid; gap: 8px;
  box-shadow: 0 1px 0 var(--rule); border: 1px solid transparent; transition: border-color .15s;
  user-select: none; -webkit-user-select: none;
}
.card:hover { border-color: var(--mid); }
.card.done .title { color: var(--mid); text-decoration: line-through; text-decoration-thickness: 1px; }
.card .cover { margin: -12px -14px 0; border-radius: 12px 12px 0 0; overflow: hidden; aspect-ratio: 16 / 10; background: var(--fill-2); }
.card .cover img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.card .title { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.card .labels { display: flex; gap: 4px; flex-wrap: wrap; }
.card .labels i { height: 6px; width: 32px; border-radius: 3px; }
.card .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card .row .meta { display: inline-flex; align-items: center; gap: 4px; }
.card .row svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 1.3; }
.card .row .avatars { margin-left: auto; }
.due.overdue { color: var(--red); }
.due.soon { color: var(--ink); }
.due.done { color: var(--green); }
.card.sortable-ghost { opacity: .35; }
.card.sortable-drag, .card.sortable-fallback { transform: rotate(2deg); box-shadow: 0 18px 40px rgba(0,0,0,.18); }
.add-card { padding: 4px 10px 12px; }
.add-card button.open { width: 100%; text-align: left; padding: 9px 8px; border-radius: 10px; color: var(--mid); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.add-card button.open:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.add-card form { display: grid; gap: 8px; }
.add-card textarea { min-height: 64px; border-radius: 12px; }
.add-card .row { display: flex; gap: 8px; align-items: center; }
.list.add { background: none; border: 1px dashed var(--rule); padding: 12px; cursor: default; }
body.has-bg .list.add { background: color-mix(in srgb, var(--bg) 60%, transparent); }

/* ── Modal and card detail ── */
.shade { position: fixed; inset: 0; z-index: 50; background: var(--shade); display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; padding: 60px 20px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; width: 100%; max-width: 860px; background: var(--bg); border-radius: 20px; animation: rise .28s cubic-bezier(.2,.7,.2,1); }
.modal.narrow { max-width: 520px; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.modal .close { position: absolute; top: 18px; right: 18px; z-index: 2; }
.modal-cover { border-radius: 20px 20px 0 0; overflow: hidden; max-height: 280px; background: var(--fill-2); }
.modal-cover img { width: 100%; max-height: 280px; object-fit: cover; }
.modal-head { padding: 30px 34px 0; display: grid; gap: 8px; }
.modal-head .title { font-size: 24px; font-weight: 500; letter-spacing: -.01em; line-height: 1.2; width: 100%; background: none; border: 0; outline: none; resize: none; overflow: hidden; border-radius: 8px; padding: 2px 0; }
.modal-head .title:focus { box-shadow: 0 0 0 1px var(--ink); padding: 2px 8px; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 36px; padding: 26px 34px 34px; }
.detail section + section { margin-top: 34px; }
.detail h4 { font-family: var(--doto); font-weight: 900; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--mid); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; font-weight: 900; }
.side { display: grid; gap: 22px; align-content: start; }
.side .field > span { margin-bottom: 0; }
.desc-view { font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; min-height: 24px; }
.desc-view.placeholder { color: var(--mid); }
.desc-view a { text-decoration: underline; text-underline-offset: 2px; }
.checklist { display: grid; gap: 4px; }
.checklist .item { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; }
.checklist .item .text { flex: 1; font-size: 14px; outline: none; overflow-wrap: anywhere; }
.checklist .item.done .text { color: var(--mid); text-decoration: line-through; }
.checklist .item .icon-btn { opacity: 0; width: 22px; height: 22px; }
.checklist .item:hover .icon-btn { opacity: 1; }
.progress { height: 3px; background: var(--rule); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.progress i { display: block; height: 100%; background: var(--ink); transition: width .3s; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.file { position: relative; border-radius: 12px; overflow: hidden; background: var(--fill); border: 1px solid var(--rule); display: flex; flex-direction: column; }
.file .thumb { aspect-ratio: 4 / 3; background: var(--fill-2); display: grid; place-items: center; overflow: hidden; cursor: zoom-in; position: relative; }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; pointer-events: none; }
.file .thumb .ext { font-family: var(--doto); font-weight: 900; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; color: var(--mid); }
.file .info { padding: 8px 10px; display: grid; gap: 2px; }
.file .name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .acts { display: flex; gap: 10px; flex-wrap: wrap; }
.file .acts button, .file .acts a { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mid); }
.file .acts button:hover, .file .acts a:hover { color: var(--ink); }
.file .lock { position: absolute; top: 8px; right: 8px; }
.dropzone { border: 1px dashed var(--rule); border-radius: 12px; padding: 18px; text-align: center; color: var(--mid); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; transition: border-color .2s, color .2s; }
.dropzone:hover, .dropzone.over { border-color: var(--ink); color: var(--ink); }
.uploading { display: grid; gap: 6px; margin-top: 10px; }
.uploading .bar { height: 3px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.uploading .bar i { display: block; height: 100%; background: var(--ink); width: 0; transition: width .2s; }
.proof-box { border: 1px solid var(--rule); border-radius: 16px; padding: 20px; display: grid; gap: 16px; background: var(--fill); }
.proof-box .status { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.proof-box .lede { font-size: 15px; }
.proof-box .controls { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.proof-box .controls .field { width: 140px; }
.comments { display: grid; gap: 18px; }
.comment { display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.comment .av { width: 28px; height: 28px; font-size: 11px; }
.comment .who { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.comment .who b { font-weight: 500; font-size: 13px; }
.comment .text { font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment .del { opacity: 0; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mid); }
.comment:hover .del { opacity: 1; }
.composer { display: grid; gap: 10px; margin-top: 6px; }
.composer .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--rule); font-size: 12px; cursor: pointer; }
.chip.on { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.chip i { width: 8px; height: 8px; border-radius: 50%; }
.label-chip { color: #fff; border: 0; font-size: 11px; }
.side .time-total { font-family: var(--doto); font-weight: 900; font-size: 18px; letter-spacing: .06em; }
.time-list { display: grid; gap: 4px; max-height: 160px; overflow-y: auto; }
.time-list div { display: flex; justify-content: space-between; color: var(--mid); font-size: 12px; }

/* ── Lightbox for proofs ── */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(10,10,9,.92); display: grid; grid-template-rows: auto 1fr auto; color: #ECEBE6; animation: fade .2s; }
.lightbox .top { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; }
.lightbox .stage { display: grid; place-items: center; min-height: 0; padding: 0 70px; position: relative; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #ECEBE6; border: 1px solid rgba(255,255,255,.25); }
.lightbox .nav:hover { border-color: #fff; }
.lightbox .nav svg, .lightbox .top svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.3; stroke-linecap: round; }
.lightbox .nav.prev { left: 16px; } .lightbox .nav.next { right: 16px; }
.lightbox .bottom { padding: 16px 24px 22px; text-align: center; }
.lightbox .meta { color: rgba(236,235,230,.6); }

/* ── Settings ── */
.settings { padding: 34px; display: grid; gap: 24px; }
.settings h2 { font-size: 22px; font-weight: 500; letter-spacing: -.01em; }
.settings .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; outline: 1px solid var(--rule); outline-offset: -1px; }
.swatch.on { border-color: var(--bg); outline: 2px solid var(--ink); outline-offset: 0; }
.swatches input[type=color] { width: 28px; height: 28px; border: 0; border-radius: 50%; padding: 0; background: none; cursor: pointer; }
.swatches input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.swatches input[type=color]::-webkit-color-swatch { border-radius: 50%; border: 1px solid var(--rule); }
.bg-choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bg-choice { aspect-ratio: 4 / 3; border-radius: 12px; border: 1px solid var(--rule); overflow: hidden; position: relative; display: grid; place-items: center; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mid); background: var(--fill); }
.bg-choice img, .bg-choice video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bg-choice.on { outline: 2px solid var(--ink); outline-offset: 2px; }
.range { width: 100%; accent-color: var(--ink); }
.member-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.member-row .who { flex: 1; min-width: 0; }
.member-row .who b { font-weight: 500; display: block; }
.member-row .who span { color: var(--mid); font-size: 12px; }
.danger-zone { border-top: 1px solid var(--rule); padding-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Calendar ── */
.cal-head { display: flex; align-items: center; gap: 14px; }
.cal-head .month { font-size: 22px; font-weight: 500; letter-spacing: -.01em; min-width: 200px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--rule); border-top: 1px solid var(--rule); }
.cal .dow { padding: 10px 12px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.cal .day { min-height: 128px; padding: 8px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal .day.other { background: color-mix(in srgb, var(--fill-2) 50%, transparent); }
.cal .day.other .n { opacity: .4; }
.cal .day .n { font-family: var(--doto); font-weight: 900; font-size: 12px; letter-spacing: .06em; color: var(--mid); margin-bottom: 2px; }
.cal .day.today .n { color: var(--bg); background: var(--ink); border-radius: 999px; padding: 0 7px; align-self: flex-start; }
.cal-item { display: flex; gap: 6px; align-items: center; font-size: 12px; padding: 3px 6px; border-radius: 6px; background: var(--fill); text-align: left; min-width: 0; }
.cal-item:hover { background: var(--fill-2); }
.cal-item i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.cal-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-item.done span { color: var(--mid); text-decoration: line-through; }
.agenda { display: none; }

/* ── Hours ── */
.hours-top { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 40px; }
.stat { border: 1px solid var(--rule); border-radius: 16px; padding: 18px 20px; display: grid; gap: 6px; background: var(--fill); text-align: left; transition: border-color .2s; }
.stat:hover, .stat.on { border-color: var(--ink); }
.stat .big { font-family: var(--doto); font-weight: 900; font-size: 26px; letter-spacing: .04em; }
.stat .name { font-size: 14px; display: flex; gap: 8px; align-items: center; }
.stat .name i { width: 8px; height: 8px; border-radius: 50%; }
.add-time { display: grid; grid-template-columns: 1.3fr 1.3fr 130px 100px 2fr auto; gap: 10px; align-items: end; margin-bottom: 30px; }
table.entries { width: 100%; border-collapse: collapse; }
table.entries th { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); font-family: var(--doto); font-weight: 900; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--mid); }
table.entries td { padding: 12px; border-bottom: 1px solid var(--rule); font-size: 13px; vertical-align: top; }
table.entries td.num { font-family: var(--doto); font-weight: 900; letter-spacing: .06em; white-space: nowrap; }
table.entries tr:hover td { background: color-mix(in srgb, var(--fill-2) 60%, transparent); }
table.entries .acts { white-space: nowrap; text-align: right; }

/* ── Toasts ── */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-size: 13px; animation: rise .25s; pointer-events: auto; max-width: 90vw; }
.toast.err { background: var(--red); color: #fff; }

.loading { padding: 80px var(--pad); color: var(--mid); text-align: center; }

@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; }
  .add-time { grid-template-columns: 1fr 1fr; }
  .add-time .note { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  :root { --pad: 18px; }
  .top-bar { padding: 18px var(--pad); grid-template-columns: auto 1fr; }
  .clock { display: none; }
  .top-nav { gap: 18px; }
  .top-left { gap: 16px; }
  .top-left .studio-tag, .top-left #toggle-slot { display: none; }
  .top-left { white-space: nowrap; }
  .top-nav { gap: 14px; }
  .top-nav a, .top-nav button.navlink { letter-spacing: .1em; }
  .top-nav .acct-name { display: none; }
  .top-nav .acct-av { display: inline-grid; }
  .crumbs .home, .crumbs .home-sep { display: none; }
  .crumbs { white-space: nowrap; overflow: hidden; }
  .page-header .left { flex-wrap: wrap; }
  main { padding: 24px var(--pad) 60px; }
  .page-header { flex-wrap: wrap; padding: 14px var(--pad); min-height: 0; }
  .shade { padding: 0; align-items: stretch; }
  .modal { border-radius: 0; min-height: 100%; }
  .modal-cover { border-radius: 0; }
  .modal-head { padding: 26px 20px 0; }
  .detail { padding: 22px 20px 30px; }
  .settings { padding: 26px 20px; }
  .settings .row2 { grid-template-columns: 1fr; }
  .bg-choices { grid-template-columns: repeat(2, 1fr); }
  .list { flex-basis: 84vw; max-height: none; }
  .board { scroll-snap-type: x mandatory; min-height: 0; }
  .cal { display: none; }
  .agenda { display: grid; gap: 22px; }
  .agenda .day-group { display: grid; gap: 6px; }
  .agenda .cal-item { padding: 10px 12px; font-size: 14px; }
  .timer-pill .what { display: none; }
  table.entries .card-col, table.entries .note-col { display: none; }
  .lightbox .stage { padding: 0 8px; }
  .lightbox .nav { display: none; }
}

/* ── Shared bits ── */
.hint { color: var(--mid); font-size: 12px; line-height: 1.5; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tile .sub { font-size: 13px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs .here { color: var(--ink); }
.tab-pick { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; padding: 2px; background: var(--fill); }
.seg button { height: 26px; padding: 0 12px; border-radius: 999px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--mid); }
.seg button.on { background: var(--ink); color: var(--bg); }
.tab-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px var(--pad) 0; }
body.has-bg .tab-tools .hint, body.has-bg .tab-tools .meta { color: var(--ink); opacity: .7; }

/* ── Project header: crumbs and tools on top, tabs underneath ── */
.project-head { flex-wrap: wrap; padding-top: 16px; padding-bottom: 0; row-gap: 6px; }
.project-head .tabs { flex-basis: 100%; display: flex; align-items: center; gap: 26px; overflow-x: auto; scrollbar-width: none; margin-top: 2px; }
.project-head .tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: baseline; gap: 8px; padding: 12px 0 13px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mid); white-space: nowrap; transition: color .2s; }
.tab:hover, .tab.on { color: var(--ink); }
.tab::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--ink); transform: scaleX(0); transition: transform .22s ease; transform-origin: left; }
.tab.on::after { transform: scaleX(1); }
.tab .kind:empty { display: none; }
.tab .kind { font-family: var(--doto); font-weight: 900; font-size: 10px; letter-spacing: .06em; color: var(--mid); }
.add-tab { margin-left: -10px; }
.client-crumb:hover { color: var(--ink); }

/* ── Timeline ── */
.tl-scroll { margin: 18px var(--pad) 40px; overflow: auto; border: 1px solid var(--rule); border-radius: 16px; background: var(--bg); max-height: calc(100vh - 270px); }
body.has-bg .tl-scroll { background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.tl-grid { position: relative; min-width: 100%; }
.tl-head, .tl-row { display: flex; }
.tl-head { position: sticky; top: 0; z-index: 3; background: var(--bg); border-bottom: 1px solid var(--rule); }
.tl-label { position: sticky; left: 0; z-index: 2; flex: 0 0 240px; width: 240px; padding: 10px 16px; background: var(--bg); border-right: 1px solid var(--rule); display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
.tl-head .tl-label { z-index: 4; }
.tl-scale { position: relative; height: 52px; }
.tl-months, .tl-ticks { position: absolute; left: 0; }
.tl-months { top: 8px; height: 18px; }
.tl-months span { position: absolute; top: 0; padding-left: 6px; border-left: 1px solid var(--rule); font-family: var(--doto); font-weight: 900; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.tl-ticks { top: 30px; height: 18px; }
.tl-ticks span { position: absolute; top: 0; text-align: center; font-family: var(--doto); font-weight: 900; font-size: 10px; letter-spacing: .04em; color: var(--mid); white-space: nowrap; }
.tl-ticks span.we { opacity: .5; }
.tl-row { border-bottom: 1px solid color-mix(in srgb, var(--rule) 60%, transparent); min-height: 48px; }
.tl-track { position: relative; flex: none; background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(var(--dw) * 7 - 1px), color-mix(in srgb, var(--rule) 70%, transparent) calc(var(--dw) * 7 - 1px), color-mix(in srgb, var(--rule) 70%, transparent) calc(var(--dw) * 7)); }
.tl-name { display: flex; align-items: center; gap: 8px; text-align: left; font-size: 13px; min-width: 0; }
.tl-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-name i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tl-name.done span { color: var(--mid); text-decoration: line-through; }
.tl-bar { position: absolute; top: 9px; height: 30px; border-radius: 8px; color: #fff; display: flex; align-items: center; padding: 0 12px; font-size: 12px; overflow: hidden; white-space: nowrap; box-shadow: 0 1px 0 rgba(0,0,0,.08); touch-action: none; user-select: none; }
.tl-bar span { overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.tl-bar.done { opacity: .45; }
.tl-bar.dragging { box-shadow: 0 10px 24px rgba(0,0,0,.2); z-index: 1; }
.tl-bar .grip { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.tl-bar .grip.l { left: 0; } .tl-bar .grip.r { right: 0; }
.tl-bar .grip::after { content: ''; position: absolute; top: 9px; bottom: 9px; left: 3px; width: 2px; border-radius: 1px; background: rgba(255,255,255,.55); opacity: 0; transition: opacity .15s; }
.tl-bar:hover .grip::after { opacity: 1; }
.tl-bar:not(.dragging) { cursor: grab; }
.tl-row.dues { min-height: 44px; background: color-mix(in srgb, var(--fill-2) 40%, transparent); }
.tl-due { position: absolute; top: 50%; display: flex; align-items: center; gap: 6px; transform: translate(-6px, -50%); font-size: 11px; white-space: nowrap; color: var(--ink); max-width: 200px; }
.tl-due i { width: 10px; height: 10px; background: var(--accent); transform: rotate(45deg); flex: none; border-radius: 1px; }
.tl-due.done i { background: var(--green); }
.tl-due span { overflow: hidden; text-overflow: ellipsis; }
.tl-due:hover { z-index: 2; background: var(--bg); padding-right: 6px; border-radius: 4px; max-width: none; }
.tl-today { position: absolute; top: 30px; bottom: 0; width: 1px; background: var(--red); z-index: 1; pointer-events: none; }
.tl-today::before { content: ''; position: absolute; top: 0; left: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.empty-row .tl-label { min-height: 80px; }

/* ── Mood board ── */
body.mood-active { overflow: hidden; }
.mood-scroll { position: relative; margin: 18px var(--pad) 0; height: calc(100vh - 262px); overflow: auto; border: 1px solid var(--rule); border-radius: 16px;
  background-color: var(--bg); background-image: radial-gradient(color-mix(in srgb, var(--mid) 55%, transparent) 1.2px, transparent 1.4px); background-size: 24px 24px; }
body.has-bg .mood-scroll { background-color: color-mix(in srgb, var(--bg) 80%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.mood-scroll.over { border-color: var(--ink); }
.mood-canvas { position: relative; }
.mood-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 8px; pointer-events: none; }
.mood-empty .lede { font-size: 17px; }
.mi { position: absolute; user-select: none; -webkit-user-select: none; touch-action: none; }
.mi.movable { cursor: grab; }
.mi.dragging { cursor: grabbing; filter: drop-shadow(0 16px 30px rgba(0,0,0,.25)); }
.mi.image img { width: 100%; height: auto; display: block; border-radius: 4px; pointer-events: none; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.mi.note { background: var(--fill); border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 0 0 1px var(--rule); }
.mi .note-text { font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; outline: none; min-height: 1.5em; cursor: inherit; }
.mi .note-text[contenteditable="true"] { cursor: text; user-select: text; -webkit-user-select: text; }
.mi .note-text:empty::before { content: attr(data-empty); color: var(--mid); }
.mi.color { display: grid; gap: 8px; }
.mi .chip-color { aspect-ratio: 4 / 3; border-radius: 8px; box-shadow: 0 0 0 1px var(--rule); }
.mi.color .meta { color: var(--ink); }
.mi-del { position: absolute; top: -10px; right: -10px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; opacity: 0; transition: opacity .15s; z-index: 2; }
.mi-del svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 1.6; fill: none; }
.mi-size { position: absolute; right: -6px; bottom: -6px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 1px solid var(--ink); cursor: nwse-resize; opacity: 0; transition: opacity .15s; }
.mi:hover .mi-del, .mi:hover .mi-size { opacity: 1; }
.color-add { position: relative; overflow: hidden; }
.color-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
@media (hover: none) { .mi-del, .mi-size { opacity: 1; } }

/* ── Notes ── */
.notes { padding: 22px var(--pad) 80px; }
.notes-edit, .notes-view { max-width: 760px; }
.notes-edit { display: block; width: 100%; min-height: 400px; background: var(--fill); border: 1px solid var(--rule); border-radius: 16px; padding: 30px 34px; font-size: 15px; line-height: 1.75; resize: none; outline: none; }
.notes-edit:focus { border-color: var(--ink); }
.notes-view { background: color-mix(in srgb, var(--bg) 88%, transparent); border-radius: 16px; padding: 30px 34px; font-size: 15px; line-height: 1.75; }
.notes-view h2 { font-size: 24px; font-weight: 500; letter-spacing: -.01em; line-height: 1.25; margin: 22px 0 10px; }
.notes-view h3 { font-family: var(--doto); font-weight: 900; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--mid); margin: 26px 0 8px; }
.notes-view > :first-child { margin-top: 0; }
.notes-view p + p { margin-top: 12px; }
.notes-view ul { padding-left: 20px; margin: 8px 0; }
.notes-view a { text-decoration: underline; text-underline-offset: 2px; }

/* ── Calendar and hours additions ── */
.cal-item.phase i { background: none !important; box-shadow: inset 0 0 0 1.5px currentColor; color: var(--mid); }
.stat .proj { font-size: 12px; color: var(--mid); line-height: 1.5; }
.client-name { display: block; font-size: 11px; color: var(--mid); }

@media (max-width: 700px) {
  .project-head .tabs { gap: 20px; }
  .tl-label { flex-basis: 150px; width: 150px; padding: 8px 10px; }
  .tl-scroll, .mood-scroll { margin-left: 0; margin-right: 0; border-radius: 0; border-left: 0; border-right: 0; }
  .mood-scroll { height: calc(100vh - 250px); }
  .notes-edit, .notes-view { padding: 22px 20px; }
}
