:root {
  --bg: #fafafb; --sidebar: #f3f3f5; --panel: #ffffff; --hover: #efeff2; --active: #e8e8ed;
  --text: #1b1c1f; --muted: #7a7d86; --faint: #a4a7af; --line: #e4e5ea;
  --accent: #5b5bd6; --accent-h: #4a4ac4; --accent-soft: rgba(91,91,214,.12); --danger: #d5463f;
  --shadow: 0 1px 2px rgba(20,20,30,.06), 0 4px 14px rgba(20,20,30,.05);
  --shadow-lg: 0 20px 60px rgba(10,10,20,.25);
  --lt: 36%; --on-accent: #fff; --backdrop: rgba(20,20,30,.35);
  --s-backlog: #9a9da6; --s-todo: #7a7d86; --s-in_progress: #e5a000; --s-in_review: #8a63e8; --s-done: #3aa76d; --s-canceled: #c9606a;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 13.5px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--active); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: padding-box; border: 2px solid transparent; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
svg { flex-shrink: 0; }

/* controls */
button, input, select, textarea { font: inherit; color: inherit; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: background .12s, border-color .12s, transform .05s; box-shadow: 0 1px 0 rgba(0,0,0,.02); white-space: nowrap; }
button:hover { background: var(--hover); }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 500; }
button.primary:hover { background: var(--accent-h); }
button.danger { color: var(--danger); }
button.danger:hover { background: rgba(213,70,63,.1); border-color: rgba(213,70,63,.35); }
button.ghost { background: none; border-color: transparent; box-shadow: none; color: var(--muted); padding: 0 8px; }
button.ghost:hover { background: var(--hover); color: var(--text); }
button.icon { width: 28px; height: 28px; padding: 0; }
input[type=text], input:not([type]), input[type=date], select, textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; height: 32px; width: 100%; transition: border-color .12s, box-shadow .12s;
}
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 28px; cursor: pointer; width: auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b8e97' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
input[type=file] { display: none; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 500; }
.field > input, .field > select, .field > textarea { color: var(--text); font-weight: 400; font-size: 13.5px; width: 100%; }

