/* ═══════════════════════════════════════════════════════════════
   Tracker — same design language as the api.mocii.dev docs and the
   portfolio (a dark take on EventBoard's "Liquid Glass"): Apple dark
   system colors, glass for navigation, calm rounded cards for content.
   Desktop: fixed glass sidebar. Below 900px: top bar + drawer (checkbox,
   works without JS). Board columns scroll sideways on phones.
   ═══════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;

  --bg: #000;
  --card: rgba(28, 28, 30, 0.78);
  --card-solid: #1c1c1e;
  --elevated: #2c2c2e;
  --inset: rgba(255, 255, 255, 0.04);
  --fill: rgba(118, 118, 128, 0.24);
  --fill-strong: rgba(118, 118, 128, 0.34);
  --hover: rgba(120, 120, 128, 0.18);
  --separator: rgba(84, 84, 88, 0.45);

  --text: #f5f5f7;
  --text-muted: rgba(235, 235, 245, 0.6);
  --text-faint: rgba(235, 235, 245, 0.32);

  --accent: #0a84ff;
  --accent-soft: rgba(10, 132, 255, 0.18);
  --accent-text: #4da3ff;
  --green: #30d158;
  --orange: #ff9f0a;
  --red: #ff453a;
  --yellow: #ffd60a;
  --purple: #bf5af2;
  --teal: #64d2ff;
  --gray: #98989f;

  --glass-bg: rgba(30, 30, 32, 0.6);
  --glass-blur: blur(30px) saturate(190%);
  --edge: 0 0 0 0.5px rgba(255, 255, 255, 0.14);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-card: 20px;
  --radius-pill: 999px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition: 0.25s var(--ease);

  --sidebar-w: 264px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scroll-padding-top: 1rem; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: transparent;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60vw 55vh at 0% 0%, rgba(10, 132, 255, 0.24), transparent 70%),
    radial-gradient(50vw 50vh at 100% 10%, rgba(191, 90, 242, 0.18), transparent 70%),
    radial-gradient(60vw 55vh at 80% 100%, rgba(100, 210, 255, 0.12), transparent 70%),
    var(--bg);
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
::selection { background: rgba(10, 132, 255, 0.45); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; }
code, pre, kbd, .mono { font-family: var(--font-mono); }
.icon { flex: none; vertical-align: -0.14em; }
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.hint { color: var(--text-muted); font-size: 0.8rem; font-weight: 400; }
.grow { flex: 1; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.js .no-js-only { display: none; }
.skip-link { position: absolute; left: 1rem; top: -3rem; z-index: 100; padding: 0.5rem 1rem; border-radius: var(--radius-pill); background: var(--accent); color: #fff; }
.skip-link:focus { top: 1rem; }

/* ── Shell ───────────────────────────────────── */

