:root {
  --accent: #0c66e4;
  --accent-hover: #0055cc;
  --accent-subtle: #e9f2ff;
  --bg: #f7f8f9;
  --surface: #ffffff;
  --inset: #f1f2f4;
  --sidebar: #ffffff;
  --text: #172b4d;
  --text-subtle: #44546f;
  --text-subtlest: #626f86;
  --border: #dfe1e6;
  --hairline: #dfe1e6;
  --selected: #e9f2ff;
  --hover: #091e420f;
  --success: #1f845a;
  --warning: #b65c02;
  --danger: #c9372c;
  --bug: #c9372c;
  --feature: #1f845a;
  --radius: 3px;
  --radius-lg: 3px;
  --shadow: 0 1px 1px rgba(9, 30, 66, 0.13), 0 0 1px 1px rgba(9, 30, 66, 0.13);
  --shadow-lift: 0 4px 8px -2px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
  --font: "Noto Sans", system-ui, -apple-system, sans-serif;
  --mono: "Noto Sans Mono", ui-monospace, monospace;
  --topbar: 56px;
  --sidebar-w: 240px;
  --ease-snappy: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --dur-quick: 120ms;
  --dur-snappy: 220ms;
  --dur-soft: 320ms;
  --auth-glow-a: #d6e7ff;
  --auth-glow-b: #e8f5ef;
  --danger-bg: #ffeceb;
  --danger-border: #ffd2cc;
  --success-bg: #dcfff1;
  --warning-bg: #fff3e0;
  --purple-bg: #f3f0ff;
  --purple: #6e5dc6;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --accent: #579dff;
  --accent-hover: #85b8ff;
  --accent-subtle: #1c2b41;
  --bg: #161a1d;
  --surface: #22272b;
  --inset: #1d2125;
  --sidebar: #1d2125;
  --text: #dee4ea;
  --text-subtle: #9fadbc;
  --text-subtlest: #8c9bab;
  --border: #38414a;
  --hairline: #38414a;
  --selected: #1c2b41;
  --hover: #a1bdd914;
  --success: #4bce97;
  --warning: #f5cd47;
  --danger: #f87168;
  --bug: #f87168;
  --feature: #4bce97;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.35), 0 0 1px 1px rgba(0, 0, 0, 0.4);
  --shadow-lift: 0 8px 24px rgba(0, 0, 0, 0.45);
  --auth-glow-a: #1c2b41;
  --auth-glow-b: #1f3329;
  --danger-bg: #3d1f1f;
  --danger-border: #6b3030;
  --success-bg: #1f3329;
  --warning-bg: #3d3218;
  --purple-bg: #2b2540;
  --purple: #9f8fef;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.42857;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.9em; }

.boot {
  display: grid;
  place-items: center;
  min-height: 100vh;
  color: var(--text-subtlest);
  animation: fadeRise var(--dur-soft) var(--ease-soft) both;
}

.boot::after {
  content: "";
  width: 20px;
  height: 20px;
  margin-top: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Auth */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.auth-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 32px;
  animation: authEnter var(--dur-soft) var(--ease-snappy) both;
}

.auth-card h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-card > p {
  margin: 0 0 20px;
  color: var(--text-subtlest);
  font-size: 14px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 16px;
  background: var(--inset);
  padding: 2px;
  border-radius: var(--radius);
}

.tabs button {
  border: 0;
  background: transparent;
  border-radius: var(--radius);
  padding: 6px 8px;
  color: var(--text-subtle);
  font-weight: 500;
  font-size: 14px;
  transition: background var(--dur-quick) var(--ease-soft), color var(--dur-quick) var(--ease-soft);
}

.tabs button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* Shell */
.app-frame {
  min-height: 100vh;
  display: grid;
  grid-template-rows: var(--topbar) 1fr;
}

.topbar,
.jira-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--topbar);
  z-index: 10;
}

.brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding: 6px 8px;
  border-radius: var(--radius);
  transition: background var(--dur-quick) var(--ease-soft);
}

.brand-btn:hover { background: var(--hover); }

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: var(--radius);
  display: block;
  flex: none;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
}

.brand-lockup img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
}

.brand-lockup h1 { margin: 0; }

.search-field {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--inset);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 0 10px;
  height: 32px;
  margin: 0 8px;
  color: var(--text-subtlest);
  transition: background var(--dur-quick) var(--ease-soft), border-color var(--dur-quick) var(--ease-soft);
}

.search-field:focus-within {
  background: var(--surface);
  border-color: var(--accent);
}

