/* ============================================
   Projects Dashboard — style.css
   Apple Reminders × Linear
   ============================================ */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-hover: #f2f2f7;
  --border: rgba(0, 0, 0, 0.08);
  --border-solid: #d2d2d7;
  --text: #1d1d1f;
  --text-secondary: #86868b;
  --text-tertiary: #aeaeb2;
  --accent: #0071e3;
  --green: #34c759;
  --blue: #007aff;
  --orange: #ff9500;
  --yellow: #ffcc00;
  --red: #ff3b30;
  --purple: #af52de;
  --pink: #ff2d55;
  --teal: #00c7be;
  --radius: 16px;
  --radius-sm: 8px;
  --radius-inner: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --font-display:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue",
    sans-serif;
  --font:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
    sans-serif;
  --mono: "SF Mono", SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-hover: #2c2c2e;
    --border: rgba(255, 255, 255, 0.08);
    --border-solid: #38383a;
    --text: #f5f5f7;
    --text-secondary: #98989d;
    --text-tertiary: #636366;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.16), 0 4px 16px rgba(0, 0, 0, 0.16);
    --shadow-hover:
      0 1px 2px rgba(0, 0, 0, 0.16), 0 8px 24px rgba(0, 0, 0, 0.24);
  }
}

/* ---- Reset ---- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ---- Base ---- */

body {
  background: var(--bg);
  font-family: var(--font);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 150ms ease;
}

a:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* ---- Layout ---- */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* ---- Header ---- */

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 0 24px;
}

.header-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.header-sync {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-link {
  font-size: 15px;
  font-weight: 500;
}

/* ---- Filter Bar ---- */

.filters-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: wrap;
}

.filters-row::-webkit-scrollbar {
  display: none;
}

.filter-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 4px;
}

.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 0 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-bar:last-of-type {
  padding-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  min-height: 44px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background 150ms ease,
    color 150ms ease,
    border-color 150ms ease;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-user-select: none;
  user-select: none;
}

.pill:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.pill:active {
  transform: scale(0.98);
}

.pill.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.pill-dirty {
  color: var(--orange);
  border-color: rgba(255, 149, 0, 0.24);
}

.pill-dirty:hover {
  background: rgba(255, 149, 0, 0.08);
  color: var(--orange);
}

.pill-dirty.active {
  background: var(--orange);
  color: #ffffff;
  border-color: var(--orange);
}

/* ---- Stats Bar ---- */

.stats-bar {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 24px 0 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.stats-bar .stat {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.stats-bar .stat strong {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-divider {
  color: var(--text-tertiary);
  font-size: 16px;
  margin: 0 4px;
}

/* ---- Summary Section ---- */

.summary-section {
  padding: 8px 0 0;
}

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

@media (max-width: 768px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

.summary-card .section-header {
  padding: 0 0 8px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  cursor: pointer;
  transition: background 150ms ease;
  min-height: 44px;
}

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

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

.summary-row:active {
  transform: scale(0.99);
}

.summary-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.summary-name {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-detail {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-time {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.summary-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.summary-badge-dirty {
  background: rgba(255, 149, 0, 0.12);
  color: var(--orange);
}

.summary-badge-todo {
  background: rgba(0, 122, 255, 0.1);
  color: var(--blue);
}

.summary-empty {
  padding: 20px 16px;
  font-size: 14px;
  color: var(--text-tertiary);
  font-style: italic;
}

/* ---- Project Grid ---- */

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

/* ---- Project Card ---- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition:
    box-shadow 150ms ease,
    transform 150ms ease,
    border-color 150ms ease;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.card:active {
  transform: scale(0.98);
}

.card.dormant {
  opacity: 0.55;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}

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

.card-status-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 4px;
}

/* Card progress bar — thin line at bottom */

.card-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
}

.card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #30d158);
  border-radius: 0 2px 2px 0;
  transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Badges ---- */

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.badge-macos {
  background: rgba(0, 122, 255, 0.1);
  color: var(--blue);
}
.badge-ios {
  background: rgba(52, 199, 89, 0.1);
  color: var(--green);
}
.badge-web {
  background: rgba(255, 149, 0, 0.1);
  color: var(--orange);
}
.badge-cli {
  background: rgba(175, 82, 222, 0.1);
  color: var(--purple);
}
.badge-cross-platform {
  background: rgba(255, 45, 85, 0.1);
  color: var(--pink);
}
.badge-full-stack {
  background: rgba(255, 149, 0, 0.1);
  color: var(--orange);
}
.badge-figma {
  background: rgba(162, 89, 255, 0.1);
  color: #a259ff;
}
.badge-package {
  background: rgba(0, 199, 190, 0.1);
  color: var(--teal);
}

/* ---- Status ---- */

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.active {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.2);
}
.status-dot.shipped {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}
.status-dot.dormant {
  background: var(--text-tertiary);
  box-shadow: 0 0 0 3px rgba(134, 134, 139, 0.12);
}
.status-dot.planning {
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.2);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  gap: 8px;
}

/* ---- Tags ---- */

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  background: var(--surface-hover);
  border-radius: 6px;
  color: var(--text-secondary);
}

@media (prefers-color-scheme: dark) {
  .tag {
    background: rgba(255, 255, 255, 0.06);
  }
}

/* ---- Progress Bar (detail page) ---- */

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-lg {
  height: 6px;
  border-radius: 3px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #30d158);
  border-radius: 3px;
  transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Commit Info ---- */

.commit-info {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ---- Uncommitted Dot ---- */

.uncommitted-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 149, 0, 0.2);
}

/* ============================================
   Login Page
   ============================================ */

.login-wrapper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 20vh 24px 0;
  background:
    radial-gradient(
      ellipse at 50% 0%,
      rgba(0, 113, 227, 0.04) 0%,
      transparent 60%
    ),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 8px 32px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  .login-card {
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.16),
      0 8px 32px rgba(0, 0, 0, 0.24);
  }
}

.login-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  text-wrap: balance;
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 16px;
}