.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.content { flex: 1; min-width: 0; margin-left: var(--sidebar-w); padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 4rem; max-width: calc(1400px + var(--sidebar-w)); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: var(--sidebar-w);
  padding: 1.1rem 0.75rem 0.75rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(22, 22, 24, 0.62);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.sidebar-brand { margin: 0 0.5rem; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  box-shadow: var(--highlight), 0 4px 14px rgba(10, 132, 255, 0.35);
  color: #fff;
  font-size: 1rem;
}
.brand-mark-lg { width: 3.25rem; height: 3.25rem; border-radius: 15px; font-size: 1.6rem; }

.sidebar-search { position: relative; margin: 0 0.25rem; }
.sidebar-search .icon { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.sidebar-search input[type="search"] { padding-left: 2.1rem; padding-right: 2rem; }
.sidebar-search kbd { position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%); }
kbd { padding: 0 0.35rem; border-radius: 5px; background: var(--fill); color: var(--text-muted); font-size: 0.72rem; }

.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-heading { margin: 0.25rem 0.75rem 0.3rem; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0; }
.nav-group a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
  font-size: 0.92rem;
  transition: background var(--transition);
}
.nav-group a:hover { background: var(--hover); text-decoration: none; }
.nav-group a.active { background: rgba(255, 255, 255, 0.1); box-shadow: var(--highlight), var(--edge); font-weight: 600; }
.nav-group a .icon { color: var(--text-muted); font-size: 1.05rem; }
.nav-group a.active .icon { color: var(--accent-text); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { min-width: 1.4rem; padding: 0 0.4rem; border-radius: var(--radius-pill); background: var(--fill); color: var(--text-muted); font-size: 0.72rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.nav-add { color: var(--text-muted) !important; }

.sidebar-footer { display: flex; align-items: center; gap: 0.6rem; margin-top: auto; padding: 0.6rem 0.5rem 0.2rem; border-top: 0.5px solid var(--separator); }
.user-name { flex: 1; font-weight: 600; font-size: 0.9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.avatar { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--purple)); color: #fff; font-weight: 700; font-size: 0.85rem; }
.avatar-sm { width: 1.7rem; height: 1.7rem; font-size: 0.75rem; }

.topbar, .nav-scrim { display: none; }
.nav-toggle { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ── Page header & tabs ──────────────────────── */

.page-header { margin-bottom: 1.25rem; }
.page-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.page-title { margin: 0; font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }
.tabs { display: flex; gap: 0.25rem; margin-top: 1rem; overflow-x: auto; scrollbar-width: none; border-bottom: 0.5px solid var(--separator); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  margin-bottom: -0.5px;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; color: var(--text-muted); font-size: 0.88rem; }
.breadcrumbs a { color: var(--text-muted); }

.section-title { margin: 1.75rem 0 0.75rem; font-size: 1.15rem; }
.section-title:first-child { margin-top: 0; }
.card-title { margin: 0 0 0.75rem; font-size: 1.05rem; }
.card-subtitle { margin: 1rem 0 0.5rem; font-size: 0.9rem; color: var(--text-muted); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* ── Building blocks ─────────────────────────── */

.card { background: var(--card); border-radius: var(--radius-card); box-shadow: var(--edge), 0 6px 20px rgba(0, 0, 0, 0.3); padding: 1.15rem 1.25rem; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 0.9rem; }
.stack-sm { display: flex; flex-direction: column; gap: 0.5rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.grid-2-wide { grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0.9rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.75rem; margin: 0 0 1.25rem; }
.stat { padding: 0.8rem 1rem; border-radius: var(--radius); background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--highlight), var(--edge); }
.stat dt { color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
.stat dd { margin: 0; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.tag-pill { display: inline-block; padding: 0.08rem 0.5rem; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent-text); font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em; vertical-align: 0.1em; }
.tag-pill-lg { font-size: 0.85rem; padding: 0.2rem 0.65rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.chip { display: inline-block; padding: 0.15rem 0.65rem; border-radius: var(--radius-pill); background: var(--fill); color: rgba(235, 235, 245, 0.88); font-size: 0.8rem; font-weight: 500; }
.chip-button { border: none; font: inherit; font-size: 0.78rem; cursor: pointer; margin: 0.1rem 0; }
.chip-button:hover { background: var(--fill-strong); }

.badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.1rem 0.55rem; border-radius: var(--radius-pill); background: var(--fill); font-size: 0.74rem; font-weight: 600; white-space: nowrap; }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }
.badge-success { background: rgba(48, 209, 88, 0.16); color: var(--green); }
.badge-danger { background: rgba(255, 69, 58, 0.16); color: var(--red); }
.badge-muted { color: var(--text-muted); }
.type-feature { background: rgba(191, 90, 242, 0.16); color: #d39af7; }
.type-fix { background: rgba(255, 69, 58, 0.16); color: #ff7a72; }
.type-chore { background: var(--fill); color: var(--gray); }
.type-docs { background: rgba(100, 210, 255, 0.14); color: var(--teal); }
.priority { display: inline-grid; place-items: center; font-size: 1rem; }
.priority-urgent { color: var(--red); }
.priority-high { color: var(--orange); }
.priority-medium { color: var(--yellow); }
.priority-low { color: var(--teal); }
.status { display: inline-block; padding: 0.1rem 0.55rem; border-radius: var(--radius-pill); font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.status-todo { background: var(--fill); color: rgba(235, 235, 245, 0.85); }
.status-in_work { background: var(--accent-soft); color: var(--accent-text); }
.status-done { background: rgba(48, 209, 88, 0.16); color: var(--green); }
.status-dot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; margin-right: 0.5rem; padding: 0; vertical-align: 0.05em; }
.status-dot.status-todo { background: var(--gray); }
.status-dot.status-in_work { background: var(--accent); }
.status-dot.status-done { background: var(--green); }
.issue-key { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.meta-chip, .milestone-chip { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--text-muted); font-size: 0.78rem; white-space: nowrap; }
.milestone-chip { padding: 0.05rem 0.5rem; border-radius: var(--radius-pill); background: rgba(255, 159, 10, 0.12); color: #ffbf5c; }

progress { width: 100%; height: 6px; margin: 0.5rem 0 0.25rem; border: none; border-radius: var(--radius-pill); background: var(--fill); overflow: hidden; appearance: none; -webkit-appearance: none; }
progress::-webkit-progress-bar { background: var(--fill); border-radius: var(--radius-pill); }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: var(--radius-pill); }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: var(--radius-pill); }

/* ── Buttons & forms ─────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.35rem;
  padding: 0.45rem 1.05rem;
  border: none;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), filter var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: var(--glass-bg); color: var(--text); box-shadow: var(--highlight), var(--edge); }
.btn-ghost:hover { background: var(--elevated); }
.btn-danger { background: rgba(255, 69, 58, 0.14); color: #ff7a72; box-shadow: 0 0 0 0.5px rgba(255, 69, 58, 0.4); }
.btn-danger:hover { background: rgba(255, 69, 58, 0.24); }
.btn-sm { min-height: 2rem; padding: 0.3rem 0.85rem; font-size: 0.84rem; }
.btn-xs { min-height: 1.6rem; padding: 0.1rem 0.6rem; font-size: 0.75rem; }
.btn-block { width: 100%; }
.icon-button { display: grid; place-items: center; width: 2rem; height: 2rem; border: none; border-radius: 50%; background: transparent; color: var(--text-muted); font-size: 1.05rem; cursor: pointer; }
.icon-button:hover { background: var(--hover); color: var(--text); }

label { display: flex; flex-direction: column; gap: 0.35rem; color: var(--text-muted); font-size: 0.84rem; font-weight: 500; }
label.check { flex-direction: row; align-items: center; gap: 0.6rem; color: var(--text); font-size: 0.92rem; }
label.narrow { max-width: 220px; }
input[type="text"], input[type="search"], input[type="password"], input[type="url"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: none;
  border-radius: var(--radius);
  background: var(--fill);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  transition: box-shadow var(--transition), background var(--transition);
}
@media (min-width: 900px) {
  input[type="text"], input[type="search"], input[type="password"], input[type="url"], input[type="number"], input[type="date"], select, textarea { font-size: 0.9rem; }
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ebebf5' stroke-opacity='.6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; background-color: rgba(118, 118, 128, 0.32); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.45); }
input:disabled { opacity: 0.6; }
input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.8); }
.narrow-input { max-width: 9rem; }

.flash { margin: 0 0 1rem; padding: 0.7rem 1rem; border-radius: var(--radius); font-size: 0.9rem; }
.flash-success { background: rgba(48, 209, 88, 0.12); box-shadow: 0 0 0 0.5px rgba(48, 209, 88, 0.45); color: #8ff0a8; }
.flash-error { background: rgba(255, 69, 58, 0.12); box-shadow: 0 0 0 0.5px rgba(255, 69, 58, 0.45); color: #ffa39d; }

.edit-toggle { margin-top: 0.75rem; }
.edit-toggle > summary { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--text-muted); font-size: 0.84rem; font-weight: 600; cursor: pointer; list-style: none; }
.edit-toggle > summary::-webkit-details-marker { display: none; }
.edit-toggle > summary:hover { color: var(--text); }
.edit-toggle[open] > summary { margin-bottom: 0.6rem; color: var(--text); }
.edit-toggle > form + form { margin-top: 0.6rem; }

.empty-state { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; color: var(--text-muted); }
.empty-state p { margin: 0; }
.big-empty { align-items: center; text-align: center; max-width: 30rem; margin: 3rem auto; padding: 2.5rem; }
.big-empty h1 { margin: 0; color: var(--text); }
.big-code { margin: 0 !important; font-family: var(--font-display); font-size: 4rem; font-weight: 800; letter-spacing: -0.05em; line-height: 1; background: linear-gradient(135deg, var(--accent), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── Dashboard ───────────────────────────────── */

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 0.85rem; }
.project-card { position: relative; transition: transform var(--transition), box-shadow var(--transition); }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--edge), 0 12px 30px rgba(0, 0, 0, 0.45); }
.project-card header { display: flex; justify-content: space-between; gap: 0.5rem; }
.project-card h3 { margin: 0.6rem 0 0; font-size: 1.15rem; }
.project-card p { margin: 0.3rem 0 0; }
.stretched { color: var(--text); }
.stretched::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.stretched:hover { text-decoration: none; }

.feed { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.85rem; }
.feed li { display: flex; gap: 0.65rem; }
.feed p { margin: 0; font-size: 0.88rem; }
.feed time { font-size: 0.78rem; }
.milestone-mini + .milestone-mini { margin-top: 0.9rem; }
.milestone-mini p { margin: 0; }

/* ── Issue lists ─────────────────────────────── */

.issue-list { margin: 0; padding: 0; list-style: none; }
.issue-list.card { padding: 0.35rem 0; }
.issue-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1.25rem;
  border-bottom: 0.5px solid var(--separator);
}
.issue-list:not(.card) .issue-row { padding-left: 0; padding-right: 0; }
.issue-row:last-child { border-bottom: none; }
.issue-row:hover { background: rgba(255, 255, 255, 0.025); }
.issue-row-badges { display: inline-flex; align-items: center; gap: 0.35rem; }
.issue-row-badges .badge-text { display: none; }
.issue-row-badges .badge { padding: 0.15rem 0.35rem; }
.issue-row-title { color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.issue-row-meta { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.8rem; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.75rem; margin-bottom: 0.75rem; }
.filters select { width: auto; min-width: 0; flex: 0 1 auto; }
.filter-search { position: relative; flex: 1 1 260px; }
.filter-search .icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.filter-search input[type="search"] { padding-left: 2.2rem; }
.result-count { margin: 0 0 0.6rem; font-size: 0.85rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }

/* ── Board ───────────────────────────────────── */

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; align-items: start; }
.board-column {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 12rem;
  padding: 0.75rem;
  border-radius: var(--radius-card);
  background: rgba(28, 28, 30, 0.5);
  box-shadow: var(--edge);
  transition: box-shadow var(--transition), background var(--transition);
}
.board-column.is-over { background: rgba(10, 132, 255, 0.08); box-shadow: 0 0 0 1.5px var(--accent); }
.board-column-head { display: flex; align-items: center; justify-content: space-between; padding: 0.15rem 0.35rem; }
.board-column-head h2 { margin: 0; font-size: 0.95rem; }
.board-cards { display: flex; flex-direction: column; gap: 0.55rem; min-height: 3rem; }
.issue-card { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.8rem 0.9rem; border-radius: var(--radius); background: var(--card-solid); cursor: grab; transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition); }
.issue-card:hover { box-shadow: var(--edge), 0 8px 22px rgba(0, 0, 0, 0.45); }
.issue-card.is-dragging { opacity: 0.4; transform: rotate(1deg); }
.issue-card.is-saving { opacity: 0.7; }
.issue-card-title { color: var(--text); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.issue-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.issue-card-meta .badge-text { display: none; }
.issue-card-meta .badge { padding: 0.15rem 0.35rem; }
.issue-card .milestone-chip { align-self: flex-start; }
.card-move { display: flex; gap: 0.35rem; }
.card-move select { padding: 0.25rem 1.8rem 0.25rem 0.6rem; font-size: 0.78rem; border-radius: var(--radius-sm); background-position: right 0.55rem center; }
.js .card-move { display: none; }
.js .card-move .no-js-only { display: none; }
/* Touch screens: native drag & drop is unreliable, so keep the dropdown (JS saves it in place). */
@media (hover: none) {
  .js .card-move { display: flex; }
  .issue-card { cursor: default; }
}
.quick-add > summary { display: flex; align-items: center; gap: 0.35rem; padding: 0.45rem 0.5rem; border-radius: var(--radius); color: var(--text-muted); font-weight: 600; font-size: 0.86rem; cursor: pointer; list-style: none; }
.quick-add > summary::-webkit-details-marker { display: none; }
.quick-add > summary:hover { background: var(--hover); color: var(--text); }
.quick-add .row select { flex: 1; width: auto; }

/* ── Issue page ──────────────────────────────── */

.issue-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.issue-main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.issue-side { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1.25rem; }
.title-form { display: flex; gap: 0.5rem; align-items: center; }
.title-input { font-family: var(--font-display) !important; font-size: clamp(1.3rem, 2.6vw, 1.75rem) !important; font-weight: 700; letter-spacing: -0.02em; background: transparent !important; box-shadow: none !important; padding-left: 0.2rem !important; }
.title-input:focus { background: var(--fill) !important; box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.45) !important; }
.issue-key-lg { margin: 0; font-family: var(--font-mono); font-weight: 700; color: var(--accent-text); }
.meta-list { margin: 0; display: flex; flex-direction: column; gap: 0.3rem; color: var(--text-muted); }
.meta-list div { display: flex; justify-content: space-between; }
.meta-list dd { margin: 0; color: var(--text); }
.inline-add { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

.prose { overflow-wrap: anywhere; }
.prose p { margin: 0 0 0.75rem; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin: 0 0 0.75rem; padding-left: 1.25rem; }
.prose code { padding: 0.08rem 0.35rem; border-radius: 5px; background: var(--fill); font-size: 0.85em; }
.prose pre { margin: 0 0 0.75rem; padding: 0.8rem 1rem; border-radius: var(--radius); background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.08); overflow-x: auto; }
.prose pre code { padding: 0; background: none; }

