:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #0f766e;
  --primary-hover: #0d9488;
  --danger: #dc2626;
  --warning: #d97706;
  --border: #e2e8f0;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --input-bg: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-muted: #f1f5f9;
  --surface-hover: #f3f4f6;
  --surface-active: #eff6ff;
  --surface-highlight: #f0fdfa;
  --btn-default-bg: #e2e8f0;
  --chart-accent: #3b82f6;
  --chart-callout-bg: #0f172a;
  --chart-callout-text: #f8fafc;
  --chart-callout-muted: #cbd5e1;
  --chart-axis: #e2e8f0;
  --chart-dot-border: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.88);
  --nav-panel-bg: rgba(255, 255, 255, 0.97);
  --nav-border: #e5e7eb;
  --nav-text: #4b5563;
  --nav-text-strong: #111827;
  --nav-active-text: #1d4ed8;
  --popover-bg: #ffffff;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --card: #1e293b;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --primary: #2dd4bf;
    --primary-hover: #5eead4;
    --danger: #f87171;
    --warning: #fbbf24;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    --input-bg: #0f172a;
    --surface-subtle: #1e293b;
    --surface-muted: #334155;
    --surface-hover: #334155;
    --surface-active: rgba(59, 130, 246, 0.15);
    --surface-highlight: rgba(45, 212, 191, 0.12);
    --btn-default-bg: #334155;
    --chart-accent: #60a5fa;
    --chart-callout-bg: #f1f5f9;
    --chart-callout-text: #0f172a;
    --chart-callout-muted: #64748b;
    --chart-axis: #475569;
    --chart-dot-border: #1e293b;
    --nav-bg: rgba(15, 23, 42, 0.92);
    --nav-panel-bg: rgba(15, 23, 42, 0.98);
    --nav-border: #334155;
    --nav-text: #94a3b8;
    --nav-text-strong: #f1f5f9;
    --nav-active-text: #60a5fa;
    --popover-bg: #1e293b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  overflow-x: hidden;
  width: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  overscroll-behavior-x: none;
  touch-action: manipulation;
}

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

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand a { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.nav { display: flex; gap: 0.75rem; flex: 1; }
.nav a { color: var(--muted); padding: 0.25rem 0.5rem; border-radius: 6px; }
.nav a.active, .nav a:hover { color: var(--primary); background: var(--surface-highlight); text-decoration: none; }
.nav-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

/* macOS-style schedule toggle */
.mac-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
  color: var(--muted);
}
.mac-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.mac-toggle-track {
  position: relative;
  width: 42px;
  height: 26px;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.mac-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.mac-toggle input:checked + .mac-toggle-track {
  background: #34c759;
}
.mac-toggle input:checked + .mac-toggle-track .mac-toggle-knob {
  transform: translateX(16px);
}
.mac-toggle input:focus-visible + .mac-toggle-track {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.mac-toggle.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

.local-datetime { font-variant-numeric: tabular-nums; }

.container { max-width: 1200px; margin: 0 auto; padding: 1rem; width: 100%; min-width: 0; }

.dashboard-section,
#dashboard-live > .card,
#dashboard-live > section.card,
#dashboard-live > section.grid {
  margin-bottom: 1rem;
}

.storage-path {
  margin: 0 0 1rem;
}
h1 { margin: 0 0 1rem; font-size: 1.5rem; }
h2 { margin: 0 0 0.75rem; font-size: 1.1rem; }

.grid { display: grid; gap: 1rem; }
.stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 1rem; }
.stat {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.stat-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.stat-teal .stat-icon { background: #ccfbf1; color: #0f766e; }
.stat-red .stat-icon { background: #fee2e2; color: #b91c1c; }
.stat-blue .stat-icon { background: #dbeafe; color: #1d4ed8; }
.stat-purple .stat-icon { background: #ede9fe; color: #6d28d9; }
.stat-indigo .stat-icon { background: #e0e7ff; color: #4338ca; }
.stat-cyan .stat-icon { background: #cffafe; color: #0e7490; }
.stat-slate .stat-icon { background: #f1f5f9; color: #334155; }
.stat-green .stat-icon { background: #dcfce7; color: #15803d; }
.stat-orange .stat-icon { background: #ffedd5; color: #c2410c; }
.stat-body { min-width: 0; flex: 1; }
.stat-sub { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.stat-elapsed {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.cell-duration-live {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--purple, #7c3aed);
}
.stat-link.is-live .stat-elapsed,
.stat.is-live .stat-elapsed { color: var(--purple, #7c3aed); }
.stat-falcon-failure {
  display: block;
  color: var(--danger);
  font-weight: 600;
  line-height: 1.35;
}
.stat-falcon-success-muted {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}
.stat-falcon-error {
  color: var(--danger);
  opacity: 0.9;
  font-size: 0.72rem;
  line-height: 1.3;
}
.stat-link.has-falcon-failure {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
}
.stat-link.has-falcon-failure .stat-icon { color: var(--danger); }
.stat-value-falcon .stat-falcon-failure { font-size: 0.92rem; }
.stat-link { text-decoration: none; color: inherit; transition: box-shadow 0.15s ease, transform 0.15s ease; }
.stat-link:hover { text-decoration: none; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1); transform: translateY(-1px); }
.stat-link.has-alert .stat-value { color: var(--danger); }
.stat.is-live .stat-icon i { animation: spin 1s linear infinite; }
.stat-value.text-growth { color: #0f766e; }
.two-col { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.stat-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.stat-label-inline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.stat-label-inline .badge {
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.72rem;
}
.stat-value-falcon { font-size: 0.92rem; font-weight: 500; margin-top: 0.35rem; }
.stat-value { font-size: 1.1rem; font-weight: 600; margin-top: 0.25rem; word-break: break-word; }
.stat-value.small { font-size: 0.85rem; font-weight: 500; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  cursor: pointer;
  background: var(--btn-default-bg);
  color: var(--text);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.8rem; }
.btn-block { width: 100%; }
.inline { display: inline; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--surface-muted);
  color: var(--muted);
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-muted { background: #e5e7eb; color: #4b5563; }
.badge-running { background: #dbeafe; color: #1e40af; }
.alert-muted { background: #f3f4f6; border-color: #d1d5db; color: #374151; }
.row-muted td { opacity: 0.85; }
@media (prefers-color-scheme: dark) {
  .badge-success { background: #14532d; color: #86efac; }
  .badge-warning { background: #78350f; color: #fde68a; }
  .badge-danger { background: #7f1d1d; color: #fca5a5; }
  .badge-muted { background: #374151; color: #d1d5db; }
  .badge-running { background: #1e3a8a; color: #93c5fd; }
  .alert-muted { background: #1f2937; border-color: #374151; color: #e5e7eb; }
  .stat-teal .stat-icon { background: #134e4a; color: #5eead4; }
  .stat-red .stat-icon { background: #7f1d1d; color: #fca5a5; }
  .stat-blue .stat-icon { background: #1e3a8a; color: #93c5fd; }
  .stat-purple .stat-icon { background: #4c1d95; color: #c4b5fd; }
  .stat-indigo .stat-icon { background: #312e81; color: #a5b4fc; }
  .stat-cyan .stat-icon { background: #164e63; color: #67e8f9; }
  .stat-slate .stat-icon { background: #334155; color: #cbd5e1; }
  .stat-green .stat-icon { background: #14532d; color: #86efac; }
  .stat-orange .stat-icon { background: #7c2d12; color: #fdba74; }
  .stat-value.text-growth { color: #5eead4; }
  .alert-success { background: #14532d; color: #86efac; border-color: #166534; }
  .alert-warning { background: #78350f; color: #fde68a; border-color: #92400e; }
  .alert-danger { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
  .tab.active { background: #134e4a; color: var(--primary); border-color: #0f766e; }
  .log-run-header { background: var(--surface-subtle); }
  .log-run-active .log-run-header { background: var(--surface-active); }
  .live-run-banner { background: var(--surface-active); border-color: #1e40af; color: #93c5fd; }
  .alert-card { border-color: #9a3412; }
  .problem-item:hover { background: var(--surface-subtle); }
  .last-run-issues-title { color: #fdba74; }
  #projects-table tr.row-running { background: var(--surface-active); }
  #projects-table tr.row-running td { border-bottom-color: #1e40af; }
  .restore-output { background: var(--surface-subtle); }
  .storage-chart-callout { background: var(--chart-callout-bg); color: var(--chart-callout-text); }
  .storage-chart-callout-time { color: var(--chart-callout-muted); }
  .storage-chart-dot { border-color: var(--chart-dot-border); }
  .mac-toggle-track { background: #475569; }
  .mac-toggle-knob { background: #e2e8f0; }
  .live-run-banner { color: #93c5fd; border-color: #1e40af; }
}
.text-warning { color: var(--warning); }

.table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.table-wrap > table,
#projects-table {
  width: max-content;
  min-width: 100%;
}
.table-wrap > table th,
.table-wrap > table td,
#projects-table th,
#projects-table td {
  white-space: nowrap;
  vertical-align: middle;
}
.table-wrap > table td .badge,
#projects-table td .badge {
  display: inline-block;
  white-space: nowrap;
}
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }

.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; overflow-wrap: anywhere; word-break: break-word; }
.truncate { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-danger { color: var(--danger); }

.page-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.login-card {
  max-width: 400px;
  margin: 4rem auto;
  padding: 2rem;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.login-card label { display: block; margin-bottom: 0.75rem; font-size: 0.9rem; }
.login-card input {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
}
.error { color: var(--danger); font-size: 0.9rem; }
.hidden { display: none; }

.form-card label { display: block; margin-bottom: 0.75rem; }
.form-card input:not([type="checkbox"]):not([type="radio"]),
.form-card select,
.form-card textarea {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
}
.checkbox {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  width: auto;
  max-width: 100%;
}
.checkbox input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  min-width: 1.1rem;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}
.form-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
}
.tab.active { background: var(--surface-highlight); color: var(--primary); border-color: #99f6e4; }

.log-list { list-style: none; padding: 0; margin: 0; }
.log-list li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.log-time { color: var(--muted); margin-right: 0.5rem; }
.storage-path { font-size: 0.8rem; margin-bottom: 1rem; }

.log-runs { display: flex; flex-direction: column; gap: 1rem; }
.log-run-group { padding: 0; overflow: hidden; }
.log-run-header {
  padding: 0.85rem 1rem;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
}
.log-run-active .log-run-header { background: var(--surface-active); }
.log-run-title { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-weight: 600; }
.log-run-meta { font-size: 0.8rem; margin-top: 0.25rem; }
.log-run-entries { padding: 0.5rem 1rem 0.75rem; margin: 0; }
.log-run-empty { padding: 0.75rem 1rem; margin: 0; }

.last-run-banner { margin-bottom: 1rem; }
.last-run-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.last-run-head h2 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.last-run-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }

.live-run-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--surface-active);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  color: #1e40af;
  font-weight: 500;
}

.alert-card { border-color: #fed7aa; }
.alert-card--danger { border-color: #fecaca; background: rgba(254, 226, 226, 0.35); }
.attention-intro { margin: 0 0 0.75rem; font-size: 0.85rem; line-height: 1.45; }
.problem-list { display: flex; flex-direction: column; gap: 0.5rem; }
.problem-item {
  display: block;
  padding: 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.problem-item:hover { background: var(--surface-subtle); text-decoration: none; }
.problem-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.35rem;
}
.problem-failed { border-left: 3px solid var(--danger); }
.problem-partial { border-left: 3px solid var(--warning); }
.problem-detail { margin: 0; font-size: 0.82rem; color: var(--muted); line-height: 1.45; }
.problem-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}
.stat-link.has-alert[aria-disabled="true"] { pointer-events: none; opacity: 0.85; }

.last-run-issues {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.last-run-issues-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #c2410c;
}
.last-run-issues-lead {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}
.last-run-issues-list {
  margin: 0 0 0.65rem;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--text);
}
.last-run-issues-list li { margin-bottom: 0.35rem; }
.last-run-issues-list a { font-weight: 600; }
.last-run-issues-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

#projects-table tr.row-running { background: var(--surface-active); }
#projects-table tr.row-running td { border-bottom-color: #bae6fd; }

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

.inline-loader {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.95rem;
}
.stat-value.is-loading,
td.is-loading {
  color: var(--muted);
}

.restore-output {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--surface-subtle);
  border-radius: 8px;
  font-size: 0.8rem;
  max-height: 280px;
  overflow: auto;
}

#restore-panel tr.is-restoring {
  background: rgba(15, 118, 110, 0.08);
}

#restore-panel tr.is-restoring .restore-actions .btn:not(.btn-restore-files) {
  opacity: 0.55;
  pointer-events: none;
}

.storage-chart-wrap {
  padding: 0.25rem 0 0;
}

.storage-chart-plot {
  position: relative;
  width: 100%;
  height: 160px;
  touch-action: none;
  cursor: crosshair;
}

.storage-line-chart {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.storage-chart-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.storage-chart-vline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  margin-left: -0.5px;
  background: var(--chart-accent);
  pointer-events: none;
}

.storage-chart-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.storage-chart-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  border: 2px solid var(--chart-dot-border);
  background: var(--chart-accent);
  padding: 0;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.35);
  transition: transform 0.12s ease, background 0.12s ease, opacity 0.12s ease;
  opacity: 0.55;
}

.storage-chart-plot:hover .storage-chart-dot,
.storage-chart-dot.is-active {
  opacity: 1;
}

.storage-chart-dot.is-active,
.storage-chart-plot:hover .storage-chart-dot:hover {
  transform: scale(1.25);
  background: var(--chart-accent);
  z-index: 2;
}

.storage-chart-callout {
  position: absolute;
  top: 0.35rem;
  transform: translateX(-50%);
  min-width: 8.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: var(--chart-callout-bg);
  color: var(--chart-callout-text);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  pointer-events: none;
  z-index: 3;
}

.storage-chart-callout.is-left {
  transform: translateX(-92%);
}

.storage-chart-callout.is-right {
  transform: translateX(-8%);
}

.storage-chart-callout-size {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
}

.storage-chart-callout-time {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--chart-callout-muted);
}

.storage-chart-line {
  fill: none;
  stroke: var(--chart-accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.storage-chart-area {
  stroke: none;
}

.storage-chart-axis {
  stroke: var(--chart-axis);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.storage-chart-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.storage-chart-hint {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 899px) {
  .storage-chart-hint::before { content: 'Swipe '; }
}

.storage-of {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.9em;
}

.stat-value-storage {
  line-height: 1.35;
}

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

.card-header h2 { margin: 0; }

@media (max-width: 899px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .nav { justify-content: center; }
  .nav-actions { justify-content: center; }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .stats-grid .card {
    padding: 0.65rem 0.55rem;
    min-width: 0;
  }
  .stats-grid .stat {
    gap: 0.45rem;
    align-items: flex-start;
  }
  .stats-grid .stat-icon {
    width: 1.7rem;
    height: 1.7rem;
    font-size: 0.78rem;
    border-radius: 8px;
  }
  .stats-grid .stat-label {
    font-size: 0.62rem;
    letter-spacing: 0.02em;
    line-height: 1.25;
  }
  .stats-grid .stat-value {
    font-size: 0.82rem;
    margin-top: 0.12rem;
    line-height: 1.3;
  }
  .stats-grid .stat-value.small {
    font-size: 0.72rem;
  }
  .stats-grid .stat-sub {
    font-size: 0.62rem;
    margin-top: 0.1rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .stats-grid .badge {
    font-size: 0.62rem;
    padding: 0.1rem 0.35rem;
  }
  .stats-grid .local-datetime {
    font-size: 0.72rem;
  }
  .card { max-width: 100%; min-width: 0; }
  .grid { min-width: 0; }
  th, td { overflow-wrap: anywhere; word-break: break-word; }
  .table-wrap > table th,
  .table-wrap > table td,
  #projects-table th,
  #projects-table td {
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
  }
  .login-card input { font-size: 16px; }
}
