/* ============================================================
   PFA — Personal Financial Assistant
   Prototype stylesheet (design system + components)
   Fake-data prototype. No real finance data here.
   ============================================================ */

:root {
  /* Brand */
  --brand-900: #0b1f3a;
  --brand-700: #12325e;
  --brand-500: #2563eb;
  --brand-400: #3b82f6;
  --accent:    #14b8a6;
  --accent-700:#0f766e;

  /* Status colors */
  --green:  #16a34a;
  --green-bg:  #dcfce7;
  --yellow: #ca8a04;
  --yellow-bg: #fef9c3;
  --orange: #ea580c;
  --orange-bg: #ffedd5;
  --red:    #dc2626;
  --red-bg:    #fee2e2;

  /* Neutrals */
  --bg:        #f5f7fb;
  --surface:   #ffffff;
  --surface-2: #f0f3f9;
  --border:    #e2e8f0;
  --text:      #0f172a;
  --text-soft: #475569;
  --text-mute: #94a3b8;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--brand-500); text-decoration: none; }
button { font-family: inherit; }

.hidden { display: none !important; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(37,99,235,.18), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(20,184,166,.18), transparent 55%),
    var(--brand-900);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-lg);
}
.brand-mark {
  display: flex; align-items: center; gap: 12px; margin-bottom: 6px;
}
.brand-logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-500), var(--accent));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px;
  letter-spacing: .5px;
}
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: -.2px; }
.brand-sub { color: var(--text-mute); font-size: 13px; margin-top: 2px; }
.login-card h1 { font-size: 19px; margin: 22px 0 4px; }
.login-card p.lead { color: var(--text-soft); margin: 0 0 20px; font-size: 14px; }

.field { margin-bottom: 14px; }
.field label { display:block; font-size: 12.5px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; background: var(--surface); color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; transition: .15s;
}
.btn-primary { background: var(--brand-500); color: #fff; }
.btn-primary:hover { background: var(--brand-700); }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 7px 11px; font-size: 13px; }
.btn-accent { background: var(--accent); color:#fff; }
.btn-accent:hover { background: var(--accent-700); }

.privacy-note {
  margin-top: 18px; font-size: 12px; color: var(--text-mute);
  background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius-sm);
  display:flex; gap:8px; align-items:flex-start;
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--brand-900);
  color: #cbd5e1;
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand-mark { padding: 4px 8px 16px; }
.sidebar .brand-name { color: #fff; }
.sidebar .brand-sub { color: #7c93b5; }
.nav-section-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: #64769a; padding: 14px 12px 6px; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px; color: #cbd5e1;
  cursor: pointer; font-size: 14px; font-weight: 500; transition: .12s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--brand-500); color: #fff; }
.nav-item .ico { width: 18px; text-align: center; font-size: 15px; }
.nav-item .badge {
  margin-left: auto; background: var(--orange); color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px;
}
.sidebar-footer { margin-top: auto; padding-top: 12px; }
.sidebar-footer .nav-item { color: #8da4cc; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5;
}
.topbar h2 { margin: 0; font-size: 18px; font-weight: 700; }
.topbar .month { color: var(--text-mute); font-size: 13px; margin-left: 4px; }
.topbar .spacer { flex: 1; }
.user-chip {
  display:flex; align-items:center; gap:9px; padding: 5px 10px 5px 5px;
  border:1px solid var(--border); border-radius: 999px; font-size: 13px; font-weight:600;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--accent));
  color:#fff; display:grid; place-items:center; font-size:12px; font-weight:700;
}

.content { padding: 24px 28px 56px; max-width: 1180px; width: 100%; }

/* ============================================================
   STATUS PILLS
   ============================================================ */