.timeline { margin: 1.25rem 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.9rem; }
.timeline-comment { display: flex; gap: 0.7rem; }
.comment-body { flex: 1; min-width: 0; padding: 0.75rem 0.9rem; border-radius: var(--radius); background: var(--inset); box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.07); }
.comment-head { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.4rem; font-size: 0.85rem; }
.timeline-change { display: flex; align-items: baseline; gap: 0.7rem; padding-left: 0.6rem; font-size: 0.85rem; color: var(--text-muted); }
.timeline-change p { margin: 0; }
.timeline-change strong { color: var(--text); font-weight: 600; }
.timeline-dot { flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--fill-strong); box-shadow: 0 0 0 3px rgba(118, 118, 128, 0.12); }

/* ── Milestones & settings ───────────────────── */

.milestone-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.milestone-head .card-title { margin: 0; }
.milestone.is-released { opacity: 0.78; }
.milestone .row { margin-top: 0.75rem; align-items: flex-start; }
.form-card { max-width: 860px; }
.settings { max-width: 980px; }
.sticky-actions { position: sticky; bottom: 0.75rem; z-index: 5; padding: 0.6rem; border-radius: var(--radius-pill); background: rgba(28, 28, 30, 0.85); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--edge), var(--shadow); width: max-content; max-width: 100%; }
.danger-zone { max-width: 980px; margin-top: 1.25rem; box-shadow: 0 0 0 0.5px rgba(255, 69, 58, 0.45), 0 6px 20px rgba(0, 0, 0, 0.3); }
.danger-zone .card-title { color: #ff7a72; }
.danger-zone .row { gap: 0.75rem; }

/* ── Login ───────────────────────────────────── */

.auth-page { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 1rem; }
.auth-card { width: min(100%, 380px); display: flex; flex-direction: column; align-items: center; text-align: center; padding: 2rem 1.75rem; border-radius: 28px; background: rgba(30, 30, 32, 0.7); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--highlight), var(--edge), var(--shadow); }
.auth-card h1 { margin: 0.9rem 0 0.2rem; }
.auth-card > .muted { margin: 0 0 1.25rem; }
.auth-card form { width: 100%; text-align: left; }
.auth-card .flash { width: 100%; text-align: left; }