/* layout */
#app { display: flex; height: 100vh; }
#sidebar { width: 236px; background: var(--sidebar); border-right: 1px solid var(--line); padding: 14px 10px; overflow-y: auto; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; }
#main { flex: 1; overflow: auto; display: flex; flex-direction: column; min-width: 0; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 14.5px; padding: 4px 8px 16px; letter-spacing: -.01em; }
.logo { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, var(--accent), #a06cf5); display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; }
.nav-h { display: flex; justify-content: space-between; align-items: center; color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 16px 8px 4px; }
.nav-h button { height: 22px; width: 22px; padding: 0; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; color: var(--text); transition: background .1s; }
.nav-item:hover { background: var(--hover); text-decoration: none; }
.nav-item.active { background: var(--active); font-weight: 550; }
.nav-item .count { margin-left: auto; color: var(--faint); font-size: 12px; }
.pbadge { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; background: hsl(var(--h) 55% 52%); flex-shrink: 0; }
.key { font-size: 11px; font-weight: 650; background: var(--accent-soft); color: var(--accent); border-radius: 5px; padding: 1px 6px; letter-spacing: .02em; }

.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 28px 12px; flex-wrap: wrap; }
.topbar h1 { font-size: 20px; font-weight: 650; }
.topbar .spacer { flex: 1; }
.filters { display: flex; gap: 8px; align-items: center; }
.search { position: relative; }
.search svg { position: absolute; left: 9px; top: 9px; color: var(--faint); pointer-events: none; }
.search input { padding-left: 30px; width: 190px; }
.tabs { display: flex; gap: 2px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.tab { padding: 8px 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .1s; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.content { padding: 20px 28px 40px; flex: 1; }
.page-title { padding: 22px 28px 0; display: flex; align-items: center; }

/* board */
.board { display: flex; gap: 14px; align-items: flex-start; min-height: 100%; }
.col { width: 296px; flex-shrink: 0; display: flex; flex-direction: column; max-height: calc(100vh - 170px); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 2px 6px 10px; font-weight: 600; font-size: 13px; }
.col-h .count { color: var(--faint); font-weight: 500; }
.col-h .add { margin-left: auto; width: 24px; height: 24px; padding: 0; opacity: 0; }
.col:hover .add { opacity: 1; }
.cards { overflow-y: auto; flex: 1; min-height: 60px; display: flex; flex-direction: column; gap: 8px; padding: 2px; border-radius: 10px; transition: background .12s; }
.cards.over { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.cards:empty::before { content: 'No issues'; color: var(--faint); font-size: 12px; text-align: center; padding: 18px 0; border: 1px dashed var(--line); border-radius: 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: grab; box-shadow: var(--shadow); transition: border-color .12s, transform .12s, box-shadow .12s; }
.card:hover { border-color: var(--faint); transform: translateY(-1px); }
.card.dragging { opacity: .35; }
.card .top { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.card .t { margin: 5px 0 8px; font-weight: 500; line-height: 1.4; }
.card .top .av { margin-left: auto; }
.meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11.5px; background: var(--hover); color: var(--muted); }
.chip.label { background: hsl(var(--h) 60% 50% / .16); color: hsl(var(--h) 60% var(--lt)); }
.av { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 650; color: #fff; background: hsl(var(--h) 50% 50%); flex-shrink: 0; }

/* list + tables */
.table { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tr { display: grid; grid-template-columns: 72px 22px 1fr 110px 130px 104px 70px; align-items: center; gap: 10px; padding: 0 14px; height: 40px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tr:last-child { border-bottom: none; }
.tr:not(.th):hover { background: var(--hover); }
.tr.th { height: 32px; cursor: default; color: var(--faint); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.tr .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.tr .id { color: var(--muted); font-size: 12px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.panel h3 { font-size: 13px; font-weight: 650; margin-bottom: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
a.pcard { color: inherit; display: block; transition: transform .12s, border-color .12s; }
a.pcard:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--faint); }
.bar { height: 5px; background: var(--active); border-radius: 3px; overflow: hidden; }
.bar > div { height: 100%; background: var(--s-done); border-radius: 3px; transition: width .3s; }
.row-flex { display: flex; gap: 8px; align-items: center; }
.empty { color: var(--muted); text-align: center; padding: 60px 20px; }
.empty b { display: block; font-size: 15px; color: var(--text); margin-bottom: 4px; }

/* issue modal */
#modal { position: fixed; inset: 0; background: var(--backdrop); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 5vh 16px; overflow-y: auto; z-index: 10; animation: fade .12s; }
.dialog { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: min(980px, 100%); display: flex; box-shadow: var(--shadow-lg); animation: pop .15s; overflow: hidden; }
.dialog .left { flex: 1; padding: 20px 28px 26px; min-width: 0; }
.dialog .right { width: 250px; padding: 16px 14px; border-left: 1px solid var(--line); background: var(--sidebar); display: flex; flex-direction: column; gap: 2px; }
.dhead { display: flex; align-items: center; gap: 8px; color: var(--muted); margin-bottom: 8px; }
.title-input { border: 1px solid transparent !important; background: none !important; font-size: 22px; font-weight: 650; height: 42px !important; padding: 0 8px !important; margin-left: -8px; width: calc(100% + 8px) !important; letter-spacing: -.015em; }
.title-input:hover { border-color: var(--line) !important; }
.title-input:focus { border-color: var(--accent) !important; }
.desc { border-radius: 8px; padding: 8px 10px; margin: 0 -10px; cursor: text; min-height: 52px; border: 1px solid transparent; transition: background .1s; }
.desc:hover { background: var(--hover); }
.desc.over { background: var(--accent-soft); border-color: var(--accent); }
.placeholder { color: var(--faint); }
.sec-h { display: flex; align-items: center; gap: 8px; margin: 22px 0 8px; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.prop { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 8px; border-radius: 7px; position: relative; color: var(--muted); }
.prop:hover { background: var(--hover); }
.prop .pl { width: 74px; font-size: 12px; flex-shrink: 0; }
.prop .pv { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--text); min-width: 0; }
.prop select, .prop input { border: none; background: none; box-shadow: none; padding: 0; height: 30px; flex: 1; min-width: 0; color: var(--text); background-position: right 0 center; }
.prop select:hover, .prop input:hover { border: none; }
.prop input:focus, .prop select:focus { box-shadow: none; outline: none; }
.prop-sep { height: 1px; background: var(--line); margin: 10px 0; }
.sub { font-size: 12px; color: var(--faint); padding: 4px 8px; }

.md { white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.md img { max-width: 100%; max-height: 440px; border-radius: 8px; display: block; margin: 8px 0; border: 1px solid var(--line); }
.md code { background: var(--active); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.md pre { background: var(--sidebar); border: 1px solid var(--line); padding: 10px 12px; border-radius: 8px; overflow-x: auto; white-space: pre; }
.md pre code { background: none; padding: 0; }
.comment { display: flex; gap: 10px; margin: 14px 0; }
.comment .body { flex: 1; min-width: 0; background: var(--sidebar); border: 1px solid var(--line); border-radius: 10px; padding: 9px 13px; }
.comment .ch { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.comment .ch b { color: var(--text); font-weight: 600; }
.comment .ch button { margin-left: auto; height: 22px; opacity: 0; }
.comment:hover .ch button { opacity: 1; }
.composer { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); transition: border-color .12s, box-shadow .12s; margin-top: 12px; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer.over { border-color: var(--accent); background: var(--accent-soft); }
.composer textarea { border: none !important; box-shadow: none !important; background: none; min-height: 70px; resize: none; }
.composer .bar2 { display: flex; align-items: center; gap: 8px; padding: 6px 8px 8px; flex-wrap: wrap; }
.composer .bar2 .grow { flex: 1; }
.fchip { display: inline-flex; align-items: center; gap: 6px; background: var(--hover); border-radius: 7px; padding: 2px 4px 2px 8px; font-size: 12px; max-width: 200px; }
.fchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fchip button { height: 18px; width: 18px; padding: 0; }
.atts { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.att { background: var(--sidebar); border: 1px solid var(--line); border-radius: 10px; padding: 6px; width: 180px; font-size: 12px; position: relative; overflow: hidden; }
.att img, .att video { width: 100%; height: 104px; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 5px; }
.att .fileico { height: 60px; display: grid; place-items: center; color: var(--faint); }
.att .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.att .x { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; padding: 0; opacity: 0; background: var(--panel); }
.att:hover .x { opacity: 1; }
.att audio { width: 100%; }
.attach-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 12.5px; }
.attach-btn:hover { background: var(--hover); color: var(--text); }

/* dialogs */
.dlg { position: fixed; inset: 0; background: var(--backdrop); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; z-index: 20; animation: fade .12s; }
.dlg form { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: min(500px, 92vw); padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-lg); animation: pop .15s; }
.dlg h3 { font-size: 16px; font-weight: 650; }
.dlg .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.dlg .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dlg select { width: 100%; }
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: 9px; box-shadow: var(--shadow-lg); animation: pop .15s; max-width: 340px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }

/* native select popup: follow theme (was white-on-white) */
select option { background: var(--panel); color: var(--text); }
.sidebar-foot { margin-top: auto; padding-top: 10px; }
.sidebar-foot .nav-item { width: 100%; background: none; border: none; height: 32px; box-shadow: none; justify-content: flex-start; color: var(--muted); }
.sidebar-foot .nav-item:hover { color: var(--text); background: var(--hover); }
/* appearance dialog */
.seg { display: inline-flex; background: var(--hover); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: none; background: none; box-shadow: none; height: 28px; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); font-weight: 550; }
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme { height: auto; padding: 0; flex-direction: column; align-items: stretch; overflow: hidden; border-radius: 10px; text-align: left; gap: 0; }
.theme .sw { height: 54px; padding: 8px; display: flex; gap: 6px; align-items: flex-end; }
.theme .sw i { display: block; height: 14px; border-radius: 4px; }
.theme .sw b { font-size: 15px; line-height: 1; margin-right: auto; }
.theme .nm { padding: 6px 9px; font-size: 12px; background: var(--panel); border-top: 1px solid var(--line); }
.theme.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), 0 0 0 1px var(--accent); }
.arow { display: flex; align-items: center; gap: 10px; }
.arow input[type=color] { width: 38px; height: 28px; padding: 2px; border-radius: 7px; cursor: pointer; }

/* lightbox */
.md img, .att a > img { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.85); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; animation: fade .12s; }
.lightbox > img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 80px rgba(0,0,0,.6); animation: pop .15s; }
.lb-bar { position: absolute; top: 14px; left: 18px; right: 18px; display: flex; align-items: center; gap: 12px; color: #ddd; font-size: 13px; pointer-events: none; }
.lb-bar > span { flex: 1; }
.lb-bar a, .lb-bar button { pointer-events: auto; color: #ddd; font-size: 16px; text-decoration: none; background: rgba(255,255,255,.1); border: none; border-radius: 8px; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; }
.lb-bar a:hover, .lb-bar button:hover { background: rgba(255,255,255,.2); text-decoration: none; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; font-size: 30px; color: #ddd; background: rgba(255,255,255,.08); border: none; border-radius: 10px; padding: 0 0 4px; }
.lb-nav:hover { background: rgba(255,255,255,.18); }
.lb-nav.prev { left: 16px; } .lb-nav.next { right: 16px; }

/* ---- custom select / date picker / popups ---- */
.csel-native { display: none !important; }
.csel-btn { gap: 8px; font-weight: 400; min-width: 0; justify-content: flex-start; }
.csel-btn .lbl { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csel-btn .lbl.ph { color: var(--muted); }
.csel-btn .chev { color: var(--faint); margin-left: auto; display: inline-flex; }
.csel-btn .ico { display: inline-flex; }
.csel-btn .ico:empty { display: none; }
.field > .csel-btn, .dlg .field .csel-btn { width: 100%; height: 32px; background: var(--panel); }
.filters .csel-btn { min-width: 132px; }
.prop .csel-btn { border: none; background: none; box-shadow: none; padding: 0; height: 30px; flex: 1; }
.prop .csel-btn:hover { background: none; }
.popup { position: fixed; z-index: 70; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-lg); padding: 4px; overflow: auto; animation: pop .12s; }
.cmenu-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.cmenu-item.hl { background: var(--hover); }
.cmenu-item .ico { display: inline-flex; width: 14px; justify-content: center; }
.cmenu-item .ico:empty { display: none; }
.cmenu-item .lbl { flex: 1; }
.cmenu-item .tick { color: var(--accent); width: 14px; display: inline-flex; justify-content: flex-end; margin-left: 10px; }
.cal { padding: 10px; width: 264px; }
.cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-h b { font-weight: 600; text-transform: capitalize; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal .dow { text-align: center; font-size: 11px; color: var(--faint); padding: 3px 0; }
.cal .day { height: 30px; padding: 0; border: none; background: none; box-shadow: none; border-radius: 8px; font-size: 12.5px; }
.cal .day:hover { background: var(--hover); }
.cal .day.out { color: var(--faint); }
.cal .day.today { box-shadow: inset 0 0 0 1px var(--accent); }
.cal .day.sel { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.cal-f { display: flex; justify-content: space-between; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
.dlg form.small { width: min(400px, 92vw); }
.dlg form p { line-height: 1.5; }
button.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
button.danger-solid:hover { background: var(--danger); filter: brightness(1.1); }
textarea.uploading { opacity: .55; }
textarea.over { border-color: var(--accent); background: var(--accent-soft); }
.swatches { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.swatch { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); }
.swatch:hover { transform: scale(1.12); }
.swatch.on { box-shadow: 0 0 0 2px var(--text); }
.hexin { width: 104px !important; font-family: ui-monospace, Consolas, monospace; }
.md video { max-width: 100%; max-height: 420px; border-radius: 8px; display: block; margin: 8px 0; background: #000; }
.md audio { width: 100%; margin: 8px 0; display: block; }

/* login */
body.locked #app { filter: blur(6px); pointer-events: none; }
#login { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: var(--bg); }
.login-card { width: min(340px, 90vw); display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; padding: 32px 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 22px; }
.login-card p { margin: -6px 0 6px; }
.login-card input { height: 38px; text-align: center; }
.login-card button { height: 38px; }
.login-logo { width: 48px; height: 48px; margin: 0 auto 4px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), #a06cf5); }
.login-logo svg { width: 28px; height: 28px; }
.login-err { min-height: 18px; color: var(--danger); font-size: 12.5px; }

/* ---- live updates ---- */
.brand .live { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex-shrink: 0; transition: background .2s; }
.brand .live.on { background: var(--s-done); box-shadow: 0 0 0 0 color-mix(in srgb, var(--s-done) 55%, transparent); animation: beat 2.4s infinite; }
.brand .live.off { background: var(--danger); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--s-in_progress); flex-shrink: 0; animation: beat-amber 1.6s infinite; margin-left: 2px; }
.card.flash { animation: flash 2.6s ease-out; }
.toast.live { display: flex; align-items: center; gap: 8px; border-left: 3px solid var(--accent); background: var(--panel); color: var(--text); border: 1px solid var(--line); border-left: 3px solid var(--accent); box-shadow: var(--shadow-lg); }
.toast.link { cursor: pointer; }
.toast.link:hover { background: var(--hover); }
.stale { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--accent-soft); color: var(--text); border-radius: 8px; padding: 6px 10px; margin: -4px 0 10px; font-size: 12.5px; }
.stale button { height: 24px; }
@keyframes beat { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--s-done) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes beat-amber { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--s-in_progress) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes flash { 0% { box-shadow: 0 0 0 2px var(--accent), 0 0 18px var(--accent-soft); background: var(--accent-soft); } 100% { box-shadow: var(--shadow); } }
@media (prefers-reduced-motion: reduce) { .brand .live.on, .pulse, .card.flash { animation: none; } }

/* ---- filter / display ---- */
.tb { gap: 6px; }
.tb.on { border-color: var(--accent); color: var(--accent); }
.tb .badge { background: var(--accent); color: var(--on-accent); border-radius: 9px; min-width: 17px; height: 17px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 650; padding: 0 5px; }
.tb .badge:empty { display: none; }
.chiprow { display: none; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 28px 0; }
.chiprow.on { display: flex; }
.fchip2 { display: inline-flex; align-items: center; gap: 5px; background: var(--accent-soft); border-radius: 8px; padding: 3px 4px 3px 9px; font-size: 12.5px; max-width: 100%; }
.fchip2 b { font-weight: 600; }
.fchip2 .v { color: var(--accent); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.fchip2 button { height: 20px; width: 20px; padding: 0; background: none; border: none; box-shadow: none; color: var(--muted); }
.fchip2 button:hover { color: var(--text); background: var(--hover); }
.pover { width: 380px; max-width: 94vw; padding: 12px 14px; overscroll-behavior: contain; }
.pv-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.pv-sec { margin-top: 12px; }
.pv-title { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-bottom: 6px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pillbtn { height: 26px; padding: 0 10px; gap: 6px; border-radius: 13px; font-size: 12.5px; background: var(--panel); }
.pillbtn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); font-weight: 550; }
.pillbtn .n { color: var(--faint); font-size: 11px; }
.pillbtn:disabled { opacity: .4; cursor: not-allowed; }
.gh { display: flex; align-items: center; gap: 9px; padding: 0 12px; height: 36px; background: var(--sidebar); border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
.gh .count { color: var(--faint); }
.gh .chev { height: 20px; width: 20px; padding: 0; transition: transform .12s; }
.gh .chev.shut { transform: rotate(-90deg); }

/* due dates */
.chip.due { gap: 4px; }
.chip.due.soon { background: color-mix(in srgb, var(--s-in_progress) 20%, transparent); color: var(--s-in_progress); }
.chip.due.overdue { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); font-weight: 600; }

.pend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -6px; }
.pend:empty { display: none; }
.fchip .thumb { width: 20px; height: 20px; border-radius: 4px; object-fit: cover; }

/* account / users / tokens */
.userbtn .av { width: 22px; height: 22px; }
.userbtn span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-list { display: flex; flex-direction: column; min-width: 190px; }
.menu-item { height: 32px; justify-content: flex-start; gap: 9px; border: none; background: none; box-shadow: none; padding: 0 10px; border-radius: 7px; font-weight: 400; }
.menu-item:hover { background: var(--hover); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.dlg form.wide { width: min(800px, 94vw); max-height: 86vh; display: flex; flex-direction: column; padding: 18px 20px 14px; gap: 10px; }
.set-head { display: flex; align-items: center; gap: 10px; }
.set-head h3 { flex: 1; }
.set-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.set-tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; box-shadow: none; height: 32px; color: var(--muted); margin-bottom: -1px; }
.set-tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.set-body { overflow-y: auto; display: flex; flex-direction: column; gap: 18px; padding: 4px 2px 6px; min-height: 160px; }
.set-sec h4 { margin: 0 0 8px; font-size: 13px; }
.set-sec .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.set-sec .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.set-sec .field + .field, .set-sec .field + .two { margin-top: 8px; }
.set-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.set-row:last-child { border-bottom: none; }
.set-row .grow { flex: 1; min-width: 160px; }
.set-row.dead { opacity: .55; }
.set-row.tok { font-size: 12.5px; }
.set-row code { background: var(--hover); border-radius: 4px; padding: 0 5px; }
@media (max-width: 640px) { .set-sec .two { grid-template-columns: 1fr; } }
