/* SparkBird Hub — light by default, Linear-like density. */
[data-theme="dark"] {
  --bg: #08090a;
  --panel: #101113;
  --panel-2: #16171a;
  --hover: #1b1c20;
  --active: #22232a;
  --border: #1e1f23;
  --border-2: #2a2b31;
  --text: #f7f8f8;
  --text-2: #d0d3d9;
  --muted: #8a8f98;
  --faint: #5b5f68;
  --accent: #7170ff;
  --accent-2: #5e6ad2;
  --shadow: 0 10px 40px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.06);
  --a: #ff6b5f; --b: #f5a524; --c: #8a8f98; --p0: #ff4d3d;
  color-scheme: dark;
}
:root:not([data-theme="dark"]), [data-theme="light"] {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #f8f9fa;
  --hover: #f1f2f4;
  --active: #e9eaee;
  --border: #e6e7eb;
  --border-2: #d9dbe0;
  --text: #16171a;
  --text-2: #33363d;
  --muted: #6b6f76;
  --faint: #a2a6ad;
  --accent: #5e6ad2;
  --accent-2: #5e6ad2;
  --shadow: 0 10px 40px rgba(20,22,30,.16), 0 0 0 1px rgba(20,22,30,.08);
  --a: #e5484d; --b: #d97706; --c: #80838d; --p0: #e5484d;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 13px/1.45 "Inter", "Inter Variable", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
form.inline { display: inline; margin: 0; }
kbd {
  font: 11px/1 ui-monospace, "SF Mono", monospace; padding: 2px 5px; border-radius: 4px;
  background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text-2);
}
code { font: 12px ui-monospace, "SF Mono", monospace; background: var(--panel-2); border: 1px solid var(--border); padding: 1px 4px; border-radius: 4px; }
.icon { display: block; flex: none; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; height: 100vh; }
.sidebar { display: flex; flex-direction: column; padding: 10px 8px; gap: 2px; overflow-y: auto; }
.main {
  margin: 8px 8px 8px 0; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; overflow: auto; position: relative; min-width: 0;
}