/* ── Toast ───────────────────────────────────── */

.toast { position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom)); z-index: 80; transform: translateX(-50%); padding: 0.65rem 1.1rem; border-radius: var(--radius-pill); background: rgba(44, 44, 46, 0.95); box-shadow: var(--edge), var(--shadow); font-size: 0.88rem; font-weight: 600; }
.toast.is-error { background: rgba(120, 22, 18, 0.95); }

/* ── Responsive ──────────────────────────────── */

@media (max-width: 1180px) {
  .grid-2, .grid-2-wide { grid-template-columns: minmax(0, 1fr); }
  .issue-layout { grid-template-columns: minmax(0, 1fr); }
  .issue-side { position: static; }
}

@media (max-width: 900px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-h);
    padding: 0 1rem;
    background: rgba(22, 22, 24, 0.72);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.1);
  }
  .menu-button { display: inline-flex; flex-direction: row; align-items: center; gap: 0.45rem; padding: 0.4rem 0.9rem; border-radius: var(--radius-pill); background: var(--glass-bg); box-shadow: var(--highlight), var(--edge); color: var(--text); font-size: 0.88rem; font-weight: 600; cursor: pointer; user-select: none; }
  .menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 14px; height: 1.8px; border-radius: 2px; background: currentColor; transition: transform var(--transition), background var(--transition); }
  .menu-icon { position: relative; }
  .menu-icon::before, .menu-icon::after { content: ''; position: absolute; left: 0; }
  .menu-icon::before { top: -4.5px; }
  .menu-icon::after { top: 4.5px; }
  .nav-toggle:focus-visible ~ .topbar .menu-button { outline: 2px solid var(--accent); outline-offset: 2px; }
  .nav-toggle:checked ~ .topbar .menu-icon { background: transparent; }
  .nav-toggle:checked ~ .topbar .menu-icon::before { transform: translateY(4.5px) rotate(45deg); }
  .nav-toggle:checked ~ .topbar .menu-icon::after { transform: translateY(-4.5px) rotate(-45deg); }

  .sidebar {
    top: var(--topbar-h);
    width: min(320px, 86vw);
    background: #1c1c1e;
    border-radius: 0 var(--radius-card) var(--radius-card) 0;
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform var(--transition), visibility 0s linear 0.25s;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  }
  .sidebar-brand { display: none; }
  .nav-toggle:checked ~ .shell .sidebar { transform: none; visibility: visible; transition: transform var(--transition), visibility 0s; box-shadow: var(--shadow); }
  .nav-scrim { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 35; background: rgba(0, 0, 0, 0.55); opacity: 0; pointer-events: none; transition: opacity var(--transition); }
  .nav-toggle:checked ~ .shell .nav-scrim { opacity: 1; pointer-events: auto; }

  .content { margin-left: 0; padding: 1.1rem 1rem 3rem; }
  .page-actions { margin-left: 0; width: 100%; }

  /* Board: columns side by side, swipe between them */
  .board { display: flex; gap: 0.75rem; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -1rem; padding: 0 1rem 0.5rem; scrollbar-width: none; }
  .board::-webkit-scrollbar { display: none; }
  .board-column { flex: 0 0 min(85vw, 340px); scroll-snap-align: center; }

  .issue-row { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "badges key" "title title" "meta meta"; gap: 0.3rem 0.6rem; padding: 0.7rem 1rem; }
  .issue-row-badges { grid-area: badges; }
  .issue-row > .issue-key { grid-area: key; justify-self: end; }
  .issue-row-title { grid-area: title; white-space: normal; }
  .issue-row-meta { grid-area: meta; flex-wrap: wrap; }
  .filters select { flex: 1 1 40%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .title-form { flex-direction: column; align-items: stretch; }
  .sticky-actions { width: auto; border-radius: var(--radius-card); }
  .danger-zone .row { flex-direction: column; align-items: stretch; }
  .narrow-input { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass-bg: #1c1c1e; --card: #1c1c1e; --glass-blur: none; }
  .sidebar, .topbar { background: #161618; }
}