.search-field .search-icon {
  flex: none;
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.search-field input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  color: var(--text);
  font-size: 14px;
  padding: 0;
}

.search-field input::placeholder {
  color: var(--text-subtlest);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.btn-create {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 0 12px;
  height: 32px;
  font-weight: 500;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background var(--dur-quick) var(--ease-soft);
}

.btn-create:hover { background: var(--accent-hover); }

.btn-create-secondary {
  background: transparent;
  color: var(--text-subtle);
  border: 0;
  border-radius: var(--radius);
  padding: 0 8px;
  height: 32px;
  font-size: 13px;
  font-weight: 500;
}

.btn-create-secondary:hover { background: var(--hover); color: var(--text); }

.icon-btn {
  border: 0;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  color: var(--text-subtle);
  display: grid;
  place-items: center;
  position: relative;
  transition: background var(--dur-quick) var(--ease-soft), color var(--dur-quick) var(--ease-soft);
}

.icon-btn:hover { background: var(--hover); color: var(--text); }

.avatar,
.avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #6554c0;
  color: white;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  flex: none;
  letter-spacing: 0;
}

.avatar { width: 28px; height: 28px; font-size: 12px; }
.avatar-sm { width: 20px; height: 20px; font-size: 9px; }

.body-split {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 0;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  overflow: auto;
  padding: 8px 8px 24px;
}

.main {
  overflow: auto;
  background: var(--bg);
  min-width: 0;
}

.nav-group-label {
  margin: 16px 8px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-subtlest);
}

.nav-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: var(--radius);
  padding: 6px 8px;
  min-height: 32px;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 1px;
  transition: background var(--dur-quick) var(--ease-soft), color var(--dur-quick) var(--ease-soft);
}

.nav-row:hover { background: var(--hover); }

.nav-row.active {
  background: var(--selected);
  color: var(--text);
  font-weight: 600;
  box-shadow: none;
}

.nav-row .glyph {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: var(--text-subtle);
}

.nav-row .glyph .sf-icon {
  width: 16px;
  height: 16px;
}

.nav-row.active .glyph { color: var(--accent); }

.sf-icon {
  width: 16px;
  height: 16px;
  display: block;
  flex: none;
}

.icon-btn .sf-icon {
  width: 18px;
  height: 18px;
}

.search-field .sf-icon,
.search-field .search-icon {
  width: 16px;
  height: 16px;
  color: var(--text-subtlest);
  flex: none;
}

.nav-row .badge-count {
  margin-left: auto;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0 5px;
}

.spaces-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 8px 4px;
}

.spaces-head span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-subtlest);
}

.swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.project-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex: none;
  letter-spacing: 0;
}