.error-message {
  font-size: 13px;
  color: var(--red);
  margin-bottom: 12px;
  text-align: center;
  font-weight: 500;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 400;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Inputs ---- */

.input {
  width: 100%;
  padding: 12px 16px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

@media (prefers-color-scheme: dark) {
  .input:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.25);
  }
}

/* ---- Buttons ---- */

.btn {
  padding: 12px 20px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 150ms ease,
    opacity 150ms ease,
    transform 150ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  opacity: 0.88;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: #0077ed;
  opacity: 1;
}

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

.btn-secondary:hover {
  background: var(--surface-hover);
  opacity: 1;
}

.btn-danger {
  background: transparent;
  color: var(--red);
  font-weight: 500;
}

.btn-danger:hover {
  background: rgba(255, 59, 48, 0.08);
  opacity: 1;
}

.btn-sm {
  padding: 8px 16px;
  min-height: 36px;
  font-size: 13px;
}

.btn-full {
  display: flex;
  width: 100%;
}

/* ============================================
   Project Detail Page
   ============================================ */

.detail-nav {
  padding: 32px 0 24px;
}

.back-link {
  color: var(--accent);
  font-size: 17px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 400;
  transition: opacity 150ms ease;
}

.back-link:hover {
  text-decoration: none;
  opacity: 0.8;
}

.detail-header {
  margin-bottom: 32px;
}

.detail-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  line-height: 1.1;
  text-wrap: balance;
}

.detail-badges {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---- Metadata Grid ---- */

.detail-meta {
  margin-bottom: 24px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.meta-value {
  font-size: 15px;
  color: var(--text);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.meta-value a {
  word-break: break-all;
}

/* ---- Progress (Detail) ---- */

.detail-progress {
  margin-bottom: 32px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-label {
  font-size: 15px;
  font-weight: 500;
}

.progress-pct {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

/* ---- Done / To Do ---- */

.detail-items {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 32px;
}

.items-col {
  margin-bottom: 8px;
}

.items-heading {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.items-done {
  color: var(--green);
}

.items-todo {
  color: var(--text-secondary);
}

.items-list {
  list-style: none;
}

.items-list li {
  font-size: 15px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.5;
}

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

.item-icon {
  flex-shrink: 0;
  margin-top: 3px;
}

.item-icon-done {
  color: var(--green);
}

.item-icon-todo {
  color: var(--text-secondary);
}

/* ---- Context / Markdown ---- */

.detail-context {
  margin-top: 8px;
}

.muted {
  color: var(--text-secondary);
  font-style: italic;
}

/* ---- Markdown Rendering ---- */

.markdown h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 32px 0 16px;
  line-height: 1.2;
  text-wrap: balance;
}

.markdown h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 24px 0 12px;
  line-height: 1.25;
  text-wrap: balance;
}

.markdown h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 24px 0 8px;
  line-height: 1.3;
  text-wrap: balance;
}

.markdown h4,
.markdown h5,
.markdown h6 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 8px;
  line-height: 1.35;
}

.markdown p {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
}

.markdown ul,
.markdown ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.markdown li {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 4px;
}

.markdown code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface-hover);
  padding: 2px 8px;
  border-radius: 6px;
}

