:root {
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-head: "Outfit", "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e3e6ea;
  --text: #1f2430;
  --muted: #6b7280;
  --accent: #4f46e5;
  --accent-soft: #eef0ff;
  --danger: #dc2626;
  --success: #16a34a;
  --warn: #d97706;
  --sidebar: #1e2235;
  --sidebar-text: #c7cbe0;
  --shadow: 0 8px 30px rgba(15, 20, 40, .12);
  --radius: 10px;
}
/* Dark theme: follows the device unless the person picked Light or Dark in Personal settings. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12141c;
    --surface: #1a1d28;
    --surface-2: #232736;
    --border: #2e3345;
    --text: #e6e8ef;
    --muted: #9aa1b5;
    --accent: #818cf8;
    --accent-soft: #272b4a;
    --sidebar: #0d0f16;
    --shadow: 0 8px 30px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  --bg: #12141c;
  --surface: #1a1d28;
  --surface-2: #232736;
  --border: #2e3345;
  --text: #e6e8ef;
  --muted: #9aa1b5;
  --accent: #818cf8;
  --accent-soft: #272b4a;
  --sidebar: #0d0f16;
  --shadow: 0 8px 30px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.45 var(--font-body);
  background: var(--bg); color: var(--text);
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
/* Standard fields: 40px tall, 8px corners, 14px text (the task details are the reference). :where() keeps this
   low-priority, so compact controls (table cells, inline editors) can still set their own size. */
input, select, textarea {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; width: 100%; font-size: 14px;
}
:where(input:not([type=checkbox], [type=radio], [type=file], [type=range], [type=color]), select) { height: 40px; }
textarea { padding: 10px 12px; line-height: 1.5; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; min-height: 80px; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }

#app { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar { width: 248px; flex-shrink: 0; transition: width .18s ease; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; padding: 18px 14px; overflow-y: auto; }
.brand { font-weight: 700; font-size: 19px; color: #fff; padding: 2px 8px 24px; display: flex; align-items: center; gap: 12px; min-height: 40px; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #818cf8, #4f46e5); display: grid; place-items: center; font-size: 17px; flex: none; }
.sidebar .brand-logo { width: 36px; height: 36px; border-radius: 0; object-fit: contain; }
.nav { display: grid; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 14px; color: var(--sidebar-text); padding: 0 12px; height: 48px; border-radius: 12px; font-size: 15px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: rgba(129,140,248,.16); color: #fff; }
.nav a.active .nav-icon { color: var(--accent); }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .55; padding: 18px 10px 6px; }
.sidebar-foot { margin-top: auto; }
.nav-icon { width: 24px; height: 24px; display: grid; place-items: center; flex-shrink: 0; color: #a3a9c2; transition: color .15s; }
.nav a:hover .nav-icon { color: #fff; }
.nav-label { white-space: nowrap; overflow: hidden; }
/* Collapse control: a chevron between two hairlines, as in the reference */
.sidebar-toggle { position: relative; margin-top: 12px; width: 100%; height: 36px; border: none; background: transparent; color: var(--sidebar-text); cursor: pointer; display: grid; place-items: center; }
.sidebar-toggle::before { content: ''; position: absolute; left: 8px; right: 8px; top: 50%; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-toggle svg { position: relative; background: var(--sidebar); padding: 0 8px; width: 36px; box-sizing: content-box; }
.sidebar-toggle:hover { color: #fff; }
.sidebar.collapsed { width: 76px; overflow-x: hidden; padding: 18px 10px; }
.sidebar.collapsed .nav-label, .sidebar.collapsed .nav-count { display: none; }
.sidebar.collapsed .brand { justify-content: center; padding: 2px 0 24px; }
.sidebar.collapsed .nav a { justify-content: center; padding: 0; }
.sidebar.collapsed .sidebar-foot { display: none; }
.sidebar.collapsed .sidebar-toggle { margin-top: auto; }

/* Main */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 56px; flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .spacer { flex: 1; }
@keyframes pulse { 50% { opacity: .3; } }
.content { flex: 1; overflow-y: auto; padding: 24px 28px 60px; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.btn { border: 1px solid var(--border); background: var(--surface); padding: 7px 13px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.icon-btn { border: none; background: transparent; cursor: pointer; padding: 4px 6px; border-radius: 6px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--text); border-color: var(--accent); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.seg a { padding: 6px 12px; color: var(--muted); background: var(--surface); }
.seg a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 16px 18px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }

/* Avatars & chips */
.avatar { width: 26px; height: 26px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.avatar.lg { width: 38px; height: 38px; font-size: 14px; }
img.avatar { object-fit: cover; background: var(--surface-2); }
.avatar.xl { width: 84px; height: 84px; font-size: 28px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -6px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.label { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; color: #fff; }
.label.off { background: var(--surface-2) !important; color: var(--muted); }
.due { font-size: 12px; color: var(--muted); white-space: nowrap; }
.due.overdue { color: var(--danger); font-weight: 600; }
.due.today { color: var(--warn); font-weight: 600; }
.task-no { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Project cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.project-card { padding: 16px 18px; cursor: pointer; border-top: 4px solid var(--c); transition: box-shadow .15s; display: flex; flex-direction: column; gap: 10px; }
.project-card:hover { box-shadow: var(--shadow); }
.project-card h3 { margin: 0; font-size: 16px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--success); }

/* Task list view */
.tasklist { margin-bottom: 20px; }
.tasklist-head { display: flex; align-items: center; gap: 8px; padding: 6px 4px; }
.tasklist-head h3 { margin: 0; font-size: 15px; }
.tasklist-body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.task-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--surface-2); }
.task-row .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row.done .title { text-decoration: line-through; color: var(--muted); }
.check { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); background: transparent; cursor: pointer; flex-shrink: 0; display: grid; place-items: center; color: #fff; font-size: 11px; padding: 0; }
.check:hover { border-color: var(--success); }
.check.on { background: var(--success); border-color: var(--success); }
.add-inline { display: flex; gap: 8px; padding: 8px 14px; }
.add-inline input { border-style: dashed; }
.drop-hover { outline: 2px dashed var(--accent); outline-offset: 2px; }
.dragging { opacity: .4; }

/* Board */
.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; }
.column { width: 280px; flex-shrink: 0; background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.column-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px 10px; font-weight: 600; }
.column-head .count { color: var(--muted); font-weight: 400; }
.tcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; display: flex; flex-direction: column; gap: 8px; }
.tcard:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.tcard.done { opacity: .6; }
.tcard.done .ttl { text-decoration: line-through; }
.tcard .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Timeline */

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 14px 16px; }
.stat .v { font-size: 24px; font-weight: 700; }
.stat .k { color: var(--muted); font-size: 12px; }
.hbar { display: grid; grid-template-columns: 180px 1fr 70px; gap: 10px; align-items: center; padding: 6px 0; }
.hbar .track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hbar .track > div { height: 100%; border-radius: 99px; }

.feed-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: none; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; align-items: end; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.field { margin-bottom: 12px; }

/* Drawer */
.overlay { position: fixed; inset: 0; background: rgba(10, 12, 20, .35); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--surface); z-index: 21; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.drawer.anim { animation: slidein .18s ease-out; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 40px; }
.title-input { font-size: 20px; font-weight: 600; border-color: transparent; padding: 6px 8px; margin-left: -8px; }
.title-input:hover { border-color: var(--border); }
.props { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; align-items: center; margin: 14px 0 18px; }
.props > .k { color: var(--muted); font-size: 13px; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 22px 0 8px; }
.subtask { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.subtask.done span { text-decoration: line-through; color: var(--muted); }
.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.comment .bubble { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; flex: 1; white-space: pre-wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips .label { cursor: pointer; }

/* Modal */
.modal { position: fixed; z-index: 31; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 22px; }
.modal h2 { margin: 0 0 16px; font-size: 18px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.token-new { background: var(--surface-2); border-radius: 10px; padding: 12px; margin-bottom: 10px; display: grid; gap: 6px; }
.badge-pending { color: var(--warn); font-weight: 600; }
.token-row { padding: 8px 0; border-top: 1px solid var(--border); }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.overlay.top { z-index: 30; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors label { cursor: pointer; }
.colors input { display: none; }
.colors span { display: block; width: 26px; height: 26px; border-radius: 50%; border: 3px solid transparent; }
.colors input:checked + span { border-color: var(--text); }

.note-editor textarea { min-height: 360px; font-size: 14px; line-height: 1.6; }
.two-col { display: grid; grid-template-columns: 260px 1fr; gap: 18px; }
.list-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.list-item:last-child { border-bottom: none; }
.list-item.active { background: var(--accent-soft); }

@media (max-width: 760px) {
  .sidebar { display: none; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .two-col { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 110px 1fr 56px; }
}

/* Sign-in */
.auth-wrap { flex: 1; display: grid; place-items: center; padding: 24px 16px; overflow-y: auto; }
.auth-card { width: min(400px, 100%); padding: 28px; }
.auth-card h2 { margin: 0 0 12px; font-size: 20px; }
.auth-brand { color: var(--text); padding: 0 0 20px; }
.gsi-btn { min-height: 44px; display: flex; justify-content: center; margin-bottom: 4px; }
.auth-form { display: grid; gap: 10px; }
.auth-field { position: relative; }
.auth-field input { padding-left: 40px; height: 42px; }
.auth-field .af-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; }
.auth-field:focus-within .af-icon { color: var(--accent); }
.auth-field:has(.af-eye) input { padding-right: 42px; }
.af-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; color: var(--muted); border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.af-eye:hover { color: var(--text); background: var(--surface-2); }
.auth-actions { display: flex; gap: 8px; align-items: stretch; margin-top: 4px; }
.auth-actions .btn { height: 42px; }
.gsi-icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.auth-msg { min-height: 72px; }
.auth-verified { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px 0 13px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); font-size: 14px; }
.auth-verified .af-icon { color: var(--muted); display: flex; }
.auth-verified .small:not(a) { color: var(--success); font-weight: 600; }
.req-card { margin-bottom: 14px; }
.req-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 14px 16px 8px; }
.req-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--border); }
.req-row .ppl-name { flex: 1; min-width: 0; }
.req-btns { display: flex; gap: 8px; flex: none; }
.req-msg { margin-top: 6px; font-size: 13px; padding: 7px 10px; border-radius: 7px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.req-verified { font-size: 11px; font-weight: 600; color: var(--success); }
.nav-icon { position: relative; }
.nav-dot { position: absolute; top: -2px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger, #ef4444); box-shadow: 0 0 0 2px var(--sidebar, var(--surface)); }
.nav-count { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #fff; }
@media (max-width: 560px) { .req-row { flex-wrap: wrap; } .req-btns { width: 100%; justify-content: flex-end; } }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-error { background: #fee2e2; color: #991b1b; border-radius: 8px; padding: 9px 12px; margin-bottom: 14px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: default; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain:disabled input, fieldset.plain:disabled select, fieldset.plain:disabled textarea { background: var(--surface-2); color: var(--text); opacity: 1; }

/* Notifications */
.toast { position: fixed; z-index: 40; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100vw - 32px); background: #1f2430; color: #fff; padding: 10px 8px 10px 16px; border-radius: 10px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; font-size: 13px; }
.toast .icon-btn { color: #c7cbe0; }
@media (max-width: 760px) { .hide-sm { display: none; } }

/* ---------- Projects list ---------- */
.ptoolbar { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 4px; margin-bottom: 14px; flex-wrap: wrap; row-gap: 0; }
.ptoolbar .grow { min-width: 8px; }
.ptabs { display: flex; }
.ptabs a { padding: 13px 12px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; }
.ptabs a.active { color: var(--accent); border-color: var(--accent); }
.tsel { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.tsel select { width: auto; padding: 0 32px 0 12px; }
.btn.on { color: var(--accent); }
.plist { display: grid; gap: 6px; }
.plist-head, .prow { display: grid; grid-template-columns: 28px minmax(0, 3fr) minmax(0, 1.2fr) minmax(0, 1.4fr) 110px 120px 32px; gap: 12px; align-items: center; }
.plist-head { padding: 0 14px 6px; font-size: 12px; color: var(--muted); }
.prow { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--c); border-radius: 10px; padding: 10px 14px; cursor: pointer; }
.prow:hover { border-color: var(--accent); border-left-color: var(--c); }
.pname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcode { color: var(--muted); font-weight: 600; }
.plead { gap: 6px; min-width: 0; }
.plead span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plabel { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--lc); background: color-mix(in srgb, var(--lc) 16%, transparent); border: 1px solid color-mix(in srgb, var(--lc) 45%, transparent); white-space: nowrap; vertical-align: middle; }
.star { border: none; background: none; cursor: pointer; font-size: 18px; line-height: 1; color: var(--muted); padding: 2px; }
.star:hover, .star.on { color: #f5b301; }
.page-head .star { margin-top: 6px; font-size: 22px; }
.pgroup { margin-bottom: 16px; }
.pgroup-head { display: flex; align-items: center; gap: 6px; background: none; border: none; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; padding: 6px 2px 8px; }
.caret { display: inline-block; transition: transform .15s; color: var(--muted); }
.caret.open { transform: rotate(90deg); }
.swatch { width: 38px; height: 34px; padding: 2px; flex: none; }

/* ⋯ menus */
details.menu { position: relative; }
details.menu > summary { list-style: none; font-size: 18px; line-height: 1; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 210px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); padding: 5px; display: grid; }
.menu-pop button { text-align: left; background: none; border: none; color: var(--text); font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.menu-pop button:hover { background: var(--surface-2); }
.menu-pop button.danger { color: var(--danger); }
.project-card details.menu { margin: -4px -6px 0 0; }

@media (max-width: 760px) {
  .plist-head, .prow { grid-template-columns: 28px minmax(0, 1fr) auto 32px; }
  .prow .hide-sm { display: none; }
}
.fab { width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--accent); color: #fff; font-size: 24px; line-height: 1;
  cursor: pointer; display: inline-grid; place-items: center; margin: 7px 0; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); flex: none; }
.fab:hover { filter: brightness(1.1); }

/* Filter dropdown */
.fwrap { position: relative; }
.btn.open { background: var(--surface-2); }
.ficon { font-size: 15px; }
.fpop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 280px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, .25); padding: 6px 0; }
.fitem { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 18px; background: none; border: none; color: var(--text);
  font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.fitem:hover { background: var(--surface-2); }
.fitem.muted { color: var(--muted); font-size: 14px; }
.fitem input[type=checkbox] { width: 18px; height: 18px; margin: 0; }
.chev { color: var(--muted); font-size: 20px; line-height: 1; }
.fcount { background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.fhead { display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; padding: 4px 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.fhead b { text-align: center; color: var(--muted); font-size: 15px; }
.fback { background: none; border: none; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.fback:hover { color: var(--text); background: var(--surface-2); }
.fopts { max-height: 320px; overflow-y: auto; }
.fsep { height: 1px; background: var(--border); margin: 6px 0; }

/* Typography: Outfit for headings, DM Sans (set on body) for everything else */
h1, h2, h3, h4, .brand, .stat .v, .top-title { font-family: var(--font-head); letter-spacing: -0.01em; }

/* ---------- Top bar ---------- */
.top-title { margin: 0; font-size: 22px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar { gap: 6px; }
.top-icon { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; min-width: 40px; justify-content: center; padding: 0 8px;
  border: none; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.top-icon:hover, .top-icon.open { background: var(--surface-2); color: var(--text); }
.top-icon.running { color: var(--danger); }
.top-icon.running svg { animation: pulse 1.6s infinite; }
.top-icon b { font-size: 13px; font-variant-numeric: tabular-nums; }
.top-icon .badge { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger);
  color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }
.top-avatar { border: none; background: none; padding: 4px; border-radius: 50%; cursor: pointer; display: inline-flex; }
.top-avatar .avatar { width: 30px; height: 30px; font-size: 12px; }
.top-avatar:hover .avatar { box-shadow: 0 0 0 2px var(--accent); }
.tpop-wrap { position: relative; }
.tpop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 360px; max-width: calc(100vw - 24px); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, .28); }
.tpop-title { font-family: var(--font-head); font-weight: 600; font-size: 16px; margin-bottom: 10px; }
.tpop-form { padding: 14px 16px 16px; }
.tpop-form .field { margin-bottom: 10px; }
.tpop-timer { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--danger) 8%, transparent); border-radius: 12px 12px 0 0; }
.tpop-timer .pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: pulse 1.2s infinite; flex: none; }
.tpop-notifs { width: 400px; }
.notif-list { max-height: 440px; overflow-y: auto; padding-bottom: 6px; }
.notif { display: flex; gap: 10px; padding: 10px 16px; color: var(--text); font-size: 13.5px; align-items: flex-start; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.notif.unread:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }

/* ---------- Search popup ---------- */
.search-modal { padding: 0; width: min(620px, calc(100vw - 32px)); top: 12vh; transform: translateX(-50%); }
.search-box { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); color: var(--muted); }
.search-box input { border: none; background: transparent; font-size: 17px; padding: 4px 0; outline: none; color: var(--text); }
.search-box input:focus { outline: none; }
.search-results { max-height: 52vh; overflow-y: auto; padding: 6px 0; }
.search-hint { padding: 14px 18px; }
.search-hit { display: flex; align-items: center; gap: 12px; padding: 9px 18px; color: var(--text); }
.search-hit:hover { background: var(--surface-2); }
.search-hit .kind { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); width: 78px; flex: none; }
.search-hit .done { text-decoration: line-through; opacity: .6; }
.search-hit .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.search-all { width: 100%; background: none; border: none; border-top: 1px solid var(--border); padding: 10px; color: var(--accent); font: inherit; cursor: pointer; margin-top: 4px; }

/* ---------- Project top bar ---------- */
.top-back { font-size: 26px; line-height: 1; color: var(--muted); padding: 4px 8px; border-radius: 8px; margin-left: -8px; }
.top-back:hover { color: var(--text); background: var(--surface-2); }
.top-chip { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border: none; border-radius: 10px; background: transparent;
  color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; white-space: nowrap; }
.top-chip:hover, .top-chip.open { background: var(--surface-2); color: var(--text); }
.top-chip.title { color: var(--text); min-width: 0; max-width: min(520px, 45vw); }
.top-chip.title .top-title { font-size: 21px; }
.top-chip .label { flex: none; }
.caret-down { color: var(--muted); font-size: 18px; margin-top: -6px; }
.topbar > .tpop-wrap:has(.title) { min-width: 0; }
.tpop.left { left: 0; right: auto; }
.pop-h { font-family: var(--font-head); font-weight: 600; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.count-pill { font-family: var(--font-body); font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 1px 8px; }

.proj-pop { width: 560px; padding: 20px 22px 22px; }
.dtable { background: var(--bg); border-radius: 10px; overflow: hidden; max-height: 340px; overflow-y: auto; }
.drow { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.drow:last-child { border-bottom: none; }
.drow .k { color: var(--muted); font-weight: 600; }
.inline-select { width: auto; height: 32px; padding: 0 28px 0 10px; font-size: 13px; background-position: right 10px center; }

.members-pop { width: 400px; padding: 18px 20px 20px; }
.mbox { background: var(--bg); border-radius: 10px; margin-top: 10px; overflow: hidden; }
.mrow { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.mrow:last-child { border-bottom: none; }
.mrow.add select { flex: 1; }
.crown { border: none; background: none; cursor: pointer; font-size: 17px; color: var(--muted); opacity: .45; padding: 2px 4px; }
.crown:hover { opacity: 1; }
.crown.on { color: #f5b301; opacity: 1; cursor: default; }

.stats-pop { width: 640px; padding: 18px; }
.sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.scard { background: var(--bg); border-radius: 10px; }
.scard-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.scard-h a { font-size: 13px; }
.scard-b { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.srow { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 3px 0; font-size: 14px; color: var(--muted); max-width: 200px; }
.srow b { color: var(--text); font-variant-numeric: tabular-nums; }
.ring { flex: none; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; }
.ring text { fill: var(--text); font-size: 12px; font-weight: 700; font-family: var(--font-body); }

.menu-list { width: 260px; padding: 6px; }
.mitem { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; background: none; border: none; border-radius: 7px; color: var(--text);
  font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
.mitem .mi { width: 20px; text-align: center; color: var(--muted); flex: none; }
.mitem:hover { background: var(--surface-2); }
.mcheck { width: 18px; height: 18px; border: 1.5px solid var(--border); border-radius: 4px; display: grid; place-items: center; font-size: 12px; }
.mcheck.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.msep { height: 1px; background: var(--border); margin: 6px 4px; }
.template-note { display: flex; align-items: center; gap: 14px; justify-content: space-between; background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; }

@media (max-width: 760px) {
  .proj-pop, .stats-pop { width: calc(100vw - 24px); }
  .sgrid { grid-template-columns: 1fr; }
  .top-chip span:not(.top-title) { display: none; }
}

/* ---------- View icons (project toolbar) ---------- */
.view-icons { display: inline-flex; gap: 2px; padding-right: 10px; margin-right: 4px; border-right: 1px solid var(--border); }
.view-icons.sm { border: none; padding: 0; margin: 0; }
.view-icons.sm svg { width: 17px; height: 17px; }
.view-icon { width: 38px; height: 36px; display: grid; place-items: center; border: none; background: none; color: var(--muted); border-radius: 8px; cursor: pointer; }
.view-icon:hover { background: var(--surface-2); color: var(--text); }
.view-icon.active { color: var(--accent); }

/* ---------- Project calendar ---------- */
.cal { overflow: hidden; }
.cal-top { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.cal-top .icon-btn { font-size: 20px; line-height: 1; padding: 2px 8px; }
.cal-title { font-size: 15px; margin: 0 8px 0 4px; }
.cal-head, .cal-row { display: grid; grid-template-columns: 52px 1fr; }
.cal-head { grid-template-columns: 52px repeat(7, 1fr); border-bottom: 1px solid var(--border); }
.cal-dh { padding: 10px 12px; border-left: 1px solid var(--border); display: grid; gap: 2px; font-size: 14px; }
.cal-dh span { color: var(--muted); font-size: 13px; }
.cal-dh.center { text-align: center; padding: 10px 6px; }
.cal-dh.today { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent); }
.cal-dh.today span { color: var(--accent); }
.cal-dh.weekend, .cal-cell.weekend { background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--muted) 9%, transparent) 6px 7px); }
.cal-row { border-bottom: 1px solid var(--border); }
.cal-row:last-child { border-bottom: none; }
.cal-wk { font-size: 12px; color: var(--muted); padding: 10px 0 0; text-align: center; }
.cal-days { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-row.month .cal-days { min-height: 132px; }
.cal-row.week .cal-days { min-height: calc(100vh - 290px); }
.cal-cell { border-left: 1px solid var(--border); position: relative; cursor: default; }
.cal-cell[data-action]:hover { background-color: color-mix(in srgb, var(--accent) 5%, transparent); cursor: copy; }
.cal-cell.out { background-color: color-mix(in srgb, var(--bg) 70%, transparent); }
.cal-cell.out .cal-num { opacity: .45; }
.cal-cell.today { background-color: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.cal-num { position: absolute; top: 8px; right: 10px; font-size: 12.5px; color: var(--muted); }
.cal-cell.today .cal-num { color: var(--accent); font-weight: 700; }
.cal-bars { position: absolute; inset: 32px 4px 22px; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 24px; gap: 4px 8px; align-content: start; pointer-events: none; }
.cal-row.week .cal-bars { inset: 10px 4px 10px; }
.cal-bar { pointer-events: auto; display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 8px 0 3px; border-radius: 6px; cursor: pointer;
  background: color-mix(in srgb, var(--c) 24%, var(--surface)); border-left: 3px solid var(--c); font-size: 12.5px; font-weight: 500; }
.cal-bar:hover { background: color-mix(in srgb, var(--c) 36%, var(--surface)); }
.cal-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-bar .avatar { width: 18px; height: 18px; font-size: 8px; flex: none; }
.cal-bar.done { opacity: .55; }
.cal-bar.done span { text-decoration: line-through; }
.cal-bar.clip-l { border-left-style: dashed; border-radius: 0 6px 6px 0; }
.cal-bar.clip-r { border-radius: 6px 0 0 6px; }
.cal-more { position: absolute; left: 10px; bottom: 3px; font-size: 12px; }
.opts-pop { width: 290px; padding: 6px 0; }
.opts-pop .fitem { cursor: default; }
.opts-pop label.fitem { cursor: pointer; }
.cal-top .tpop-wrap .view-icon { width: 34px; height: 30px; }
.cal-top .view-icon svg { width: 17px; height: 17px; }

/* ---------- Timeline (Gantt) ---------- */
.gantt-card { overflow: hidden; }
.gantt { overflow-x: auto; max-height: calc(100vh - 210px); overflow-y: auto; position: relative; }
.g-row { display: flex; width: max-content; min-width: 100%; }
.g-left { position: sticky; left: 0; z-index: 3; width: 440px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--surface); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-height: 46px; }
.g-track { position: relative; flex: none; width: var(--w); border-bottom: 1px solid var(--border); min-height: 46px; }
.g-header { position: sticky; top: 0; z-index: 5; }
.g-header .g-left { z-index: 6; min-height: 62px; font-size: 16px; }
.g-header .g-left .icon-btn { font-size: 18px; }
.g-scale { background: var(--surface); }
.g-months { display: flex; height: 30px; border-bottom: 1px solid var(--border); }
.g-months span { flex: none; padding: 7px 0; font-size: 13px; color: var(--muted); border-left: 1px solid var(--border); white-space: nowrap; overflow: clip; }
.g-months b { position: sticky; left: 450px; padding: 0 10px; font-weight: 600; } /* label follows while its month is on screen */
.g-days { display: flex; height: 32px; }
.g-days span { flex: none; width: 48px; text-align: center; padding-top: 7px; font-size: 13px; border-left: 1px solid var(--border); }
.g-days span.we { color: var(--muted); opacity: .6; }
.g-days span.today { color: var(--accent); font-weight: 700; }
.g-body { position: relative; }
.g-cols { position: absolute; top: 0; bottom: 0; left: 440px; display: flex; pointer-events: none; }
.g-cols span { flex: none; width: 48px; border-left: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.g-cols span.we { background: color-mix(in srgb, var(--bg) 55%, transparent); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.g-body .g-track { background: transparent; }
.g-list .g-left { font-size: 15px; }
.g-caret { border: none; background: none; color: var(--muted); font-size: 18px; cursor: pointer; transition: transform .15s; padding: 0 2px; }
.g-caret.open { transform: rotate(90deg); }
.g-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.g-count { font-size: 12px; font-weight: 700; background: var(--bg); border-radius: 6px; padding: 1px 7px; }
.g-range { white-space: nowrap; }
.g-task .g-left { padding-left: 46px; }
.g-task.done .g-name { text-decoration: line-through; color: var(--muted); }
.g-bar { position: absolute; top: 9px; height: 28px; border-radius: 6px; display: flex; align-items: center; padding: 0 10px; font-size: 13px; font-weight: 600;
  overflow: clip; white-space: nowrap; z-index: 1; }
.g-bar span { overflow: hidden; text-overflow: ellipsis; position: sticky; left: 450px; }
.g-bar.list { background: var(--accent); color: #fff; }
.g-bar.task { cursor: pointer; color: #fff; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 85%, #000) var(--done, 0%), color-mix(in srgb, var(--accent) 62%, var(--surface)) var(--done, 0%)); }
.g-bar.task:hover { filter: brightness(1.12); }
.g-task.done .g-bar { opacity: .5; }
.g-nodate { position: absolute; top: 14px; left: 12px; position: sticky; }
@media (max-width: 760px) { .g-left { width: 220px; } .g-cols { left: 220px; } .g-range { display: none; } }

/* ---------- Files tab ---------- */
.drive-card { overflow: hidden; margin-bottom: 6px; }
.drive-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.drive-logo { display: inline-grid; place-items: center; }
.drive-logo.lg svg { width: 40px; height: 36px; }
.drive-frame { display: block; width: 100%; height: 480px; border: 0; background: #fff; }
.drive-head { padding: 16px 18px; }
.drive-preview-bar { display: flex; align-items: center; gap: 10px; padding: 8px 18px; background: var(--bg); }
.drive-note { padding: 10px 16px; border-top: 1px solid var(--border); }
.empty-drive { display: flex; align-items: center; gap: 16px; padding: 18px 20px; flex-wrap: wrap; }
.drive-form { gap: 8px; flex: 1 1 420px; }
.drive-form input { flex: 1; }
.file-row { display: flex; gap: 12px; }
.file-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: 17px; flex: none;
  background: color-mix(in srgb, var(--fc) 18%, transparent); }
.file-title { font-weight: 600; color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-title:hover { color: var(--accent); }
.file-add { gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* ---------- List view table ---------- */
.lt { overflow: visible; }
.lt-row { display: grid; grid-template-columns: var(--lt-cols); align-items: center; gap: 0 12px; min-height: 46px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border); }
.lt-head { min-height: 44px; font-size: 13px; color: var(--muted); }
.lt-head .lt-name { gap: 6px; }
.lt-head .icon-btn { font-size: 14px; }
.lt-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lt-c { font-size: 13.5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-head .lt-c { font-size: 13px; }
.lt-empty { color: var(--muted); opacity: .5; }
.lt-trunc { overflow: hidden; text-overflow: ellipsis; }
.lt-labels { display: inline-flex; gap: 4px; overflow: hidden; }
.overdue { color: var(--danger); font-weight: 600; }
.lt-list { min-height: 50px; }
.lt-list-name { font-family: var(--font-head); font-size: 17px; font-weight: 700; letter-spacing: .01em; }
.lt-count { font-size: 13px; color: var(--muted); }
.lt-list-actions { opacity: 0; transition: opacity .15s; }
.lt-list:hover .lt-list-actions, .lt-list:focus-within .lt-list-actions { opacity: 1; }
.add-dot { width: 24px; height: 24px; border-radius: 50%; border: none; background: var(--accent); color: #fff; font-size: 18px; line-height: 1;
  display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.lt-task { cursor: pointer; }
.lt-task:hover { background: var(--surface-2); }
.lt-title { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-meta { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.lt-task.done .lt-title { color: var(--muted); }
.lt-task.done .lt-c { opacity: .6; }
.lt-add input { border: none; background: transparent; padding: 6px 0; color: var(--accent); font-size: 15px; font-weight: 500; }
.lt-add input::placeholder { color: var(--accent); opacity: 1; }
.lt-add input:focus { outline: none; }
.lt-add input:focus::placeholder { opacity: .5; }
.lt-done-toggle { width: 100%; background: none; border: none; border-bottom: 1px solid var(--border); text-align: left; color: var(--muted); font: inherit; font-size: 13.5px;
  display: flex; gap: 10px; cursor: pointer; grid-template-columns: none; }
.lt-done-toggle:hover { color: var(--text); }
.lt-section { margin-bottom: 0; }
.lt-section + .lt-section .lt-list { border-top: 10px solid var(--bg); }
.lt-new-list { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 10px solid var(--bg); background: color-mix(in srgb, var(--bg) 40%, var(--surface)); border-radius: 0 0 var(--radius) var(--radius); }
.lt-new-list span { font-size: 20px; font-weight: 600; }
.lt-new-list input { border: none; background: transparent; font-family: var(--font-head); font-size: 17px; font-weight: 600; padding: 4px 0; }
.lt-new-list input:focus { outline: none; }
.lt .drop-hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.lt-head .tpop-wrap { justify-self: end; }
@media (max-width: 760px) {
  .lt-row { grid-template-columns: minmax(0, 1fr) 40px; }
  .lt-c { display: none; }
}

/* Editable cells in the list table */
.lt-c.tpop-wrap { position: relative; overflow: visible; }
.lt-val { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-btn { width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 6px; padding: 5px 6px; margin-left: -7px;
  font: inherit; color: inherit; cursor: pointer; min-height: 32px; }
.lt-task:hover .cell-btn { border-color: var(--border); }
.cell-btn:hover, .lt-c.editing .cell-btn { background: var(--surface); border-color: var(--accent) !important; }
.lt-c .cell-input { width: 100%; height: 32px; padding: 0 8px; font-size: 13.5px; }
.cell-pop { left: -8px; right: auto; width: 240px; padding: 6px; max-height: 320px; overflow-y: auto; }
.cell-pop .mitem { font-size: 14px; padding: 7px 8px; }
.cell-pop .mitem.sel { background: var(--accent-soft); }
.cell-pop .mitem .avatar { width: 22px; height: 22px; font-size: 9px; }
.cell-form { padding: 12px; width: 260px; }
.cell-form .field { display: grid; gap: 4px; margin-bottom: 10px; }
.lt-c.lt-time .cell-pop, .lt-c.lt-estimate .cell-pop, .lt-c.lt-label .cell-pop { left: auto; right: -8px; }

/* ---------- Task window ---------- */
.task-panel { position: fixed; z-index: 21; top: 18px; bottom: 18px; left: 104px; right: 18px; max-width: 1240px; margin-left: auto;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1fr) 360px; overflow: hidden; }
.task-panel.anim { animation: slidein .18s ease-out; }
.tp-nav { position: fixed; z-index: 22; top: 18px; left: 40px; display: grid; gap: 10px; }
.task-overlay { background: rgba(8, 10, 16, .62); }
.tp-round { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: none; background: var(--surface); color: var(--text); font-size: 18px; cursor: pointer; box-shadow: var(--shadow); }
.tp-round:hover:not(:disabled) { background: var(--surface-2); }
.tp-round:disabled { opacity: .35; cursor: default; }
.tp-main { overflow-y: auto; padding: 26px 34px 40px; }
.tp-head { display: flex; align-items: center; gap: 10px; }
.tp-head .check { transform: scale(1.25); margin-right: 4px; }
.tp-title { flex: 1; min-width: 0; margin: 0; font-family: var(--font-head); font-size: 24px; font-weight: 600; border: 1px solid transparent; background: transparent; padding: 4px 8px; margin-left: -8px; border-radius: 8px; }
input.tp-title:hover { border-color: var(--border); }
.tp-info { display: flex; flex-wrap: wrap; gap: 0; margin: 8px 0 18px 40px; color: var(--muted); font-size: 13.5px; }
.tp-info > * { padding: 0 12px; border-left: 1px solid var(--border); }
.tp-info > :first-child { padding-left: 0; border-left: none; color: var(--muted); }
.tp-desc { width: 100%; resize: vertical; border: 1px solid transparent; background: transparent; padding: 8px 10px; margin-left: -10px; font-size: 14.5px; line-height: 1.6; border-radius: 8px; }
.tp-desc:hover, .tp-desc:focus { border-color: var(--border); background: var(--bg); }
.tp-section { border-top: 1px solid var(--border); padding: 18px 0 8px; margin-top: 12px; }
.tp-section h3 { font-family: var(--font-head); font-size: 19px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.tp-sub { display: flex; align-items: flex-start; gap: 12px; padding: 7px 0; font-size: 15px; line-height: 1.5; }
.tp-sub.done span.grow { text-decoration: line-through; color: var(--muted); }
.tp-sub .icon-btn { opacity: 0; }
.tp-sub:hover .icon-btn { opacity: 1; }
.tp-check { position: relative; flex: none; margin-top: 1px; }
.tp-check input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tp-check span { display: block; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--muted); }
.tp-check input:checked + span { background: var(--success, #22c55e); border-color: var(--success, #22c55e); opacity: .7; }
.tp-check input:checked + span::after { content: '✓'; color: #fff; display: grid; place-items: center; font-size: 13px; height: 100%; }
.tp-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.tp-add { display: flex; align-items: center; gap: 12px; padding: 8px 0 12px; }
.tp-add input { border: none; background: transparent; padding: 4px 0; color: var(--accent); font-size: 15px; font-weight: 500; }
.tp-add input::placeholder { color: var(--accent); opacity: 1; }
.tp-add input:focus { outline: none; }
.tp-history-btn { background: none; border: none; color: var(--muted); font: inherit; font-size: 14.5px; cursor: pointer; padding: 4px 0; }
.tp-history-btn:hover { color: var(--text); }
.tp-history { margin-top: 10px; display: grid; gap: 10px; }
.tp-hrow { display: flex; gap: 10px; font-size: 13.5px; }
.tp-side { background: color-mix(in srgb, var(--bg) 55%, var(--surface)); overflow-y: auto; padding: 24px 26px 40px; border-left: 1px solid var(--border); }
.tp-field { margin-bottom: 16px; }
.tp-label { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 14px; margin-bottom: 7px; }
.tp-dates { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; color: var(--muted); }
.tp-dates input { padding: 7px 8px; font-size: 13px; }
.tp-inline { display: flex; align-items: center; gap: 6px; }
.tp-labels { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tp-chip { display: inline-flex; align-items: center; }
.tp-chip .icon-btn { font-size: 11px; padding: 2px 4px; }
.tp-add-label { width: auto; min-width: 120px; flex: 1; }
.tp-checks { display: grid; gap: 10px; padding: 6px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tp-checks label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; }
.tp-block { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tp-block:last-child { border-bottom: none; }
.tp-timebox { background: var(--bg); border-radius: 14px; padding: 14px 16px 10px; }
.tp-hours { font-size: 22px; font-variant-numeric: tabular-nums; }
.tp-timer { display: flex; align-items: center; gap: 14px; margin-top: 12px; background: var(--surface); border-radius: 999px; padding: 6px; }
.tp-timer b { font-variant-numeric: tabular-nums; font-size: 16px; }
.tp-play { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--accent); color: #fff; font-size: 14px; cursor: pointer; }
.tp-timer.on .tp-play { background: var(--danger); }
.link-btn { background: none; border: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 2px 0; }
.link-btn.muted { color: var(--muted); font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.tp-person { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.tp-reminder-form { display: grid; gap: 8px; margin-top: 8px; }
.prio { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 800; flex: none; }
.notif-alarm { font-size: 20px; }
@media (max-width: 900px) {
  .task-panel { left: 0; right: 0; top: 0; bottom: 0; border-radius: 0; grid-template-columns: 1fr; overflow-y: auto; display: block; }
  .tp-main, .tp-side { overflow: visible; }
  .tp-side { border-left: none; border-top: 1px solid var(--border); }
  .tp-nav { top: auto; bottom: 16px; left: auto; right: 16px; grid-auto-flow: column; }
}

/* ---------- Account menu & branding ---------- */
.top-avatar.open .avatar, .top-avatar:hover .avatar { box-shadow: 0 0 0 2px var(--accent); }
.account-menu { width: 280px; }
.account-menu a.mitem { color: var(--text); }
.am-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 6px; }
.am-head .small { overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.brand-logo { width: 26px; height: 26px; border-radius: 0; object-fit: contain; flex: none; }
.auth-brand .brand-logo { width: 32px; height: 32px; }
.brand-mark.lg { width: 64px; height: 64px; border-radius: 16px; font-size: 28px; color: #fff; }

/* ---------- Settings page ---------- */
.settings { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; max-width: 1100px; }
.set-nav { padding: 8px; display: grid; gap: 2px; position: sticky; top: 0; }
.set-nav a, .set-logout { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: var(--text); font-size: 14.5px; }
.set-nav a:hover, .set-logout:hover { background: var(--surface-2); }
.set-nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.set-nav .mi { color: var(--muted); display: grid; }
.set-nav a.active .mi { color: var(--accent); }
.set-logout { border: none; background: none; font: inherit; cursor: pointer; margin-top: 8px; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; padding-top: 14px; }
.set-body { display: grid; gap: 16px; }
.set-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.set-card h3 { font-family: var(--font-head); font-size: 18px; margin: 0 0 14px; }
.set-form .field { margin-bottom: 12px; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.opt:hover { border-color: var(--accent); }
.opt input { margin-top: 3px; width: auto; accent-color: var(--accent); }
.opt span { display: grid; gap: 2px; }
.set-list { display: grid; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.set-row:first-child { border-top: none; }
.dev-icon { font-size: 22px; }
.logo-preview { width: 72px; height: 72px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); padding: 8px; overflow: hidden; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.days { display: flex; gap: 8px; flex-wrap: wrap; }
.day { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.day input { display: none; }
.day.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.label-row { gap: 6px; margin-bottom: 8px; }
.app-h { display: flex; gap: 14px; align-items: flex-start; }
.app-h h3 { margin: 0 0 4px; }
.app-card .section-title { margin-top: 18px; }
.app-logo { width: 42px; height: 42px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; font-size: 22px; flex: none; }
.app-logo.claude { color: #d97757; font-size: 26px; }
@media (max-width: 760px) { .settings { grid-template-columns: 1fr; } .set-nav { position: static; } }
.set-card .form-grid { align-items: start; }

/* ---------- My Work ---------- */
.mw-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.mw-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; min-width: 0; }
.mw-card > div { display: grid; gap: 2px; min-width: 0; }
.mw-card b { font-family: var(--font-head); font-size: 26px; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.mw-card span { color: var(--muted); font-size: 13px; }
.mw-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: 19px; color: var(--accent) !important;
  background: color-mix(in srgb, var(--accent) 14%, transparent); }
.mw-card.bad .mw-ic { color: var(--danger) !important; background: color-mix(in srgb, var(--danger) 14%, transparent); }
.mw-card.bad b { color: var(--danger); }
.mw-card.good .mw-ic { color: var(--success) !important; background: color-mix(in srgb, var(--success) 14%, transparent); }
.mw-card.away .mw-ic { background: color-mix(in srgb, var(--warn) 18%, transparent); }
.mw-ic svg { width: 22px; height: 22px; }
/* The running timer gets its own full-width, highlighted card above the numbers */
.mw-card.timer { margin-bottom: 12px; border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.mw-card.timer .mw-ic { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.mw-card.timer .pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: pulse 1.2s infinite; }
.mw-timer-name { color: var(--text) !important; font-weight: 600; font-size: 15px !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.mw-timer-btns { display: flex; gap: 6px; flex: none; }
.mw-card b.mw-timer-time { font-size: 30px; margin: 0 10px; }
.mw-card.timer .mw-timer-name { font-size: 17px !important; }
@media (max-width: 760px) { .mw-card.timer { flex-wrap: wrap; } }
.mw-project { margin-bottom: 16px; overflow: visible; }
.mw-phead { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.mw-client { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.mw-pname { font-family: var(--font-head); font-size: 21px; font-weight: 600; color: var(--accent); }
.mw-pname .pcode { color: var(--accent); opacity: .75; }
/* Timesheet */
.ts { overflow: hidden; }
.ts-total { color: var(--text); font-size: 15px; }
.ts-grid { overflow-x: auto; }
.ts-row { display: grid; grid-template-columns: minmax(240px, 1fr) repeat(7, 84px) 84px; align-items: center; border-bottom: 1px solid var(--border); min-width: 920px; }
.ts-row > div { padding: 6px 8px; text-align: center; }
.ts-row > div:first-child { text-align: left; padding-left: 16px; }
.ts-head > div { font-size: 13px; font-weight: 600; padding: 10px 8px; display: grid; gap: 2px; }
.ts-head span { font-size: 12px; font-weight: 400; color: var(--muted); }
.ts-row .today { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ts-row .off { background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--muted) 9%, transparent) 6px 7px); }
.ts-name { display: grid; gap: 2px; min-width: 0; }
.ts-name a { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.ts-cell { width: 100%; text-align: center; padding: 6px 4px; border-color: transparent; background: transparent; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.ts-cell::-webkit-inner-spin-button, .ts-cell::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ts-cell:hover { border-color: var(--border); }
.ts-cell:focus { background: var(--surface); }
.ts-sum { font-weight: 700; font-variant-numeric: tabular-nums; }
.ts-foot { font-weight: 600; background: var(--bg); border-bottom: none; }
.ts-add { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.ts-add select { max-width: 460px; }
/* Teams workload */
.wl { display: grid; }
.wl-row { display: grid; grid-template-columns: minmax(200px, 1.6fr) repeat(6, minmax(70px, 1fr)); gap: 8px; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.wl-row > div:not(:first-child) { text-align: center; }
.wl-head { font-size: 12.5px; color: var(--muted); border-top: none; }
.team-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
@media (max-width: 760px) { .wl-row { grid-template-columns: 1fr repeat(2, 60px); } .wl-row > div:nth-child(n+4) { display: none; } }
/* Timer column (My Work) */
.tt-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: transparent; color: var(--muted); border-radius: 999px;
  padding: 4px 12px 4px 5px; font: inherit; font-size: 13px; cursor: pointer; }
.tt-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.tt-btn:hover { border-color: var(--accent); color: var(--text); }
.tt-btn.on { border-color: color-mix(in srgb, var(--danger) 55%, transparent); background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--text); }
.tt-btn.on .tt-ic { background: var(--danger); color: #fff; }
.tt-btn b { font-variant-numeric: tabular-nums; font-weight: 600; }
.lt-task .tt-btn .tt-label { opacity: 0; transition: opacity .15s; }
.lt-task:hover .tt-btn .tt-label, .tt-btn:focus-visible .tt-label { opacity: 1; }

/* ---------- Calendar page (events) ---------- */
.ev-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.ev-side { padding: 16px; position: sticky; top: 0; }
.ev-cal { display: flex; align-items: center; gap: 6px; padding: 6px 0; }
.ev-cal input { width: 18px; height: 18px; flex: none; }
.ev-cal-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-main { overflow: hidden; }
.ev-mhead, .ev-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ev-mhead { border-bottom: 1px solid var(--border); }
.ev-week { border-bottom: 1px solid var(--border); }
.ev-week:last-child { border-bottom: none; }
.ev-day { min-height: 118px; border-left: 1px solid var(--border); padding: 28px 4px 4px; position: relative; display: grid; align-content: start; gap: 3px; min-width: 0; }
.ev-day:first-child { border-left: none; }
.ev-day:hover { background-color: color-mix(in srgb, var(--accent) 4%, transparent); }
.ev-day.out .cal-num { opacity: .4; }
.ev-day.out { background-color: color-mix(in srgb, var(--bg) 60%, transparent); }
.ev-day.weekend, .ev-wk-head .weekend, .ev-col.weekend { background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--muted) 9%, transparent) 6px 7px); }
.ev-day.today { background-color: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.ev-day .cal-num { top: 7px; right: auto; left: 9px; }
.ev-day.today .cal-num { color: var(--accent); font-weight: 700; }
.ev-chip { display: flex; align-items: center; gap: 5px; min-width: 0; width: 100%; border: none; text-align: left; font: inherit; font-size: 12.5px; cursor: pointer;
  padding: 3px 6px; border-radius: 5px; color: var(--text); background: transparent; }
.ev-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.ev-chip.allday { background: color-mix(in srgb, var(--c) 30%, var(--surface)); }
.ev-chip.allday::before { display: none; }
.ev-chip:hover { background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.ev-time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.ev-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-rep { color: var(--muted); font-size: 11px; }
.ev-more { border: none; background: none; color: var(--accent); font: inherit; font-size: 12px; text-align: left; padding: 0 6px; cursor: pointer; }
/* Week view */
.ev-wk-head, .ev-wk-allday, .ev-wk-body { display: grid; grid-template-columns: 58px repeat(7, minmax(0, 1fr)); }
.ev-wk-head > div { padding: 8px 10px; border-left: 1px solid var(--border); display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.ev-wk-head > div:first-child { border-left: none; }
.ev-wk-head span { font-family: var(--font-head); font-size: 20px; font-weight: 600; }
.ev-wk-head .today { color: var(--accent); }
.ev-wk-allday { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ev-wk-allday > div { border-left: 1px solid var(--border); padding: 4px; min-height: 34px; display: grid; gap: 3px; align-content: start; }
.ev-wk-allday > div:first-child { border-left: none; padding: 10px 6px; cursor: default; }
.ev-wk-body { max-height: calc(100vh - 290px); overflow-y: auto; position: relative; }
.ev-hours > div { font-size: 11px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.ev-col { position: relative; border-left: 1px solid var(--border); }
.ev-col.today { background-color: color-mix(in srgb, var(--accent) 6%, transparent); }
.ev-slot { border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.ev-slot:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.ev-block { position: absolute; border: none; border-left: 3px solid var(--c); border-radius: 6px; background: color-mix(in srgb, var(--c) 28%, var(--surface));
  color: var(--text); text-align: left; font: inherit; font-size: 12px; line-height: 1.3; padding: 3px 6px; overflow: hidden; cursor: pointer; display: block; z-index: 1; }
.ev-block:hover { background: color-mix(in srgb, var(--c) 40%, var(--surface)); }
.ev-block b, .ev-block span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-block span { color: var(--muted); font-size: 11px; }
.ev-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; }
.ev-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
/* Event & calendar windows */
.modal.wide { width: min(680px, calc(100vw - 32px)); }
.ev-title-input { font-family: var(--font-head); font-size: 20px; font-weight: 600; }
.ev-when { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
form.allday .ev-t, form.allday .ev-tz { display: none; }
form.rep-none .ev-until, form:not(.rep-weekly) .ev-days { display: none; }
.ev-people { max-height: 170px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.cal-people { max-height: 180px; overflow-y: auto; margin-top: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.cal-people.hide { display: none; }
.cal-bar.ev { background: color-mix(in srgb, var(--c) 16%, var(--surface)); border-left-style: dotted; font-style: italic; }
@media (max-width: 900px) { .ev-layout { grid-template-columns: 1fr; } .ev-side { position: static; } }
.field label.opt, .field label.day, .field .ev-people label, .field .cal-people label { display: flex; margin: 0; font-size: 14px; font-weight: 400; color: var(--text); }
.field label.opt b { font-weight: 600; }
form[data-form="event"] .form-grid, form[data-form="calendar"] .form-grid { align-items: start; }

/* ---------- Event popover ---------- */
.evp { position: fixed; z-index: 31; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(600px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 26px; box-shadow: var(--shadow); padding: 22px; }
.evp-k { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.evp-ticket { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; padding: 22px 24px 18px; margin-bottom: 16px; }
.evp-when { display: flex; align-items: center; gap: 8px; }
.evp-date { border: none; background: none; color: var(--text); text-align: left; padding: 0; cursor: pointer; display: grid; gap: 2px; font: inherit; }
.evp-date.end { text-align: right; justify-items: end; }
.evp-date b { font-family: var(--font-head); font-size: 34px; font-weight: 600; line-height: 1.1; display: flex; align-items: center; gap: 6px; }
.evp-date b i { font-style: normal; font-size: 16px; color: var(--muted); }
.evp-date:hover b { color: var(--accent); }
.evp-sub { color: var(--muted); font-size: 13px; }
.evp-date:disabled { cursor: default; }
.evp-line { flex: 1; border-top: 2px dashed color-mix(in srgb, var(--muted) 45%, transparent); }
.evp-dur { font-size: 13px; border: 1px solid var(--border); background: var(--bg); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.evp-picker { display: grid; gap: 10px; margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--bg); }
.evp-picker input[type=date], .evp-picker input[type=time] { width: auto; }
/* Dashed "perforation" with notches, like a ticket */
.evp-perf { position: relative; margin: 16px -24px 14px; border-top: 2px dashed color-mix(in srgb, var(--muted) 35%, transparent); }
.evp-perf::before, .evp-perf::after { content: ''; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); }
.evp-perf::before { left: -11px; } .evp-perf::after { right: -11px; }
.evp-meta { display: flex; flex-wrap: wrap; gap: 14px 36px; }
.evp-meta > label { display: grid; gap: 4px; }
.evp-select { display: inline-flex; align-items: center; gap: 8px; }
.evp-select select, .evp-until { border: none; background: transparent; font-size: 19px; font-weight: 500; padding: 0 22px 0 0; width: auto; color: var(--text); cursor: pointer; }
.evp-until { font-size: 15px; }
.evp-days { margin-top: 12px; }
.evp-box, .evp-rows { border: 1px solid var(--border); border-radius: 20px; background: var(--surface-2); margin-bottom: 16px; overflow: hidden; }
.evp-name { border: none; background: transparent; font-size: 21px; padding: 18px 20px; border-bottom: 1px solid var(--border); border-radius: 0; }
.evp-desc { border: none; background: transparent; padding: 14px 20px; resize: vertical; border-bottom: 1px solid var(--border); border-radius: 0; font-size: 14.5px; }
.evp-name:focus, .evp-desc:focus, .evp-inline:focus { outline: none; }
.evp-links { padding: 10px 20px 12px; display: grid; gap: 6px; }
.evp-link { display: flex; align-items: center; gap: 10px; }
.evp-link a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evp-attach { display: flex; align-items: center; gap: 12px; border: none; background: none; color: var(--muted); font: inherit; cursor: pointer; padding: 4px 0; }
.evp-clip { width: 34px; height: 34px; border: 1.5px dashed var(--muted); border-radius: 10px; display: grid; place-items: center; }
.evp-attach:hover { color: var(--text); }
.evp-link-add { display: grid; grid-template-columns: 1fr 160px auto; gap: 6px; }
.evp-row { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--border); min-height: 56px; }
.evp-row:last-child { border-bottom: none; }
.evp-row.clickable { cursor: pointer; }
.evp-row.clickable:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.evp-ic { color: var(--muted); display: grid; place-items: center; width: 24px; }
.evp-label { font-size: 16px; white-space: nowrap; }
.evp-inline { flex: 1; border: none; background: transparent; text-align: right; color: var(--text); font-size: 14px; min-width: 0; }
.evp-inline::placeholder { color: var(--muted); }
.evp-chev { color: var(--muted); transition: transform .15s; }
.evp-chev.up { transform: rotate(180deg); }
.evp-people { max-height: 200px; overflow-y: auto; padding: 6px 18px 10px 56px; border-bottom: 1px solid var(--border); background: var(--bg); }
.evp-people label { gap: 10px; padding: 5px 0; cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; width: 46px !important; height: 28px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); position: relative; cursor: pointer; flex: none; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { transform: translateX(18px); background: #fff; }
.evp-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.evp-save { border-radius: 999px; padding: 10px 24px; font-size: 15px; }
.evp-cancel { border-radius: 999px; padding: 10px 22px; font-size: 15px; background: transparent; }
.ts-meet { background: color-mix(in srgb, var(--accent) 5%, transparent); color: var(--muted); }
@media (max-width: 600px) { .evp-date b { font-size: 26px; } .evp-link-add { grid-template-columns: 1fr; } }
.evp-select .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* ---------- People page ---------- */
.tab-count { font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 1px 7px; margin-left: 3px; }
.ppl { overflow: visible; }
.ppl-row { display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(0, 1.2fr) 90px 100px 130px 40px; gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--border); }
.ppl-row:last-child { border-bottom: none; }
.ppl-row:not(.ppl-head):hover { background: color-mix(in srgb, var(--text) 3%, transparent); }
.ppl-head { font-size: 13px; font-weight: 700; color: var(--muted); padding-top: 14px; padding-bottom: 12px; }
.ppl-row.off { opacity: .65; }
.ppl-name { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ppl-name b { font-size: 15.5px; }
.ppl-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppl-av { position: relative; flex: none; }
.ppl-av .avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.online { position: absolute; left: 1px; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: var(--success); border: 2px solid var(--surface); }
.online-text { color: var(--success); font-weight: 600; }
.role-badge { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; line-height: 1.5; }
.role-badge.owner { background: color-mix(in srgb, #60a5fa 28%, transparent); color: #93c5fd; }
.role-badge.member { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.role-badge.client { background: #fcd34d; color: #3b2a00; }
:root[data-theme="light"] .role-badge.owner { color: #1d4ed8; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .role-badge.owner { color: #1d4ed8; } }
@media (max-width: 760px) { .ppl-row { grid-template-columns: minmax(0, 1fr) 40px; } .ppl-row > div:not(:first-child):not(:last-child) { display: none; } }

/* Import preview */
.imp-list { border: 1px solid var(--border); border-radius: 8px; max-height: min(52vh, 460px); overflow-y: auto; }
.imp-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.imp-proj + .imp-proj { border-top: 1px solid var(--border); }
.imp-phead { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.imp-phead input, .imp-task input { width: 17px; height: 17px; margin: 0; flex: none; }
.imp-toggle { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; border: 0; background: none; padding: 0; cursor: pointer; color: inherit; font: inherit; }
.imp-chev { width: 14px; color: var(--muted); }
.imp-task { display: flex; align-items: center; gap: 12px; padding: 7px 12px 7px 34px; cursor: pointer; border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.imp-task:hover { background: var(--surface-2); }
.imp-task.off { cursor: default; opacity: .55; }
.imp-task .grow { display: flex; flex-direction: column; }
.imp-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-bar { gap: 8px; margin-bottom: 8px; }
.imp-warn { margin-top: 10px; padding: 8px 11px; border-radius: 7px; font-size: 13px; background: color-mix(in srgb, var(--warning, #f59e0b) 14%, transparent); }
.code-static { background: var(--surface-2); color: var(--muted); font-weight: 600; cursor: default; }
.code-static:focus { outline: none; }

/* Google Drive */
.drive-steps { margin: 12px 0; padding-left: 20px; line-height: 1.6; }
.drive-acct { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
.drive-acct code { font-size: 12px; overflow-wrap: anywhere; }
.drive-backfill { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); gap: 10px; }
.drive-open { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.drive-open .drive-logo svg { width: 16px; height: 14px; }
.drive-cell { width: 32px; height: 28px; padding: 0; display: inline-grid; place-items: center; }
.drive-cell svg { width: 16px; height: 14px; }
.drive-cell.add { color: var(--muted); font-size: 16px; }

/* Task window: uniform fields on the right */
.tp-side select, .tp-side input:not([type=checkbox]), .tp-picker { height: 40px; font-size: 14px; border-radius: 8px; padding: 0 12px; }
.tp-side select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.tp-side select:disabled, .tp-side input:disabled { opacity: .7; cursor: default; }
.tp-side .tp-add-label { width: 100%; flex: 1 1 100%; }
.tp-input-x { position: relative; }
.tp-input-x input { padding-right: 38px; }
.tp-input-x .icon-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.tp-picker { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.tp-picker:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.tp-picker.open { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.tp-picker:disabled { opacity: .7; cursor: default; }
.tp-picker-ic, .tp-chev { color: var(--muted); display: flex; }
.dp-wrap { position: relative; }
.dp-pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; width: auto; min-width: 280px; z-index: 30; padding: 14px 14px 10px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-head b { font-size: 16px; font-weight: 600; }
.dp-head .icon-btn { font-size: 20px; width: 32px; height: 32px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px 0; justify-items: center; }
.dp-wd { font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.dp-day { width: 34px; height: 34px; border-radius: 50%; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; position: relative; }
.dp-day:hover { background: var(--surface-2); }
.dp-day.off, .dp-day.out { color: var(--muted); font-weight: 400; }
.dp-day.out { opacity: .55; }
.dp-day.today { color: var(--accent); }
.dp-day.today::after { content: ''; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.dp-day.sel { background: var(--accent); color: #fff; opacity: 1; }
.dp-day.sel.today::after { background: #fff; }
.dp-hint { min-height: 18px; margin: 8px 2px 0; }
.dp-foot { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border); margin: 8px -14px 0; padding: 10px 14px 0; }

/* Task window: assignee picker */
.tp-picker .avatar { width: 24px; height: 24px; font-size: 10px; flex: none; }
.ap-pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; width: auto; min-width: 260px; z-index: 30; padding: 0; overflow: hidden; }
.ap-search { display: flex; align-items: center; gap: 10px; padding: 12px; }
.ap-search input { flex: 1; }
.ap-group-btn { color: var(--muted); width: 38px; height: 38px; flex: none; }
.ap-group-btn.on { color: var(--text); }
.ap-list { max-height: 300px; overflow-y: auto; padding-bottom: 6px; }
.ap-group + .ap-group { border-top: 1px solid var(--border); }
.ap-head { padding: 10px 14px 4px; font-weight: 700; font-size: 13px; }
.ap-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 14px; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.ap-row:hover, .ap-row:focus-visible { background: var(--surface-2); outline: none; }
.ap-row .avatar { width: 30px; height: 30px; font-size: 11px; flex: none; }
.ap-box { width: 20px; height: 20px; border: 1.5px solid var(--border); border-radius: 5px; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.ap-row.on .ap-box { background: var(--accent); border-color: var(--accent); color: #fff; }
.ap-none-ic { width: 30px; text-align: center; color: var(--muted); }
.ap-empty { padding: 10px 14px; }
.ap-row[hidden], .ap-group[hidden], .ap-empty[hidden] { display: none; }

/* Assignee team filter */
.ap-group-btn { position: relative; border-radius: 8px; }
.ap-group-btn.on { background: var(--surface-2); }
.ap-dot { position: absolute; top: 2px; right: 2px; min-width: 15px; height: 15px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-style: normal; font-weight: 700; display: grid; place-items: center; padding: 0 3px; }
.ap-teams { margin: 0 12px 10px; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.08); padding: 4px 0; }
.ap-team { display: flex; align-items: center; gap: 10px; padding: 9px 14px; cursor: pointer; font-size: 14px; }
.ap-team:hover { background: var(--surface-2); }
.ap-team input { width: 18px; height: 18px; margin: 0; flex: none; }
.ap-row .badge-pending { font-size: 10px; }

/* Labels field */
.lp-field { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 5px 10px 5px 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }
.lp-field:hover:not(.disabled) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.lp-field.open { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; cursor: text; }
.lp-field.disabled { cursor: default; opacity: .8; }
.lp-chips { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; }
.lp-chips > .muted { padding-left: 6px; }
.lp-chip { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 600; letter-spacing: .02em; background: color-mix(in srgb, var(--lc) 82%, #000 0%); color: #fff; text-transform: uppercase; }
.tp-side .lp-chips input { flex: 1; min-width: 80px; height: 26px; border: 0; padding: 0 4px; background: none; outline: none; }
.lp-pop { padding: 6px 0; }
.lp-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 14px; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.lp-row:hover { background: var(--surface-2); }
.lp-row[hidden], .lp-nomatch[hidden] { display: none; }
.lp-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--lc); flex: none; }
.lp-name { color: var(--lc); text-transform: uppercase; letter-spacing: .02em; font-size: 14px; }
.ap-box.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Comments: edit window */
.c-meta { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.c-tools { display: inline-flex; gap: 6px; margin-left: 4px; }
.c-tools .link-btn { font-size: 12px; font-weight: 500; }
.danger-link { color: var(--danger); }
.c-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.c-edit textarea { margin-top: 4px; }

/* Workload */
.wl-card { width: 100%; text-align: left; font: inherit; cursor: pointer; }
.wl-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.mw-load-wrap { position: relative; display: flex; }
.mw-load-wrap > .wl-card { flex: 1; }
.wl-ring { background: none !important; padding: 0; }
.wl-ring svg { transform: rotate(-90deg); }
.wl-track { fill: none; stroke: var(--surface-2); stroke-width: 4; }
.wl-fill { fill: none; stroke: var(--wl, var(--success)); stroke-width: 4; stroke-linecap: round; }
.wl-card.ok { --wl: var(--success); }
.wl-card.full { --wl: var(--warn); }
.wl-card.over { --wl: var(--danger); }
.wl-card.over b { color: var(--danger); }
.wl-card.off { --wl: var(--muted); }
.wl-note { color: var(--warn) !important; font-size: 12px !important; font-weight: 600; }
.wl-pop { width: 340px; left: 0; right: auto; padding: 6px 0; max-height: 420px; overflow-y: auto; }
.wl-pop-h { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px 10px; border-bottom: 1px solid var(--border); }
.wl-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 14px; border: 0; background: none; color: var(--text); text-align: left; font: inherit; cursor: pointer; text-decoration: none; }
.wl-item:hover { background: var(--surface-2); }
.wl-item .grow { display: flex; flex-direction: column; min-width: 0; }
.wl-item b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-h { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 42px; color: var(--muted); }
.wl-empty { padding: 10px 14px; }
.wl-warn { margin: 6px 12px 6px; padding: 8px 10px; border-radius: 7px; font-size: 12px; background: color-mix(in srgb, var(--warn) 14%, transparent); }
.tp-warn { margin-top: 6px; font-size: 12px; color: var(--muted); }
.wl-nav { gap: 6px; align-items: center; }
.wl-nav .icon-btn { font-size: 18px; }
.wl-grid { padding: 0; overflow-x: auto; }
.wl-grid-row { display: grid; grid-template-columns: minmax(200px, 1.4fr) repeat(7, minmax(70px, 1fr)) minmax(96px, .9fr); align-items: stretch; border-top: 1px solid var(--border); min-width: 860px; }
.wl-grid-head { border-top: 0; font-size: 12px; color: var(--muted); }
.wl-grid-head > div { padding: 10px 8px; text-align: center; }
.wl-grid-head > div:first-child { text-align: left; padding-left: 16px; }
.wl-grid-head .today { color: var(--accent); }
.wl-grid-head .weekend { opacity: .6; }
.wl-person { display: flex; align-items: center; gap: 10px; padding: 10px 16px; min-width: 0; }
.wl-person > div { display: flex; flex-direction: column; min-width: 0; }
.wl-cellwrap { position: relative; padding: 6px 4px; }
.wl-cell { width: 100%; height: 100%; min-height: 40px; border: 0; border-radius: 8px; font: inherit; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.wl-cell.ok { background: color-mix(in srgb, var(--success) 16%, transparent); color: color-mix(in srgb, var(--success) 70%, var(--text)); }
.wl-cell.full { background: color-mix(in srgb, var(--warn) 22%, transparent); color: color-mix(in srgb, var(--warn) 60%, var(--text)); }
.wl-cell.over { background: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }
.wl-cell.off { background: var(--surface-2); color: var(--muted); font-weight: 500; }
.wl-cell.un { background: none; border: 1px dashed var(--border); color: var(--muted); }
.wl-cell.today { box-shadow: inset 0 0 0 2px var(--accent); }
.wl-total { display: flex; flex-direction: column; justify-content: center; align-items: center; font-weight: 700; padding: 6px; }
.wl-total.over { color: var(--danger); }
.wl-total .small { font-weight: 400; }
.wl-cellwrap .wl-pop { top: calc(100% - 2px); }
.wl-grid-row > .wl-cellwrap:nth-last-child(-n+4) .wl-pop { left: auto; right: 0; }
.wl-legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 10px; }
.wl-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.wl-legend i.ok { background: color-mix(in srgb, var(--success) 35%, transparent); }
.wl-legend i.full { background: color-mix(in srgb, var(--warn) 45%, transparent); }
.wl-legend i.over { background: color-mix(in srgb, var(--danger) 40%, transparent); }
.wl-legend i.off { background: var(--surface-2); border: 1px solid var(--border); }
.set-sub { font-weight: 700; margin: 6px 0 10px; padding-top: 12px; border-top: 1px solid var(--border); }

/* Workspace days off */
.hol-list { margin-bottom: 14px; }
.hol-list .past { opacity: .55; }
.hol-ic { font-size: 18px; }
.hol-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hol-form input[name=name] { flex: 1 1 200px; }
.hol-form input[type=date] { width: auto; flex: 0 1 160px; }
.ev-holiday { display: block; margin: 2px 0 4px; font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-hol { display: block; font-size: 10px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hol-emoji { position: relative; flex: none; }
.hol-emoji-btn { list-style: none; width: 42px; height: 38px; display: grid; place-items: center; font-size: 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }
.hol-emoji-btn::-webkit-details-marker { display: none; }
.hol-emoji-pop { left: 0; right: auto; width: 290px; padding: 10px; display: grid; gap: 8px; }
.hol-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.hol-emoji-pop .hol-emoji-grid button { display: block; width: auto; padding: 0; text-align: center; border: 0; background: none; font-size: 20px; height: 32px; border-radius: 6px; cursor: pointer; }
.hol-emoji-pop .hol-emoji-grid button:hover { background: var(--surface-2); }
.hol-editing { padding: 10px 0; }
.hol-editing .hol-form { width: 100%; }
.hol-when { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.hol-when.now { color: var(--success); }

/* My Work → Availability: your time off | upcoming holidays */
.av-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.av-cols > .set-card { margin: 0; }
@media (max-width: 900px) { .av-cols { grid-template-columns: 1fr; } }
.slack-brief { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }

/* Rich text (descriptions, comments, discussions, notes) */
.rich { font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.rich > :first-child { margin-top: 0; }
.rich > :last-child { margin-bottom: 0; }
.rich p { margin: 0 0 .7em; }
.rich h2 { font-family: var(--font-head); font-size: 20px; line-height: 1.3; margin: 1.1em 0 .4em; }
.rich h3 { font-family: var(--font-head); font-size: 16px; line-height: 1.35; margin: 1.1em 0 .35em; }
.rich ul, .rich ol { margin: 0 0 .7em; padding-left: 1.5em; }
.rich li { margin: .15em 0; }
.rich li > ul, .rich li > ol { margin: .15em 0; }
.rich blockquote { margin: 0 0 .7em; padding: 2px 0 2px 14px; border-left: 3px solid var(--border); color: var(--muted); }
.rich .callout { margin: 0 0 .7em; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 9%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.rich .callout > :last-child { margin-bottom: 0; }
.rich a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.rich img { max-width: 100%; height: auto; border-radius: 8px; margin: 4px 0; display: block; }
.rich pre, .rich code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--surface-2); border-radius: 5px; }
.rich code { padding: 1px 5px; }
.rich pre { padding: 10px 12px; overflow-x: auto; }
.rich.bubble p { margin-bottom: .4em; }

/* Editor */
.rte { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.rte:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.rte-btn { min-width: 32px; height: 32px; padding: 0 6px; border: 0; border-radius: 7px; background: none; color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; display: inline-grid; place-items: center; }
.rte-btn:hover { background: var(--surface-2); color: var(--text); }
.rte-btn b, .rte-btn i, .rte-btn u, .rte-btn s { font-family: Georgia, serif; font-size: 17px; }
.rte-sep { width: 1px; height: 22px; background: var(--border); margin: 0 6px; }
.rte-body { padding: 12px 16px; outline: none; max-height: 70vh; overflow-y: auto; }
.rte-body:empty::before, .rte-body:has(> p:only-child > br:only-child)::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; position: absolute; }
.rte-files { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
.rte-attach { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; cursor: pointer; }
.rte-clip { width: 30px; height: 30px; border: 1.5px dashed var(--border); border-radius: 7px; display: grid; place-items: center; font-size: 14px; }
.rte-attach:hover { color: var(--text); }
.rte.drop-on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.rte.compact .rte-bar { padding: 4px 6px; }
.rte.compact .rte-btn { min-width: 28px; height: 28px; font-size: 14px; }
.rte.compact .rte-body { padding: 10px 12px; }
.rte.compact .rte-files { padding: 8px 12px; }
.tp-desc-wrap { margin: 4px 0 6px; }

/* File chips */
.file-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); max-width: 100%; }
.file-chip > a { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; color: var(--text); text-decoration: none; min-width: 0; }
.file-chip > a:hover { background: var(--surface-2); border-radius: 9px; }
.file-chip img { width: 30px; height: 30px; object-fit: cover; border-radius: 5px; }
.fc-ic { width: 30px; height: 30px; display: grid; place-items: center; font-size: 17px; background: var(--surface-2); border-radius: 5px; }
.fc-name { font-size: 13px; font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-size { font-size: 12px; color: var(--muted); }
.file-chip .icon-btn { margin-right: 4px; }

/* "/" menu */
.slash-menu { position: fixed; z-index: 200; min-width: 200px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); display: grid; }
.slash-menu button { text-align: left; border: 0; background: none; font: inherit; font-size: 14px; color: var(--text); padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.slash-menu button.on, .slash-menu button:hover { background: var(--surface-2); }
.comment .rich.bubble { white-space: normal; }
.rte-body { position: relative; }

/* Files tab: linked files as cards */
.file-add { padding: 12px; gap: 8px; margin-bottom: 14px; }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.link-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.link-card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: 0 6px 20px rgba(0,0,0,.07); }
.lc-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 1.91 / 1; background: color-mix(in srgb, var(--fc) 14%, var(--surface-2)); overflow: hidden; text-decoration: none; }
.lc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lc-icon { font-size: 44px; filter: saturate(1.1); }
.lc-loading { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.lc-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 12px; flex: 1; min-width: 0; }
.lc-title { font-weight: 600; color: var(--text); text-decoration: none; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.lc-title:hover { color: var(--accent); }
.lc-meta { display: flex; gap: 6px; align-items: center; font-size: 12px; min-width: 0; white-space: nowrap; overflow: hidden; }
.lc-kind { font-weight: 600; color: color-mix(in srgb, var(--fc) 75%, var(--text)); }
.lc-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px; }
.lc-foot .menu-pop { bottom: calc(100% + 4px); top: auto; }
/* Comments: no toolbar, so keep the box light */
.rte.compact:not(:has(.rte-bar)) .rte-body { padding-top: 10px; }

/* Project settings: Slack channel picker */
.sc-pick { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.sc-pick:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.sc-search { border: 0 !important; border-bottom: 1px solid var(--border) !important; border-radius: 0 !important; padding: 10px 12px; outline: none !important; }
.sc-list { max-height: 220px; overflow-y: auto; padding: 4px 0; }
.sc-head { padding: 8px 12px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.field label.sc-row { display: flex; align-items: center; gap: 8px; margin: 0; padding: 7px 12px; font-size: 14px; font-weight: 400; color: var(--text); cursor: pointer; }
.sc-row:hover { background: var(--surface-2); }
.sc-row input[type=radio] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }
.sc-hash { width: 16px; text-align: center; color: var(--muted); font-weight: 600; }
.sc-create { display: block; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--border); background: none; color: var(--accent); font: inherit; font-size: 14px; padding: 9px 12px; margin-top: 4px; cursor: pointer; }
.sc-create:hover { background: var(--surface-2); }
.sc-row[hidden], .sc-head[hidden], .sc-create[hidden], .sc-empty[hidden] { display: none; }
.sc-empty { padding: 8px 12px; }
/* "hidden" has to beat the row's display:flex above, or filtered-out channels still show */
.field label.sc-row[hidden] { display: none; }

/* Workload: unassigned tasks side panel */
.wl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .wl-layout { grid-template-columns: 1fr; } }
/* No inner scrolling: the date and Assign popovers would be clipped. The page scrolls instead. */
.un-panel { padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.un-head { display: flex; align-items: center; gap: 8px; }
.un-filter { width: 100%; }
.un-tip { line-height: 1.4; }
.un-list { display: grid; gap: 10px; }
.un-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface); cursor: grab; display: grid; gap: 10px; min-width: 0; }
.un-card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.un-card.dragging { opacity: .5; }
.un-grip { color: var(--muted); font-size: 12px; letter-spacing: -2px; padding-top: 3px; }
.un-title { font-weight: 600; color: var(--text); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.un-title:hover { color: var(--accent); }
.un-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 8px; }
.un-row .dp-wrap { min-width: 0; }
.un-row .tp-picker .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.un-row .dp-pop { min-width: 290px; }
.un-assign { position: relative; }
.un-assign-btn { width: 100%; height: 40px; }
.un-pop { left: 0; right: 0; width: auto; top: calc(100% + 6px); padding: 6px 0; max-height: 340px; overflow-y: auto; }
.un-person { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 12px; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.un-person:hover { background: var(--surface-2); }
.un-load { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.un-load.ok { background: color-mix(in srgb, var(--success) 16%, transparent); color: color-mix(in srgb, var(--success) 70%, var(--text)); }
.un-load.full { background: color-mix(in srgb, var(--warn) 22%, transparent); color: color-mix(in srgb, var(--warn) 60%, var(--text)); }
.un-load.over { background: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }
.un-load.off { background: var(--surface-2); color: var(--muted); }
.wl-cellwrap.wl-drop-on .wl-cell { box-shadow: inset 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }

/* Calendar: events over several days as one bar, holidays in the week view */
.ev-week { position: relative; }
.ev-day .ev-holiday { height: 16px; margin: 0; line-height: 16px; }
.ev-lanes { display: block; }
.ev-bars { position: absolute; left: 0; right: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: 21px; row-gap: 3px; pointer-events: none; }
.ev-bar { pointer-events: auto; margin: 0 4px; display: flex; align-items: center; gap: 5px; min-width: 0; height: 21px; padding: 0 8px; border: 0; border-radius: 5px; font: inherit; font-size: 12.5px; text-align: left; cursor: pointer;
  color: var(--text); background: color-mix(in srgb, var(--c) 32%, var(--surface)); overflow: hidden; white-space: nowrap; }
.ev-bar:hover { background: color-mix(in srgb, var(--c) 45%, var(--surface)); }
.ev-bar.cl { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.ev-bar.cr { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.ev-bar .ev-title { overflow: hidden; text-overflow: ellipsis; }
.ev-bar .ev-time { font-size: 11.5px; color: var(--muted); flex: none; }
.ev-bar .ev-cont { color: var(--muted); flex: none; }
.ev-bar.hol { cursor: default; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 11.5px; border: 1px dashed var(--border); }
.ev-wk-allday { position: relative; }
.ev-bars.wk { top: 4px; left: 58px; }

/* Logos: square + wide, versions for dark backgrounds, no rounding or cropping */
.brand-wide-img { display: block; height: 36px; max-width: 200px; width: auto; object-fit: contain; object-position: left center; }
.auth-brand .brand-wide-img { height: 40px; max-width: 260px; }
.sidebar .brand.has-wide { gap: 0; }
.sidebar:not(.collapsed) .brand.has-wide .brand-sq { display: none; }
.sidebar.collapsed .brand.has-wide .brand-wide { display: none; }
.logo-on-dark { display: none; }
:root[data-theme="dark"] .logo-on-light { display: none; }
:root[data-theme="dark"] .logo-on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-on-light { display: none; }
  :root:not([data-theme="light"]) .logo-on-dark { display: block; }
}
.logo-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 18px; }
.logo-slot { display: flex; gap: 14px; align-items: flex-start; }
.logo-preview.wide { width: 140px; }
.logo-preview.dark { background: var(--sidebar); }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