.project-icon.lg {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.project-icon.sm {
  width: 16px;
  height: 16px;
  font-size: 9px;
}

.type-icon {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  flex: none;
  vertical-align: middle;
}

.type-icon.bug { background: var(--bug); }
.type-icon.feature { background: var(--feature); }
.type-icon.task { background: var(--accent); }
.type-icon.issue { background: #e56910; }
.type-icon.chore { background: #626f86; }
.type-icon.spike { background: #6e5dc6; }
.type-icon.techDebt { background: #b65c02; }
.type-icon.qa { background: #2898bd; }
.type-icon.review { background: #6e5dc6; }
.type-icon.prompt { background: #8270db; }

.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: #dfe1e6;
}

.priority-dot.urgent { background: #c9372c; }
.priority-dot.high { background: #e56910; }
.priority-dot.medium { background: #e2b203; }
.priority-dot.low { background: #0c66e4; }
.priority-dot.none { background: #dfe1e6; }

.priority-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  width: 10px;
  flex: none;
}

.priority-bars span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: #dfe1e6;
}

.priority-bars.urgent span { background: #c9372c; }
.priority-bars.high span:nth-child(1),
.priority-bars.high span:nth-child(2),
.priority-bars.high span:nth-child(3) { background: #e56910; }
.priority-bars.medium span:nth-child(1),
.priority-bars.medium span:nth-child(2) { background: #e2b203; }
.priority-bars.low span:nth-child(1) { background: #0c66e4; }

.ws-picker {
  margin: 4px 4px 8px;
}

.ws-picker select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

/* Page chrome */
.page {
  padding: 16px 24px 40px;
}

.page-enter {
  animation: pageEnter var(--dur-soft) var(--ease-snappy) both;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.page-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.page-header .sub {
  margin: 4px 0 0;
  color: var(--text-subtlest);
  font-size: 14px;
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
  padding-bottom: 0;
}

.project-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.project-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.project-header .sub {
  margin: 2px 0 0;
  color: var(--text-subtlest);
  font-size: 12px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  color: var(--text-subtlest);
  margin-bottom: 8px;
}

.breadcrumb a,
.breadcrumb button.linkish {
  color: var(--text-subtlest);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.breadcrumb a:hover,
.breadcrumb button.linkish:hover {
  color: var(--accent);
  text-decoration: underline;
}

.breadcrumb .sep { opacity: 0.5; margin: 0 2px; }

.breadcrumb .issue-key {
  color: var(--accent);
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 6px 12px;
  height: 32px;
  background: var(--accent);
  color: white;
  font-weight: 500;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-quick) var(--ease-soft);
}

.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn.secondary:hover { background: var(--inset); }

.btn.ghost {
  background: transparent;
  color: var(--text-subtle);
  height: auto;
  padding: 4px 8px;
}

.btn.ghost:hover { background: var(--hover); color: var(--text); }

.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #ae2e24; }

.btn.sm {
  padding: 2px 8px;
  height: 24px;
  font-size: 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
}

.stat-grid .card.stat {
  animation: fadeRise var(--dur-soft) var(--ease-snappy) both;
}

.stat-grid .card.stat:nth-child(1) { animation-delay: 40ms; }
.stat-grid .card.stat:nth-child(2) { animation-delay: 80ms; }
.stat-grid .card.stat:nth-child(3) { animation-delay: 120ms; }
.stat-grid .card.stat:nth-child(4) { animation-delay: 160ms; }

.stat-grid .card.stat:hover {
  border-color: #b3d4ff;
}

.card-pad { padding: 16px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat { padding: 12px 16px; }

.stat .label {
  font-size: 12px;
  color: var(--text-subtlest);
  font-weight: 600;
}

.stat .value {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-top: 4px;
  color: var(--text);
}

.field {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-subtlest);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--dur-quick) var(--ease-soft);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.field.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-field input[type="color"] {
  width: 40px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  flex: 0 0 auto;
}

.color-field input[name="accent_hex"] {
  flex: 1;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  animation: shakeIn var(--dur-snappy) var(--ease-snappy) both;
}

.info {
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 13px;
}

.empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-subtlest);
  font-size: 14px;
}

.muted { color: var(--text-subtlest); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  align-items: center;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 4px 10px;
  height: 28px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-subtle);
  transition: background var(--dur-quick) var(--ease-soft), border-color var(--dur-quick) var(--ease-soft), color var(--dur-quick) var(--ease-soft);
}

.chip:hover { background: var(--hover); }
.chip.active {
  background: var(--selected);
  border-color: #b3d4ff;
  color: var(--accent);
}

.table-wrap {
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 14px;
}

.table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-subtlest);
  background: var(--surface);
  position: sticky;
  top: 0;
  height: 36px;
}

.table td { height: 40px; }

.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--hover); }

.issue-key {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}

/* Lozenges (Jira status pills) — .badge kept for pages.js */
.badge,
.lozenge {
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  padding: 0 6px;
  height: 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: #f1f2f4;
  color: #44546f;
  white-space: nowrap;
  line-height: 1;
}

.badge.blue,
.lozenge.blue { background: var(--accent-subtle); color: var(--accent-hover); }
.badge.green,
.lozenge.green { background: var(--success-bg); color: var(--success); }
.badge.amber,
.lozenge.amber { background: var(--warning-bg); color: var(--warning); }
.badge.red,
.lozenge.red { background: var(--danger-bg); color: var(--danger); }
.badge.purple,
.lozenge.purple { background: var(--purple-bg); color: var(--purple); }
.badge.default,
.lozenge.default { background: var(--inset); color: var(--text-subtle); }

.tabs-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin: 8px 0 16px;
  overflow-x: auto;
}

.tabs-bar button {
  border: 0;
  background: transparent;
  padding: 10px 12px;
  color: var(--text-subtle);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
  transition: color var(--dur-quick) var(--ease-soft), border-color var(--dur-snappy) var(--ease-snappy);
}

.tabs-bar button:hover { color: var(--text); }

.tabs-bar button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.layout-switch {
  display: none;
}

.board-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.board-toolbar select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 8px;
  height: 32px;
  background: var(--surface);
  font-size: 13px;
}

/* Board */
.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: start;
}

.column {
  background: var(--inset);
  border-radius: var(--radius);
  min-height: 160px;
  animation: fadeRise var(--dur-soft) var(--ease-snappy) both;
}

.board .column:nth-child(1) { animation-delay: 20ms; }
.board .column:nth-child(2) { animation-delay: 40ms; }
.board .column:nth-child(3) { animation-delay: 60ms; }
.board .column:nth-child(4) { animation-delay: 80ms; }
.board .column:nth-child(5) { animation-delay: 100ms; }
.board .column:nth-child(6) { animation-delay: 120ms; }

.column-head {
  padding: 10px 10px 6px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.column-head .count {
  background: rgba(9, 30, 66, 0.08);
  border-radius: 8px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
}

.column-body {
  padding: 0 8px 8px;
  display: grid;
  gap: 6px;
  min-height: 64px;
  transition: outline-color var(--dur-quick) var(--ease-soft), background var(--dur-quick) var(--ease-soft);
}

.column-body.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
  border-radius: var(--radius);
  background: rgba(12, 102, 228, 0.06);
}

.kanban-card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
  cursor: grab;
  text-align: left;
  width: 100%;
  display: block;
  transition: box-shadow var(--dur-quick) var(--ease-soft), background var(--dur-quick) var(--ease-soft);
}

.kanban-card:hover {
  background: #fafbfc;
  box-shadow: var(--shadow-lift);
}

.kanban-card:active,
.kanban-card.dragging {
  cursor: grabbing;
  opacity: 0.9;
  box-shadow: var(--shadow-lift);
}

.kanban-card .issue-key {
  margin-bottom: 4px;
  display: block;
}

.kanban-card .title {
  font-weight: 400;
  font-size: 14px;
  color: var(--text);
  line-height: 1.35;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.kanban-card .card-footer-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.kanban-card.card-enter {
  animation: fadeRise var(--dur-soft) var(--ease-snappy) both;
}

/* Detail — Jira issue view */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.detail-main {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  min-width: 0;
}

.detail-side,
.context-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.issue-title-input {
  width: 100%;
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 4px 6px;
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  background: transparent;
  line-height: 1.25;
  resize: none;
}

.issue-title-input:hover { background: var(--hover); }
.issue-title-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.detail-section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-subtlest);
  margin: 0 0 6px;
}

.detail-main .field textarea {
  border-color: transparent;
  background: transparent;
  padding: 8px;
  min-height: 80px;
}

.detail-main .field textarea:hover { background: var(--hover); }
.detail-main .field textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.context-panel .field {
  margin-bottom: 4px;
  padding: 6px 8px;
  border-radius: var(--radius);
  transition: background var(--dur-quick) var(--ease-soft);
}

.context-panel .field:hover { background: var(--hover); }

.context-panel .field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-subtlest);
}

.context-panel .field select,
.context-panel .field input {
  border: 2px solid transparent;
  background: transparent;
  padding: 4px 6px;
  font-size: 14px;
}

.context-panel .field select:hover,
.context-panel .field input:hover {
  background: var(--surface);
}

.context-panel .field select:focus,
.context-panel .field input:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.comment {
  border-top: 1px solid var(--border);
  padding: 12px 0;
}

.comment:first-child { border-top: 0; }

.backlog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sprint-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
  background: var(--surface);
}

