:root {
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --bg-page: #f0f2f5;
  --bg-surface: #ffffff;
  --bg-raised: #ffffff;
  --bg-hover: #e8ecf2;
  --bg-input: #ffffff;

  --border-subtle: #dde1e8;
  --border-default: #c4cbd6;
  --border-strong: #a3adb8;
  --border-focus: #0b4fda;

  --text-primary: #0f1a2e;
  --text-secondary: #475569;
  --text-tertiary: #8896a8;
  --text-inverse: #ffffff;

  --accent-primary: #0b4fda;
  --accent-primary-hover: #0940b3;
  --accent-primary-bg: rgba(11, 79, 218, 0.06);
  --accent-success: #00875a;
  --accent-success-bg: rgba(0, 135, 90, 0.06);
  --accent-warning: #ff6b00;
  --accent-warning-bg: rgba(255, 107, 0, 0.06);
  --accent-danger: #f03e6b;
  --accent-danger-bg: rgba(240, 62, 107, 0.05);

  --pop-pink: #f03e6b;
  --pop-pink-bg: rgba(240, 62, 107, 0.06);
  --pop-orange: #ff6b00;
  --pop-green: #00c853;

  --shadow-xs: 0 1px 2px rgba(9, 30, 66, 0.06);
  --shadow-sm: 0 1px 2px rgba(9, 30, 66, 0.1);
  --shadow-md: 0 4px 12px rgba(9, 30, 66, 0.1);
  --shadow-lg: 0 8px 24px rgba(9, 30, 66, 0.12);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

fieldset { border: none; margin: 0; padding: 0; }

::selection {
  background: var(--accent-primary);
  color: var(--text-inverse);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}

a:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* ── Nav ─────────────────────────────────────────── */

nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.5rem;
  background: linear-gradient(180deg, #0f2044 0%, #0a1832 100%);
  border-bottom: none;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

nav strong { font-weight: 700; }

nav strong a.nav-brand {
  color: #ffffff;
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

nav strong a.nav-brand:hover {
  color: #a4c4ff;
  text-decoration: none;
}

nav a {
  color: #8faad4;
  font-size: 0.875rem;
  font-weight: 500;
}

nav a:hover {
  color: #ffffff;
  text-decoration: none;
}

.nav-sep { color: rgba(255, 255, 255, 0.15); font-size: 0.75rem; }

.nav-dropdown { position: relative; }

.nav-dropdown-trigger::after {
  content: ' \25BE';
  font-size: 0.625rem;
  color: var(--text-tertiary);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  padding: 0.375rem 0;
  padding-top: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
}

.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0.5rem;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.nav-dropdown-menu a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  text-decoration: none;
}

.nav-dropdown-btn {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-family: var(--font-body);
  background: none;
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.25rem;
  padding-top: 0.625rem;
  text-align: left;
  cursor: pointer;
}

.nav-dropdown-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-person-trigger {
  color: #ffffff !important;
  font-weight: 600;
}

.nav-person-menu { right: 0; left: auto; }

/* ── Flash ───────────────────────────────────────── */

.flash {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 0.75rem 1.5rem;
  background: #e6f9f0;
  border: 1px solid rgba(24, 160, 88, 0.2);
  border-left: 3px solid var(--accent-success);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--accent-success);
  box-shadow: var(--shadow-md);
}

.flash + .flash { top: 3.5rem; }

.flash-warning {
  background: #fff4e6;
  border-color: rgba(255, 107, 0, 0.15);
  border-left-color: var(--pop-orange);
  color: #9a4500;
}

.flash-error {
  background: #fde8ef;
  border-color: rgba(240, 62, 107, 0.15);
  border-left-color: var(--pop-pink);
  color: var(--pop-pink);
}

/* ── Layout ──────────────────────────────────────── */

main {
  padding: 2rem 2rem;
}

.section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin: 0 0 0.75rem;
}

.section-action {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent-primary);
}

.section-action:hover { color: var(--accent-primary-hover); }

.page-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0.25rem 0 0;
}

.team-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Buttons ─────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background: var(--accent-primary);
  color: var(--text-inverse);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  background: var(--accent-primary-hover);
  text-decoration: none;
  color: var(--text-inverse);
  box-shadow: 0 2px 8px rgba(11, 79, 218, 0.2);
}

.btn:disabled {
  background: var(--border-default);
  color: var(--text-tertiary);
  cursor: not-allowed;
}

.btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-danger {
  background: var(--pop-pink);
  box-shadow: 0 1px 2px rgba(240, 62, 107, 0.15);
}

.btn-danger:hover:not(:disabled) {
  background: #d4325b;
  box-shadow: 0 2px 8px rgba(240, 62, 107, 0.2);
}

.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 0;
}

.btn-link:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

form .btn { margin-top: 1rem; }

.confirm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  background: var(--accent-primary);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
}

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

/* ── Auth pages ──────────────────────────────────── */

body.landing {
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.hero {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 3rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-brand {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f2044;
  letter-spacing: -0.04em;
  margin-bottom: 0.5rem;
}

.login-rule {
  width: 3rem;
  height: 3px;
  background: var(--accent-primary);
  border-radius: 2px;
  margin: 1rem auto 1.5rem;
}

.login-heading {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1.25rem;
}

.login-divider {
  margin: 1.5rem 0;
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  position: relative;
}

.login-divider::before,
.login-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 1.5rem);
  height: 1px;
  background: var(--border-subtle);
}

.login-divider::before { left: 0; }
.login-divider::after { right: 0; }

.login-new, .login-back {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 1rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.auth-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.auth-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.email-auth-form { text-align: left; }

/* ── Forms ───────────────────────────────────────── */

label {
  display: block;
  margin-top: 1rem;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-top: 0.25rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--bg-input);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-bg);
}

textarea { height: 80px; resize: vertical; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235f6876'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.form-container { max-width: 400px; }
.form-row { margin-bottom: 0.75rem; }

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.form-label--checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.form-input {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-bg);
}

.form-input--narrow { width: 6rem; }

.form-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent-primary);
}

.inline-form { display: inline; }

.inline-form-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.inline-form-row input { flex: 1; max-width: 300px; margin-top: 0; }
.inline-form-row .btn { margin-top: 0; }