@media (prefers-color-scheme: dark) {
  .markdown code {
    background: rgba(255, 255, 255, 0.06);
  }
}

.markdown pre {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 20px;
  overflow-x: auto;
  margin: 0 0 20px;
}

@media (prefers-color-scheme: dark) {
  .markdown pre {
    background: rgba(255, 255, 255, 0.04);
  }
}

.markdown pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
}

.markdown blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-style: italic;
}

.markdown table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0 0 20px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  overflow: hidden;
}

.markdown th,
.markdown td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.markdown tr:last-child td {
  border-bottom: none;
}

.markdown th {
  font-weight: 600;
  background: var(--surface-hover);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

@media (prefers-color-scheme: dark) {
  .markdown th {
    background: rgba(255, 255, 255, 0.04);
  }
}

.markdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.markdown a {
  color: var(--accent);
}

.markdown img {
  max-width: 100%;
  border-radius: var(--radius-inner);
}

/* ============================================
   Settings Page
   ============================================ */

.page-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 40px;
  text-wrap: balance;
}

.settings-section {
  margin-bottom: 48px;
}

.section-heading {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.passkey-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.passkey-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  min-height: 44px;
}

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

.passkey-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.passkey-name {
  font-size: 15px;
  font-weight: 500;
}

.passkey-meta {
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.passkey-empty {
  font-size: 15px;
  color: var(--text-secondary);
  font-style: italic;
  padding: 20px 0;
}

/* ============================================
   Grouped Cards (Apple Settings pattern)
   ============================================ */

.section-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 24px 20px 8px;
}

.section-header .section-count {
  font-weight: 400;
}

.grouped-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.grouped-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  gap: 16px;
  min-height: 44px;
}

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

.row-label {
  color: var(--text);
  font-weight: 400;
  flex-shrink: 0;
}

.row-value {
  color: var(--text-secondary);
  text-align: right;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

.row-value a {
  color: var(--accent);
  text-decoration: none;
}

.row-value a:hover {
  text-decoration: underline;
}

/* ---- Checklist rows ---- */

.checklist-row {
  justify-content: flex-start;
  gap: 12px;
}

.checkbox {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-solid);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: transparent;
}

.checkbox.checked {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.checklist-row .checklist-text {
  font-size: 15px;
  line-height: 1.4;
}

.checklist-row.done-row .checklist-text {
  color: var(--text-secondary);
}

/* ---- Section header colors ---- */

.section-header-done {
  color: var(--green);
}

.section-header-todo {
  color: var(--orange);
}

/* ---- Progress in grouped context ---- */

.progress-grouped {
  padding: 20px;
}

.progress-grouped .progress-bar {
  height: 8px;
  border-radius: 4px;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 24px 0;
  }

  .header-title {
    font-size: 28px;
  }

  .header-sync {
    order: 3;
    width: 100%;
    text-align: center;
  }

  .stats-bar .stat strong {
    font-size: 24px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .detail-title {
    font-size: 28px;
  }

  .container {
    padding: 0 16px 40px;
  }

  .login-card {
    padding: 32px 24px;
  }

  .page-title {
    font-size: 28px;
  }

  .filters-row {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
}

/* ---- Card Checklists ---- */

.card-checklist {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.card-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 3px 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}

.card-check > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-check-done {
  color: var(--text-tertiary);
}

.card-check-done > span:last-child {
  text-decoration: line-through;
  text-decoration-color: var(--border-solid);
}

.card-check-overflow {
  font-size: 12px;
  color: var(--text-tertiary);
  padding-left: 24px;
  font-style: italic;
}

.card-check-done-overflow {
  color: var(--green);
}

.card-cb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border-solid);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 9px;
  color: transparent;
  margin-top: 1px;
}

.card-cb-done {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 700;
}

/* ---- Focus-visible for interactive elements ---- */

.card:focus-visible,
.pill:focus-visible,
.btn:focus-visible,
.back-link:focus-visible,
.passkey-item:focus-visible,
.header-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Touch action ---- */

.btn,
.pill,
.card,
a,
input,
button {
  touch-action: manipulation;
}

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