.item-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  margin-bottom: 0;
  cursor: pointer;
  width: 100%;
  text-align: left;
  min-height: 36px;
  transition: background var(--dur-quick) var(--ease-soft);
}

.item-row:hover { background: var(--hover); }
.item-row:last-child { border-bottom: 0; }

.for-you-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.for-you-section .panel-title {
  padding: 12px 16px;
  margin: 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
}

.for-you-section .section-body { padding: 0; }

.for-you-projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  padding: 12px;
}

.project-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  width: 100%;
  color: inherit;
  transition: background var(--dur-quick) var(--ease-soft), border-color var(--dur-quick) var(--ease-soft);
}

.project-tile:hover {
  background: var(--hover);
  border-color: #b3d4ff;
}

.project-tile strong {
  display: block;
  font-weight: 600;
  font-size: 14px;
}

.project-tile .muted {
  font-size: 12px;
  margin-top: 2px;
}

.stub {
  padding: 40px 24px;
  text-align: center;
}

.stub h2 { margin: 0 0 8px; font-weight: 500; }
.stub p { margin: 0 auto; max-width: 420px; color: var(--text-subtlest); }

/* Charts / reports */
.chart-bars { display: flex; flex-direction: column; gap: 8px; }
.chart-row {
  display: grid;
  grid-template-columns: 110px 1fr 36px;
  gap: 8px;
  align-items: center;
}
.chart-label {
  font-size: 12px;
  color: var(--text-subtlest);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chart-track {
  height: 8px;
  background: var(--inset);
  border-radius: var(--radius);
  overflow: hidden;
}
.chart-track.tall { height: 12px; }
.chart-fill {
  height: 100%;
  border-radius: var(--radius);
  background: var(--accent);
  min-width: 2px;
  transition: width var(--dur-snappy) var(--ease-snappy);
}
.chart-count {
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Timeline */
.gantt { display: flex; flex-direction: column; gap: 4px; }
.gantt-row {
  display: grid;
  grid-template-columns: minmax(160px, 240px) 1fr minmax(120px, 160px);
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 6px 4px;
  border-radius: var(--radius);
  color: inherit;
}
.gantt-row:hover { background: var(--hover); }
.gantt-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  min-width: 0;
}
.gantt-meta span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-track {
  position: relative;
  height: 16px;
  background: var(--inset);
  border-radius: var(--radius);
  overflow: hidden;
}
.gantt-bar {
  position: absolute;
  top: 2px;
  height: 12px;
  border-radius: 2px;
  background: var(--accent);
}
.gantt-bar.green { background: var(--success); }
.gantt-bar.amber,
.gantt-bar.overdue { background: var(--warning); }
.gantt-bar.blue { background: var(--accent); }
.gantt-bar.purple { background: #6e5dc6; }
.gantt-dates { font-size: 12px; color: var(--text-subtlest); }

/* Calendar */
.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-weekdays {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtlest);
  text-align: center;
}
.cal-cell {
  min-height: 88px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 6px;
  border: 1px solid var(--border);
}
.cal-cell.empty-day { background: transparent; border-color: transparent; }
.cal-daynum {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-subtle);
}
.cal-chip {
  display: block;
  width: 100%;
  border: 0;
  background: var(--selected);
  color: var(--accent);
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 500;
  text-align: left;
  padding: 2px 4px;
  border-radius: 2px;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-chip.overdue { color: var(--danger); background: #ffeceb; }

/* Dashboards / vibe */
.gadget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.prompt-preview {
  margin: 6px 0 0;
  padding: 8px;
  background: var(--inset);
  border-radius: var(--radius);
  font-size: 12px;
  white-space: pre-wrap;
  max-height: 96px;
  overflow: hidden;
  font-family: var(--mono);
  color: var(--text-subtlest);
}
.row-unread td { background: var(--selected); }
.dot-unread {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

@media (max-width: 960px) {
  .gantt-row { grid-template-columns: 1fr; }
  .chart-row { grid-template-columns: 80px 1fr 28px; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 30, 66, 0.54);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 40;
  animation: backdropIn var(--dur-snappy) var(--ease-soft) both;
}

.modal {
  width: min(560px, 100%);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px 24px;
  box-shadow: var(--shadow-lift);
  max-height: 90vh;
  overflow: auto;
  animation: modalIn var(--dur-soft) var(--ease-snappy) both;
}

.modal h2 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 500;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--text);
}

@media (max-width: 960px) {
  .body-split { grid-template-columns: 1fr; }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 200px;
  }
  .detail-grid,
  .backlog-grid { grid-template-columns: 1fr; }
  .search-field { display: none; }
  .board { grid-template-columns: repeat(6, minmax(200px, 1fr)); }
  .for-you-projects { grid-template-columns: 1fr; }
}

/* Motion */
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeRise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes authEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shakeIn {
  0% { opacity: 0; transform: translateX(-4px); }
  60% { opacity: 1; transform: translateX(2px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.settings-card {
  max-width: 520px;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--inset);
  cursor: pointer;
  color: var(--text-subtle);
  transition: border-color var(--dur-quick) var(--ease-soft), background var(--dur-quick) var(--ease-soft), color var(--dur-quick) var(--ease-soft);
}

.theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-option-icon {
  color: inherit;
}

.theme-option:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--hairline));
  color: var(--text);
}

.theme-option.active {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

html {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

.notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-subtle, #e9f2ff);
  color: var(--text);
  font-size: 0.9rem;
}

.notice-prominent {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border, #dfe1e6);
}

.notice-prominent code {
  display: inline-block;
  margin: 8px 0;
  word-break: break-all;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  padding: 4px 0;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .boot::after { animation: none; }
}