.cancel-link {
  margin-left: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.errors {
  color: var(--accent-danger);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.errors li { margin: 0.25rem 0; }

/* ── Cards ───────────────────────────────────────── */

.map-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.map-card {
  display: block;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.map-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.map-card-name {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.map-card-meta {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

/* ── Tables ──────────────────────────────────────── */

.history-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.history-table th {
  text-align: left;
  border-bottom: 2px solid var(--border-default);
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.history-table td {
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.history-when {
  white-space: nowrap;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

/* ── Lists ───────────────────────────────────────── */

.plain-list {
  list-style: none;
  padding: 0;
}

.plain-list li {
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9375rem;
}

.plain-list li:last-child { border-bottom: none; }

.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

/* ── Settings ────────────────────────────────────── */

.settings-page { max-width: 900px; }

.settings-subtitle {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin: 0.25rem 0 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
}

.settings-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
}

.settings-card-desc {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin: 0 0 1rem;
  line-height: 1.5;
}

.settings-card .btn { margin-top: 0.75rem; }

.settings-history {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

/* ── Providers ───────────────────────────────────── */

.provider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.provider-row:last-child { border-bottom: none; }

.provider-name { font-weight: 500; color: var(--text-primary); }

.provider-connect-options {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ── Help text ───────────────────────────────────── */

.lens-help {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin: 0 0 0.5rem;
}

.empty-state {
  color: var(--text-tertiary);
  font-size: 0.9375rem;
  text-align: center;
  padding: 3rem 1rem;
}

/* ── Styleguide ──────────────────────────────────── */

.sg-section { margin-bottom: 3rem; }

.sg-section h2 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
  margin: 0 0 1.5rem;
}

.sg-colors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.sg-swatch {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.sg-swatch-color { height: 4rem; }

.sg-swatch-label {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background: var(--bg-surface);
}

.sg-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.sg-card-demo {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.sg-demo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.sg-demo-card h4 {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.sg-demo-card p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

.sg-input-demo { max-width: 320px; }

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

.sg-table-demo th {
  text-align: left;
  padding: 0.625rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  border-bottom: 2px solid var(--border-default);
}

.sg-table-demo td {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.sg-table-demo tr:hover td { background: var(--bg-hover); }

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

.board-surveillance {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--pop-pink-bg);
  border: 1px solid rgba(240, 62, 107, 0.2);
  border-left: 4px solid var(--pop-pink);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--pop-pink);
  animation: surveillance-pulse 2s ease-in-out infinite;
}

@keyframes surveillance-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.surveillance-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pop-pink);
  box-shadow: 0 0 6px rgba(240, 62, 107, 0.4);
  flex-shrink: 0;
}

.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.board-header-left {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.board-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text-primary);
}

.board-counter {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.board-velocity {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

.velocity-trend {
  color: var(--pop-green);
  font-weight: 700;
}

.board-wip-warning {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--accent-warning-bg);
  border: 1px solid rgba(255, 107, 0, 0.15);
  border-left: 4px solid var(--pop-orange);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #9a4500;
}

.wip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--pop-orange);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.board-scroll {
  overflow-x: auto;
  padding-bottom: 1rem;
}

.board {
  display: flex;
  gap: 0;
  min-width: max-content;
}

.board-col {
  width: 210px;
  min-width: 210px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.board-col:last-child { border-right: none; }

.col-header {
  padding: 0.75rem 0.75rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background: var(--bg-page);
  border-bottom: 3px solid var(--accent-primary);
  white-space: nowrap;
}

.col-header-done {
  border-bottom-color: var(--border-default);
  color: var(--text-tertiary);
}

.col-count {
  font-weight: 400;
  color: var(--text-tertiary);
  margin-left: 0.25rem;
}

.col-cards {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 120px;
  flex: 1;
  background: var(--bg-page);
}

.col-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-col-text {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-style: italic;
}

.ticket-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.75rem;
  cursor: grab;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.ticket-card:hover {
  border-left-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.ticket-done {
  opacity: 0.5;
  border-left-color: var(--border-default);
}

.ticket-done:hover {
  opacity: 0.65;
  border-left-color: var(--border-default);
  box-shadow: none;
  transform: none;
}

.ticket-ghost {
  opacity: 0.3;
  border: 2px dashed var(--accent-primary);
  background: var(--bg-hover);
}

.ticket-drag {
  box-shadow: var(--shadow-lg, 0 4px 12px rgba(0,0,0,0.15));
  transform: rotate(2deg);
  cursor: grabbing;
}

.ticket-id {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  margin-bottom: 0.25rem;
}

.ticket-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 0.375rem;
}

.ticket-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
}

.ticket-points {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.25rem;
  padding: 0 0.375rem;
  border-radius: 3px;
  background: rgba(255, 107, 0, 0.1);
  color: #d45a00;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
}

.ticket-assignee {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.6875rem;
}

.ticket-age {
  margin-top: 0.375rem;
  font-size: 0.6875rem;
  color: var(--pop-orange);
  font-weight: 500;
  font-family: var(--font-mono);
}

.board-col-done .ticket-points {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-tertiary);
}

/* ── Ticket Detail ──────────────────────────────── */

.ticket-show-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.ticket-show-badges {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.ticket-show-status {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.ticket-show-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.ticket-show-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ticket-show-field-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 0.25rem;
}

.ticket-show-meta-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.ticket-show-body {
  margin-bottom: 1.5rem;
}

.ticket-show-section {
  margin-bottom: 1.25rem;
}

.ticket-show-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin: 0 0 0.375rem;
}

.ticket-show-text {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin: 0;
}

.ticket-show-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

/* ── Planning Poker ─────────────────────────────── */

.poker-prompt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.poker-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.poker-card {
  width: 5rem;
  height: 7rem;
  perspective: 600px;
  cursor: pointer;
}

.poker-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.poker-card-face-down .poker-card-inner {
  transform: rotateY(180deg);
}

.poker-card-flipped .poker-card-inner {
  transform: rotateY(0deg);
}

.poker-card-front,
.poker-card-back {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-default);
  border-radius: var(--radius-sm);
  backface-visibility: hidden;
}

.poker-card-front {
  background: var(--bg-surface);
}

.poker-card-back {
  background: var(--accent-primary);
  transform: rotateY(180deg);
}

.poker-card-back-label {
  font-size: 1.75rem;
  font-weight: 800;
  color: white;
  font-family: var(--font-mono);
}

.poker-card:hover .poker-card-inner {
  transform: translateY(-4px);
}

.poker-card-face-down:hover .poker-card-inner {
  transform: rotateY(180deg) translateY(-4px);
}

.poker-card-points {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.poker-result {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.poker-your-estimate,
.poker-ai-estimate {
  text-align: center;
  padding: 1.5rem 2rem;
  border: 2px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

.poker-ai-estimate {
  border-color: var(--pop-orange);
}

.poker-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
}

.poker-value {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.poker-ai-estimate .poker-value {
  color: var(--pop-orange);
}

.poker-justification {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1.5rem;
  max-width: 40rem;
}

.poker-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.poker-action-form {
  display: inline;
}

/* ── Ticket Index ────────────────────────────────── */

.ticket-index-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.ticket-index-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.toolbar-select {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--text-tertiary);
  cursor: not-allowed;
  width: auto;
  margin-top: 0;
}

.toolbar-hint {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  font-style: italic;
  margin-left: auto;
}

.ticket-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}

.ticket-table th {
  text-align: left;
  padding: 0.5rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  background: var(--bg-page);
  border-bottom: 2px solid var(--border-default);
  white-space: nowrap;
}

.ticket-table td {
  padding: 0.5rem 0.625rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.ticket-table tr:hover td { background: var(--bg-hover); }

.ticket-table-key {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
}

.ticket-table-key a {
  color: var(--accent-primary);
  font-weight: 600;
}

.ticket-table-title { max-width: 240px; }

.ticket-table-title a {
  color: var(--text-primary);
  font-weight: 500;
}

.ticket-table-title a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

.ticket-table-badge {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-subtype {
  background: var(--accent-primary-bg);
  color: var(--accent-primary);
}

.badge-priority {
  background: var(--accent-primary-bg);
  color: var(--accent-primary);
}

.badge-low { background: #e8f5e9; color: #2e7d32; }
.badge-medium { background: #fff8e1; color: #f57f17; }
.badge-high { background: #fff3e0; color: #e65100; }
.badge-critical { background: var(--accent-danger-bg); color: var(--accent-danger); }
.badge-apocalyptic { background: #4a0020; color: #ff6b9d; }

.badge-severity { background: #f3e5f5; color: #7b1fa2; }
.badge-minor { background: #e8f5e9; color: #2e7d32; }
.badge-moderate { background: #fff8e1; color: #f57f17; }
.badge-major { background: #fff3e0; color: #e65100; }
.badge-existential { background: #1a0a2e; color: #ce93d8; }

.ticket-table-points {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
}

.ticket-table-sprint {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
}

.ticket-table-stakeholder,
.ticket-table-dept {
  font-size: 0.75rem;
  color: var(--text-secondary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-table-due {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
  color: var(--text-secondary);
}

.ticket-table-footer {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 0.75rem;
  font-style: italic;
}

/* ── Landing Page ────────────────────────────────── */

.landing-page {
  background: #ffffff;
  margin: 0;
  padding: 0;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 2.5rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.landing-nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.landing-nav-left a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.landing-nav-left a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.landing-brand,
.landing-brand a {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f2044;
  letter-spacing: -0.04em;
  margin-right: 1rem;
}

.landing-nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.landing-nav-login {
  color: var(--text-secondary) !important;
  font-weight: 500;
}

.landing-hero {
  text-align: center;
  padding: 6rem 2rem 4rem;
  max-width: 800px;
  margin: 0 auto;
}

.landing-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-primary);
  text-transform: uppercase;
  margin: 0 0 1.5rem;
}

.landing-headline {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0 0 1.5rem;
}

.landing-subhead {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.landing-cta {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.landing-btn-primary {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
}

.landing-btn-secondary {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.landing-btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  box-shadow: none;
}

.landing-trust {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin: 0;
}

.landing-logos {
  text-align: center;
  padding: 2rem 2rem 3rem;
  border-bottom: 1px solid var(--border-subtle);
}

.landing-logos-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2.5rem;
}

.landing-feature {
  text-align: center;
  padding: 1.5rem;
}

.landing-feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.landing-feature h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
}

.landing-feature p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.landing-quote {
  background: var(--bg-page);
  padding: 4rem 2rem;
  text-align: center;
}

.landing-quote blockquote {
  max-width: 700px;
  margin: 0 auto;
}

.landing-quote p {
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-primary);
  font-style: italic;
  margin: 0 0 1rem;
}

.landing-quote cite {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  font-style: normal;
}

.landing-bottom-cta {
  text-align: center;
  padding: 5rem 2rem;
}

.landing-bottom-cta h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 1rem;
}

.landing-bottom-cta p {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.landing-footer {
  background: #0f2044;
  color: #8faad4;
  padding: 3rem 2.5rem 2rem;
}

.landing-footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto 2rem;
}

.landing-footer h4 {
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem;
}

.landing-footer a {
  display: block;
  color: #8faad4;
  font-size: 0.8125rem;
  padding: 0.25rem 0;
}

.landing-footer a:hover {
  color: #ffffff;
  text-decoration: none;
}

.landing-footer-copy {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  margin: 0;
}

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

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.dashboard-links {
  display: flex;
  gap: 0.5rem;
}

.dashboard-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.charts-row {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.chart-container {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.25rem;
}

.chart-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.chart-svg {
  width: 100%;
  height: auto;
}

.dashboard-bottom-row {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
}

.milestones-panel {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.25rem;
  max-height: 500px;
  overflow-y: auto;
}

.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.25rem;
  max-height: 500px;
  overflow: hidden;
}

.chat-panel .chat-messages {
  flex: 1;
  overflow-y: auto;
}

#chat-panel-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.chat-form {
  flex-shrink: 0;
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.chat-form .char-counter-wrap input[name="body"] {
  margin-top: 0;
  box-sizing: border-box;
}

.chat-controls-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  justify-content: space-between;
}

.chat-captcha-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chat-captcha-group input[name="captcha"] {
  width: 3rem;
  text-align: center;
  margin-top: 0;
  box-sizing: border-box;
}

.chat-controls-row .btn {
  margin-top: 0;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  font-size: 0.875rem;
  line-height: 1;
}

.chat-error {
  font-size: 0.75rem;
  color: var(--accent-red, #dc2626);
}

.chat-form input:focus,
.chat-form input:focus-visible {
  box-shadow: none;
  outline: none;
  outline-offset: 0;
  border-color: var(--border-strong);
}

.chat-form .btn:focus,
.chat-form .btn:focus-visible {
  outline: none;
  outline-offset: 0;
}

.captcha-label {
  display: inline-block;
  width: 7.5rem;
  margin: 0;
  font-size: 0.75rem;
  white-space: nowrap;
  color: var(--text-tertiary);
  text-align: right;
  flex-shrink: 0;
}

.char-counter-wrap {
  position: relative;
}

.char-counter-wrap input,
.char-counter-wrap textarea {
  width: 100%;
  padding-right: 2.5rem;
  box-sizing: border-box;
}

.char-counter {
  position: absolute;
  right: 0.375rem;
  bottom: 0.25rem;
  font-size: 0.5625rem;
  color: var(--text-tertiary);
  pointer-events: none;
  line-height: 1;
}

.char-counter-warn {
  color: var(--accent-amber, #d97706);
}

.char-counter-full {
  color: var(--accent-red, #dc2626);
}

.chat-messages, .chat-messages-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.chat-message {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.875rem;
}

.chat-message:last-child { border-bottom: none; }

.chat-time {
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.milestones-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}

.milestone-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.milestone-item:last-child { border-bottom: none; }

.milestone-ticket {
  color: var(--text-primary);
  font-weight: 500;
}

.roster-panel {
  margin-top: 1.5rem;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.roster-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-align: center;
}

.presence-light {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.presence-light-active {
  background: #2ecc71;
  box-shadow: 0 0 6px rgba(46, 204, 113, 0.5);
}

.presence-light-idle {
  background: var(--accent-danger);
  box-shadow: 0 0 8px rgba(240, 62, 107, 0.6);
  animation: idle-blink 1s step-start infinite;
}

@keyframes idle-blink {
  50% { opacity: 0; }
}

.roster-emoji {
  font-size: 1.5rem;
}

.roster-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.roster-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.role-subtitle {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  max-width: 900px;
}

.role-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 120px;
  padding: 1.25rem;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.role-box-emoji {
  font-size: 2rem;
}

.role-box:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.role-box:active {
  transform: translateY(0);
  box-shadow: none;
}

.role-box-selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(11, 79, 218, 0.2);
  transform: translateY(-2px);
}

.role-confirm {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  bottom: 1rem;
  box-shadow: var(--shadow-md);
}

.role-confirm[hidden] {
  display: none;
}

#role-confirm-text {
  flex: 1;
  font-weight: 600;
}

@media (max-width: 640px) {
  nav { padding: 0.75rem 1rem; }
  main { padding: 1.5rem 1rem; }
  .hero { padding: 2rem 1.5rem; }
  .settings-grid { grid-template-columns: 1fr; }
  .charts-row { flex-direction: column; }
  .dashboard-bottom-row { flex-direction: column; }
  .role-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