.brand { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 600; font-size: 13.5px; }
.brand-art { object-fit: contain; mix-blend-mode: multiply; }
[data-theme="dark"] .brand-art { filter: invert(1); mix-blend-mode: screen; }
.brand-actions { margin-left: auto; display: flex; gap: 4px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn-solid { background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text-2); }
.icon-btn-active { color: var(--accent); background: var(--active); }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px; border-radius: 6px;
  color: var(--text-2); cursor: pointer; font-weight: 500; user-select: none;
}
.nav-item .icon { color: var(--muted); }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--active); color: var(--text); }
.nav-item.active .icon { color: var(--text); }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 11px; color: var(--text); background: var(--accent-2); border-radius: 9px; padding: 0 6px; line-height: 17px; }
.nav-key { font-size: 11px; color: var(--faint); font-weight: 500; }
.nav-section { margin: 16px 8px 4px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.nav-ws > summary { list-style: none; }
.nav-ws > summary::-webkit-details-marker { display: none; }
.nav-ws-head { padding: 0; }
.nav-ws-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 100%; padding: 0 4px 0 8px; border-radius: 6px; color: inherit; }
.nav-ws-link:hover { color: var(--text); }
.nav-ws-toggle { flex: none; display: grid; place-items: center; width: 24px; height: 100%; color: var(--muted); border-radius: 6px; }
.nav-ws-toggle:hover { color: var(--text); background: var(--hover); }
.nav-ws-toggle .icon { transition: transform .12s; }
.nav-ws[open] > summary .nav-ws-toggle .icon { transform: rotate(90deg); }
.nav-children { padding-left: 14px; display: flex; flex-direction: column; gap: 1px; margin-bottom: 4px; }
.ws-glyph {
  display: inline-grid; place-items: center; width: var(--s); height: var(--s); border-radius: 5px; flex: none;
  background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c);
  font-size: calc(var(--s) * .58); font-weight: 700;
}
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; padding: 8px 6px 2px; border-top: 1px solid var(--border); }
.foot-name { flex: 1; font-weight: 500; color: var(--text-2); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px;
  height: 46px; padding: 0 16px 0 20px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(12px);
}
.topbar-title { display: flex; align-items: center; gap: 8px; }
.topbar-title h1 { font-size: 13.5px; font-weight: 600; margin: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tabs { display: flex; gap: 4px; }
.tab {
  height: 26px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 6px;
  border: 1px solid var(--border-2); color: var(--muted); font-weight: 500; font-size: 12.5px;
}
.tab:hover { color: var(--text); background: var(--hover); }
.tab.on { color: var(--text); background: var(--active); border-color: var(--border-2); }

.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: 7px; padding: 2px; gap: 2px; background: var(--panel-2); }
.seg-btn { border: 0; background: transparent; height: 22px; padding: 0 9px; border-radius: 5px; color: var(--muted); font-weight: 600; font-size: 12px; cursor: pointer; letter-spacing: .02em; }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: var(--active); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text-2); font-weight: 500; cursor: pointer; font-size: 12.5px;
}
.btn:hover { background: var(--hover); color: var(--text); }
.btn-primary { background: var(--accent-2); border-color: transparent; color: #fff; }
.btn-primary:hover { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { height: 24px; padding: 0 8px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; height: 34px; }

.filterbar { display: flex; align-items: center; gap: 8px; padding: 8px 20px; border-bottom: 1px solid var(--border); }
.filter-chip { display: inline-flex; gap: 5px; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--border-2); font-size: 12px; }
.filter-chip .x { color: var(--faint); font-size: 10px; }
.filter-chip:hover .x { color: var(--text); }

/* ---------- Menus ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; z-index: 30; top: calc(100% + 4px); right: 0; min-width: 220px; max-height: 420px; overflow-y: auto;
  background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 9px; box-shadow: var(--shadow); padding: 4px;
}
.prop-menu .menu-pop { left: 0; right: auto; }
.menu-wide { width: 300px; }
.menu-head { font-size: 11px; color: var(--muted); padding: 8px 8px 4px; font-weight: 500; }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 8px; border-radius: 6px;
  border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--text-2); white-space: nowrap;
}
.menu-item:hover { background: var(--hover); color: var(--text); }
.menu-item input[type=checkbox] { accent-color: var(--accent-2); margin: 0; }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 0 2px; }
.menu-cell { display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 6px; color: var(--text-2); }
.menu-cell:hover { background: var(--hover); }
.menu-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 6px 8px; }
.menu-chips .chip:hover { border-color: var(--muted); }
.menu-filter { width: 100%; height: 30px; margin-bottom: 4px; padding: 0 8px; background: transparent; border: 0; border-bottom: 1px solid var(--border-2); color: var(--text); outline: none; }

/* ---------- Issue list ---------- */
.list { padding-bottom: 60px; }
.group-head {
  position: sticky; top: 46px; z-index: 2; display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 20px; background: var(--panel-2); border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 13px;
}
.group-count { color: var(--muted); font-weight: 500; }
.group-add { margin-left: auto; width: 30px; height: 30px; }
.group-add:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.row {
  display: grid; grid-template-columns: 30px 64px 22px minmax(0, 1fr) auto 26px 64px; align-items: center;
  height: 40px; padding: 0 20px 0 18px; border-bottom: 1px solid var(--border); color: var(--text-2);
}
.row { position: relative; }
.row-link { color: inherit; }
.row-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.row-link:focus-visible { outline: none; }
.row:has(.row-link:focus-visible) { box-shadow: inset 2px 0 0 var(--accent); }
.c-prio { display: grid; align-items: center; }
.row-prio-menu { position: relative; z-index: 3; width: max-content; }
.row-prio-menu[open] { z-index: 6; }
.row-prio-menu > summary { display: inline-flex; border-radius: 5px; padding: 1px; margin: -1px; }
.row-prio-menu > summary:hover { background: var(--active); }
.row-prio-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row-prio-menu .menu-pop { width: 240px; padding-top: 0; }
.row-prio-menu .menu-head { display: flex; align-items: center; gap: 8px; padding: 9px 8px 6px; }
.row-prio-menu .menu-item[aria-current=true] { color: var(--text); }
.row-prio-menu .menu-check { margin-left: auto; color: var(--accent); }
.row-prio-menu .menu-check::before { content: "✓"; }
kbd.keycap { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border: 1px solid var(--border-2); border-radius: 4px; background: var(--active); color: var(--text-2); font: 600 10.5px/1 inherit; }
.menu-up .menu-pop { top: auto; bottom: calc(100% + 4px); }
.row:hover, .row.focus { background: var(--hover); color: var(--text); }
.row.focus { box-shadow: inset 2px 0 0 var(--accent); }
.row-compact { height: 34px; grid-template-columns: 30px 64px 22px minmax(0, 1fr) 26px; padding: 0 8px; border: 0; border-radius: 6px; }
.c-key { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-title { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 12px; }
.c-meta { display: flex; gap: 6px; align-items: center; justify-content: flex-end; overflow: hidden; max-width: 46vw; }
.c-avatar { display: grid; place-items: center; }
.c-date { text-align: right; color: var(--muted); font-size: 12px; white-space: nowrap; }
.status-icon { display: block; }

.prio {
  display: inline-grid; place-items: center; min-width: 22px; height: 17px; padding: 0 4px; border-radius: 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums;
}
.prio-a { color: var(--a); background: color-mix(in srgb, var(--a) 16%, transparent); }
.prio-b { color: var(--b); background: color-mix(in srgb, var(--b) 15%, transparent); }
.prio-c { color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.prio-p0 { color: #fff; background: var(--p0); }
.prio-n { color: var(--text-2); background: var(--active); }
.prio-none { color: var(--faint); background: none; min-width: 22px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px;
  border: 1px solid var(--border-2); color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.chip .dot, .menu-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.chip-project .pglyph { flex: none; }
.chip-late { color: var(--a); border-color: color-mix(in srgb, var(--a) 40%, transparent); }

.avatar {
  display: inline-grid; place-items: center; width: var(--s); height: var(--s); border-radius: 50%; flex: none;
  background: var(--c); color: #fff; font-size: calc(var(--s) * .42); font-weight: 700; letter-spacing: -.02em;
}
.avatar-empty { background: none; border: 1.5px dashed var(--faint); }

.empty { padding: 90px 20px; text-align: center; color: var(--muted); }
.empty h2 { color: var(--text); font-size: 15px; margin: 0 0 6px; }

/* ---------- Issue images ---------- */
.issue-images { margin: 24px 0; }
.issue-images h3 { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.image-picker { border: 1px dashed var(--border-2); border-radius: 8px; padding: 12px; margin: 10px 0; transition: border-color .15s, background .15s; }
.image-picker-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.image-dragover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.image-file-input { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.image-file-input:focus-visible { position: static; width: 100%; height: auto; clip-path: none; margin: 8px 0; }
.image-previews { display: flex; flex-wrap: wrap; gap: 8px; }
.image-preview { position: relative; width: 140px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; margin-top: 10px; }
.image-preview img { width: 100%; height: 80px; object-fit: contain; }
.image-preview .icon-btn { position: absolute; top: 3px; right: 3px; background: var(--panel); }
.image-filename { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.image-upload-error { color: var(--a); font-size: 12px; }
.attached-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.attached-image { min-width: 0; margin: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.attached-image img { display: block; width: 100%; max-height: 360px; object-fit: contain; background: var(--panel-2); }
.attached-image figcaption { display: flex; align-items: center; gap: 8px; padding: 6px 8px; }
.attached-image .image-filename { flex: 1; min-width: 0; }
.image-download { display: block; padding: 24px 12px; overflow-wrap: anywhere; }
.new-issue-form > .image-picker { margin: 8px 16px; }

/* ---------- Issue page ---------- */
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.crumbs .icon { color: var(--faint); }
.crumb { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 5px; font-weight: 500; }
.crumb:hover { background: var(--hover); color: var(--text); }
.crumb-key { color: var(--text-2); cursor: copy; }
.issue-page { display: grid; grid-template-columns: minmax(0, 1fr) 272px; min-height: calc(100% - 46px); }
.issue-main { padding: 34px 48px 80px; max-width: 900px; width: 100%; margin: 0 auto; }
.parent-link { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.parent-link:hover { color: var(--text); }
.issue-title {
  width: 100%; border: 0; background: transparent; resize: none; overflow: hidden; outline: none;
  font-family: inherit; font-weight: 600; font-size: 24px; line-height: 1.3; color: var(--text); letter-spacing: -.012em; padding: 0; margin: 0 0 12px;
}
.desc { position: relative; margin-bottom: 30px; }
.desc-auto { min-height: 72px; resize: none; overflow: hidden; background: transparent; border-color: transparent; padding-left: 0; padding-right: 0; }
.desc-auto:hover { border-color: var(--border); padding-left: 12px; padding-right: 12px; }
.desc-auto:focus { background: var(--panel-2); padding-left: 12px; padding-right: 12px; }
.desc-status { min-height: 18px; margin-top: 4px; }
.desc-status.desc-error { color: #e5484d; }
.desc-input, .comment-form textarea, .input {
  width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid var(--border-2); border-radius: 8px;
  padding: 10px 12px; font-family: inherit; font-size: 13.5px; line-height: 1.55; outline: none; resize: vertical;
}
.desc-input:focus, .comment-form textarea:focus, .input:focus { border-color: var(--accent-2); }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.row-actions .muted { margin-right: auto; }

.markdown { font-size: 14px; line-height: 1.65; color: var(--text-2); overflow-wrap: anywhere; }
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown h1, .markdown h2, .markdown h3 { color: var(--text); line-height: 1.3; margin: 1.3em 0 .5em; }
.markdown h1 { font-size: 19px; } .markdown h2 { font-size: 16.5px; } .markdown h3 { font-size: 14.5px; }
.markdown p { margin: 0 0 .8em; }
.markdown ul, .markdown ol { padding-left: 1.4em; margin: 0 0 .8em; }
.markdown li { margin: .15em 0; }
.markdown a { color: var(--accent); }
.markdown a:hover { text-decoration: underline; }
.markdown pre { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.markdown pre code { border: 0; padding: 0; background: none; }
.markdown blockquote { margin: 0 0 .8em; padding-left: 12px; border-left: 3px solid var(--border-2); color: var(--muted); }
.markdown table { border-collapse: collapse; margin: 0 0 1em; font-size: 13px; }
.markdown th, .markdown td { border: 1px solid var(--border-2); padding: 5px 9px; text-align: left; }
.markdown th { background: var(--panel-2); color: var(--text); }
.markdown img { max-width: 100%; border-radius: 8px; }
.markdown hr { border: 0; border-top: 1px solid var(--border); margin: 1.4em 0; }
.markdown .issue-ref { color: var(--text); background: var(--active); padding: 0 5px; border-radius: 4px; font-size: 12.5px; font-weight: 500; }

.subissues { margin-bottom: 28px; }
.subissues h3, .activity h3 { font-size: 13px; font-weight: 600; margin: 0 0 10px; color: var(--text); }
.activity { border-top: 1px solid var(--border); padding-top: 22px; }
.event { display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 12.5px; padding: 6px 0 6px 4px; }
.event strong { color: var(--text-2); font-weight: 500; }
.event-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-2); flex: none; transform: translateY(-1px); margin-right: 6px; }
.comment { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12.5px; }
.comment .markdown { font-size: 13.5px; }
.comment-form { margin-top: 18px; }

.issue-props { border-left: 1px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; gap: 2px; }
.prop { display: grid; grid-template-columns: 82px 1fr; align-items: center; min-height: 32px; }
.prop-name { color: var(--muted); font-size: 12.5px; }
.prop-value { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 2px 8px; border-radius: 6px; font-weight: 500; color: var(--text-2); }
.prop-value:hover { background: var(--hover); color: var(--text); }
.prop-labels { flex-wrap: wrap; gap: 4px; }
.prop-date { background: transparent; border: 0; color: var(--text-2); font: inherit; padding: 4px 8px; border-radius: 6px; }
.prop-date:hover { background: var(--hover); }
.prop-date.empty { color: var(--faint); }
.prop-divider { border-top: 1px solid var(--border); margin: 12px 0; }
.prop-quiet { font-size: 12.5px; color: var(--text-2); min-height: 26px; }
.prop-quiet > span:last-child { padding-left: 8px; }

/* ---------- Projects, inbox, settings ---------- */
.projects { padding-bottom: 40px; }
.project-desc { padding: 14px 20px; border-bottom: 1px solid var(--border); }
.proj-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 170px 90px 100px; gap: 12px; align-items: center; height: 44px; padding: 0 20px; border-bottom: 1px solid var(--border); }
a.proj-row:hover { background: var(--hover); }
.proj-headrow { height: 34px; }
.proj-name { display: flex; gap: 8px; align-items: center; font-weight: 500; color: var(--text); }
.progress { display: flex; gap: 8px; align-items: center; }
.bar { flex: 1; height: 5px; border-radius: 3px; background: var(--active); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent-2); border-radius: 3px; }

.inbox-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.inbox-row:hover { background: var(--hover); }
.inbox-row.unread { box-shadow: inset 3px 0 0 var(--accent-2); }
.inbox-row.unread .inbox-line { font-weight: 600; color: var(--text); }
.inbox-text { display: flex; flex-direction: column; min-width: 0; }
.inbox-line { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.settings { padding: 24px; display: grid; gap: 16px; max-width: 760px; }
.card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.card h3 { margin: 0 0 10px; font-size: 14px; }
.card p { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.token-once { display: grid; gap: 6px; padding: 10px; border: 1px dashed var(--accent-2); border-radius: 8px; margin: 10px 0; }
.token-once code { font-size: 13px; user-select: all; }
.token-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.token-row .inline { margin-left: auto; }
.token-form { display: flex; gap: 8px; margin-top: 10px; }
.token-form .input { height: 30px; padding: 0 10px; }
.workspace-row { display: flex; align-items: start; gap: 8px; margin-top: 10px; }
.workspace-row > .btn { margin-top: 3px; }
.workspace-handle { flex: none; margin-top: 4px; cursor: grab; font-size: 20px; touch-action: none; }
.workspace-handle:active { cursor: grabbing; }
.workspace-dragging { opacity: .45; }
.workspace-handle:focus-visible { outline: 2px solid var(--accent); }
.workspace-form { flex: 1; min-width: 0; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.workspace-create { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; align-items: end; gap: 10px; }
.workspace-create label { display: grid; gap: 6px; color: var(--text-2); }
.workspace-create .input, .workspace-delete .input { width: 100%; height: 34px; padding: 0 10px; }
.workspace-create .btn { height: 34px; }
.workspace-help, .workspace-create .workspace-errors { grid-column: 1 / -1; margin: 0; }
.workspace-delete-actions { display: flex; gap: 8px; margin-top: 16px; }
.workspace-delete form { display: grid; gap: 8px; }
.workspace-delete li { margin: 6px 0; }
.btn-danger { color: var(--a); }
.btn-danger-solid { background: var(--a); border-color: transparent; color: #fff; }
.btn-danger-solid:hover { background: var(--p0); color: #fff; }
.workspace-form .input { height: 34px; padding: 0 10px; }
.workspace-key { font-weight: 600; color: var(--muted); font-size: 12px; }
.workspace-errors { grid-column: 2 / -1; margin: 0; color: var(--a); font-size: 12px; }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; color: var(--text-2); }

/* ---------- Modals ---------- */
.modal {
  border: 0; padding: 0; border-radius: 12px; background: var(--panel-2); color: var(--text);
  box-shadow: var(--shadow); width: min(720px, 92vw); margin-top: 12vh;
}
.modal::backdrop { background: rgba(0,0,0,.5); backdrop-filter: blur(2px); }
.new-issue-form { display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 4px; }
.modal-close { margin-left: auto; }
.title-input { border: 0; background: transparent; outline: none; color: var(--text); font-family: inherit; font-weight: 600; font-size: 19px; padding: 10px 18px 4px; }
.new-issue-form .desc-input { border: 0; background: transparent; padding: 6px 18px; min-height: 110px; }
.modal-props { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; }
.pill-select {
  height: 26px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border-2); background: var(--panel);
  color: var(--text-2); font-family: inherit; font-weight: 500; font-size: 12px; outline: none; cursor: pointer;
}
.modal-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); }

.palette { width: min(640px, 92vw); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.palette-input input { flex: 1; height: 52px; border: 0; background: transparent; outline: none; color: var(--text); font-family: inherit; font-size: 15px; }
.palette-results { max-height: 380px; overflow-y: auto; padding: 6px; }
.palette-item { display: grid; grid-template-columns: 18px 70px 1fr auto; gap: 8px; align-items: center; height: 38px; padding: 0 10px; border-radius: 7px; color: var(--text-2); }
.palette-item.on, .palette-item:hover { background: var(--active); color: var(--text); }
.palette-empty { padding: 24px; text-align: center; }
.palette-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--border); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 18px; right: 18px; z-index: 50; background: var(--panel-2); border: 1px solid var(--border-2);
  box-shadow: var(--shadow); padding: 10px 14px; border-radius: 9px; font-weight: 500; transition: opacity .4s, transform .4s;
}
.toast-alert { border-color: var(--a); }
.toast.gone { opacity: 0; transform: translateY(8px); pointer-events: none; }

/* ---------- Sign in ---------- */
.auth-body { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(1200px 600px at 50% -10%, #1d1d3a 0%, var(--bg) 60%); }
.auth-card { width: 340px; text-align: center; }
.auth-logo { object-fit: contain; mix-blend-mode: multiply; }
.auth-card h1 { font-size: 20px; margin: 14px 0 6px; }
.auth-form { display: grid; gap: 10px; margin-top: 18px; }
.auth-form input { height: 38px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--panel); color: var(--text); padding: 0 12px; font-family: inherit; font-size: 14px; outline: none; }
.auth-form input:focus { border-color: var(--accent-2); }
.auth-alert { color: var(--a); }
.dev-note { font-size: 12px; color: var(--b); margin-top: 18px; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { margin: 0; border-radius: 0; border: 0; }
  .issue-page { grid-template-columns: 1fr; }
  .issue-props { border-left: 0; border-top: 1px solid var(--border); }
  .c-meta, .c-date { display: none; }
  .row { grid-template-columns: 30px 64px 22px 1fr 26px; }
  .issue-main { padding: 22px 18px 60px; }
  .settings { padding: 16px; }
  .workspace-create { grid-template-columns: minmax(0, 1fr) 100px; }
  .workspace-create .btn { grid-column: 1 / -1; justify-content: center; }
}

/* Property menus open toward the page, never off the right edge. */
.main { overflow-x: hidden; }
.issue-props .prop-menu .menu-pop { left: auto; right: -6px; }
