/* Morning Brief PWA — iPad-first. Palette from the landscape brief. */
:root {
  --bg: #f3f6fb;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-soft: #eef2f7;
  --blue: #1d4ed8;
  --blue-ink: #1e3a8a;
  --blue-soft: #dbeafe;
  --blue-softer: #eff6ff;
  --blue-line: #bfdbfe;
  --navy: #16305e;
  --navy-2: #1e3a8a;
  --amber-soft: #fef3c7;
  --amber-ink: #92400e;
  --radius: 16px;
  --tap: 48px;
  --nav-w: 208px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --tabbar-h: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px; line-height: 1.4; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden; overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left; }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; border-radius: 12px; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill { fill: currentColor; }
[hidden] { display: none !important; }

/* ---------- app frame ---------- */
.app { height: 100%; display: flex; flex-direction: column; }
.shell { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: calc(12px + var(--sat)) calc(20px + var(--sar)) 14px calc(20px + var(--sal));
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; flex: none;
}
.topbar-text { flex: 1; min-width: 0; }
.kicker { font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: #a5b4d4; font-weight: 600; }
.topbar h1 { margin: 2px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.updated { font-size: 14px; color: #dbe5f7; white-space: nowrap; }
.status-chip { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--amber-soft); color: var(--amber-ink); white-space: nowrap; }
.icon-btn {
  width: var(--tap); height: var(--tap); border-radius: 14px; display: inline-grid; place-items: center; flex: none;
  background: rgba(255,255,255,.12); color: #fff;
}
.icon-btn:active { background: rgba(255,255,255,.24); }
.icon-btn.soft { background: var(--blue-softer); color: var(--blue); }
.icon-btn.soft:active { background: var(--blue-soft); }
.icon-btn[disabled] { opacity: .35; cursor: default; }
.icon-btn.spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.main {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
  padding: 16px calc(16px + var(--sar)) calc(24px + var(--tabbar-h) + var(--sab)) calc(16px + var(--sal));
  position: relative; outline: none;
}

/* ---------- navigation: bottom tab bar by default (portrait / phone) ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around; align-items: stretch;
  padding: 6px calc(8px + var(--sar)) calc(6px + var(--sab)) calc(8px + var(--sal));
  background: rgba(255,255,255,.94); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
}
.nav-brand, .nav-foot { display: none; }
.nav-btn {
  position: relative; flex: 1; min-height: 52px; max-width: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 12px; color: var(--muted); font-size: 12px; font-weight: 600;
}
.nav-btn[aria-current="page"] { color: var(--blue); background: var(--blue-softer); }
.nav-btn .badge {
  position: absolute; top: 4px; left: calc(50% + 8px);
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--blue); color: #fff; font-size: 11.5px; line-height: 20px; text-align: center;
}
.badge:empty { display: none; }

/* ---------- sidebar on wide (iPad landscape, ≥1000px) ---------- */
@media (min-width: 1000px) {
  :root { --tabbar-h: 0px; }
  .app { flex-direction: row; }
  .nav {
    position: static; flex: none; width: calc(var(--nav-w) + var(--sal)); flex-direction: column; justify-content: flex-start;
    gap: 4px; padding: calc(14px + var(--sat)) 12px calc(14px + var(--sab)) calc(12px + var(--sal));
    background: #eaf1fb; border-top: 0; border-right: 1px solid #d9e4f5;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .nav-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 700; font-size: 17px; color: var(--blue-ink); }
  .nav-brand img { border-radius: 9px; }
  .nav-btn {
    flex: none; max-width: none; min-height: 52px; flex-direction: row; justify-content: flex-start; gap: 12px;
    padding: 0 14px; font-size: 16.5px; color: var(--ink-2);
  }
  .nav-btn[aria-current="page"] { background: #fff; color: var(--blue); box-shadow: 0 1px 2px rgba(15,23,42,.06), 0 0 0 1px #d6e3f7; }
  .nav-btn .badge { position: static; margin-left: auto; background: var(--blue-soft); color: var(--blue-ink); }
  .nav-btn[aria-current="page"] .badge { background: var(--blue); color: #fff; }
  .nav-foot { display: block; margin-top: auto; padding: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
  .topbar { padding-left: 24px; }
  .main { padding: 20px calc(22px + var(--sar)) calc(28px + var(--sab)) 22px; }
}

/* ---------- grid ---------- */
.grid { display: flex; flex-direction: column; gap: 16px; max-width: 1400px; margin: 0 auto; }
.col { display: contents; }
#sec-focus { order: 1; } #sec-markets { order: 2; } #sec-calendar { order: 3; } #sec-tasks { order: 4; } #sec-emails { order: 5; }
@media (min-width: 1000px) {
  body[data-view="overview"] .grid { flex-direction: row; align-items: flex-start; gap: 18px; }
  body[data-view="overview"] .col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
  body[data-view="overview"] .col-a { flex: 1 1 0; }
  body[data-view="overview"] .col-b { flex: 1.12 1 0; }
}
body:not([data-view="overview"]) .card:not(.is-active) { display: none; }
body:not([data-view="overview"]) .grid { max-width: 920px; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border-radius: var(--radius); padding: 16px 18px 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 0 0 1px rgba(15,23,42,.05);
  min-width: 0;
}
.card.flash { animation: flash 1s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px #93c5fd; } 100% { box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 0 0 1px rgba(15,23,42,.05); } }
.card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--blue-line); }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); }
.card-sub { font-size: 13.5px; color: var(--muted); margin-left: auto; }
.fine { margin: 10px 2px 0; font-size: 13px; color: var(--muted); }
.empty { padding: 18px 8px; color: var(--muted); text-align: center; font-size: 15px; }

/* ---------- focus ---------- */
.focus-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.focus-item {
  width: 100%; min-height: var(--tap); display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 12px; background: var(--blue-softer); color: var(--blue-ink);
  border: 1px solid #d6e6fd; font-size: 16.5px; line-height: 1.3;
  transition: background .15s, opacity .15s;
}
.focus-item:nth-child(even), li:nth-child(even) > .focus-item { background: #e4efff; }
.focus-item:active { background: var(--blue-soft); }
.focus-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue); color: #fff; font-weight: 700; font-size: 15px;
}
/* checked: same check + strike-through as Open Tasks, then the row collapses out of the list */
.focus-item[aria-checked="true"] .focus-text { color: var(--muted); text-decoration: line-through; }
.focus-item[aria-checked="true"] .focus-num { background: #94a3b8; }
/* remove-on-check (Focus Today + Open Tasks): the row collapses out of the list */
.focus-list li, .task-list li { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .26s ease, opacity .26s ease, margin .26s ease; }
.focus-list li > .focus-item, .task-list li > .task { min-height: var(--tap); overflow: hidden; }
.focus-list li.leaving, .task-list li.leaving { grid-template-rows: 0fr; opacity: 0; pointer-events: none; }
.focus-list li.leaving { margin-bottom: -6px; }
.task-list li.leaving { border-top-color: transparent; }
.focus-list li.leaving > .focus-item, .task-list li.leaving > .task { min-height: 0; padding-top: 0; padding-bottom: 0; border-width: 0; transition: padding .26s ease, min-height .26s ease; }

/* ---------- tasks ---------- */
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li + li { border-top: 1px solid var(--line-soft); }
.task {
  width: 100%; min-height: var(--tap); display: flex; align-items: center; gap: 12px;
  padding: 8px 6px; border-radius: 10px; font-size: 16px; line-height: 1.3; color: var(--ink);
}
.task:active { background: #f8fafc; }
/* shared checkbox (Open Tasks + Focus Today): any [role=checkbox] row with a .check box */
.check {
  flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid #94a3b8; background: #fff; display: grid; place-items: center;
  transition: background .15s, border-color .15s;
}
.check svg { width: 18px; height: 18px; stroke: #fff; stroke-width: 3; opacity: 0; }
[role="checkbox"][aria-checked="true"] .check { background: #16a34a; border-color: #16a34a; }
[role="checkbox"][aria-checked="true"] .check svg { opacity: 1; }
.task[aria-checked="true"] .task-text { color: var(--muted); text-decoration: line-through; }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; }
.cal-title { flex: 1; text-align: center; min-width: 0; }
.cal-day { font-size: 20px; font-weight: 700; }
.cal-date { font-size: 14px; color: var(--muted); }
.cal-date .today-pill { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px; background: var(--amber-soft); color: var(--amber-ink); font-weight: 600; font-size: 12.5px; }
.day-strip { display: flex; gap: 6px; margin: 10px 0 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.day-strip::-webkit-scrollbar { display: none; }
.day-chip {
  flex: 1 0 auto; min-width: 58px; min-height: var(--tap); padding: 5px 8px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #f8fafc; border: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.15;
}
.day-chip b { font-size: 16px; color: var(--ink); }
.day-chip.is-today { border-color: #fcd34d; background: #fffbeb; }
.day-chip[aria-selected="true"] { background: var(--blue); border-color: var(--blue); color: #dbeafe; }
.day-chip[aria-selected="true"] b { color: #fff; }
.day-chip .dots { display: flex; gap: 3px; height: 6px; margin-top: 3px; }
.day-chip .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--dot); }

.cal-viewport { overflow: hidden; touch-action: pan-y; position: relative; transition: height .25s ease; border-radius: 12px; }
.cal-track { display: flex; align-items: flex-start; will-change: transform; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.cal-track.dragging { transition: none; }
.cal-panel { flex: 0 0 100%; min-width: 0; padding: 2px 1px 4px; }
.cal-panel .empty { border: 1px dashed var(--line); border-radius: 12px; }
.ev {
  width: 100%; min-height: 56px; display: flex; align-items: stretch; gap: 12px; margin-bottom: 7px;
  padding: 8px 12px 8px 0; border-radius: 12px; background: var(--ev-bg); color: var(--ev-fg);
  border: 1px solid var(--ev-border); overflow: hidden; user-select: none; -webkit-user-select: none;
}
.ev:active { filter: brightness(.97); }
.ev-bar { flex: none; width: 6px; margin: -8px 0; background: var(--ev-accent); }
.ev-time { flex: none; width: 104px; font-size: 14px; font-weight: 700; padding-top: 1px; font-variant-numeric: tabular-nums; }
.ev-main { flex: 1; min-width: 0; }
.ev-title { font-size: 16px; font-weight: 600; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
.ev-meta { margin-top: 2px; font-size: 13px; opacity: .92; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; padding: 0 7px; border-radius: 6px; background: rgba(255,255,255,.7); color: var(--ink-2); line-height: 18px; }
.ev.is-stale .ev-title { color: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 13.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; background: var(--sw-bg); border: 1.5px solid var(--sw-accent); }

/* ---------- emails ---------- */
.acct { display: flex; align-items: center; gap: 8px; margin: 12px 2px 4px; font-size: 14px; font-weight: 700; color: var(--acct, var(--ink-2)); }
.acct:first-child { margin-top: 2px; }
.acct::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--acct, #94a3b8); }
.acct .n { font-weight: 600; color: var(--muted); }
.acct-bko { --acct: #2563eb; } .acct-aith { --acct: #16a34a; } .acct-gm { --acct: #7c3aed; }
.mail { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; overflow: hidden; background: #fff; }
.mail-row { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.mail-row:active { background: #f8fafc; }
.mail-text { flex: 1; min-width: 0; }
.mail-from { font-weight: 700; font-size: 15.5px; }
.mail-subj { font-size: 14.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-date { flex: none; font-size: 13px; color: var(--muted); }
.chev { flex: none; width: 20px; height: 20px; color: #94a3b8; transition: transform .2s; }
.mail-row[aria-expanded="true"] .chev { transform: rotate(90deg); }
.mail-row[aria-expanded="true"] .mail-subj { white-space: normal; }
.mail-detail { margin: 0; padding: 4px 14px 12px; display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 14.5px; background: #fbfdff; border-top: 1px solid var(--line-soft); }
.mail-detail dt { color: var(--muted); font-weight: 600; padding-top: 8px; }
.mail-detail dd { margin: 0; padding-top: 8px; overflow-wrap: anywhere; }
.mail-detail .why { color: var(--blue-ink); font-weight: 600; }
.mail-detail .inferred { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }

/* ---------- banner, pull to refresh, toast, footer ---------- */
.banner { max-width: 1400px; margin: 0 auto 14px; padding: 10px 14px; border-radius: 12px; background: var(--amber-soft); color: var(--amber-ink); font-size: 14.5px; }
.ptr {
  position: absolute; left: 0; right: 0; top: 0; height: 0; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; gap: 8px;
  color: var(--muted); font-size: 14px; pointer-events: none;
}
.ptr .ptr-icon { transition: transform .2s; display: inline-block; }
.ptr.ready .ptr-icon { transform: rotate(180deg); }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--tabbar-h) + var(--sab)); transform: translateX(-50%); z-index: 50;
  background: rgba(15,23,42,.92); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 15px; max-width: 90vw;
}
.foot { max-width: 1400px; margin: 18px auto 0; font-size: 12.5px; color: #94a3b8; text-align: center; }
.noscript { padding: 24px; }

/* ---------- event sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.35); animation: fade .2s ease; }
.sheet-panel {
  position: relative; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 80px); overflow-y: auto;
  background: #fff; border-radius: 20px; padding: 14px 18px 20px; box-shadow: 0 20px 50px rgba(15,23,42,.25);
  animation: pop .22s ease;
}
.sheet-grip { display: none; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; }
.sheet-swatch { flex: none; width: 8px; align-self: stretch; min-height: 44px; border-radius: 4px; background: var(--sw, var(--blue)); }
.sheet-head h3 { flex: 1; margin: 8px 0 0; font-size: 20px; line-height: 1.25; }
.sheet-body { margin: 12px 0 0; display: grid; grid-template-columns: 110px 1fr; gap: 0 12px; font-size: 16px; }
.sheet-body dt { color: var(--muted); font-weight: 600; font-size: 14px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.sheet-body dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.sheet-body dd ul { margin: 0; padding-left: 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (max-width: 640px) {
  .sheet { align-items: flex-end; }
  .sheet-panel { width: 100%; border-radius: 20px 20px 0 0; padding-bottom: calc(20px + var(--sab)); max-height: 85vh; }
  .sheet-grip { display: block; width: 40px; height: 5px; border-radius: 3px; background: #cbd5e1; margin: 0 auto 10px; }
}

/* ---------- smaller screens ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .topbar { gap: 10px; padding-left: calc(14px + var(--sal)); padding-right: calc(14px + var(--sar)); }
  .topbar h1 { font-size: 19px; }
  .topbar-meta .updated { font-size: 12.5px; }
  .main { padding-left: calc(10px + var(--sal)); padding-right: calc(10px + var(--sar)); }
  .card { padding: 14px 12px 12px; }
  .ev-time { width: 84px; font-size: 13px; }
  .nav-btn { font-size: 11px; }
  .card-sub { margin-left: 0; width: 100%; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; row-gap: 2px; }
  .topbar-text { flex: 1 1 0; }
  .topbar-meta { order: 3; flex-basis: 100%; flex-direction: row; align-items: center; gap: 8px; }
}
@media (min-width: 1000px) and (max-width: 1100px) {
  :root { --nav-w: 184px; }
  .ev-time { width: 92px; font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.market-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.market-list li { background: #f8fafc; border-radius: 10px; padding: 10px 12px; line-height: 1.35; }

/* iPad-only email Hide control */
.mail-line { display: flex; align-items: stretch; gap: 4px; }
.mail-line .mail-row { flex: 1 1 auto; min-width: 0; }
.mail-hide { flex: 0 0 44px; min-height: 44px; border: 0; border-radius: 10px; background: rgba(127,127,127,.12); color: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.mail.is-hidden .mail-hide { font-size: 13px; flex-basis: 64px; }
.mail.is-hidden { opacity: .5; }
.show-hidden { background: none; border: 0; padding: 4px 0 8px; color: #2563eb; font-size: 14px; text-decoration: underline; cursor: pointer; }

.news-head { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin: 14px 0 6px; }
.news-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.news-item { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 10px; background: #f8fafc; color: inherit; text-decoration: none; }
.news-item:active { background: #e2e8f0; }
.news-title { font-weight: 600; line-height: 1.3; }
.news-meta { font-size: 12px; color: #64748b; }

.acct-pers { --acct: #0d9488; } .acct-leou { --acct: #b45309; }
.task-sec { list-style: none; font-weight: 700; margin: 10px 0 2px; color: #334155; }
.task-none { list-style: none; color: #94a3b8; font-size: 0.9em; }
.task-focus { list-style: none; background: #dbeafe; border: 1px solid #93c5fd; color: #1e3a8a; padding: 4px 8px; border-radius: 6px; margin: 2px 0 4px; font-weight: 600; }

/* 2026-11-05 single-column order: calendar, focus, markets, to-dos */
body[data-view="overview"] .grid { flex-direction: column; }
body[data-view="overview"] .col-a { flex: 1 1 auto; }
.email-slot { list-style: none; }
.from-email { font-size: 0.8em; color: #94a3b8; margin: 6px 0 2px; text-transform: uppercase; letter-spacing: .03em; }
#sec-calendar { order: 1; } #sec-focus { order: 2; } #sec-markets { order: 3; } #sec-tasks { order: 4; }


/* 2026-11-09 nofocus-1109: Focus removed; markets → calendar → tasks; 4-col tasks on wide screens */
#sec-focus { display: none !important; }
.nav-btn[data-view="focus"] { display: none !important; }
#sec-markets { order: 1; }
#sec-calendar { order: 2; }
#sec-tasks { order: 3; }
body[data-view="overview"] .grid { flex-direction: column; }
@media (min-width: 1000px) {
  #task-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px 16px;
    align-items: start;
  }
  /* section headers and following items flow; use subgrid-like stacking per section via task-sec spanning */
  #task-list > .task-sec { grid-column: auto; font-size: 15px; margin: 0; padding: 6px 0; border-bottom: 2px solid #cbd5e1; }
  #task-list > li.task, #task-list > .task-none, #task-list > .email-slot, #task-list > .task-focus { break-inside: avoid; }
}
@media (max-width: 999px) {
  #task-list { display: block; }
}

/* newspaper-1109 page-2 style markets/news card */
#sec-markets.newspaper, .newspaper-card { font-family: Georgia, "Times New Roman", Times, serif; }
.newspaper-masthead { text-align:center; padding:8px 0 4px; }
.newspaper-masthead .nameplate { font-size:28px; font-weight:700; letter-spacing:0.04em; margin:0; }
.newspaper-masthead .dateline { font-size:13px; color:#444; margin:4px 0 8px; }
.newspaper-double-rule { border:none; border-top:3px solid #111; border-bottom:1px solid #111; height:5px; margin:0 0 12px; }
.newspaper-grid { display:grid; grid-template-columns:1.7fr 1fr; gap:16px; }
@media (max-width:999px){ .newspaper-grid { grid-template-columns:1fr; } }
.newspaper-stories-head, .newspaper-markets-head { font-size:14px; font-weight:700; letter-spacing:0.08em; text-transform:uppercase; border-bottom:2px solid #111; margin:0 0 10px; padding-bottom:3px; }
.newspaper-cols { column-count:2; column-gap:16px; column-rule:1px solid #999; }
@media (max-width:699px){ .newspaper-cols { column-count:1; } }
.np-story { break-inside:avoid; margin:0 0 14px; padding-bottom:10px; border-bottom:1px solid #ddd; }
.np-hed { font-size:17px; font-weight:700; line-height:1.2; margin:0 0 2px; color:#000; }
.np-byline { font-size:12px; font-style:italic; color:#555; margin:0 0 6px; }
.np-dek { font-size:14px; line-height:1.4; margin:0; text-align:justify; }
.prebox { border:2px solid #111; padding:8px; margin:0 0 12px; background:#fafafa; }
.prebox .pre-h { font-size:13px; font-weight:700; letter-spacing:0.1em; }
.prebox .pre-meta { font-size:11px; color:#666; font-family: system-ui, sans-serif; margin:2px 0 6px; }
.np-table { width:100%; border-collapse:collapse; font-size:13px; font-family: system-ui, sans-serif; }
.np-table th { text-align:left; border-bottom:2px solid #111; padding:3px 4px; font-size:11px; text-transform:uppercase; letter-spacing:0.04em; }
.np-table td { padding:4px; border-bottom:1px solid #e5e7eb; }
.np-table .up { color:#15803d; } .np-table .down { color:#b91c1c; }

/* 2026-11-11 ipad-compact-1111: Markets/news section removed; to-dos smaller and tighter */
#sec-markets { display: none !important; }
.nav-btn[data-view="markets"] { display: none !important; }
#task-list .task { min-height: 30px; padding: 3px 4px; gap: 8px; font-size: 13px; line-height: 1.25; border-radius: 6px; }
#task-list .task-text { font-size: 13px; line-height: 1.25; }
#task-list li > .task { min-height: 0; }
#task-list .check { width: 18px; height: 18px; border-radius: 5px; border-width: 1.5px; }
#task-list .check svg { width: 12px; height: 12px; }
#task-list .mail { border-radius: 8px; margin-bottom: 3px; }
#task-list .mail-row { min-height: 32px; padding: 3px 8px; gap: 6px; }
#task-list .mail-from { font-size: 12.5px; }
#task-list .mail-subj { font-size: 12px; }
#task-list .mail-date { font-size: 11px; }
#task-list .mail-detail { font-size: 12px; padding: 2px 10px 8px; }
#task-list .mail-hide { flex-basis: 32px; min-height: 30px; font-size: 16px; }
#task-list > .task-sec { font-size: 13px !important; padding: 3px 0 !important; margin: 4px 0 2px; }
#task-list .from-email { font-size: 0.7em; margin: 4px 0 1px; }
#task-list .task-none { font-size: 12px; }

/* 2026-11-11 ipad-compact2-1111: open tasks area tighter overall */
#sec-tasks.card { padding: 8px 10px 6px; }
#sec-tasks .card-head { margin-bottom: 4px; padding-bottom: 3px; gap: 6px; }
#sec-tasks .card-head h2 { font-size: 12px; }
#sec-tasks .card-sub { font-size: 11px; }
#sec-tasks .fine { font-size: 10.5px; margin: 2px 0 0; }
#task-list { gap: 0 10px !important; }
#task-list .task { min-height: 0; padding: 1px 3px; gap: 6px; font-size: 12px; line-height: 1.15; }
#task-list .task-text { font-size: 12px; line-height: 1.15; }
#task-list .check { width: 14px; height: 14px; border-radius: 4px; border-width: 1.5px; }
#task-list .check svg { width: 10px; height: 10px; }
#task-list li + li { border-top-width: 0; }
#task-list > .task-sec { font-size: 11px !important; padding: 1px 0 !important; margin: 2px 0 1px; border-bottom-width: 1px !important; letter-spacing: .04em; text-transform: uppercase; }
#task-list .mail { margin-bottom: 1px; border-radius: 6px; }
#task-list .mail-row { min-height: 24px; padding: 1px 6px; }
#task-list .mail-from { font-size: 11.5px; }
#task-list .mail-subj { font-size: 11px; }
#task-list .mail-hide { flex-basis: 26px; min-height: 24px; font-size: 14px; }
#task-list .from-email { margin: 2px 0 0; }

/* 2026-11-11 fourcol-1111: exactly four columns (Personal | Aitherios | BKO | Leou), always, no horizontal scroll */
body .grid, body:not([data-view="overview"]) .grid { max-width: none; }
#sec-tasks { min-width: 0; max-width: 100%; overflow-x: hidden; }
#task-list { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 0 8px !important; align-items: start; margin: 0; padding: 0; width: 100%; }
#task-list > li.task-col { display: block; grid-template-rows: none; min-width: 0; border: 0 !important; padding: 0; }
#task-list .task-col-list { list-style: none; margin: 0; padding: 0; min-width: 0; }
#task-list .task-col .task-sec { display: block; font-size: 12px !important; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); margin: 0 0 2px !important; padding: 2px 0 3px !important; border-bottom: 2px solid #94a3b8 !important; }
#task-list .task-col li { display: block; }
#task-list .task { width: 100%; align-items: flex-start; padding: 2px 2px; gap: 5px; font-size: 11.5px; line-height: 1.2; min-width: 0; }
#task-list .task-text { font-size: 11.5px; line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }
#task-list .check { margin-top: 1px; width: 13px; height: 13px; }
#task-list .task-col li + li { border-top: 1px solid var(--line-soft); }
#task-list .email-slot { border-top: 0 !important; }
#task-list .mail-text, #task-list .mail-from, #task-list .mail-subj { min-width: 0; }

/* fourcol-1111 fit: never wider than the screen; email-derived rows compact */
.main { overflow-x: hidden; max-width: 100vw; }
.grid, .col, .card { min-width: 0; max-width: 100%; }
#sec-calendar, #sec-calendar .day-strip, #cal-track { min-width: 0; max-width: 100%; }
#task-list .mail-date, #task-list .chev { display: none; }
#task-list .mail-row { align-items: flex-start; padding: 2px 4px; gap: 3px; min-height: 0; }
#task-list .mail-text { flex: 1 1 0; min-width: 0; }
#task-list .mail-from { font-size: 11px; line-height: 1.2; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
#task-list .mail-subj { font-size: 10px; line-height: 1.2; white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; color: #64748b; }
#task-list .mail-line { gap: 2px; min-width: 0; }
#task-list .mail-hide { flex: 0 0 22px; min-height: 20px; font-size: 13px; padding: 0; }
#task-list .mail-detail { grid-template-columns: 60px 1fr; font-size: 11px; }
#task-list .from-email { font-size: 9.5px; margin: 3px 0 1px; }

/* fourcol-1111 squeeze: email-derived rows are two lines max, sender moves to the tap-open detail */
#task-list .mail-subj { display: none; }
#task-list .mail-row { padding: 1px 4px; }
#task-list .mail { margin-bottom: 1px; }
#task-list .task { padding: 1px 2px; }
#sec-tasks .fine { display: none; }