.pill {
  display:inline-flex; align-items:center; gap:6px;
  font-size: 12.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.pill.green  { background: var(--green-bg);  color: #166534; }
.pill.green .dot  { background: var(--green); }
.pill.yellow { background: var(--yellow-bg); color: #854d0e; }
.pill.yellow .dot { background: var(--yellow); }
.pill.orange { background: var(--orange-bg); color: #9a3412; }
.pill.orange .dot { background: var(--orange); }
.pill.red    { background: var(--red-bg);    color: #991b1b; }
.pill.red .dot    { background: var(--red); }
.pill.muted  { background: var(--surface-2); color: var(--text-soft); }
.pill.muted .dot { background: var(--text-mute); }

/* ============================================================
   CARDS / GRID
   ============================================================ */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 2px; font-size: 15px; }
.card .card-head { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.card .card-head h3 { margin:0; }
.card .card-head .spacer { flex:1; }
.muted-label { color: var(--text-mute); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.stat .value { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin-top: 6px; }
.stat .sub { font-size: 12.5px; color: var(--text-mute); margin-top: 4px; }
.stat .delta-up { color: var(--green); font-weight: 700; }
.stat .delta-down { color: var(--red); font-weight: 700; }

/* Hero status */
.hero {
  border-radius: var(--radius);
  padding: 22px 24px; color:#fff; box-shadow: var(--shadow);
  display:flex; align-items:center; gap: 24px; flex-wrap: wrap;
}
.hero.green  { background: linear-gradient(135deg, #15803d, #16a34a); }
.hero.yellow { background: linear-gradient(135deg, #a16207, #ca8a04); }
.hero.orange { background: linear-gradient(135deg, #c2410c, #ea580c); }
.hero.red    { background: linear-gradient(135deg, #b91c1c, #dc2626); }
.hero .hero-status { font-size: 13px; opacity:.9; font-weight:600; text-transform:uppercase; letter-spacing:.06em; }
.hero .hero-title { font-size: 22px; font-weight: 800; margin: 4px 0 6px; }
.hero .hero-desc { font-size: 14px; opacity:.92; max-width: 520px; }
.hero .hero-friday {
  margin-left:auto; background: rgba(255,255,255,.15);
  border:1px solid rgba(255,255,255,.25); border-radius: var(--radius);
  padding: 14px 20px; text-align:center; min-width: 180px;
}
.hero .hero-friday .lbl { font-size: 12px; opacity:.9; font-weight:600; }
.hero .hero-friday .amt { font-size: 32px; font-weight: 800; letter-spacing:-1px; margin-top:2px; }
.hero .hero-friday .sub { font-size: 12px; opacity:.85; }

/* Lists / rows */
.row-list { display:flex; flex-direction:column; }
.list-row {
  display:flex; align-items:center; gap: 12px; padding: 11px 2px;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row .ico-badge {
  width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2);
  display:grid; place-items:center; font-size: 16px; flex-shrink:0;
}
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; font-size: 14px; }
.list-row .sub { color: var(--text-mute); font-size: 12.5px; }
.list-row .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.amt.neg { color: var(--text); }
.amt.pos { color: var(--green); }

/* Category bars */
.cat-bar { margin-bottom: 13px; }
.cat-bar .cat-top { display:flex; justify-content:space-between; font-size:13.5px; margin-bottom:5px; }
.cat-bar .cat-top .name { font-weight:600; }
.cat-bar .cat-top .val { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.track > span { display:block; height:100%; border-radius:999px; }

/* Tables */
.table-wrap { overflow-x:auto; border:1px solid var(--border); border-radius: var(--radius); }
table.data { width:100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align:left; padding: 11px 14px; background: var(--surface-2);
  font-size: 11.5px; text-transform: uppercase; letter-spacing:.04em; color: var(--text-soft); font-weight: 700;
  position: sticky; top: 0;
}
table.data td { padding: 11px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
table.data tr:hover td { background: #fafbfe; }
.tnum { font-variant-numeric: tabular-nums; }
.tag {
  display:inline-block; font-size: 11.5px; font-weight:600; padding: 2px 9px;
  border-radius: 999px; background: var(--surface-2); color: var(--text-soft);
}
.tag.cat { background: #eef2ff; color:#4338ca; }
.tag.income { background: var(--green-bg); color:#166534; }
.tag.dup { background: var(--red-bg); color:#991b1b; }

/* Confidence meter */
.conf { display:flex; align-items:center; gap:7px; }
.conf .bar { width: 54px; height: 6px; background: var(--surface-2); border-radius:999px; overflow:hidden; }
.conf .bar > span { display:block; height:100%; }
.conf .pct { font-size: 12px; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.conf.hi  .bar>span { background: var(--green); }
.conf.mid .bar>span { background: var(--yellow); }
.conf.lo  .bar>span { background: var(--red); }

/* Page intro */
.page-intro { margin-bottom: 20px; }
.page-intro p { color: var(--text-soft); margin: 4px 0 0; font-size: 14px; max-width: 720px; }

/* Upload dropzone */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 40px 24px; text-align:center; background: var(--surface-2);
  cursor: pointer; transition:.15s;
}
.dropzone:hover { border-color: var(--brand-400); background: #eef4ff; }
.dropzone .big-ico { font-size: 38px; }
.dropzone h3 { margin: 12px 0 4px; }
.dropzone p { color: var(--text-mute); margin: 0; font-size: 13.5px; }
.fmt-chips { display:flex; gap:8px; justify-content:center; margin-top:14px; flex-wrap:wrap; }
.fmt-chips .chip { font-size:12px; font-weight:600; padding:4px 10px; border-radius:999px; background:#fff; border:1px solid var(--border); }
.fmt-chips .chip.soon { color: var(--text-mute); }

/* Review queue card */
.review-card {
  border:1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface);
  margin-bottom: 14px;
}
.review-card .rc-head { display:flex; align-items:center; gap:12px; margin-bottom: 12px; }
.review-card .rc-q { font-weight: 600; margin-bottom: 10px; }
.choice-chips { display:flex; gap:8px; flex-wrap:wrap; }
.choice {
  padding: 7px 13px; border:1px solid var(--border); border-radius: 999px;
  background: var(--surface); cursor:pointer; font-size: 13px; font-weight: 600; transition:.12s;
}
.choice:hover { border-color: var(--brand-400); background:#eef4ff; }
.choice.selected { background: var(--brand-500); color:#fff; border-color: var(--brand-500); }
.rc-foot { display:flex; align-items:center; gap:12px; margin-top:14px; }
.switch { display:flex; align-items:center; gap:8px; font-size:13px; color: var(--text-soft); }
.switch input { width:16px; height:16px; }

/* Friday breakdown */
.calc-row {
  display:flex; align-items:center; gap:12px; padding: 12px 0; border-bottom:1px dashed var(--border);
}
.calc-row:last-child { border-bottom:none; }
.calc-row .calc-ico { width:30px; text-align:center; font-size:16px; }
.calc-row .calc-label { flex:1; }
.calc-row .calc-label .t { font-weight:600; font-size:14px; }
.calc-row .calc-label .s { color: var(--text-mute); font-size:12.5px; }
.calc-row .calc-amt { font-weight:700; font-variant-numeric: tabular-nums; }
.calc-row.start .calc-amt { color: var(--green); }
.calc-row.minus .calc-amt { color: var(--red); }
.calc-row.total { border-top: 2px solid var(--text); margin-top:6px; padding-top:14px; }
.calc-row.total .calc-label .t { font-size: 16px; }
.calc-row.total .calc-amt { font-size: 20px; }

.threshold-grid { display:grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 4px; }
@media (max-width:640px){ .threshold-grid{ grid-template-columns:1fr; } }
.thr {
  border-radius: var(--radius); padding: 16px; text-align:center; border:1px solid var(--border);
}
.thr .lbl { font-size:12.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.thr .amt { font-size: 28px; font-weight: 800; margin: 6px 0 2px; }
.thr .desc { font-size: 12.5px; color: var(--text-soft); }
.thr.safe { background: var(--green-bg); } .thr.safe .lbl, .thr.safe .amt { color:#166534; }
.thr.caution { background: var(--yellow-bg); } .thr.caution .lbl, .thr.caution .amt { color:#854d0e; }
.thr.nogo { background: var(--red-bg); } .thr.nogo .lbl, .thr.nogo .amt { color:#991b1b; }

/* Debt + progress */
.progress-lg { height: 12px; background: var(--surface-2); border-radius:999px; overflow:hidden; }
.progress-lg > span { display:block; height:100%; border-radius:999px; background: linear-gradient(90deg, var(--accent), var(--brand-500)); }

.slider-row { display:flex; align-items:center; gap:14px; margin: 8px 0 4px; }
.slider-row input[type=range] { flex:1; accent-color: var(--brand-500); }
.sim-out { display:flex; gap:20px; flex-wrap:wrap; margin-top:14px; }
.sim-out .so { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 16px; }
.sim-out .so .lbl { font-size:12px; color: var(--text-mute); font-weight:600; }
.sim-out .so .v { font-size: 19px; font-weight:800; margin-top:2px; }

.seg {
  display:inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap:2px;
}
.seg button {
  border:none; background:transparent; padding: 7px 14px; border-radius: 999px;
  font-size: 13px; font-weight:600; cursor:pointer; color: var(--text-soft);
}
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Misc */
.divider { height:1px; background: var(--border); margin: 18px 0; }
.flex { display:flex; align-items:center; gap:10px; }
.flex.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt-0{margin-top:0}.mt-8{margin-top:8px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}
.mb-0{margin-bottom:0}
.text-soft { color: var(--text-soft); }
.text-mute { color: var(--text-mute); }
.small { font-size: 12.5px; }
.right { text-align:right; }
.demo-banner {
  background: #fffbeb; border:1px solid #fde68a; color:#92400e;
  font-size: 12.5px; padding: 8px 14px; border-radius: var(--radius-sm);
  margin-bottom: 18px; display:flex; gap:8px; align-items:center;
}

/* ============================================================
   Server-rendered additions (calendar, forms, flash)
   ============================================================ */
a.nav-item { text-decoration: none; }
.sidebar a { color: inherit; }

.flash {
  background: var(--green-bg); color:#166534; border:1px solid #bbf7d0;
  padding:10px 14px; border-radius: var(--radius-sm); margin-bottom:16px; font-size:13.5px;
}
.flash.info { background:#eff6ff; color:#1e40af; border-color:#bfdbfe; }
.flash.error { background: var(--red-bg); color:#991b1b; border-color:#fecaca; }

form.inline { display:inline; }
.form-grid { display:grid; grid-template-columns: repeat(2,1fr); gap:0 16px; }
@media (max-width:640px){ .form-grid{ grid-template-columns:1fr; } }

.btn-danger { background:#fff; color:var(--red); border-color:#fecaca; }
.btn-danger:hover { background: var(--red-bg); }
.btn-xs { padding:5px 9px; font-size:12px; }

/* Calendar grid */
.cal { width:100%; border-collapse:collapse; table-layout:fixed; }
.cal th { padding:8px; font-size:11.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--text-soft); text-align:left; }
.cal td {
  border:1px solid var(--border); vertical-align:top; height:96px; padding:6px; width:14.28%;
  background:var(--surface);
}
.cal td.other { background:var(--surface-2); color:var(--text-mute); }
.cal td.today { box-shadow: inset 0 0 0 2px var(--brand-500); }
.cal .daynum { font-size:12px; font-weight:700; color:var(--text-soft); }
.cal .ev { font-size:10.5px; padding:1px 5px; border-radius:6px; margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ev.payday { background: var(--green-bg); color:#166534; }
.ev.bill { background:#eef2ff; color:#3730a3; }
.ev.debt { background: var(--red-bg); color:#991b1b; }
.ev.subscription { background:#f3e8ff; color:#6b21a8; }
.ev.manual { background: var(--yellow-bg); color:#854d0e; }
.ev.friday_review { background:#ccfbf1; color:#115e59; }
.ev.overdue { outline:1px dashed var(--red); }

.legend { display:flex; gap:12px; flex-wrap:wrap; font-size:12px; margin-top:12px; }
.legend span { display:inline-flex; align-items:center; gap:5px; }
.legend i { width:12px; height:12px; border-radius:4px; display:inline-block; }

.empty { color:var(--text-mute); font-size:13.5px; padding:18px; text-align:center; }

/* ============================================================
   Brand logo (uploaded PFA logo)
   ============================================================ */
.brand-img {
  display:block; width:100%; max-width:180px;
  background:transparent; padding:0;
}
.login-logo { display:block; width:230px; max-width:78%; margin:2px auto 10px; }

/* Letters-only mark for the dark sidebar (white PFA on transparent) */
.brand-letters { display:block; width:100%; max-width:150px; }

/* ============================================================
   Responsive / mobile (sidebar -> slide-in drawer)
   ============================================================ */
.hamburger {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; margin-right: 4px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  font-size: 18px; line-height: 1; cursor: pointer; color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.hamburger:hover { background: var(--surface-2); }
.nav-backdrop {
  position: fixed; inset: 0; background: rgba(8,15,30,.5);
  opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 55;
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 268px; height: 100vh;
    z-index: 60; transform: translateX(-100%);
    transition: transform .24s ease; box-shadow: 0 0 40px rgba(0,0,0,.45);
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  .app.nav-open .sidebar { transform: translateX(0); }
  .app.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  .hamburger { display: inline-flex; }
  .topbar { position: sticky; top: 0; padding: 11px 14px; gap: 10px; }
  .topbar h2 { font-size: 16px; }
  .content { padding: 16px 14px 64px; }
  .nav-item { padding: 11px 12px; }           /* bigger tap targets */
  .uc-email { display: none; }                /* show only the avatar */
  .user-chip { padding: 4px; border: none; }
  .topbar .month { display: none; }
  .hero { padding: 18px; }
  .hero .hero-friday { margin-left: 0; width: 100%; }
}

@media (max-width: 600px) {
  .topbar h2 { font-size: 15px; }
  .card { padding: 15px; }
  .hero .hero-title { font-size: 19px; }
  .hero .hero-friday .amt { font-size: 27px; }
  .thr .amt { font-size: 23px; }
  .stat .value { font-size: 22px; }
  /* status pill: keep dot, hide long label to save room */
  .topbar .pill span:not(.dot) { display:none; }
  .topbar .pill { padding: 6px; }
}

/* Tables: let wide tables scroll horizontally on small screens */
@media (max-width: 760px) {
  table.data { min-width: 560px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
}

/* Avoid horizontal page overflow from any stray wide element */
html, body { max-width: 100%; overflow-x: hidden; }
img { max-width: 100%; }

/* Calendar page layout: month + agenda side by side, stacked on mobile */
.cal-layout { grid-template-columns: 2fr 1fr; }
@media (max-width: 900px) { .cal-layout { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .cal td { height: 64px; padding: 3px; }
  .cal .ev { font-size: 9px; }
  .cal th { padding: 5px 3px; font-size: 10px; }
}

/* Let grid children shrink below their content's intrinsic width so a wide table
   (min-width) scrolls inside its .table-wrap instead of stretching the column
   and overflowing the viewport on mobile. */
.grid > * { min-width: 0; }
.card { min-width: 0; }
