:root {
  color-scheme: light;
  --slate-950: #0f172a;
  --slate-900: #172033;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-100: #dbeafe;
  --green-700: #15803d;
  --green-100: #dcfce7;
  --amber-700: #a16207;
  --amber-100: #fef3c7;
  --white: #fff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .04);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--slate-50); }
body { min-height: 100vh; margin: 0; color: var(--slate-950); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.svg-library { position: absolute; width: 0; height: 0; overflow: hidden; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--slate-950);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  color: var(--white);
  background: var(--slate-950);
  box-shadow: var(--shadow-sm);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--blue-600);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
}
.security-dot, .status i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .12);
}

/* Login */
.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 12% 16%, rgba(37, 99, 235, .08), transparent 28%),
    radial-gradient(circle at 88% 84%, rgba(14, 165, 233, .07), transparent 26%),
    var(--slate-50);
}
.login-shell {
  display: grid;
  width: min(100%, 980px);
  min-height: 570px;
  grid-template-columns: 1.05fr .95fr;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .10), 0 2px 8px rgba(15, 23, 42, .04);
}
.login-intro {
  display: flex;
  flex-direction: column;
  padding: 42px;
  background: linear-gradient(145deg, #eff6ff 0%, #f8fafc 62%, #eef2ff 100%);
  border-right: 1px solid var(--slate-200);
}
.login-copy { margin: auto 0; max-width: 430px; }
.login-copy h1 {
  margin: 0;
  color: var(--slate-950);
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1.06;
  letter-spacing: -.05em;
}

.security-note {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--slate-600);
  font-size: 12px;
  font-weight: 500;
}
.auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 58px;
}
.auth-heading { margin-bottom: 30px; }
.auth-heading h2 { margin: 0 0 8px; font-size: 25px; letter-spacing: -.025em; }
.auth-heading p { margin: 0; color: var(--slate-500); font-size: 14px; line-height: 1.5; }
.field { margin-bottom: 18px; }
.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--slate-700);
  font-size: 13px;
  font-weight: 600;
}
.field input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--slate-300);
  border-radius: 9px;
  outline: none;
  color: var(--slate-950);
  background: var(--white);
  transition: border-color .16s, box-shadow .16s;
}
.field input::placeholder { color: var(--slate-400); }
.field input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.primary-button {
  display: flex;
  width: 100%;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  border: 0;
  border-radius: 9px;
  color: var(--white);
  background: var(--slate-950);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-weight: 650;
  transition: transform .16s, background .16s;
}
.primary-button:hover { background: #1e293b; transform: translateY(-1px); }
.primary-button:active { transform: translateY(0); }
.form-error {
  margin: -3px 0 16px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  background: #fef2f2;
  font-size: 13px;
}

/* Application */
.app-page { background: var(--slate-50); }
.app-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--slate-200);
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(14px);
}
.header-inner {
  display: flex;
  width: min(100% - 40px, 1180px);
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  margin: auto;
}
.header-actions { display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--slate-600); font-size: 12px; font-weight: 600; }
.user-chip b {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  color: var(--blue-700);
  background: var(--blue-100);
  font-size: 10px;
}
.logout-button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  color: var(--slate-700);
  background: var(--white);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: border-color .15s, background .15s;
}
.logout-button:hover { border-color: var(--slate-400); background: var(--slate-50); }
.page-container { width: min(100% - 40px, 1180px); margin: 0 auto; padding: 56px 0 72px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 56px; }
.page-heading h1 { margin: 0; font-size: clamp(34px, 5vw, 48px); line-height: 1.05; letter-spacing: -.045em; }
.page-subtitle { max-width: 630px; margin: 14px 0 0; color: var(--slate-500); font-size: 15px; line-height: 1.65; }
.summary {
  display: flex;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.summary div { display: grid; min-width: 92px; gap: 2px; padding: 13px 16px; border-left: 1px solid var(--slate-200); }
.summary div:first-child { border-left: 0; }
.summary strong { font-size: 18px; letter-spacing: -.02em; }
.summary span { color: var(--slate-500); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.client-filters {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -26px 0 42px;
}
.filter-label { color: var(--slate-500); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.filter-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--slate-200);
  border-radius: 999px;
  color: var(--slate-600);
  background: var(--white);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  transition: border-color .15s, color .15s, background .15s;
}
.filter-button:hover { border-color: var(--slate-400); color: var(--slate-900); }
.filter-button.is-active { border-color: var(--slate-950); color: var(--white); background: var(--slate-950); }
.project-section + .project-section { margin-top: 54px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-heading > div { display: grid; gap: 5px; }
.section-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.section-heading p { margin: 0; color: var(--slate-500); font-size: 12px; }
.section-count {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  color: var(--slate-600);
  background: var(--white);
  font-size: 11px;
  font-weight: 700;
}
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.project-card {
  display: flex;
  min-width: 0;
  min-height: 152px;
  gap: 15px;
  padding: 20px;
  border: 1px solid var(--slate-200);
  border-radius: 13px;
  color: inherit;
  background: var(--white);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
a.project-card:hover { border-color: #bfdbfe; box-shadow: 0 10px 30px rgba(37, 99, 235, .09); transform: translateY(-2px); }
a.project-card:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; }
.project-card-muted { box-shadow: none; }
.project-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 11px;
  background: var(--slate-100);
}
.project-icon svg { width: 28px; height: 28px; }
.icon-car { background: #eff6ff; }
.icon-video { background: #f5f3ff; }
.icon-notes, .icon-bulb { background: #fffbeb; }
.icon-monitor, .icon-shield { background: #ecfeff; }
.icon-agents { background: #eef2ff; }
.icon-backup { background: #eff6ff; }
.icon-briefcase, .icon-tv { background: #f1f5f9; }
.icon-mower { background: #f0fdf4; }
.icon-tools { background: #fff7ed; }
.card-content { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.card-topline { display: flex; min-width: 0; align-items: start; justify-content: space-between; gap: 10px; }
.card-topline strong { overflow: hidden; color: var(--slate-900); font-size: 14px; line-height: 1.35; text-overflow: ellipsis; }
.open-arrow { color: var(--slate-400); font-size: 16px; font-style: normal; transition: color .16s, transform .16s; }
a.project-card:hover .open-arrow { color: var(--blue-600); transform: translate(2px, -2px); }
.description { display: -webkit-box; overflow: hidden; margin-top: 7px; color: var(--slate-500); font-size: 12px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; }
.status { display: inline-flex; width: fit-content; align-items: center; gap: 7px; font-size: 10px; font-weight: 700; letter-spacing: .015em; }
.status-live { color: var(--green-700); }
.status-wip { color: var(--amber-700); }
.status-wip i { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .12); }
.client-badge {
  overflow: hidden;
  max-width: 112px;
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--blue-700);
  background: var(--blue-100);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[hidden] { display: none !important; }

/* Backup dashboard */
.backup-container { padding-top: 34px; }
.back-link {
  display: inline-flex;
  margin-bottom: 36px;
  color: var(--slate-600);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}
.back-link:hover { color: var(--blue-600); }
.backup-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}
.backup-heading h1 { margin: 0; font-size: clamp(34px, 5vw, 48px); letter-spacing: -.045em; }
.backup-state, .mini-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.backup-state { padding: 9px 13px; }
.backup-state i { width: 8px; height: 8px; border-radius: 999px; }
.backup-state-success { color: var(--green-700); background: var(--green-100); }
.backup-state-success i { background: #22c55e; }
.backup-state-failed { color: #b91c1c; background: #fee2e2; }
.backup-state-failed i { background: #ef4444; }
.backup-state-running { color: var(--blue-700); background: var(--blue-100); }
.backup-state-running i { background: var(--blue-600); }
.backup-state-unknown { color: var(--amber-700); background: var(--amber-100); }
.backup-state-unknown i { background: #f59e0b; }
.backup-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 25px;
  border: 1px solid #bbf7d0;
  border-radius: 16px;
  background: linear-gradient(135deg, #f0fdf4, #fff);
  box-shadow: var(--shadow-card);
}
.backup-hero-failed { border-color: #fecaca; background: linear-gradient(135deg, #fef2f2, #fff); }
.backup-hero-running { border-color: #bfdbfe; background: linear-gradient(135deg, #eff6ff, #fff); }
.backup-hero-unknown { border-color: #fde68a; background: linear-gradient(135deg, #fffbeb, #fff); }
.backup-hero-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: #16a34a;
  font-size: 24px;
  font-weight: 800;
}
.backup-hero-failed .backup-hero-icon { background: #dc2626; }
.backup-hero-running .backup-hero-icon { background: var(--blue-600); }
.backup-hero-unknown .backup-hero-icon { background: #d97706; }
.backup-hero p, .info-panel .panel-heading p, .scope-panel > div > p {
  margin: 0 0 6px;
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .09em;
}
.backup-hero h2 { margin: 0 0 5px; font-size: 20px; }
.backup-hero > div > span { color: var(--slate-600); font-size: 12px; }
.backup-hero-time { display: grid; justify-items: end; gap: 4px; text-align: right; }
.backup-hero-time small { color: var(--slate-500); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.backup-hero-time strong { font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.metric-card, .info-panel, .scope-panel {
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-card);
}
.metric-card { display: grid; gap: 7px; min-width: 0; padding: 20px; }
.metric-card > span { color: var(--slate-500); font-size: 11px; font-weight: 650; }
.metric-card > strong { overflow: hidden; font-size: 24px; letter-spacing: -.025em; text-overflow: ellipsis; }
.metric-card > small { color: var(--slate-500); font-size: 10px; line-height: 1.4; }
.metric-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.backup-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.info-panel { padding: 22px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.panel-heading h2, .scope-panel h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.mini-status { padding: 6px 9px; }
.mini-status-ok { color: var(--green-700); background: var(--green-100); }
.mini-status-warn { color: var(--amber-700); background: var(--amber-100); }
.next-run { display: block; margin-top: 30px; font-size: 25px; letter-spacing: -.03em; }
.info-panel > p { margin: 10px 0 0; color: var(--slate-500); font-size: 11px; line-height: 1.55; }
.detail-list { display: grid; gap: 0; margin: 22px 0 0; padding: 0; list-style: none; }
.detail-list li { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-top: 1px solid var(--slate-100); font-size: 11px; }
.detail-list span { color: var(--slate-500); }
.detail-list strong { text-align: right; }
.scope-panel { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 14px; padding: 22px; }
.scope-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.scope-tags span { padding: 6px 9px; border-radius: 7px; color: var(--slate-600); background: var(--slate-100); font-size: 10px; font-weight: 650; }

/* MTG investments */
.mtg-page { width: min(100% - 40px, 2040px); margin: 0 auto; display: grid; gap: 18px; }
.mtg-page .back-link { width: fit-content; margin-bottom: 2px; color: var(--slate-600); font-size: 12px; font-weight: 650; text-decoration: none; }
.mtg-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 30px; border: 1px solid #ddd6fe; border-radius: 18px; background: linear-gradient(135deg, #f5f3ff, #fff 68%); box-shadow: var(--shadow-card); }
.mtg-hero h1 { margin: 0 0 10px; font-size: clamp(30px, 5vw, 48px); letter-spacing: -.045em; }
.mtg-hero p:not(.eyebrow) { max-width: 720px; margin: 0; color: var(--slate-600); font-size: 14px; line-height: 1.6; }
.mtg-snapshot { display: grid; min-width: 130px; justify-items: end; }
.mtg-snapshot strong { color: #6d28d9; font-size: 42px; line-height: 1; }
.mtg-snapshot span { margin: 4px 0 9px; font-size: 12px; font-weight: 700; }
.mtg-snapshot small { color: var(--slate-500); font-size: 10px; }
.mtg-panel { padding: 26px; border: 1px solid var(--slate-200); border-radius: 16px; background: var(--white); box-shadow: var(--shadow-card); }
.mtg-panel .section-heading { margin-bottom: 20px; }
.mtg-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mtg-type { display: flex; gap: 14px; padding: 17px; border: 1px solid var(--slate-200); border-radius: 12px; background: var(--slate-50); }
.mtg-type-rank { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 9px; color: #fff; background: #6d28d9; font-size: 13px; font-weight: 850; }
.mtg-type h3 { margin: 1px 0 5px; font-size: 14px; }
.mtg-type strong { display: block; margin-bottom: 6px; color: #6d28d9; font-size: 10px; line-height: 1.4; }
.mtg-type p { margin: 0; color: var(--slate-600); font-size: 11px; line-height: 1.55; }
.mtg-rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mtg-rule { display: flex; gap: 12px; padding: 16px; border: 1px solid var(--slate-200); border-radius: 12px; background: var(--slate-50); }
.mtg-rule > span { display: grid; width: 26px; height: 26px; flex: 0 0 26px; place-items: center; border-radius: 8px; color: #6d28d9; background: #ede9fe; font-size: 11px; font-weight: 800; }
.mtg-rule h3 { margin: 2px 0 6px; font-size: 13px; }
.mtg-rule p { margin: 0; color: var(--slate-600); font-size: 11px; line-height: 1.55; }
.mtg-liquidity-method { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .8fr); gap: 24px; margin: 0 0 20px; padding: 18px 20px; border: 1px solid #ddd6fe; border-radius: 12px; background: #faf8ff; }
.mtg-liquidity-method h3 { margin: 0 0 6px; color: #5b21b6; font-size: 14px; }
.mtg-liquidity-method p { margin: 0; color: var(--slate-600); font-size: 11px; line-height: 1.55; }
.mtg-liquidity-method .mtg-liquidity-caveat { margin-top: 9px; padding-top: 9px; border-top: 1px solid #ddd6fe; color: var(--slate-700); }
.mtg-liquidity-formula { display: grid; align-content: center; gap: 6px; padding-left: 24px; border-left: 1px solid #ddd6fe; }
.mtg-liquidity-formula strong { color: var(--slate-950); font-size: 11px; line-height: 1.5; }
.mtg-liquidity-formula span { color: var(--slate-500); font-size: 10px; line-height: 1.5; }
.mtg-table-wrap { overflow-x: auto; }
.mtg-table { width: 100%; min-width: 1940px; border-collapse: collapse; font-size: 11px; }
.mtg-table caption { padding: 0 0 10px; color: var(--slate-600); font-size: 11px; font-weight: 650; text-align: left; }
.mtg-table th { padding: 10px 12px; border-bottom: 1px solid var(--slate-300); color: var(--slate-500); text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.mtg-table td { padding: 13px 12px; border-bottom: 1px solid var(--slate-100); color: var(--slate-600); vertical-align: top; line-height: 1.45; }
.mtg-table td:first-child { color: var(--slate-400); font-weight: 700; }
.mtg-table td:nth-child(3) a, .mtg-table td:nth-child(7) a { color: var(--slate-950); font-weight: 750; text-decoration: none; }
.mtg-table td:nth-child(4), .mtg-table td:nth-child(7), .mtg-table td:nth-child(8), .mtg-table td:nth-child(9), .mtg-table td:nth-child(10), .mtg-table td:nth-child(12), .mtg-table td:nth-child(13) { white-space: nowrap; }
.mtg-table td:nth-child(12), .mtg-table td:nth-child(13) { color: var(--slate-950); }
.mtg-preview-trigger { display: inline-block; position: relative; border-radius: 5px; outline: none; }
.mtg-card-preview { display: block; width: 61px; height: 85px; border-radius: 5px; object-fit: cover; box-shadow: 0 3px 9px rgba(15, 23, 42, .18); }
.mtg-preview-trigger::before { content: ""; position: fixed; z-index: 90; inset: 0; visibility: hidden; opacity: 0; pointer-events: none; background: rgba(15, 23, 42, .64); backdrop-filter: blur(3px); transition: opacity .15s, visibility .15s; }
.mtg-preview-popover { position: fixed; z-index: 91; top: 50%; left: 50%; visibility: hidden; opacity: 0; pointer-events: none; transform: translate(-50%, -48%) scale(.96); transition: opacity .15s, transform .15s, visibility .15s; }
.mtg-preview-popover img { display: block; width: min(349px, calc(100vw - 40px)); height: auto; max-height: calc(100vh - 48px); border-radius: 16px; box-shadow: 0 28px 80px rgba(0, 0, 0, .5); }
.mtg-preview-trigger:hover::before, .mtg-preview-trigger:focus-visible::before, .mtg-preview-trigger:hover .mtg-preview-popover, .mtg-preview-trigger:focus-visible .mtg-preview-popover { visibility: visible; opacity: 1; }
.mtg-preview-trigger:hover .mtg-preview-popover, .mtg-preview-trigger:focus-visible .mtg-preview-popover { transform: translate(-50%, -50%) scale(1); }
.mtg-preview-trigger:focus-visible { box-shadow: 0 0 0 3px rgba(109, 40, 217, .28); }
.mtg-trend { display: inline-flex; min-width: 64px; justify-content: center; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; text-decoration: none; }
.mtg-trend-up { color: var(--green-700); background: var(--green-100); }
.mtg-trend-down { color: #b91c1c; background: #fee2e2; }
.mtg-trend-na { color: var(--slate-500); background: var(--slate-100); }
.mtg-liquidity-cell { width: 190px; min-width: 190px; }
.mtg-liquidity-cell strong { display: inline-flex; margin-bottom: 6px; padding: 5px 8px; border-radius: 999px; color: #5b21b6; background: #ede9fe; font-size: 9px; font-weight: 850; white-space: nowrap; }
.mtg-liquidity-cell span, .mtg-liquidity-cell small { display: block; color: var(--slate-600); font-size: 10px; line-height: 1.6; white-space: nowrap; }
.mtg-liquidity-cell small { margin-top: 3px; }
.mtg-pill { display: inline-flex; padding: 5px 8px; border-radius: 999px; color: var(--green-700); background: var(--green-100); font-size: 9px; font-weight: 750; white-space: nowrap; }
.mtg-pill-warn { color: var(--amber-700); background: var(--amber-100); }

.owned-section { border-color: #bbf7d0; background: linear-gradient(180deg, #f0fdf4 0, #fff 240px); }
.owned-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.owned-heading h2 { margin-bottom: 7px; }
.owned-heading p:not(.eyebrow) { max-width: 920px; margin: 0; color: var(--slate-600); font-size: 12px; line-height: 1.6; }
.owned-count { display: grid; min-width: 130px; justify-items: end; }
.owned-count strong { color: var(--green-700); font-size: 34px; line-height: 1; }
.owned-count span { margin: 3px 0 7px; font-size: 11px; font-weight: 750; }
.owned-count small { color: var(--slate-500); font-size: 9px; }
.owned-grid { display: grid; gap: 14px; }
.owned-card { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 22px; padding: 20px; border: 1px solid #bbf7d0; border-radius: 14px; background: rgba(255, 255, 255, .95); box-shadow: 0 8px 28px rgba(21, 128, 61, .06); }
.owned-card-image img { display: block; width: 180px; height: 251px; border-radius: 10px; object-fit: cover; box-shadow: 0 9px 24px rgba(15, 23, 42, .24); }
.owned-card-body { display: grid; min-width: 0; gap: 14px; }
.owned-card-title h3 { margin: 12px 0 5px; color: var(--slate-950); font-size: 24px; letter-spacing: -.025em; }
.owned-card-title strong { display: block; color: var(--slate-700); font-size: 11px; line-height: 1.55; }
.owned-card-title p { margin: 5px 0 0; color: var(--slate-500); font-size: 10px; }
.owned-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; overflow: hidden; border: 1px solid var(--slate-200); border-radius: 10px; }
.owned-metrics div { padding: 11px 13px; border-right: 1px solid var(--slate-100); border-bottom: 1px solid var(--slate-100); }
.owned-metrics div:nth-child(3n) { border-right: 0; }
.owned-metrics div:nth-last-child(-n+3) { border-bottom: 0; }
.owned-metrics dt { margin-bottom: 4px; color: var(--slate-500); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.owned-metrics dd { margin: 0; color: var(--slate-700); font-size: 10px; line-height: 1.5; }
.owned-metrics dd small { display: block; margin-top: 3px; color: var(--slate-500); font-size: 9px; }
.owned-metrics a { color: var(--green-700); text-decoration: none; }
.owned-change { color: var(--green-700); }
.owned-cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.owned-cases > div { padding: 11px 13px; border-left: 3px solid #22c55e; border-radius: 0 8px 8px 0; background: #f0fdf4; }
.owned-cases strong { color: #166534; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.owned-cases p { margin: 4px 0 0; color: var(--slate-700); font-size: 10px; line-height: 1.55; }
.owned-cases .owned-risk { border-left-color: #f59e0b; background: #fffbeb; }
.owned-cases .owned-risk strong { color: #92400e; }
.owned-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.owned-links a { color: var(--green-700); font-size: 9px; font-weight: 750; text-decoration: none; }
.owned-footnote { margin: 14px 0 0; color: var(--slate-500); font-size: 9px; line-height: 1.55; }

.pokemon-section { border-color: #bfdbfe; background: linear-gradient(180deg, #eff6ff 0, #fff 220px); }
.pokemon-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.pokemon-heading h2 { margin-bottom: 7px; }
.pokemon-heading p:not(.eyebrow) { max-width: 900px; margin: 0; color: var(--slate-600); font-size: 12px; line-height: 1.6; }
.pokemon-count { display: grid; min-width: 120px; justify-items: end; }
.pokemon-count strong { color: #1d4ed8; font-size: 34px; line-height: 1; }
.pokemon-count span { margin: 3px 0 7px; font-size: 11px; font-weight: 750; }
.pokemon-count small { color: var(--slate-500); font-size: 9px; }
.pokemon-method { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-bottom: 18px; overflow: hidden; border: 1px solid #bfdbfe; border-radius: 12px; background: #bfdbfe; }
.pokemon-method div { display: grid; align-content: start; gap: 5px; padding: 15px 17px; background: #f8fbff; }
.pokemon-method strong { color: #1e3a8a; font-size: 11px; }
.pokemon-method span { color: var(--slate-600); font-size: 10px; line-height: 1.55; }
.pokemon-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pokemon-candidate { display: grid; gap: 14px; padding: 18px; border: 1px solid #dbeafe; border-radius: 14px; background: rgba(255, 255, 255, .94); box-shadow: 0 8px 28px rgba(30, 64, 175, .06); }
.pokemon-card-top { display: grid; grid-template-columns: 122px minmax(0, 1fr); gap: 16px; align-items: start; }
.pokemon-preview-trigger { width: 122px; }
.pokemon-card-preview { display: block; width: 122px; height: 170px; border-radius: 8px; object-fit: cover; box-shadow: 0 7px 20px rgba(15, 23, 42, .22); }
.pokemon-card-title { min-width: 0; }
.pokemon-card-title .mtg-pill { margin-left: 5px; }
.pokemon-rank { color: #2563eb; font-size: 10px; font-weight: 850; }
.pokemon-card-title h3 { margin: 14px 0 4px; color: var(--slate-950); font-size: 20px; letter-spacing: -.025em; }
.pokemon-card-title p { margin: 0 0 10px; color: var(--slate-500); font-size: 10px; line-height: 1.4; }
.pokemon-card-title > strong { display: block; color: var(--slate-700); font-size: 10px; line-height: 1.55; }
.pokemon-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; overflow: hidden; border: 1px solid var(--slate-200); border-radius: 10px; }
.pokemon-metrics div { padding: 10px 12px; border-right: 1px solid var(--slate-100); border-bottom: 1px solid var(--slate-100); }
.pokemon-metrics div:nth-child(2n) { border-right: 0; }
.pokemon-metrics div:nth-last-child(-n+2) { border-bottom: 0; }
.pokemon-metrics dt { margin-bottom: 4px; color: var(--slate-500); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.pokemon-metrics dd { margin: 0; color: var(--slate-700); font-size: 10px; line-height: 1.45; }
.pokemon-metrics a { color: #1d4ed8; font-weight: 750; text-decoration: none; }
.pokemon-case { padding: 11px 13px; border-left: 3px solid #60a5fa; border-radius: 0 8px 8px 0; background: #eff6ff; }
.pokemon-case strong { color: #1e3a8a; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.pokemon-case p { margin: 4px 0 0; color: var(--slate-700); font-size: 10px; line-height: 1.55; }
.pokemon-risk { border-left-color: #f59e0b; background: #fffbeb; }
.pokemon-risk strong { color: #92400e; }
.pokemon-links { display: flex; flex-wrap: wrap; gap: 8px 14px; padding-top: 2px; }
.pokemon-links a { color: #1d4ed8; font-size: 9px; font-weight: 750; text-decoration: none; }

.app-footer {
  display: flex;
  width: min(100% - 40px, 1180px);
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  padding: 24px 0 30px;
  border-top: 1px solid var(--slate-200);
  color: var(--slate-500);
  font-size: 11px;
}
.app-footer div:last-child { display: flex; align-items: center; gap: 9px; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; max-width: 540px; }
  .login-intro { min-height: 300px; padding: 32px; border-right: 0; border-bottom: 1px solid var(--slate-200); }
  .login-copy { margin: 54px 0; }
  .auth-card { padding: 40px 32px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-heading { align-items: start; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .backup-detail-grid { grid-template-columns: 1fr; }
  .mtg-types { grid-template-columns: 1fr; }
  .mtg-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mtg-liquidity-method { grid-template-columns: 1fr; }
  .mtg-liquidity-formula { padding: 16px 0 0; border-top: 1px solid #ddd6fe; border-left: 0; }
  .owned-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .owned-metrics div, .owned-metrics div:nth-child(3n), .owned-metrics div:nth-last-child(-n+3) { border-right: 1px solid var(--slate-100); border-bottom: 1px solid var(--slate-100); }
  .owned-metrics div:nth-child(2n) { border-right: 0; }
  .owned-metrics div:nth-last-child(-n+2) { border-bottom: 0; }
  .pokemon-method { grid-template-columns: 1fr; }
  .pokemon-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .login-page { display: block; padding: 0; background: var(--white); }
  .login-shell { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .login-intro { min-height: 250px; padding: 26px 22px; }
  .login-copy { margin: 34px 0 22px; }
  .login-copy h1 { font-size: 34px; }

  .auth-card { padding: 34px 22px 44px; }
  .header-inner, .page-container, .app-footer { width: min(100% - 28px, 1180px); }
  .header-actions { gap: 7px; }
  .user-chip span { display: none; }
  .page-container { padding-top: 38px; }
  .page-heading { margin-bottom: 42px; }
  .client-filters { align-items: flex-start; flex-direction: column; margin-top: -18px; }
  .summary { width: 100%; }
  .summary div { min-width: 0; flex: 1; padding: 12px; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card { min-height: 138px; }
  .backup-heading { align-items: flex-start; flex-direction: column; }
  .backup-hero { grid-template-columns: auto 1fr; }
  .backup-hero-time { grid-column: 1 / -1; justify-items: start; padding-top: 14px; border-top: 1px solid var(--slate-200); text-align: left; }
  .metric-grid { grid-template-columns: 1fr; }
  .panel-heading, .scope-panel { align-items: flex-start; flex-direction: column; }
  .scope-tags { justify-content: flex-start; }
  .detail-list li { align-items: flex-start; flex-direction: column; gap: 5px; }
  .detail-list strong { text-align: left; }
  .mtg-hero { align-items: flex-start; flex-direction: column; padding: 22px; }
  .mtg-snapshot { justify-items: start; }
  .mtg-panel { padding: 18px; }
  .mtg-rules { grid-template-columns: 1fr; }
  .owned-heading { align-items: flex-start; flex-direction: column; }
  .owned-count { justify-items: start; }
  .owned-card { grid-template-columns: 1fr; }
  .owned-card-image img { width: 140px; height: 195px; }
  .owned-metrics, .owned-cases { grid-template-columns: 1fr; }
  .owned-metrics div, .owned-metrics div:nth-child(2n), .owned-metrics div:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--slate-100); }
  .owned-metrics div:last-child { border-bottom: 0; }
  .pokemon-heading { align-items: flex-start; flex-direction: column; }
  .pokemon-count { justify-items: start; }
  .pokemon-card-top { grid-template-columns: 96px minmax(0, 1fr); }
  .pokemon-preview-trigger { width: 96px; }
  .pokemon-card-preview { width: 96px; height: 134px; }
  .pokemon-metrics { grid-template-columns: 1fr; }
  .pokemon-metrics div, .pokemon-metrics div:nth-child(2n), .pokemon-metrics div:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--slate-100); }
  .pokemon-metrics div:last-child { border-bottom: 0; }
  .app-footer { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
