:root {
  --primary: #11264f;
  --accent: #1d4ed8;
  --bg: #f7f9fd;
  --surface: #ffffff;
  --surface-2: #f3f6fb;
  --text: #101828;
  --muted: #667085;
  --border: #d9e1ee;
  --task-bg: #e8f0fe;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
  --radius: 18px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }

.app-shell { height: 100vh; display: grid; grid-template-rows: 64px 1fr; background: var(--bg); }
.topbar { display: grid; grid-template-columns: auto auto minmax(220px, 1fr) auto; align-items: center; gap: 14px; padding: 10px 20px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 94%, transparent); z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 250px; }
.logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: white; background: linear-gradient(135deg, var(--primary), var(--accent)); font-weight: 900; letter-spacing: -.04em; box-shadow: 0 10px 25px color-mix(in srgb, var(--primary) 25%, transparent); }
.brand-title { font-weight: 760; letter-spacing: -.03em; }
.brand-subtitle { color: var(--muted); font-size: 12px; margin-top: 1px; }
.nav-controls { display: flex; align-items: center; gap: 8px; }
.range-title { border: 0; background: transparent; color: var(--text); font-size: 20px; font-weight: 720; letter-spacing: -.03em; min-width: 175px; text-align: left; }
.search-wrap { justify-self: center; width: min(560px, 100%); position: relative; }
.search-wrap input { width: 100%; height: 42px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 0 46px 0 44px; outline: none; }
.search-wrap input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); border-color: var(--accent); }
.search-icon { position: absolute; left: 16px; top: 10px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn, .pill-btn, .primary-btn, .ghost-btn, .danger-btn, .create-btn, .side-add, .icon-pill { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; min-height: 36px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.icon-btn { width: 38px; padding: 0; font-size: 18px; }
.icon-btn:hover, .pill-btn:hover, .ghost-btn:hover, .side-add:hover, .icon-pill:hover { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.menu-toggle.active { background: var(--primary); color: white; }
.primary-btn { background: var(--primary); border-color: var(--primary); color: white; font-weight: 750; }
.primary-btn:hover { filter: brightness(1.05); }
.danger-btn { color: #b42318; border-color: #f6c6c2; background: #fff5f5; }
.view-select { height: 38px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 0 12px; }
.speak-top { padding-inline: 11px; min-width: 0; }

.layout { min-height: 0; display: grid; grid-template-columns: 304px 1fr; }
.layout.sidebar-collapsed { grid-template-columns: 74px 1fr; }
.sidebar { border-right: 1px solid var(--border); background: var(--surface); padding: 14px 16px; overflow-y: auto; }
.sidebar.collapsed { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 14px 10px; }
.create-wrap { position: relative; }
.create-btn { min-height: 48px; border-radius: 18px; padding: 0 20px; font-weight: 780; background: var(--surface); box-shadow: 0 10px 28px rgba(15, 23, 42, .08); }
.create-btn .plus { font-size: 26px; color: #f59e0b; margin-top: -2px; }
.floating-create { width: 50px; height: 50px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); font-size: 28px; color: var(--accent); box-shadow: var(--shadow); }
.create-menu { position: absolute; left: 0; top: 56px; z-index: 30; min-width: 210px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); display: grid; gap: 4px; }
.sidebar.collapsed .create-menu { left: 58px; top: 72px; }
.create-menu button { border: 0; background: transparent; text-align: left; padding: 10px 12px; border-radius: 9px; color: var(--text); }
.create-menu button:hover { background: var(--surface-2); }
.side-section { margin-top: 18px; }
.compact-section { margin-top: 14px; }
.section-title { font-size: 12px; font-weight: 850; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 10px; }

.mini-card, .brief-card, .feed-card, .manual-card, .setting-card, .health-card, .flash-trial { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 22px rgba(15, 23, 42, .045); }
.mini-card { padding: 12px; }
.mini-head { display: grid; grid-template-columns: 28px 1fr 28px auto; align-items: center; gap: 6px; margin-bottom: 10px; font-weight: 780; }
.mini-nav { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--primary); }
.mini-today { border: 0; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mini-day, .mini-date { height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--muted); font-size: 12px; }
.mini-day { font-weight: 750; height: 22px; }
.mini-date { color: var(--text); background: transparent; border: 1px solid transparent; }
.mini-date:hover { border-color: var(--border); background: var(--surface-2); }
.mini-date.out { color: color-mix(in srgb, var(--muted) 45%, transparent); }
.mini-date.active { background: var(--primary); color: white; font-weight: 850; }
.mini-date.has-events:not(.active) { box-shadow: inset 0 -3px 0 var(--accent); }

.voice-panel.compact { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; border-radius: 16px; padding: 11px 12px; background: linear-gradient(140deg, var(--primary), color-mix(in srgb, var(--primary) 78%, var(--accent))); color: white; box-shadow: 0 16px 34px color-mix(in srgb, var(--primary) 18%, transparent); }
.voice-panel.compact strong { font-size: 14px; }
.voice-panel.compact p { margin: 3px 0 0; font-size: 12px; line-height: 1.35; color: rgba(255,255,255,.76); }
.icon-pill { width: 38px; height: 38px; padding: 0; color: var(--primary); border: 0; background: white; }
.calendar-list { display: grid; gap: 7px; }
.calendar-toggle { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; }
.calendar-toggle:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.calendar-toggle input { accent-color: #f59e0b; }
.color-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--dot); flex: 0 0 12px; }
.side-add { margin-top: 10px; width: 100%; height: 36px; font-size: 13px; color: var(--primary); }
.insight-link { display: block; text-decoration: none; border: 1px solid var(--border); border-radius: 12px; padding: 10px 11px; font-weight: 750; color: var(--primary); background: var(--surface-2); margin-bottom: 10px; }
.flash-trial { padding: 12px; display: grid; gap: 5px; }
.flash-trial strong { font-size: 20px; color: var(--primary); }
.flash-trial span, .health-card small { color: var(--muted); font-size: 12px; }
.tiny { min-height: 28px; padding: 0 10px; font-size: 12px; justify-self: start; }
.health-card { padding: 12px; display: grid; gap: 7px; }
.health-card strong { color: var(--primary); font-size: 20px; }
.compact-actions { gap: 8px; flex-wrap: wrap; }

.main { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.brief-strip { margin: 12px 18px 0; border-radius: 22px; background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--accent) 5%, var(--surface))); border: 1px solid var(--border); padding: 14px 16px; display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 16px; align-items: center; box-shadow: 0 12px 28px rgba(15, 23, 42, .06); }
.brief-strip.clickable { cursor: pointer; }
.brief-strip:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.micro-label { color: var(--accent); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 5px; }
.brief-strip h2 { margin: 0; font-size: 20px; letter-spacing: -.04em; color: var(--primary); }
.brief-strip p { margin: 4px 0 0; color: var(--muted); }
.brief-utility { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.quick-chip, .badge, .status-pill, .confidence { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--primary); font-weight: 700; font-size: 12px; }
.utility-strip { margin: 12px 18px 0; border: 1px solid var(--border); border-radius: 20px; padding: 12px 14px; background: var(--surface); display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 10px 16px; align-items: center; box-shadow: 0 10px 26px rgba(15,23,42,.05); }
.utility-strip strong { color: var(--primary); }
.utility-cards { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.utility-card { border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); padding: 8px 12px; display: grid; gap: 1px; min-width: 82px; color: var(--primary); }
.utility-card strong { font-size: 16px; }
.utility-card span, .upcoming-line { color: var(--muted); font-size: 12px; }
.upcoming-line { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.upcoming-line span { border: 1px solid var(--border); border-radius: 999px; padding: 4px 8px; }

.calendar-stage { margin: 14px 18px 18px; min-height: 0; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow); }
.month-grid { min-width: 900px; display: grid; grid-template-columns: repeat(7, 1fr); }
.month-weekday { height: 42px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; font-weight: 780; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); }
.month-cell { min-height: 132px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 9px; background: var(--surface); position: relative; }
.month-cell:nth-child(7n) { border-right: 0; }
.month-cell.out { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); color: var(--muted); }
.date-number { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: 13px; }
.month-cell.today .date-number { background: var(--primary); color: white; }
.event-chip { width: 100%; border: 0; border-left: 3px solid var(--event-color); background: color-mix(in srgb, var(--event-color) 10%, var(--surface)); color: var(--text); border-radius: 9px; padding: 5px 6px; margin-top: 5px; display: flex; align-items: center; gap: 6px; text-align: left; font-size: 12px; }
.event-chip:hover { filter: brightness(.98); }
.event-time { color: var(--muted); font-weight: 700; }
.task-chip { background: var(--task-bg); }
.task-circle { width: 13px; height: 13px; border: 2px solid color-mix(in srgb, var(--primary) 55%, white); border-radius: 50%; display: inline-block; flex: 0 0 13px; background: var(--surface); }
.completed { opacity: .75; }
.completed strong, .completed span:not(.resize-handle):not(.task-circle), .completed .event-main { text-decoration: line-through; }
.external-mark { margin-left: auto; font-size: 12px; opacity: .7; }
.more-count { margin-top: 6px; color: var(--muted); font-size: 12px; }

.week-view, .day-view { min-width: 980px; display: grid; grid-template-columns: 74px repeat(var(--days), minmax(145px, 1fr)); grid-template-rows: 66px auto; position: relative; }
.week-header-spacer { position: sticky; top: 0; z-index: 7; background: var(--surface); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; align-items: end; justify-content: center; padding-bottom: 10px; }
.tz-label { color: var(--muted); font-size: 12px; }
.week-header { position: sticky; top: 0; z-index: 6; height: 66px; background: var(--surface); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); display: grid; place-items: center; text-align: center; }
.week-header span { display: block; color: var(--muted); font-size: 12px; font-weight: 760; letter-spacing: .06em; }
.week-header strong { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-size: 24px; letter-spacing: -.04em; color: var(--text); }
.week-header.active-day strong { background: var(--primary); color: white; }
.time-col { border-right: 1px solid var(--border); background: var(--surface); }
.time-label { height: 54px; padding-right: 10px; text-align: right; color: var(--muted); font-size: 12px; position: relative; top: -9px; }
.day-col { position: relative; min-height: calc((var(--day-hours, 17)) * 54px); border-right: 1px solid var(--border); background: var(--surface); }
.hour-lines { position: absolute; inset: 0; z-index: 0; pointer-events: none; display: grid; grid-template-rows: repeat(var(--day-hours, 17), 54px); }
.hour-lines span { height: 1px; background: var(--border); opacity: .9; }
.hour-lines span:last-child { align-self: end; }
.day-col > :not(.hour-lines) { z-index: 1; }
.week-view .day-col, .day-view .day-col { min-height: calc(17 * 54px); }
.day-col:hover { background-color: color-mix(in srgb, var(--accent) 2%, transparent); }
.week-event { position: absolute; left: 4px; right: 4px; border-radius: 8px; border-left: 3px solid var(--event-color); background: color-mix(in srgb, var(--event-color) 10%, var(--surface)); color: var(--text); padding: 4px 26px 4px 8px; overflow: hidden; display: flex; flex-direction: column; gap: 1px; font-size: 12px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--event-color) 12%, transparent); user-select: none; }
.week-event:hover { filter: brightness(.985); box-shadow: 0 6px 14px rgba(15,23,42,.08); }
.week-event strong { font-size: 12px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-event span { color: var(--muted); }
.event-main { display: flex; align-items: center; gap: 6px; min-width: 0; }
.task-event { min-height: 22px; flex-direction: row; align-items: center; background: var(--task-bg); border-left-color: var(--accent); padding-block: 3px; }
.task-event .event-main { width: 100%; }
.feed-event { background: color-mix(in srgb, #fef3c7 60%, var(--surface)); }
.flash-event { background: color-mix(in srgb, #ede9fe 65%, var(--surface)); }
.note-event { background: color-mix(in srgb, #dcfce7 55%, var(--surface)); }
.mini-edit { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(255,255,255,.78); color: var(--primary); display: none; }
.week-event:hover .mini-edit { display: grid; place-items: center; }
.resize-handle { position: absolute; left: 8px; right: 8px; bottom: 0; height: 6px; cursor: ns-resize; border-radius: 0 0 8px 8px; }
.resize-handle:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.is-resizing, .is-resizing * { cursor: ns-resize !important; }

.modal-backdrop, .briefing-backdrop { position: fixed; inset: 0; background: rgba(16, 24, 40, .48); z-index: 90; display: grid; place-items: center; padding: 24px; }
.modal { width: min(980px, calc(100vw - 48px)); max-height: calc(100vh - 48px); background: var(--surface); border-radius: 26px; box-shadow: 0 30px 80px rgba(15,23,42,.28); overflow: hidden; border: 1px solid var(--border); display: grid; grid-template-rows: auto 1fr auto; }
.modal.small { width: min(520px, calc(100vw - 48px)); }
.settings-modal { width: min(1080px, calc(100vw - 48px)); height: min(760px, calc(100vh - 48px)); border-radius: 20px; background: #f5f5f7; color: #1d1d1f; overflow: hidden; }
.voice-modal { width: min(980px, calc(100vw - 48px)); }
.modal-header, .modal-footer { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); }
.modal-footer { border-top: 1px solid var(--border); border-bottom: 0; justify-content: flex-end; }
.modal-title { margin: 0; font-size: 20px; color: var(--primary); }
.modal-body { padding: 18px 20px; overflow: auto; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tab-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 8px 12px; color: var(--muted); }
.tab-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.form-grid, .two-col, .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; }
.field.full, .setting-card.full { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 82%, var(--bg)); border-radius: 12px; padding: 11px 12px; color: var(--text); outline: none; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.inline-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.check-list { display: grid; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.check-row input { accent-color: var(--accent); }
.check-row small, .muted, .plugin-row small, .feed-row small, .subscription-row small, .draft-card small, .manual-row small { color: var(--muted); }
.link-list { display: flex; flex-wrap: wrap; gap: 8px; }
.resource-link { display: inline-flex; padding: 7px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--primary); text-decoration: none; background: var(--surface-2); }
.settings-shell { min-height: 0; display: grid; grid-template-columns: 255px 1fr; overflow: hidden; background: #f5f5f7; }
.settings-nav { border-right: 1px solid rgba(0,0,0,.1); padding: 12px 10px 18px; overflow: auto; background: rgba(224,224,228,.78); backdrop-filter: blur(30px); }
.settings-search { height: 34px; margin: 0 2px 12px; border-radius: 9px; background: rgba(118,118,128,.14); color: #6e6e73; display: flex; align-items: center; gap: 7px; padding: 0 10px; font-size: 13px; }
.settings-nav button { width: 100%; border: 0; background: transparent; text-align: left; padding: 6px 8px; border-radius: 7px; color: #1d1d1f; display: grid; grid-template-columns: 25px 1fr; align-items: center; gap: 8px; font-size: 14px; }
.settings-nav button i { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: #7c7c80; color: #fff; font-style: normal; font-size: 13px; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.16); }
.settings-nav button:nth-of-type(2) i { background:#147efb; }.settings-nav button:nth-of-type(3) i { background:#8e8e93; }.settings-nav button:nth-of-type(4) i { background:#ff9f0a; }.settings-nav button:nth-of-type(5) i { background:#ff375f; }.settings-nav button:nth-of-type(6) i { background:#5856d6; }.settings-nav button:nth-of-type(7) i { background:#34c759; }.settings-nav button:nth-of-type(8) i { background:#0a84ff; }.settings-nav button:nth-of-type(9) i { background:#bf5af2; }.settings-nav button:nth-of-type(10) i { background:#64d2ff; }.settings-nav button:nth-of-type(11) i { background:#ff453a; }.settings-nav button:nth-of-type(12) i { background:#30d158; }.settings-nav button:nth-of-type(13) i { background:#8e8e93; }.settings-nav button:nth-of-type(14) i { background:#007aff; }.settings-nav button:nth-of-type(15) i { background:#af52de; }
.settings-nav button.active { background: #0a84ff; color: white; font-weight: 650; }
.settings-content { padding: 26px 30px 40px; overflow: auto; }
.settings-content h2 { margin-top: 0; color: #1d1d1f; letter-spacing: -.035em; font-size: 25px; }
.settings-content .muted { color: #6e6e73; }
.settings-content .settings-grid { gap: 14px; }
.settings-content .setting-card { padding: 17px; border-radius: 13px; border: .5px solid rgba(0,0,0,.14); box-shadow: 0 1px 2px rgba(0,0,0,.04); background: #fff; }
.settings-content .setting-card h3 { color:#1d1d1f; }
.account-actions { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0; }
.auth-link-button { border:0; background:transparent; color:#007aff; padding:8px 4px; }
.account-identity { display:flex; align-items:center; gap:12px; padding:12px 0 18px; }
.account-identity > span { width:48px; height:48px; border-radius:50%; display:grid; place-items:center; background:linear-gradient(145deg,#0a84ff,#5e5ce6); color:#fff; font-weight:800; }
.account-identity div { display:grid; gap:3px; }.account-identity small { color:#6e6e73; }
.legal-links small { display:block; margin-top:14px; color:#6e6e73; line-height:1.45; }
.setting-card h3 { margin: 0 0 8px; color: var(--primary); }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.preset-card { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 12px; text-align: left; display: grid; gap: 7px; color: var(--text); }
.preset-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); }
.preset-swatch { height: 28px; border-radius: 999px; background: linear-gradient(90deg, var(--p-primary), var(--p-accent), var(--p-bg)); border: 1px solid var(--border); }
.plugin-row, .feed-row, .subscription-row, .manual-row, .draft-card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); margin: 8px 0; }
.feed-row { grid-template-columns: auto 1fr auto; }
.draft-card { grid-template-columns: 1fr auto; }
.draft-card div, .feed-row div, .plugin-row div { display: grid; gap: 3px; }
.manual-row .kbd { justify-self: start; }
.kbd { display: inline-grid; place-items: center; min-width: 34px; min-height: 28px; padding: 0 8px; border: 1px solid var(--border); border-bottom-width: 3px; border-radius: 8px; background: var(--surface-2); font-weight: 800; color: var(--primary); }
.empty-state { padding: 16px; border: 1px dashed var(--border); border-radius: 14px; color: var(--muted); background: var(--surface-2); }

.briefing-modal { width: min(1040px, calc(100vw - 48px)); height: min(760px, calc(100vh - 48px)); border-radius: 30px; background: radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 32%), var(--surface); color: var(--text); box-shadow: 0 40px 90px rgba(15,23,42,.34); border: 1px solid var(--border); display: grid; grid-template-rows: auto auto auto 1fr auto; overflow: hidden; }
.briefing-head { padding: 28px 32px 18px; display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.briefing-head h1 { margin: 0 0 4px; color: var(--primary); font-size: clamp(34px, 6vw, 64px); letter-spacing: -.06em; }
.briefing-head p { margin: 0; color: var(--muted); }
.briefing-progress { height: 4px; background: var(--surface-2); }
.briefing-progress div { height: 100%; background: var(--accent); transition: width .3s ease; }
.ambient-indicator { display: flex; align-items: center; gap: 5px; padding: 12px 32px 0; color: var(--muted); }
.ambient-indicator span { width: 5px; height: 18px; border-radius: 99px; background: var(--accent); animation: wave 1.2s infinite ease-in-out; opacity: .65; }
.ambient-indicator span:nth-child(2) { animation-delay: .15s; height: 24px; }
.ambient-indicator span:nth-child(3) { animation-delay: .3s; height: 14px; }
@keyframes wave { 50% { transform: scaleY(.45); opacity: .35; } }
.briefing-sections { overflow: auto; padding: 10px 32px 20px; scroll-behavior: smooth; display: grid; gap: 18px; }
.brief-section { opacity: .36; transform: scale(.985); transition: .25s ease; border: 1px solid var(--border); border-radius: 22px; padding: 24px; background: var(--surface); }
.brief-section.active { opacity: 1; transform: scale(1); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: 0 16px 36px rgba(15,23,42,.08); }
.brief-section h2 { margin: 0 0 8px; color: var(--primary); font-size: 30px; letter-spacing: -.05em; }
.brief-section p { margin: 0 0 12px; color: var(--text); font-size: 18px; line-height: 1.45; }
.briefing-foot { border-top: 1px solid var(--border); padding: 16px 24px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.voice-answer { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.toast { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: grid; gap: 8px; }
.toast-item { background: var(--primary); color: white; padding: 12px 14px; border-radius: 14px; box-shadow: var(--shadow); max-width: 360px; }

@media (max-width: 1100px) {
  .topbar { grid-template-columns: 1fr auto; }
  .search-wrap { grid-column: 1 / -1; width: 100%; max-width: none; }
  .layout, .layout.sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar, .sidebar.collapsed { display: none; }
  .brief-strip, .utility-strip { grid-template-columns: 1fr; }
  .form-grid, .two-col, .settings-grid, .settings-shell { grid-template-columns: 1fr; }
  .settings-nav { border-right: 0; border-bottom: 1px solid var(--border); display: flex; overflow-x: auto; }
  .settings-nav button { min-width: max-content; }
}
@media (max-width: 700px) {
  .settings-modal { width: calc(100vw - 18px); height: calc(100dvh - 18px); }
  .settings-shell { grid-template-columns: 1fr; }
  .settings-nav { border-right:0; border-bottom:1px solid rgba(0,0,0,.1); display:flex; gap:4px; padding:8px; }
  .settings-search { display:none; }
  .settings-nav button { min-width:max-content; width:auto; grid-template-columns:22px auto; padding:5px 8px; }
  .settings-nav button i { width:20px; height:20px; font-size:11px; }
  .settings-content { padding:20px 16px 32px; }
}

/* v4 refinements: onboarding, cleaner voice glyph, better time/import controls */
.voice-glyph { position: relative; width: 18px; height: 18px; display: inline-flex; align-items: end; justify-content: center; gap: 2px; flex: 0 0 18px; }
.voice-glyph i { display: block; width: 3px; border-radius: 99px; background: currentColor; opacity: .88; }
.voice-glyph i:nth-child(1) { height: 14px; }
.voice-glyph i:nth-child(2) { height: 11px; }
.voice-glyph i:nth-child(3) { height: 8px; }
.voice-glyph i:nth-child(4) { height: 5px; }
.voice-glyph b { position: absolute; left: 50%; top: 1px; bottom: 1px; width: 2px; transform: translateX(-50%); border-radius: 99px; background: currentColor; opacity: .55; }
.icon-pill .voice-glyph { width: 20px; height: 20px; }
.speak-top { padding-inline: 12px; }
.modal-title .voice-glyph { vertical-align: -3px; margin-right: 6px; color: var(--primary); }

.time-control { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: center; }
.time-control input[type="time"] { text-align: center; font-variant-numeric: tabular-nums; }
.time-nudge { border: 1px solid var(--border); background: var(--surface); color: var(--primary); border-radius: 10px; height: 42px; padding: 0 10px; font-weight: 760; }
.time-nudge:hover { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }

.onboarding-backdrop { background: radial-gradient(circle at 30% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 35%), rgba(16, 24, 40, .54); }
.onboarding-modal { width: min(920px, calc(100vw - 48px)); }
.onboarding-body { display: grid; gap: 18px; }
.onboarding-hero { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 18px; border: 1px solid var(--border); border-radius: 22px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 7%, var(--surface)), var(--surface)); }
.onboarding-logo { width: 58px; height: 54px; border-radius: 18px; font-size: 26px; }
.onboarding-hero h1 { margin: 4px 0 6px; color: var(--primary); font-size: clamp(28px, 5vw, 48px); letter-spacing: -.06em; }
.onboarding-hero p { margin: 0; color: var(--muted); }
.starter-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.starter-list span { border: 1px solid var(--border); border-radius: 999px; padding: 7px 10px; color: var(--primary); background: var(--surface-2); font-weight: 720; }
.preset-preview-row { display: flex; gap: 10px; flex-wrap: wrap; }
.mini-preset { width: 78px; height: 24px; border-radius: 999px; border: 1px solid var(--border); background: linear-gradient(90deg, var(--p-primary), var(--p-accent), var(--p-bg)); }

.file-picker { display: grid; gap: 4px; place-items: start; border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: 16px; padding: 18px; margin: 12px 0; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); color: var(--primary); cursor: pointer; }
.file-picker input { width: 100%; max-width: 100%; border: 0; padding: 0; background: transparent; color: var(--muted); }
.file-picker span { font-weight: 800; }
.file-picker small { color: var(--muted); }

input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 68%, transparent); }

/* v5 mobile-native pass */
.mobile-topbar, .mobile-bottom-nav, .mobile-drawer, .mobile-drawer-backdrop, .mobile-create-sheet, .mobile-dim { display: none; }
.avatar { width: 40px; height: 40px; border: 0; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: white; font-weight: 900; box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 25%, transparent); }
.now-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid #ef4444; z-index: 6; pointer-events: none; }
.now-line span { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: #ef4444; }
.pointer-dragging { opacity: .76; transform: scale(.985); z-index: 30; box-shadow: 0 18px 40px rgba(15,23,42,.20); }
.premium-lock { border: 1px dashed color-mix(in srgb, var(--accent) 50%, var(--border)); border-radius: 16px; padding: 12px; display: grid; gap: 8px; background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.premium-lock input { border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; min-width: 160px; background: var(--surface); color: var(--text); }
.preset-card.premium { background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--accent) 6%, var(--surface))); }

/* voice glyph: 4 descending bars + horizontal grey line */
.voice-glyph { align-items: end; }
.voice-glyph b { left: 1px; right: 1px; top: 50%; bottom: auto; height: 2px; width: auto; transform: translateY(-50%); background: currentColor; opacity: .42; }

@media (max-width: 760px) {
  :root { --radius: 16px; }
  html, body, #app { height: 100%; }
  body { overflow: hidden; background: var(--bg); }
  .app-shell { height: 100dvh; grid-template-rows: 72px 1fr 78px; overflow: hidden; }
  .topbar { display: none; }
  .mobile-topbar { display: grid; grid-template-columns: 44px 1fr 44px 44px 44px; align-items: center; gap: 8px; padding: 12px 14px 8px; background: var(--surface); border-bottom: 1px solid var(--border); z-index: 45; }
  .mobile-icon, .mobile-month { border: 0; background: transparent; color: var(--text); min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-weight: 760; }
  .mobile-icon { font-size: 26px; border-radius: 50%; }
  .mobile-icon:active, .mobile-icon:hover { background: var(--surface-2); }
  .mobile-month { justify-content: flex-start; font-size: 26px; gap: 8px; letter-spacing: -.04em; }
  .date-chip { border: 2px solid var(--muted); font-size: 16px; border-radius: 12px; font-weight: 900; width: 40px; height: 40px; }
  .avatar { width: 42px; height: 42px; }

  .layout, .layout.sidebar-collapsed { display: block; min-height: 0; overflow: hidden; }
  .sidebar, .sidebar.collapsed { display: none !important; }
  .main { height: calc(100dvh - 150px); display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
  .brief-strip, .utility-strip { margin: 8px 10px 0; padding: 10px 12px; border-radius: 16px; grid-template-columns: 1fr auto; gap: 8px; }
  .brief-strip .micro-label { font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brief-strip h2 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brief-strip p { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .brief-utility .quick-chip:nth-child(n+2) { display: none; }
  .brief-utility { gap: 4px; }
  .brief-utility .icon-btn { width: 30px; height: 30px; min-height: 30px; font-size: 14px; }
  .utility-strip { grid-template-columns: 1fr; }
  .utility-cards { display: grid; grid-template-columns: repeat(3, 1fr); }
  .utility-card { min-width: 0; padding: 6px 8px; }
  .upcoming-line { display: none; }

  .calendar-stage { overflow: auto; -webkit-overflow-scrolling: touch; padding: 8px 0 96px 0; touch-action: pan-y pan-x; }
  .week-view, .day-view { min-width: calc(76px + var(--days) * 132px); margin: 0 8px 0; border-radius: 18px; }
  .day-view { min-width: calc(100vw - 16px); }
  .week-header-spacer { min-height: 62px; position: sticky; left: 0; z-index: 3; background: var(--surface); }
  .week-header { min-height: 62px; padding: 8px 4px 6px; background: var(--surface); position: sticky; top: 0; z-index: 2; }
  .week-header span { font-size: 11px; }
  .week-header strong { width: 38px; height: 38px; font-size: 22px; }
  .time-col { position: sticky; left: 0; z-index: 2; background: var(--surface); }
  .time-label { font-size: 11px; height: 54px; padding-right: 8px; }
  .day-col { min-height: calc(17 * 54px); background: repeating-linear-gradient(to bottom, transparent 0, transparent 53px, var(--border) 54px); }
  .week-event { left: 3px; right: 3px; border-radius: 7px; font-size: 12px; padding: 5px 22px 4px 7px; touch-action: none; }
  .week-event strong { font-size: 12px; white-space: normal; line-height: 1.05; }
  .week-event span { font-size: 10px; }
  .task-event { min-height: 26px; }
  .month-grid { min-width: 100%; width: 100%; margin: 0; border-radius: 0; border-left: 0; border-right: 0; }
  .month-cell { min-height: 112px; padding: 6px 4px; }
  .date-number { font-size: 13px; }
  .event-chip { font-size: 10px; padding: 3px 4px; min-height: 18px; }

  .mobile-bottom-nav { display: grid; position: fixed; left: 0; right: 0; bottom: 0; height: 78px; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 6px 8px calc(env(safe-area-inset-bottom) + 4px); background: color-mix(in srgb, var(--surface) 96%, transparent); border-top: 1px solid var(--border); z-index: 60; box-shadow: 0 -10px 32px rgba(15,23,42,.10); }
  .mobile-bottom-nav button { border: 0; background: transparent; color: var(--muted); border-radius: 16px; display: grid; place-items: center; gap: 1px; min-height: 54px; font-size: 18px; }
  .mobile-bottom-nav button strong { font-size: 10px; font-weight: 760; }
  .mobile-bottom-nav button:active, .mobile-bottom-nav button:hover { color: var(--primary); background: var(--surface-2); }
  .mobile-bottom-nav .mobile-fab { position: relative; top: -20px; width: 62px; height: 62px; justify-self: center; border-radius: 22px; background: var(--accent); color: white; font-size: 42px; box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 35%, transparent); }
  .mobile-bottom-nav .voice-glyph { color: currentColor; }

  .mobile-drawer-backdrop, .mobile-dim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 70; }
  .mobile-drawer { display: block; position: fixed; left: 0; top: 0; bottom: 0; width: min(82vw, 360px); background: var(--surface); color: var(--text); z-index: 75; box-shadow: 20px 0 60px rgba(0,0,0,.25); padding: calc(env(safe-area-inset-top) + 14px) 18px 28px; overflow-y: auto; }
  .mobile-drawer-head { display: grid; grid-template-columns: 42px 1fr 36px; gap: 10px; align-items: center; margin-bottom: 18px; }
  .mobile-drawer-head small { display: block; color: var(--muted); margin-top: 2px; }
  .mobile-drawer-head button { border: 0; background: var(--surface-2); border-radius: 50%; color: var(--text); width: 34px; height: 34px; }
  .mobile-view-list { display: grid; gap: 5px; margin-bottom: 14px; }
  .mobile-view-list button { border: 0; border-radius: 18px; padding: 13px 14px; background: transparent; color: var(--text); text-align: left; display: flex; align-items: center; gap: 14px; font-size: 17px; }
  .mobile-view-list button.active { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--primary); font-weight: 850; }
  .mobile-month-rail { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
  .mobile-month-rail button { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; min-height: 42px; color: var(--text); }
  .mobile-month-rail button.active { background: var(--primary); color: white; border-color: var(--primary); }
  .mobile-drawer h3 { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; margin: 18px 0 8px; }
  .mobile-calendar-list { display: grid; gap: 6px; }
  .mobile-calendar-list label { display: flex; align-items: center; gap: 12px; min-height: 42px; }
  .mobile-calendar-list input { accent-color: var(--accent); width: 18px; height: 18px; }
  .mobile-calendar-list span { width: 14px; height: 14px; border-radius: 4px; background: var(--dot); }
  .mobile-wide { width: 100%; min-height: 44px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--primary); margin-top: 10px; display: flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 780; }
  .mobile-drawer-section { margin-top: 14px; border-radius: 16px; border: 1px solid var(--border); padding: 12px; display: grid; gap: 4px; background: var(--surface-2); }
  .mobile-drawer-section small { color: var(--muted); }

  .mobile-create-sheet { display: grid; position: fixed; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 80; gap: 10px; justify-items: end; }
  .mobile-create-sheet button { min-width: 188px; border: 0; background: var(--accent); color: white; border-radius: 24px; min-height: 54px; padding: 0 20px; display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 18px; box-shadow: 0 16px 36px rgba(0,0,0,.25); }
  .mobile-create-sheet .close-create { min-width: 62px; width: 62px; height: 62px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 25%, white); color: var(--primary); font-size: 34px; }

  .modal-backdrop, .briefing-backdrop { padding: 0; align-items: end; }
  .modal, .settings-modal, .voice-modal, .briefing-modal { width: 100vw; max-width: none; height: min(92dvh, 920px); max-height: none; border-radius: 24px 24px 0 0; border-left: 0; border-right: 0; border-bottom: 0; }
  .modal-header { padding: 18px 18px 12px; }
  .modal-body { padding: 14px 18px 24px; }
  .modal-footer { padding: 12px 18px calc(env(safe-area-inset-bottom) + 12px); }
  .form-grid, .two-col, .settings-grid, .settings-shell { grid-template-columns: 1fr; }
  .settings-modal { height: 94dvh; }
  .settings-shell { display: block; overflow: hidden; }
  .settings-nav { border-right: 0; border-bottom: 1px solid var(--border); display: flex; overflow-x: auto; padding: 10px; }
  .settings-nav button { min-width: max-content; }
  .settings-content { padding: 16px; height: calc(94dvh - 112px); overflow: auto; }
  .plugin-row, .feed-row, .subscription-row, .manual-row, .draft-card { grid-template-columns: 1fr; align-items: start; }
  .subscription-row .inline-actions { width: 100%; }
  .subscription-row .inline-actions button { flex: 1; }
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .briefing-modal { grid-template-rows: auto auto auto 1fr auto; }
  .briefing-head { padding: 24px 18px 12px; }
  .briefing-head h1 { font-size: clamp(34px, 11vw, 50px); }
  .briefing-head p { font-size: 13px; }
  .ambient-indicator, .briefing-sections { padding-left: 18px; padding-right: 18px; }
  .brief-section { padding: 18px; border-radius: 18px; }
  .brief-section h2 { font-size: 24px; }
  .brief-section p { font-size: 16px; }
  .briefing-foot { padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px); flex-direction: column; align-items: stretch; }
  .voice-answer, .briefing-foot .inline-actions { justify-content: space-between; }
  .toast { left: 10px; right: 10px; bottom: calc(86px + env(safe-area-inset-bottom)); }
  .toast-item { max-width: none; }
}

/* v6 polish: ecosystem launcher, feed quick-add, immersive briefing, contextual creation, account safety */
.time-label { top: 0; padding-top: 0; transform: translateY(-2px); line-height: 1; }
.week-header-spacer { padding-bottom: 14px; }
.day-col { scroll-margin-top: 16px; }

.ecosystem-btn { position: relative; }
.top-actions { position: relative; }
.ecosystem-panel { position: absolute; top: 52px; right: 48px; width: 420px; max-width: calc(100vw - 32px); background: color-mix(in srgb, var(--surface) 96%, white); border: 1px solid var(--border); border-radius: 28px; box-shadow: 0 24px 70px rgba(15,23,42,.22); z-index: 80; padding: 18px; }
.ecosystem-head { display: grid; gap: 2px; margin-bottom: 12px; color: var(--primary); }
.ecosystem-head small { color: var(--muted); }
.ecosystem-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.ecosystem-app { text-decoration: none; color: var(--text); border: 1px solid var(--border); border-radius: 18px; background: var(--surface); padding: 12px; display: grid; gap: 6px; min-height: 132px; }
.ecosystem-app:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(15,23,42,.08); }
.ecosystem-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(135deg, var(--primary), var(--accent)); color: white; font-weight: 900; }
.ecosystem-app small { color: var(--muted); line-height: 1.25; }
.ecosystem-app em { color: var(--primary); font-style: normal; font-size: 12px; font-weight: 850; }
.ecosystem-app.current { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }

.quick-add-actions .emphasis { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.feed-bank-modal { width: min(1120px, calc(100vw - 48px)); }
.feed-bank-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.feed-bank-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.feed-bank-tabs button { border: 1px solid var(--border); background: var(--surface); color: var(--primary); border-radius: 999px; padding: 8px 12px; font-weight: 760; }
.feed-bank-tabs button.active { background: var(--primary); color: white; border-color: var(--primary); }
.feed-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px,1fr)); gap: 12px; }
.feed-bank-card { border: 1px solid var(--border); border-radius: 18px; background: var(--surface); padding: 14px; display: grid; gap: 10px; box-shadow: 0 8px 24px rgba(15,23,42,.045); }
.feed-bank-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 780; }
.feed-bank-card h3 { margin: 0; color: var(--primary); font-size: 16px; line-height: 1.2; }
.feed-bank-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.feed-bank-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.feed-bank-actions .primary-btn, .feed-bank-actions .ghost-btn { padding: 8px 10px; font-size: 12px; }

.context-editor { position: fixed; right: 28px; top: 170px; z-index: 70; width: min(390px, calc(100vw - 56px)); max-height: calc(100vh - 210px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: 0 24px 80px rgba(15,23,42,.22); padding: 16px; display: grid; gap: 12px; }
.context-head { display: flex; align-items: center; justify-content: space-between; color: var(--primary); }
.context-title { border: 0; border-bottom: 2px solid var(--accent); padding: 10px 2px; font-size: 22px; outline: 0; color: var(--text); background: transparent; }
.context-type-row { display: flex; gap: 8px; flex-wrap: wrap; }
.context-type-row button { border: 1px solid var(--border); background: var(--surface); color: var(--primary); border-radius: 999px; padding: 8px 12px; }
.context-type-row button.active { background: var(--primary); color: white; border-color: var(--primary); }
.context-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.context-grid label { display: grid; gap: 5px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 850; }
.context-grid input, .context-grid select, .context-editor textarea { border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: 10px; color: var(--text); }
.context-editor textarea { min-height: 80px; resize: vertical; }
.context-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.draft-event { border-style: dashed; opacity: .88; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 13%, transparent); }

.danger-zone { border-color: color-mix(in srgb, #dc2626 35%, var(--border)); background: color-mix(in srgb, #dc2626 4%, var(--surface)); }
.danger-title { color: #b91c1c !important; }
.danger-zone h3 { color: #b91c1c; }

.briefing-backdrop.theater { background: #02040a; padding: 0; }
.theater-modal { width: 100vw; height: 100dvh; border-radius: 0; border: 0; background: radial-gradient(circle at 78% 20%, rgba(29,78,216,.24), transparent 26%), radial-gradient(circle at 15% 90%, rgba(20,184,166,.12), transparent 28%), #02040a; color: #f8fafc; box-shadow: none; display: grid; grid-template-rows: auto auto 1fr auto; overflow: hidden; }
.theater-top { display: flex; align-items: center; justify-content: space-between; padding: 24px 34px 14px; color: rgba(248,250,252,.72); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.theater-top .icon-btn { color: white; background: rgba(255,255,255,.08); }
.theater-modal .briefing-progress { background: rgba(255,255,255,.08); }
.theater-modal .briefing-progress div { background: linear-gradient(90deg, #fff, #93c5fd); }
.theater-stage { display: grid; align-content: center; justify-items: center; text-align: center; padding: 6vh 10vw; gap: 22px; }
.theater-stage .micro-label { color: rgba(248,250,252,.55); letter-spacing: .16em; }
.theater-stage h1 { color: #fff; font-size: clamp(44px, 9vw, 112px); line-height: .92; margin: 0; letter-spacing: -.075em; max-width: 1100px; }
.theater-line { color: rgba(248,250,252,.88); font-size: clamp(20px, 3.2vw, 42px); line-height: 1.25; max-width: 980px; margin: 0; animation: theater-pop .35s ease both; }
@keyframes theater-pop { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.theater-details { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; max-width: 980px; }
.theater-details span { border: 1px solid rgba(255,255,255,.16); color: rgba(248,250,252,.88); background: rgba(255,255,255,.07); border-radius: 999px; padding: 8px 12px; }
.theater-transcript { position: absolute; left: 34px; bottom: 86px; width: min(420px, 42vw); display: grid; gap: 8px; text-align: left; }
.theater-transcript div { opacity: .42; border-left: 2px solid rgba(255,255,255,.14); padding-left: 10px; display: grid; gap: 2px; }
.theater-transcript div.active { opacity: .95; border-color: #93c5fd; }
.theater-transcript strong { font-size: 12px; color: white; }
.theater-transcript span { color: rgba(248,250,252,.62); font-size: 12px; line-height: 1.3; }
.theater-foot { background: rgba(2,4,10,.72); border-color: rgba(255,255,255,.1); }
.theater-foot .ghost-btn { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.16); }
.theater-foot .pill-btn { background: #fff; color: #0f172a; }

.mobile-ecosystem { display: none; }
@media (max-width: 760px) {
  .context-editor { left: 0; right: 0; bottom: 0; top: auto; width: 100vw; max-height: 72dvh; border-radius: 24px 24px 0 0; border-left: 0; border-right: 0; }
  .context-grid { grid-template-columns: 1fr; }
  .feed-bank-modal { height: 94dvh; }
  .feed-bank-toolbar { align-items: stretch; flex-direction: column; }
  .feed-bank-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .feed-card-grid { grid-template-columns: 1fr; }
  .ecosystem-panel { display: none; }
  .mobile-ecosystem { display: grid; position: fixed; left: 0; right: 0; bottom: 0; z-index: 82; background: var(--surface); border-radius: 24px 24px 0 0; padding: 16px 16px calc(env(safe-area-inset-bottom) + 18px); gap: 10px; box-shadow: 0 -20px 60px rgba(0,0,0,.28); }
  .mobile-sheet-head { display: flex; justify-content: space-between; align-items: center; color: var(--primary); font-size: 20px; }
  .mobile-app-link { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; text-decoration: none; color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 12px; background: var(--surface-2); }
  .mobile-app-link span { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-weight: 900; }
  .mobile-app-link small { display: block; color: var(--muted); line-height: 1.25; }
  .theater-top { padding: calc(env(safe-area-inset-top) + 18px) 18px 12px; }
  .theater-stage { padding: 8vh 20px 18vh; }
  .theater-stage h1 { font-size: clamp(42px, 15vw, 76px); }
  .theater-line { font-size: clamp(20px, 7vw, 32px); }
  .theater-transcript { display: none; }
  .theater-foot { padding-bottom: calc(env(safe-area-inset-bottom) + 14px); }
}

/* v7.1 subtle resizing refinements */
.week-event { padding-top: 6px; padding-bottom: 7px; }
.resize-handle { left: 0; right: 0; height: 10px; z-index: 5; background: transparent; }
.resize-top { top: 0; bottom: auto; border-radius: 8px 8px 0 0; }
.resize-bottom { bottom: 0; top: auto; border-radius: 0 0 8px 8px; }
.week-event:hover .resize-top,
.week-event:hover .resize-bottom,
.is-resizing .resize-top,
.is-resizing .resize-bottom { background: transparent; }
.resize-top::after, .resize-bottom::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); width: 22px; height: 2px; border-radius: 999px; background: color-mix(in srgb, var(--event-color) 42%, transparent); opacity: 0; transition: opacity .12s ease, width .12s ease; pointer-events: none; }
.resize-top::after { top: 3px; }
.resize-bottom::after { bottom: 3px; }
.week-event:hover .resize-top::after,
.week-event:hover .resize-bottom::after { opacity: .38; }
.is-resizing .resize-top::after,
.is-resizing .resize-bottom::after { opacity: .62; width: 28px; }

.horizontal-feed-grid { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 14px; scroll-snap-type: x proximity; }
.horizontal-feed-grid .feed-bank-card { flex: 0 0 min(330px, 82vw); scroll-snap-align: start; }
.feed-schedule-controls { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.feed-schedule-controls label { display: grid; gap: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 850; }
.feed-schedule-controls input, .feed-schedule-controls select { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; color: var(--text); padding: 9px 10px; min-height: 38px; }
.insight-subscribe-strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); border-radius: 18px; padding: 12px 14px; margin-bottom: 14px; }
.insight-subscribe-strip div:first-child { display: grid; gap: 3px; color: var(--primary); }
.insight-subscribe-strip span { color: var(--muted); font-size: 13px; }
.insight-card { border-color: color-mix(in srgb, var(--primary) 28%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 4%, var(--surface)), var(--surface)); }
.compact-feed-toolbar { align-items: flex-start; }

.theater-stage { padding-bottom: 18vh; }
.theater-transcript { position: absolute; left: 34px; right: 34px; bottom: 84px; width: auto; display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; text-align: left; mask-image: linear-gradient(90deg, transparent, #000 2%, #000 95%, transparent); }
.theater-transcript div { min-width: 210px; max-width: 260px; border-left: 0; border-top: 2px solid rgba(255,255,255,.14); padding: 9px 10px 0; background: rgba(255,255,255,.035); border-radius: 12px; }
.theater-transcript div.active { background: rgba(147,197,253,.10); border-color: #93c5fd; }
.theater-foot { position: relative; z-index: 3; }
@media (max-width: 760px) {
  .horizontal-feed-grid { padding-bottom: 80px; }
  .insight-subscribe-strip { align-items: stretch; flex-direction: column; }
  .feed-schedule-controls { align-items: stretch; }
  .feed-schedule-controls label { flex: 1 1 120px; }
  .theater-transcript { display: none; }
  .week-event { touch-action: none; }
  .resize-handle { height: 18px; }
}

/* v7.2 cleanup: calmer settings rows, working delete flow, no visual overlap */
.subscription-settings-grid { grid-template-columns: 1fr; }
.subscription-add-card { overflow: visible; }
.subscription-list-card { overflow: hidden; }
.subscription-list { display: grid; gap: 10px; }
.subscription-row.clean-row { display: grid; grid-template-columns: minmax(94px, 122px) minmax(0, 1fr) auto; gap: 14px; align-items: center; margin: 0; padding: 13px 14px; }
.subscription-copy { display: grid; gap: 4px; min-width: 0; }
.subscription-copy strong { display: block; min-width: 0; color: var(--text); line-height: 1.22; overflow-wrap: anywhere; }
.subscription-copy small { display: block; min-width: 0; line-height: 1.35; overflow-wrap: anywhere; }
.subscription-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: nowrap; }
.subscription-actions .ghost-btn { white-space: nowrap; padding-inline: 12px; }
.section-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.delete-modal { width: min(720px, calc(100vw - 36px)); }
.delete-body { display: grid; gap: 14px; }
.delete-warning-card { border: 1px solid color-mix(in srgb, #dc2626 32%, var(--border)); background: color-mix(in srgb, #dc2626 5%, var(--surface)); color: var(--text); border-radius: 16px; padding: 13px 14px; display: grid; gap: 4px; }
.delete-warning-card strong { color: #b91c1c; }
.delete-warning-card span { color: var(--muted); line-height: 1.4; }
.delete-message { color: var(--muted); margin: 0; font-size: 13px; }
.delete-message.error { color: #b91c1c; font-weight: 750; }
.danger-btn:focus-visible, .ghost-btn:focus-visible, .primary-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 920px) {
  .subscription-row.clean-row { grid-template-columns: 1fr; align-items: start; }
  .subscription-actions { justify-content: start; flex-wrap: wrap; }
  .subscription-actions .ghost-btn { flex: 0 0 auto; }
}

/* v7.3 responsive/name polish */
.network-glyph { position: relative; width: 21px; height: 21px; display: inline-block; color: currentColor; }
.network-glyph i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent); }
.network-glyph i:nth-child(1) { left: 2px; top: 7px; }
.network-glyph i:nth-child(2) { right: 2px; top: 2px; }
.network-glyph i:nth-child(3) { right: 2px; bottom: 2px; }
.network-glyph b { position: absolute; height: 2px; background: color-mix(in srgb, currentColor 55%, transparent); border-radius: 99px; transform-origin: left center; left: 8px; top: 10px; width: 11px; }
.network-glyph b:nth-of-type(1) { transform: rotate(-28deg); }
.network-glyph b:nth-of-type(2) { transform: rotate(28deg); }
.ecosystem-btn { color: var(--primary); }
.ecosystem-btn:hover .network-glyph i { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }

@media (max-width: 1420px) {
  .layout { grid-template-columns: 286px 1fr; }
  .topbar { gap: 10px; padding-inline: 14px; grid-template-columns: auto auto minmax(180px, 1fr) auto; }
  .brand { min-width: 220px; }
  .range-title { min-width: 145px; font-size: 18px; }
  .search-wrap { width: min(480px, 100%); }
}

@media (max-width: 1240px) {
  .layout { grid-template-columns: 258px 1fr; }
  .sidebar { padding: 12px; }
  .brand { min-width: 190px; }
  .brand-title { font-size: 15px; }
  .logo { width: 34px; height: 34px; }
  .nav-controls { gap: 5px; }
  .range-title { min-width: 120px; font-size: 17px; }
  .speak-top span { display: none; }
  .search-wrap input { height: 38px; }
  .brief-strip { margin-inline: 14px; grid-template-columns: 1fr; gap: 10px; }
  .brief-utility { justify-content: flex-start; }
}

@media (max-width: 1100px) and (min-width: 761px) {
  .app-shell { grid-template-rows: auto 1fr; }
  .topbar { grid-template-columns: 1fr auto; row-gap: 8px; padding: 9px 12px; }
  .brand { min-width: 0; }
  .brand-title { max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-controls { order: 3; grid-column: 1 / 2; }
  .search-wrap { order: 2; justify-self: stretch; width: 100%; max-width: 360px; }
  .top-actions { order: 4; grid-column: 2 / 3; }
  .layout, .layout.sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar, .sidebar.collapsed { display: none; }
  .main { min-width: 0; }
  .calendar-stage { overflow: auto; -webkit-overflow-scrolling: touch; }
  .week-view, .day-view { min-width: 860px; }
}

@media (max-width: 920px) and (min-width: 761px) {
  .topbar { grid-template-columns: 1fr; }
  .search-wrap, .nav-controls, .top-actions { grid-column: 1; justify-self: stretch; }
  .top-actions, .nav-controls { justify-content: space-between; }
  .view-select { flex: 1; }
  .week-view, .day-view { min-width: 780px; }
  .brief-strip h2 { font-size: 18px; }
  .brief-strip p { font-size: 14px; }
}

@media (max-width: 760px) {
  .mobile-drawer-head strong { font-size: 16px; }
  .brief-strip { display: none; }
  .network-glyph { width: 20px; height: 20px; }
}

/* Auth + cloud sync gate */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  padding: clamp(14px, 2vw, 28px);
  background:
    radial-gradient(circle at 16% 6%, rgba(37, 99, 235, 0.22), transparent 30%),
    radial-gradient(circle at 86% 88%, rgba(79, 70, 229, 0.12), transparent 34%),
    linear-gradient(135deg, #edf4ff 0%, #ffffff 50%, #eef3ff 100%);
  color: #0b1530;
  overflow: auto;
}
.auth-screen.hidden { display: none; }
.auth-shell {
  width: min(1160px, calc(100vw - 40px));
  height: min(760px, calc(100vh - 86px));
  min-height: 650px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 30px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 36px 105px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(255,255,255,.72) inset;
}
.auth-hero {
  position: relative;
  height: 100%;
  min-height: 0;
  padding: clamp(38px, 4vw, 64px);
  color: #fff;
  background:
    radial-gradient(circle at 70% 54%, rgba(37, 99, 235, 0.36), transparent 34%),
    radial-gradient(circle at 36% 92%, rgba(30, 64, 175, 0.32), transparent 32%),
    linear-gradient(145deg, #050b17 0%, #08152d 53%, #020713 100%);
  isolation: isolate;
  overflow: hidden;
}
.auth-hero::before,
.auth-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}
.auth-hero::before {
  width: min(690px, 88vw);
  height: min(690px, 88vw);
  left: 10%;
  top: 18%;
  border-radius: 50%;
  border: 1px solid rgba(147, 197, 253, .18);
  box-shadow:
    0 0 0 92px rgba(147, 197, 253, .065),
    0 0 0 184px rgba(147, 197, 253, .045),
    0 0 0 276px rgba(147, 197, 253, .028);
}
.auth-hero::after {
  left: 13%;
  right: 7%;
  bottom: 22px;
  height: 122px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(96, 165, 250, .34), rgba(15, 23, 42, .44) 54%, transparent 75%);
  filter: blur(4px);
}
.auth-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(2, 6, 23, .32);
  border: 1px solid rgba(191, 219, 254, .27);
  color: rgba(255, 255, 255, .92);
  font-size: 12px;
  font-weight: 780;
  backdrop-filter: blur(14px);
}
.auth-hero h1 {
  position: relative;
  z-index: 3;
  max-width: 440px;
  margin: clamp(28px, 4.2vh, 42px) 0 18px;
  font-size: clamp(58px, 5.7vw, 78px);
  line-height: .93;
  letter-spacing: -.075em;
  color: #fff;
  text-shadow: 0 8px 36px rgba(0,0,0,.32);
}
.auth-hero p {
  position: relative;
  z-index: 3;
  width: min(420px, 100%);
  margin: 0;
  color: rgba(255, 255, 255, .80);
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.55;
}
.auth-orbits span,
.auth-orbits i {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}
.auth-orbits span:nth-child(1) { width: 7px; height: 7px; left: 54px; top: 48%; background: #60a5fa; box-shadow: 0 0 20px #60a5fa; }
.auth-orbits span:nth-child(2) { width: 6px; height: 6px; right: 94px; top: 44%; background: #93c5fd; box-shadow: 0 0 20px #93c5fd; }
.auth-orbits span:nth-child(3) { width: 5px; height: 5px; right: 76px; bottom: 25%; background: #3b82f6; box-shadow: 0 0 20px #3b82f6; }
.auth-orbits i:nth-of-type(1) { width: 1px; height: 1px; left: 60%; top: 28%; box-shadow: 0 0 0 2px rgba(147,197,253,.75); }
.auth-orbits i:nth-of-type(2) { width: 1px; height: 1px; left: 24%; bottom: 35%; box-shadow: 0 0 0 2px rgba(147,197,253,.72); }
.auth-orbits i:nth-of-type(3) { width: 1px; height: 1px; right: 18%; bottom: 49%; box-shadow: 0 0 0 2px rgba(147,197,253,.65); }
.auth-phone {
  position: absolute;
  right: clamp(34px, 7vw, 92px);
  bottom: clamp(64px, 10vh, 108px);
  width: clamp(158px, 16vw, 192px);
  height: clamp(282px, 28vw, 338px);
  padding: 20px 15px;
  transform: rotate(9deg);
  border-radius: 34px;
  background: linear-gradient(145deg, #0a1020, #030712 74%);
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 32px 80px rgba(0,0,0,.55), inset 0 0 0 8px rgba(255,255,255,.025);
  z-index: 2;
}
.auth-phone::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 50%;
  width: 62px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #020617;
}
.phone-status { display: flex; justify-content: space-between; color: #dbeafe; font-size: 9px; opacity: .9; }
.phone-calendar-head { margin-top: 22px; display: flex; justify-content: space-between; align-items: center; color: #dbeafe; font-size: 11px; }
.phone-calendar-head b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #2563eb; color: #fff; }
.phone-week, .phone-days { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; gap: 4px; margin-top: 10px; color: #94a3b8; font-size: 9px; }
.phone-days { color: #dbeafe; }
.phone-days strong { display: grid; place-items: center; width: 20px; height: 20px; margin: -4px auto 0; border-radius: 50%; background: #60a5fa; color: #fff; }
.phone-event { margin-top: 10px; min-height: 45px; border-radius: 12px; padding: 8px 10px; background: rgba(15, 23, 42, .84); display: grid; grid-template-columns: 42px 1fr; column-gap: 8px; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.045); }
.phone-event em { grid-row: span 2; font-style: normal; color: #60a5fa; font-size: 10px; }
.phone-event strong { font-size: 10px; line-height: 1.1; }
.phone-event small { font-size: 8px; color: #94a3b8; }
.phone-add { position: absolute; right: 18px; bottom: 20px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #2563eb; color: #fff; font-size: 30px; line-height: 1; }
.auth-pedestal {
  position: absolute;
  right: clamp(12px, 4vw, 54px);
  bottom: 24px;
  width: clamp(300px, 34vw, 430px);
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(59, 130, 246, .18), rgba(2, 6, 23, .78));
  box-shadow: 0 -16px 45px rgba(37, 99, 235, .23);
}
.auth-panel {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 62% 0%, rgba(219, 234, 254, .55), transparent 30%), #fff;
  padding: clamp(34px, 5vh, 54px) 0;
  overflow: auto;
}
.auth-panel-inner { width: min(420px, calc(100% - 72px)); }
.auth-logo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; color: #0f1f44; }
.auth-logo-mark { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #4f46e5, #2563eb); box-shadow: 0 15px 34px rgba(37, 99, 235, .24); font-size: 18px; }
.auth-logo-row strong { font-size: 24px; letter-spacing: -.04em; }
.auth-logo-row span { color: #64748b; font-weight: 560; }
.auth-mode-pill { display: inline-flex; min-height: 28px; align-items: center; padding: 0 11px; margin-bottom: 16px; border-radius: 999px; background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; font-size: 12px; font-weight: 800; }
.auth-panel h2 { margin: 0; font-size: 38px; line-height: 1; letter-spacing: -.055em; color: #0b1530; }
.auth-copy { margin: 12px 0 24px; color: #64748b; line-height: 1.5; max-width: 380px; }
.auth-field { display: grid; gap: 8px; margin-top: 15px; color: #0f172a; font-size: 14px; font-weight: 720; }
.auth-field span { display: inline-flex; align-items: baseline; gap: 7px; }
.auth-field small { color: #94a3b8; font-weight: 650; text-transform: none; letter-spacing: 0; }
.signup-only { display: none; }
.auth-screen[data-auth-mode="signup"] .signup-only { display: grid; }
.auth-screen[data-auth-mode="signup"] .auth-meta-row { margin-top: 14px; }
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 54px;
  border-radius: 19px;
  border: 1px solid #d9e1ee;
  background: #fff;
  box-shadow: 0 2px 0 rgba(15, 23, 42, .02);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.auth-input-wrap:focus-within { border-color: #2563eb; box-shadow: 0 0 0 5px rgba(37, 99, 235, .12); background: #fff; }
.auth-input-wrap i { width: 48px; text-align: center; color: #64748b; font-style: normal; font-weight: 800; flex: 0 0 auto; }
.auth-eye { width: 44px; height: 44px; margin-right: 5px; border: 0; border-radius: 12px; background: transparent; color: #64748b; font-weight: 900; cursor: pointer; }
.auth-eye:hover { background: #f1f5f9; color: #1d4ed8; }
.auth-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: #0f172a;
  padding: 0 12px 0 0;
  outline: none;
  font: inherit;
  font-weight: 650;
}
.auth-field input::placeholder { color: #98a2b3; font-weight: 600; }
.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover,
.auth-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0f172a;
  box-shadow: 0 0 0 1000px #fff inset;
  transition: background-color 9999s ease-in-out 0s;
}
.auth-meta-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 18px 0 22px; color: #334155; font-size: 14px; }
.auth-remember { display: inline-flex; align-items: center; gap: 8px; }
.auth-remember input { width: 16px; height: 16px; accent-color: #2563eb; }
.auth-link { border: 0; background: transparent; color: #1d4ed8; font-weight: 720; padding: 0; cursor: pointer; }
.auth-primary, .ghost-button, .auth-google { min-height: 56px; border-radius: 19px; padding: 0 18px; font-weight: 780; cursor: pointer; }
.auth-primary { width: 100%; border: 0; background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; box-shadow: 0 14px 28px rgba(37, 99, 235, .24); }
.auth-primary:hover { filter: brightness(1.03); transform: translateY(-1px); }
.auth-primary:disabled { opacity: .65; cursor: wait; transform: none; }
.auth-primary span { margin-left: 7px; }
.auth-divider { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin: 24px 0 14px; color: #94a3b8; font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: #e2e8f0; }
.auth-google { width: 100%; border: 1px solid #d9e1ee; background: #fff; color: #0f172a; }
.auth-google b { display: inline-grid; place-items: center; margin-right: 10px; color: #4285f4; font-size: 18px; }
.auth-switch { margin: 18px 0 0; text-align: center; color: #64748b; font-size: 14px; }
.auth-switch button { border: 0; background: transparent; color: #1d4ed8; font-weight: 800; cursor: pointer; }
.ghost-button { width: 100%; margin-top: 12px; border: 1px solid transparent; background: transparent; color: #64748b; }
.ghost-button:hover { border-color: #d9e1ee; background: #f8fafc; color: #0f172a; }
.auth-error { min-height: 22px; margin: 10px 0 0; color: #b42318; line-height: 1.42; font-weight: 700; }
.auth-error[data-type="success"] { color: #047857; }
.password-strength { gap: 7px; margin-top: 10px; }
.strength-bar { height: 7px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.strength-bar span { display: block; height: 100%; width: 8%; border-radius: inherit; background: linear-gradient(90deg, #ef4444, #f59e0b); transition: width .2s ease, background .2s ease; }
.strength-bar span[data-score="4"] { background: linear-gradient(90deg, #f59e0b, #2563eb); }
.strength-bar span[data-score="5"] { background: linear-gradient(90deg, #2563eb, #10b981); }
.password-strength p { margin: 0; color: #64748b; font-size: 12px; line-height: 1.4; }
.auth-footer { margin-top: 16px; color: #61708a; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 14px; }
@media (max-height: 780px) and (min-width: 981px) {
  .auth-shell { height: calc(100vh - 54px); min-height: 600px; }
  .auth-panel { padding: 28px 0; }
  .auth-logo-row { margin-bottom: 14px; }
  .auth-panel h2 { font-size: 34px; }
  .auth-copy { margin-bottom: 18px; }
  .auth-field { margin-top: 11px; }
  .auth-input-wrap { height: 49px; border-radius: 16px; }
  .auth-meta-row { margin: 13px 0 16px; }
  .auth-primary, .ghost-button, .auth-google { min-height: 50px; border-radius: 16px; }
  .auth-divider { margin: 18px 0 12px; }
  .auth-switch { margin-top: 14px; }
  .auth-hero h1 { font-size: clamp(52px, 5vw, 66px); margin-top: 30px; }
  .auth-phone { width: 150px; height: 270px; bottom: 70px; }
  .phone-event:nth-of-type(n+6) { display: none; }
  .auth-pedestal { height: 72px; }
}
@media (max-width: 1180px) {
  .auth-shell { width: min(1060px, calc(100vw - 32px)); grid-template-columns: .96fr 1fr; }
  .auth-hero { padding: 42px; }
  .auth-hero h1 { font-size: 62px; }
  .auth-phone { right: 50px; bottom: 88px; width: 170px; height: 306px; }
  .auth-pedestal { right: 28px; width: 360px; }
}
@media (max-width: 980px) {
  .auth-screen { place-items: start center; }
  .auth-shell { grid-template-columns: 1fr; width: min(560px, calc(100vw - 28px)); height: auto; min-height: 0; }
  .auth-hero { min-height: 360px; padding: 36px; }
  .auth-hero h1 { font-size: 56px; }
  .auth-phone { width: 150px; height: 265px; left: auto; right: 40px; bottom: 44px; padding: 16px 12px; border-radius: 28px; }
  .phone-event:nth-of-type(n+6) { display: none; }
  .auth-pedestal { width: 270px; left: auto; right: 20px; bottom: 18px; }
  .auth-panel { padding: 38px 0; }
  .auth-logo-row { margin-bottom: 18px; }
}
@media (max-width: 560px) {
  .auth-screen { padding: 12px; }
  .auth-shell { width: 100%; border-radius: 24px; }
  .auth-hero { min-height: 260px; padding: 26px; }
  .auth-hero h1 { font-size: 44px; }
  .auth-hero p { font-size: 15px; width: 260px; }
  .auth-phone, .auth-pedestal { opacity: .24; transform: rotate(8deg) scale(.8); right: 12px; }
  .auth-panel-inner { width: calc(100% - 38px); }
  .auth-panel h2 { font-size: 32px; }
  .auth-footer { font-size: 12px; gap: 8px; flex-wrap: wrap; }
}
.cloud-status { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 999px; background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; font-size: 12px; font-weight: 800; }

/* v8.4 auth hardening and responsive polish */
.auth-screen {
  min-height: 100dvh;
  padding: clamp(10px, 1.6vw, 22px);
  align-items: center;
}
.auth-shell {
  width: min(1180px, calc(100vw - 28px));
  height: min(730px, calc(100dvh - 58px));
  min-height: min(620px, calc(100dvh - 58px));
}
.auth-panel-inner { width: min(420px, calc(100% - 72px)); }
.auth-field input { caret-color: #1d4ed8; }
.auth-field input::selection { background: rgba(37, 99, 235, .18); }
.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover,
.auth-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0f172a;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
}
.auth-screen[data-auth-mode="reset"] .reset-only { display: grid; }
.auth-screen[data-auth-mode="reset"] .auth-name-field,
.auth-screen[data-auth-mode="reset"] .auth-email-field,
.auth-screen[data-auth-mode="reset"] .auth-meta-row,
.auth-screen[data-auth-mode="reset"] .auth-divider,
.auth-screen[data-auth-mode="reset"] .auth-google,
.auth-screen[data-auth-mode="reset"] .ghost-button { display: none; }
.auth-screen[data-auth-mode="forgot"] .auth-name-field,
.auth-screen[data-auth-mode="forgot"] .auth-password-field,
.auth-screen[data-auth-mode="forgot"] .auth-confirm-field,
.auth-screen[data-auth-mode="forgot"] .password-strength,
.auth-screen[data-auth-mode="forgot"] .auth-meta-row,
.auth-screen[data-auth-mode="forgot"] .auth-divider,
.auth-screen[data-auth-mode="forgot"] .auth-google { display: none; }
.auth-screen[data-auth-mode="forgot"] .auth-email-field { display: grid; }
.auth-screen[data-auth-mode="signin"] .auth-confirm-field,
.auth-screen[data-auth-mode="signin"] .password-strength,
.auth-screen[data-auth-mode="signin"] .auth-name-field { display: none; }
.auth-error { min-height: 24px; }
.auth-error:not(:empty) {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff5f5;
  border: 1px solid #fecaca;
}
.auth-error[data-type="success"]:not(:empty) {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.auth-consent { display:none; grid-template-columns:auto 1fr; align-items:start; gap:8px; margin:12px 0; color:#475467; font-size:12px; line-height:1.45; }
.auth-screen[data-auth-mode="signup"] .auth-consent { display:grid; }
.auth-consent input { margin-top:2px; accent-color:#1d4ed8; }
.auth-consent a { color:#1d4ed8; }
@media (max-height: 760px) and (min-width: 981px) {
  .auth-screen { padding: 8px; }
  .auth-shell { height: calc(100dvh - 22px); min-height: 0; }
  .auth-panel-inner { width: min(402px, calc(100% - 64px)); }
  .auth-hero { padding: 38px 48px; }
  .auth-hero h1 { font-size: clamp(52px, 5.0vw, 66px); margin: 26px 0 12px; }
  .auth-hero p { font-size: 18px; line-height: 1.45; }
  .auth-phone { width: 146px; height: 260px; bottom: 54px; right: 58px; }
  .auth-pedestal { height: 62px; bottom: 14px; }
  .auth-logo-row { margin-bottom: 12px; }
  .auth-mode-pill { margin-bottom: 10px; }
  .auth-copy { margin: 9px 0 14px; }
  .auth-field { margin-top: 9px; gap: 6px; }
  .auth-input-wrap { height: 46px; }
  .auth-meta-row { margin: 12px 0 14px; }
  .auth-primary, .auth-google, .ghost-button { min-height: 48px; }
  .auth-divider { margin: 14px 0 10px; }
  .auth-footer { display: none; }
}
@media (max-width: 980px) {
  .auth-shell { height: auto; max-height: none; min-height: 0; overflow: visible; }
  .auth-screen { overflow: auto; align-items: start; }
}

/* Final time-grid invariant: explicit DOM lines remain visible in every theme and viewport. */
.week-view .day-col, .day-view .day-col { min-height: calc(var(--day-hours, 17) * 54px); background-image: none; }
.day-col .hour-lines { display:grid; grid-template-rows: repeat(var(--day-hours, 17), 54px); }
@media (max-width:760px) {
  .week-view .day-col, .day-view .day-col { min-height: calc(var(--day-hours, 17) * 54px); background-image:none; background-color:var(--mobile-bg, #202124); }
  .hour-lines span { background:var(--mobile-border, #3c4043); opacity:1; }
}

/* v8.5 Google Calendar mobile upgrade: search, compact multi-day/week, feed nav, and draft creation sheet */
.week-header { border: 0; color: inherit; font: inherit; cursor: pointer; }
.week-header:hover { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.date-number { border: 0; background: transparent; color: inherit; cursor: pointer; }
.date-number:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

.mobile-search-overlay { display: none; }
.mobile-search-bar, .mobile-search-results, .mobile-search-result, .mobile-search-empty { box-sizing: border-box; }

@media (max-width: 760px) {
  :root {
    --primary: #e8eaed;
    --accent: #8ab4f8;
    --bg: #202124;
    --surface: #303134;
    --surface-2: #202124;
    --text: #e8eaed;
    --muted: #a7adb6;
    --border: #3c4043;
    --task-bg: #1f3a5f;
    --shadow: 0 18px 45px rgba(0,0,0,.35);
  }

  body { background: #202124; overscroll-behavior: none; }
  .app-shell { background: #202124; grid-template-rows: auto 1fr 76px; }

  .mobile-topbar {
    grid-template-columns: 44px minmax(0, 1fr) 44px 44px 48px;
    min-height: 72px;
    padding: calc(env(safe-area-inset-top) + 10px) 16px 8px;
    background: #303134;
    border-bottom: 1px solid #3c4043;
    box-shadow: 0 1px 0 rgba(0,0,0,.3);
  }
  .mobile-icon, .mobile-month { color: #e8eaed; }
  .mobile-icon { font-size: 28px; }
  .mobile-month { font-size: 24px; font-weight: 500; }
  .date-chip { width: 38px; height: 38px; border: 2px solid #c9ced6; border-radius: 10px; color: #e8eaed; font-size: 16px; }
  .avatar { width: 44px; height: 44px; background: #a142c1; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.12); }

  .main { height: calc(100dvh - 148px); grid-template-rows: 1fr; background: #202124; }
  .calendar-stage {
    margin: 0;
    padding: 0 0 calc(90px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: #202124;
    box-shadow: none;
    overflow: auto;
    touch-action: pan-y;
    scrollbar-width: thin;
  }

  .week-view, .day-view {
    width: 100%;
    min-width: 100% !important;
    margin: 0;
    border-radius: 0;
    grid-template-columns: 56px repeat(var(--days), minmax(0, 1fr));
    grid-template-rows: 84px auto;
    background: #202124;
  }
  .day-view { grid-template-columns: 66px minmax(0, 1fr); }
  .week-view[style*="--days:7"] { grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
  .week-view[style*="--days:3"] { grid-template-columns: 56px repeat(3, minmax(0, 1fr)); }

  .week-header-spacer {
    min-height: 84px;
    background: #303134;
    border-bottom: 1px solid #3c4043;
    border-right: 1px solid #3c4043;
    align-items: center;
    padding: 0 4px 0 6px;
  }
  .tz-label { color: #9aa0a6; font-size: 10px; line-height: 1.2; }
  .week-header {
    min-height: 84px;
    padding: 10px 2px 8px;
    background: #303134;
    border-bottom: 1px solid #3c4043;
    border-right: 1px solid #3c4043;
    color: #e8eaed;
  }
  .week-header span { color: #9aa0a6; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
  .week-header strong { width: 38px; height: 38px; color: #e8eaed; font-size: clamp(18px, 6vw, 28px); font-weight: 450; }
  .week-view[style*="--days:7"] .week-header strong { width: 31px; height: 31px; font-size: 22px; }
  .week-view[style*="--days:7"] .week-header span { font-size: 10px; }
  .week-header.active-day strong { background: #8ab4f8; color: #202124; }

  .time-col { background: #202124; border-right: 1px solid #3c4043; }
  .time-label { height: 54px; color: #a7adb6; font-size: 12px; padding-right: 8px; top: -10px; }
  .day-col {
    min-height: calc((var(--day-hours, 17)) * 54px);
    border-right: 1px solid #3c4043;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 53px, #3c4043 54px);
  }
  .week-view .day-col, .day-view .day-col { min-height: calc(17 * 54px); }

  .now-line { border-top-color: #e8eaed; }
  .now-line span { background: #e8eaed; width: 12px; height: 12px; top: -6px; left: -6px; }

  .week-event {
    left: 3px;
    right: 3px;
    border: 0;
    border-radius: 6px;
    background: #5e97f6;
    color: #132238;
    box-shadow: none;
    padding: 5px 18px 4px 6px;
    overflow: hidden;
  }
  .week-event strong { color: #132238; font-weight: 800; font-size: 12px; line-height: 1.1; }
  .week-event span { color: #1d2b42; }
  .week-view[style*="--days:7"] .week-event { left: 2px; right: 2px; padding-inline: 3px; font-size: 10px; }
  .week-view[style*="--days:7"] .week-event strong { font-size: 10px; }
  .week-view[style*="--days:7"] .event-time-range { display: none; }
  .task-event { background: #5e97f6; }
  .feed-event { background: #7baaf7; }
  .note-event { background: #81c995; }
  .flash-event { background: #c58af9; }

  .draft-event {
    background: rgba(124, 179, 66, .08) !important;
    border: 2px solid #7cb342 !important;
    color: #d7ead0 !important;
    box-shadow: 0 0 0 2px rgba(124,179,66,.18), 0 0 22px rgba(124,179,66,.18) !important;
    opacity: 1;
  }
  .draft-event strong, .draft-event span { color: #d7ead0 !important; }
  .draft-event .resize-handle { height: 26px; opacity: 1; }
  .draft-event .resize-top::after,
  .draft-event .resize-bottom::after {
    opacity: 1;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #7cb342;
    box-shadow: 0 0 0 7px rgba(124,179,66,.24);
  }
  .draft-event .resize-top::after { left: 22px; top: -12px; transform: none; }
  .draft-event .resize-bottom::after { left: auto; right: 22px; bottom: -12px; transform: none; }

  .month-grid {
    min-width: 100% !important;
    width: 100%;
    min-height: calc(100dvh - 148px);
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: 34px repeat(6, minmax(72px, 1fr));
    background: #202124;
  }
  .month-weekday { height: 34px; background: #303134; color: #a7adb6; border-color: #3c4043; font-size: 12px; }
  .month-cell { min-height: 0; padding: 4px 3px; background: #202124; border-color: #3c4043; overflow: hidden; }
  .month-cell.out { background: #202124; color: #7d8590; }
  .date-number { width: 28px; height: 28px; color: #e8eaed; font-size: 15px; margin: 0 auto 2px; }
  .month-cell.today .date-number { background: #8ab4f8; color: #202124; }
  .event-chip { border: 0; background: #5e97f6; color: #132238; border-radius: 4px; min-height: 16px; padding: 1px 3px; margin-top: 2px; font-size: 10px; white-space: nowrap; overflow: hidden; }
  .event-chip span { overflow: hidden; text-overflow: ellipsis; }
  .event-time { display: none; }
  .more-count { font-size: 10px; color: #a7adb6; margin-top: 2px; }

  .mobile-bottom-nav {
    height: 76px;
    background: #202124;
    border-top: 1px solid #3c4043;
    box-shadow: 0 -14px 30px rgba(0,0,0,.28);
  }
  .mobile-bottom-nav button { color: #a7adb6; }
  .mobile-bottom-nav button:hover,
  .mobile-bottom-nav button:active { background: #303134; color: #e8eaed; }
  .mobile-bottom-nav .mobile-fab {
    top: -24px;
    width: 70px;
    height: 70px;
    border-radius: 22px;
    background: #1558d6;
    color: #fff;
    box-shadow: 0 16px 30px rgba(0,0,0,.38);
  }

  .mobile-create-sheet { right: 18px; bottom: calc(96px + env(safe-area-inset-bottom)); }
  .mobile-create-sheet button { background: #1558d6; border-radius: 28px; color: #fff; box-shadow: 0 18px 34px rgba(0,0,0,.42); }
  .mobile-create-sheet .close-create { background: #303134; color: #e8eaed; }

  .context-editor {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100vw;
    max-height: 44dvh;
    border: 0;
    border-radius: 22px 22px 0 0;
    background: #303134;
    color: #e8eaed;
    box-shadow: 0 -18px 50px rgba(0,0,0,.48);
    padding: 14px 18px calc(env(safe-area-inset-bottom) + 18px);
    z-index: 74;
  }
  .context-head { display: grid; grid-template-columns: 80px 1fr 80px; align-items: center; gap: 8px; color: #e8eaed; }
  .context-head strong { text-align: center; font-size: 16px; }
  .context-cancel, .context-save { border: 0; background: transparent; color: #aecbfa; font-size: 18px; padding: 8px 0; }
  .context-save { text-align: right; font-weight: 750; }
  .context-title { color: #e8eaed; border-bottom-color: #8ab4f8; font-size: 26px; padding-top: 16px; }
  .context-type-row { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .context-type-row button { background: #202124; color: #e8eaed; border-color: #5f6368; }
  .context-type-row button.active { background: #8ab4f8; color: #202124; border-color: #8ab4f8; }
  .context-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .context-grid label:nth-child(4) { grid-column: 1 / -1; }
  .context-grid input, .context-grid select, .context-editor textarea { background: #202124; border-color: #3c4043; color: #e8eaed; }
  .context-editor textarea { min-height: 54px; }
  .context-actions { justify-content: flex-start; }
  .context-time-summary { color: #a7adb6; font-size: 12px; margin: 0; }

  .mobile-search-overlay {
    display: grid;
    grid-template-rows: auto 1fr;
    position: fixed;
    inset: 0;
    z-index: 95;
    background: #202124;
    color: #e8eaed;
    padding-top: env(safe-area-inset-top);
  }
  .mobile-search-bar {
    display: grid;
    grid-template-columns: 46px 1fr 46px;
    gap: 6px;
    align-items: center;
    min-height: 64px;
    padding: 8px 12px;
    background: #303134;
    border-bottom: 1px solid #3c4043;
  }
  .mobile-search-bar input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #e8eaed;
    font-size: 20px;
  }
  .mobile-search-bar input::placeholder { color: #a7adb6; }
  .mobile-search-results { overflow: auto; padding: 10px 0 calc(24px + env(safe-area-inset-bottom)); }
  .mobile-search-result {
    width: 100%;
    border: 0;
    background: transparent;
    color: #e8eaed;
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 16px;
    align-items: center;
    text-align: left;
    padding: 14px 20px;
  }
  .mobile-search-result:active { background: #303134; }
  .mobile-search-result strong { display: block; font-size: 16px; font-weight: 650; }
  .mobile-search-result small { display: block; margin-top: 3px; color: #a7adb6; font-size: 13px; }
  .search-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--dot); }
  .mobile-search-empty { display: grid; gap: 6px; padding: 28px 22px; color: #a7adb6; }
  .mobile-search-empty strong { color: #e8eaed; }

  .mobile-drawer,
  .mobile-ecosystem,
  .modal,
  .settings-modal,
  .voice-modal,
  .briefing-modal { background: #303134; color: #e8eaed; }
  .mobile-wide,
  .mobile-drawer-section,
  .mobile-app-link,
  .setting-card,
  .feed-row,
  .manual-card,
  .draft-card { background: #202124; border-color: #3c4043; }
}

/* v8.6 production polish: theme-safe mobile, clean auth, source-aware feed quick add */
.feed-source-helper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  margin: 12px 0 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 4%);
}
.feed-source-helper div { display: grid; gap: 4px; min-width: 0; }
.feed-source-helper strong { color: var(--primary); }
.feed-source-helper span, .feed-source-helper small { color: var(--muted); line-height: 1.35; }
.feed-source-helper small { grid-column: 1 / -1; }
.feed-bank-tabs { scrollbar-width: thin; }
.feed-bank-tabs button { white-space: nowrap; }
.feed-bank-card { min-width: 0; }
.feed-bank-actions { flex-wrap: wrap; }

.auth-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: normal;
  text-align: center;
  line-height: 1.15;
}
.auth-google b { flex: 0 0 auto; margin-right: 0; }
.auth-panel-inner { max-width: 100%; }

@media (max-width: 760px) {
  body {
    background: var(--mobile-bg);
    color: var(--mobile-text);
  }
  .app-shell {
    background: var(--mobile-bg);
    grid-template-rows: auto 1fr 76px;
  }
  .mobile-topbar {
    background: var(--mobile-surface);
    border-bottom-color: var(--mobile-border);
    color: var(--mobile-text);
    min-height: 70px;
    padding: calc(env(safe-area-inset-top) + 8px) 14px 8px;
  }
  .mobile-icon, .mobile-month, .date-chip {
    color: var(--mobile-text);
  }
  .mobile-icon:active, .mobile-icon:hover {
    background: var(--mobile-surface-2);
  }
  .mobile-month {
    color: var(--mobile-text);
    font-size: 24px;
    min-width: 0;
  }
  .date-chip {
    border-color: color-mix(in srgb, var(--mobile-muted) 70%, transparent);
    background: var(--mobile-surface);
  }
  .avatar {
    background: linear-gradient(135deg, var(--mobile-accent), color-mix(in srgb, var(--mobile-accent) 75%, var(--mobile-primary)));
    color: #fff;
  }
  .main,
  .calendar-stage,
  .week-view,
  .day-view,
  .time-col,
  .day-col,
  .month-grid,
  .month-cell,
  .month-cell.out {
    background: var(--mobile-bg);
    color: var(--mobile-text);
  }
  .main { height: calc(100dvh - 146px); }
  .calendar-stage {
    border: 0;
    border-radius: 0;
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
  }
  .week-view, .day-view {
    grid-template-rows: 78px auto;
    grid-template-columns: 58px repeat(var(--days), minmax(0, 1fr));
  }
  .day-view { grid-template-columns: 62px minmax(0, 1fr); }
  .week-view[style*="--days:7"] { grid-template-columns: 42px repeat(7, minmax(0, 1fr)); }
  .week-view[style*="--days:3"] { grid-template-columns: 50px repeat(3, minmax(0, 1fr)); }
  .week-header-spacer,
  .week-header,
  .month-weekday {
    background: var(--mobile-surface);
    color: var(--mobile-text);
    border-color: var(--mobile-border);
  }
  .week-header-spacer,
  .week-header { min-height: 78px; }
  .tz-label,
  .week-header span,
  .time-label,
  .month-weekday,
  .more-count,
  .event-time-range {
    color: var(--mobile-muted);
  }
  .week-header strong,
  .date-number {
    color: var(--mobile-text);
  }
  .week-header.active-day strong,
  .month-cell.today .date-number {
    background: var(--mobile-accent);
    color: #fff;
  }
  html[data-theme-mode="light"] .week-header.active-day strong,
  html[data-theme-mode="light"] .month-cell.today .date-number {
    color: #0b1530;
  }
  .time-col { border-right-color: var(--mobile-border); }
  .day-col {
    border-right-color: var(--mobile-border);
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 53px, var(--mobile-border) 54px), var(--mobile-bg);
  }
  .now-line { border-top-color: var(--mobile-accent); }
  .now-line span { background: var(--mobile-accent); }
  .week-event,
  .event-chip,
  .task-event,
  .feed-event,
  .note-event,
  .flash-event {
    background: var(--event-color, var(--mobile-accent));
    color: #fff;
    border: 0;
  }
  .week-event strong,
  .week-event span,
  .event-chip,
  .event-chip span {
    color: #fff;
  }
  html[data-theme-mode="light"] .week-event,
  html[data-theme-mode="light"] .event-chip {
    color: #0b1530;
  }
  html[data-theme-mode="light"] .week-event strong,
  html[data-theme-mode="light"] .week-event span,
  html[data-theme-mode="light"] .event-chip,
  html[data-theme-mode="light"] .event-chip span {
    color: #0b1530;
  }
  .draft-event {
    --active-draft: var(--event-color, var(--draft-color, var(--mobile-accent)));
    background: color-mix(in srgb, var(--active-draft) 12%, transparent) !important;
    border: 2px solid var(--active-draft) !important;
    color: var(--mobile-text) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--active-draft) 18%, transparent), 0 0 22px color-mix(in srgb, var(--active-draft) 20%, transparent) !important;
  }
  .draft-event strong,
  .draft-event span {
    color: var(--mobile-text) !important;
  }
  .draft-event .resize-top::after,
  .draft-event .resize-bottom::after {
    background: var(--active-draft);
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--active-draft) 24%, transparent);
  }
  .month-grid {
    min-height: calc(100dvh - 146px);
    border-top: 1px solid var(--mobile-border);
  }
  .month-weekday,
  .month-cell {
    border-color: var(--mobile-border);
  }
  .month-cell { min-height: 0; }
  .mobile-bottom-nav {
    background: color-mix(in srgb, var(--mobile-surface) 94%, transparent);
    border-top-color: var(--mobile-border);
    box-shadow: 0 -12px 26px color-mix(in srgb, #000 14%, transparent);
  }
  .mobile-bottom-nav button { color: var(--mobile-muted); }
  .mobile-bottom-nav button:hover,
  .mobile-bottom-nav button:active {
    color: var(--mobile-text);
    background: var(--mobile-surface-2);
  }
  .mobile-bottom-nav .mobile-fab,
  .mobile-create-sheet button {
    background: var(--mobile-accent);
    color: #fff;
  }
  .mobile-create-sheet .close-create {
    background: var(--mobile-surface);
    color: var(--mobile-text);
    border: 1px solid var(--mobile-border);
  }
  .context-editor {
    max-height: 50dvh;
    background: var(--mobile-surface);
    color: var(--mobile-text);
    border-top: 1px solid var(--mobile-border);
    overflow: auto;
  }
  .context-head { color: var(--mobile-text); }
  .context-cancel, .context-save { color: var(--mobile-accent); }
  .context-title {
    color: var(--mobile-text);
    border-bottom-color: var(--mobile-accent);
  }
  .context-title::placeholder { color: color-mix(in srgb, var(--mobile-muted) 82%, transparent); }
  .context-type-row button,
  .context-grid input,
  .context-grid select,
  .context-editor textarea {
    background: var(--mobile-surface-2);
    color: var(--mobile-text);
    border-color: var(--mobile-border);
  }
  .context-type-row button.active {
    background: var(--mobile-accent);
    color: #fff;
    border-color: var(--mobile-accent);
  }
  html[data-theme-mode="light"] .context-type-row button.active { color: #0b1530; }
  .context-time-summary { color: var(--mobile-muted); }
  .mobile-search-overlay {
    background: var(--mobile-bg);
    color: var(--mobile-text);
  }
  .mobile-search-bar {
    background: var(--mobile-surface);
    border-bottom-color: var(--mobile-border);
  }
  .mobile-search-bar input { color: var(--mobile-text); }
  .mobile-search-bar input::placeholder { color: var(--mobile-muted); }
  .mobile-search-result { color: var(--mobile-text); }
  .mobile-search-result:active { background: var(--mobile-surface-2); }
  .mobile-search-result small,
  .mobile-search-empty { color: var(--mobile-muted); }
  .mobile-search-empty strong { color: var(--mobile-text); }
  .mobile-drawer,
  .mobile-ecosystem,
  .modal,
  .settings-modal,
  .voice-modal,
  .briefing-modal {
    background: var(--mobile-surface);
    color: var(--mobile-text);
  }
  .mobile-wide,
  .mobile-drawer-section,
  .mobile-app-link,
  .setting-card,
  .feed-row,
  .manual-card,
  .draft-card,
  .feed-source-helper {
    background: var(--mobile-surface-2);
    border-color: var(--mobile-border);
    color: var(--mobile-text);
  }
  .feed-source-helper strong,
  .mobile-sheet-head,
  .settings-content h2,
  .modal-title { color: var(--mobile-text); }
  .feed-source-helper span,
  .feed-source-helper small,
  .muted { color: var(--mobile-muted); }
  .feed-bank-modal {
    width: 100vw;
    height: min(88dvh, 760px);
    max-height: 88dvh;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
  }
  .feed-bank-modal .modal-body {
    overflow: auto;
    padding: 0 16px 18px;
  }
  .compact-feed-toolbar { display: grid; gap: 12px; }
  .feed-bank-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 10px;
  }
  .feed-bank-tabs button {
    flex: 0 0 auto;
    min-width: 72px;
    min-height: 42px;
  }
  .feed-schedule-controls {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .feed-schedule-controls label,
  .feed-schedule-controls button { min-width: 0; }
  .horizontal-feed-grid,
  .feed-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    overflow: visible;
  }
  .feed-bank-card {
    width: 100%;
    min-width: 0;
  }
  .feed-bank-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .feed-bank-actions button { flex: 1 1 auto; min-width: 96px; }
  .insight-subscribe-strip {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .auth-screen {
    padding: 12px;
    background: linear-gradient(180deg, #f7f9fd, #edf4ff);
    place-items: center;
  }
  .auth-shell {
    width: min(430px, calc(100vw - 24px));
    height: auto;
    max-height: calc(100dvh - 24px);
    min-height: 0;
    grid-template-columns: 1fr;
    border-radius: 24px;
    overflow: auto;
  }
  .auth-hero { display: none; }
  .auth-panel {
    padding: 28px 0 22px;
    overflow: visible;
  }
  .auth-panel-inner {
    width: min(360px, calc(100% - 40px));
  }
  .auth-logo-row { margin-bottom: 14px; }
  .auth-logo-row strong { font-size: 21px; white-space: nowrap; }
  .auth-mode-pill { margin-bottom: 12px; }
  .auth-panel h2 { font-size: 32px; }
  .auth-copy {
    margin: 10px 0 16px;
    font-size: 14px;
    line-height: 1.45;
  }
  .auth-field { margin-top: 10px; }
  .auth-input-wrap {
    height: 48px;
    border-radius: 16px;
  }
  .auth-input-wrap i { width: 40px; }
  .auth-eye { width: 40px; }
  .auth-meta-row {
    margin: 12px 0 14px;
    gap: 8px;
    font-size: 12px;
  }
  .auth-primary,
  .ghost-button,
  .auth-google {
    min-height: 48px;
    border-radius: 16px;
    font-size: 14px;
  }
  .auth-divider { margin: 14px 0 10px; gap: 10px; }
  .auth-switch { margin-top: 12px; font-size: 13px; }
  .ghost-button { margin-top: 8px; }
  .auth-error:not(:empty) { margin-top: 10px; font-size: 13px; }
  .auth-footer { display: none !important; }
}

/* v8.7 mobile calendar refinement: default-light, compact Google-style month popover, uniform 3-day/week grids */
.mobile-month-panel { display: none; }

@media (max-width: 760px) {
  html[data-theme-mode="light"] body,
  html[data-theme-mode="light"] .app-shell,
  html[data-theme-mode="light"] .main,
  html[data-theme-mode="light"] .calendar-stage,
  html[data-theme-mode="light"] .week-view,
  html[data-theme-mode="light"] .day-view,
  html[data-theme-mode="light"] .time-col,
  html[data-theme-mode="light"] .day-col,
  html[data-theme-mode="light"] .month-grid,
  html[data-theme-mode="light"] .month-cell,
  html[data-theme-mode="light"] .month-cell.out {
    background: var(--mobile-bg);
  }

  .mobile-topbar {
    position: relative;
    z-index: 82;
    height: 70px;
  }

  .mobile-month-panel {
    display: block;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 81;
    background: var(--mobile-surface);
    color: var(--mobile-text);
    border-bottom: 1px solid var(--mobile-border);
    box-shadow: 0 18px 34px color-mix(in srgb, #000 18%, transparent);
    padding: 10px 16px 12px;
    max-height: min(54dvh, 430px);
    overflow: auto;
    overscroll-behavior: contain;
  }

  .mobile-month-panel-head {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
  }

  .mobile-month-panel-head strong {
    text-align: center;
    font-size: 16px;
    font-weight: 780;
    color: var(--mobile-text);
  }

  .mobile-month-nav {
    width: 38px;
    height: 34px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--mobile-muted);
    font-size: 28px;
    line-height: 1;
  }

  .mobile-month-nav:active { background: var(--mobile-surface-2); color: var(--mobile-text); }

  .mobile-month-expanded-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px 4px;
    align-items: center;
  }

  .mobile-month-weekday {
    height: 24px;
    display: grid;
    place-items: center;
    color: var(--mobile-muted);
    font-size: 12px;
    font-weight: 760;
    text-transform: uppercase;
  }

  .mobile-month-date {
    min-width: 0;
    height: 42px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--mobile-text);
    display: grid;
    grid-template-rows: 24px 10px;
    justify-items: center;
    align-items: center;
    padding: 3px 0 2px;
  }

  .mobile-month-date.out { color: color-mix(in srgb, var(--mobile-muted) 58%, transparent); }
  .mobile-month-date:active { background: var(--mobile-surface-2); }

  .mobile-month-date span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 18px;
    line-height: 1;
  }

  .mobile-month-date.today span {
    box-shadow: inset 0 0 0 1.5px var(--mobile-accent);
  }

  .mobile-month-date.selected span {
    background: var(--mobile-accent);
    color: #fff;
    box-shadow: none;
  }

  html[data-theme-mode="light"] .mobile-month-date.selected span { color: #0b1530; }

  .mobile-month-date em {
    display: flex;
    gap: 3px;
    height: 8px;
    max-width: 28px;
    overflow: hidden;
  }

  .mobile-month-date i {
    width: 5px;
    height: 5px;
    flex: 0 0 5px;
    border-radius: 50%;
    background: var(--dot, var(--mobile-accent));
  }

  .mobile-month-rail.expanded {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 12px 0 2px;
    scrollbar-width: none;
  }

  .mobile-month-rail.expanded button {
    flex: 0 0 auto;
    min-width: 74px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--mobile-border) 90%, var(--mobile-muted) 10%);
    background: transparent;
    color: var(--mobile-text);
    font-size: 16px;
    font-weight: 720;
  }

  .mobile-month-rail.expanded button.active {
    background: var(--mobile-accent);
    color: #fff;
    border-color: var(--mobile-accent);
  }

  html[data-theme-mode="light"] .mobile-month-rail.expanded button.active { color: #0b1530; }

  .week-view,
  .day-view {
    overflow: visible;
    width: 100%;
    min-width: 100% !important;
    grid-template-rows: 64px auto;
  }

  .week-view { grid-template-columns: 58px repeat(var(--days), minmax(0, 1fr)); }
  .day-view { grid-template-columns: 62px minmax(0, 1fr); }
  .week-view[style*="--days:7"] { grid-template-columns: 58px repeat(7, minmax(0, 1fr)); }
  .week-view[style*="--days:3"] { grid-template-columns: 58px repeat(3, minmax(0, 1fr)); }

  .week-header-spacer,
  .week-header {
    min-height: 64px;
    height: 64px;
    padding: 6px 1px 5px;
    overflow: hidden;
  }

  .week-header-spacer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-inline: 3px;
  }

  .tz-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
    font-size: 10px;
    letter-spacing: -.02em;
  }

  .week-header div {
    min-width: 0;
    width: 100%;
    display: grid;
    justify-items: center;
    gap: 2px;
  }

  .week-header span {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
    text-align: center;
    font-size: 10px;
    letter-spacing: .06em;
  }

  .week-header strong {
    width: 32px;
    height: 32px;
    font-size: 21px;
    font-weight: 560;
    line-height: 1;
  }

  .week-view[style*="--days:7"] .week-header strong {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }

  .week-view[style*="--days:7"] .week-header span { font-size: 9px; }
  .week-view[style*="--days:3"] .week-header strong { width: 36px; height: 36px; font-size: 24px; }

  .time-label {
    height: 54px;
    padding-right: 6px;
    font-size: 11px;
    line-height: 1.05;
    white-space: normal;
    text-align: right;
  }

  .day-col {
    min-width: 0;
    overflow: hidden;
  }

  .week-event {
    left: 3px;
    right: 3px;
    min-width: 0;
    display: block;
    padding: 4px 5px;
  }

  .week-event .event-main {
    display: flex;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
    overflow: hidden;
  }

  .week-event strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
  }

  .week-view[style*="--days:7"] .week-event {
    left: 1px;
    right: 1px;
    padding: 2px 3px;
    border-radius: 5px;
  }

  .week-view[style*="--days:7"] .week-event strong { font-size: 9px; }
  .week-view[style*="--days:3"] .week-event strong { font-size: 11px; }

  .draft-event {
    background: color-mix(in srgb, var(--active-draft) 14%, transparent) !important;
    border-width: 2px !important;
  }

  .draft-event .event-main,
  .draft-event .mini-edit { display: none; }

  .draft-event .event-time-range {
    display: block;
    color: var(--mobile-text) !important;
    font-size: 11px;
    font-weight: 760;
  }

  .context-editor {
    max-height: min(52dvh, 470px);
    border-radius: 24px 24px 0 0;
  }
}

/* v8.8 refinement: make drag/resize time handles small and clean everywhere. */
.resize-handle {
  background: transparent !important;
}

.resize-top::after,
.resize-bottom::after {
  width: 12px !important;
  height: 3px !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  opacity: .44;
}

.week-event:hover .resize-top::after,
.week-event:hover .resize-bottom::after,
.is-resizing .resize-top::after,
.is-resizing .resize-bottom::after {
  width: 12px !important;
  height: 3px !important;
  opacity: .72 !important;
}

.draft-event .resize-top::after,
.draft-event .resize-bottom::after {
  width: 9px !important;
  height: 9px !important;
  border-radius: 50% !important;
  background: var(--active-draft, var(--event-color, var(--mobile-accent, var(--accent)))) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--active-draft, var(--event-color, var(--mobile-accent, var(--accent)))) 18%, transparent) !important;
  opacity: .92 !important;
}

.draft-event .resize-top::after {
  left: 12px !important;
  top: -5px !important;
  transform: none !important;
}

.draft-event .resize-bottom::after {
  left: auto !important;
  right: 12px !important;
  bottom: -5px !important;
  transform: none !important;
}

.now-line span {
  width: 8px !important;
  height: 8px !important;
  top: -4px !important;
  left: -4px !important;
}

@media (max-width: 760px) {
  .resize-handle {
    height: 14px !important;
  }

  .draft-event .resize-handle {
    height: 16px !important;
  }

  .resize-top::after,
  .resize-bottom::after,
  .week-event:hover .resize-top::after,
  .week-event:hover .resize-bottom::after,
  .is-resizing .resize-top::after,
  .is-resizing .resize-bottom::after {
    width: 10px !important;
    height: 3px !important;
  }

  .draft-event .resize-top::after,
  .draft-event .resize-bottom::after {
    width: 8px !important;
    height: 8px !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--active-draft, var(--event-color, var(--mobile-accent, var(--accent)))) 16%, transparent) !important;
  }

  .draft-event .resize-top::after {
    left: 10px !important;
    top: -4px !important;
  }

  .draft-event .resize-bottom::after {
    right: 10px !important;
    bottom: -4px !important;
  }

  .now-line span {
    width: 7px !important;
    height: 7px !important;
    top: -3.5px !important;
    left: -3.5px !important;
  }
}

/* Legal consent notice: narrow, neutral, and non-invasive. */
.legal-consent-banner {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 9900;
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  color: var(--text);
  box-shadow: 0 18px 50px rgba(15,23,42,.18);
  backdrop-filter: blur(18px);
}
.legal-consent-copy { display: grid; gap: 4px; min-width: 0; }
.legal-consent-copy strong { color: var(--primary); }
.legal-consent-copy span { color: var(--muted); font-size: 13px; line-height: 1.38; }
.legal-consent-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 3px; }
.legal-consent-links a { color: var(--accent); font-size: 12px; font-weight: 800; text-decoration: none; }
.legal-consent-actions { display: flex; align-items: center; gap: 8px; }

/* Mobile-only Settings redesign: iOS-style grouped list. Web settings remain unchanged. */
@media (max-width: 760px) {
  .mobile-settings-backdrop {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    background: #000;
  }
  .mobile-settings-modal {
    width: 100vw !important;
    height: 100dvh !important;
    max-height: none !important;
    border-radius: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
    color: #fff !important;
    overflow: hidden !important;
    display: grid;
    grid-template-rows: auto auto 1fr;
  }
  .ios-settings-status {
    min-height: calc(env(safe-area-inset-top) + 46px);
    padding: calc(env(safe-area-inset-top) + 12px) 22px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    font-weight: 800;
    letter-spacing: -.02em;
    font-size: 15px;
  }
  .ios-settings-title {
    position: relative;
    padding: 12px 20px 24px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .ios-settings-title h2 {
    margin: 0;
    color: #fff;
    font-size: 21px;
    letter-spacing: -.04em;
  }
  .ios-close {
    position: absolute;
    right: 18px;
    top: 6px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    color: #fff;
    font-size: 22px;
  }
  .ios-settings-list {
    padding: 22px 16px calc(32px + env(safe-area-inset-bottom));
    overflow: auto;
    background: #000;
  }
  .ios-settings-group {
    overflow: hidden;
    margin: 0 0 34px;
    border-radius: 14px;
    background: #1c1c1e;
    border: .5px solid rgba(255,255,255,.06);
  }
  .ios-settings-row {
    width: 100%;
    min-height: 58px;
    border: 0;
    border-bottom: .5px solid rgba(255,255,255,.12);
    background: transparent;
    color: #fff;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 10px 14px;
    text-align: left;
  }
  .ios-settings-row:last-child { border-bottom: 0; }
  .ios-settings-row:active { background: rgba(255,255,255,.08); }
  .ios-settings-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    background: var(--ios-icon, #0a84ff);
    color: #fff;
    font-style: normal;
    font-size: 17px;
    font-weight: 800;
    box-shadow: inset 0 0 0 .5px rgba(255,255,255,.16), 0 1px 2px rgba(0,0,0,.28);
  }
  .ios-settings-label { display: grid; gap: 2px; min-width: 0; }
  .ios-settings-label strong {
    color: #f5f5f7;
    font-size: 19px;
    font-weight: 500;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ios-settings-label small {
    color: #8e8e93;
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ios-settings-chevron {
    color: #636366;
    font-size: 34px;
    font-weight: 300;
    line-height: 1;
  }
  .ios-subpage-head {
    min-height: calc(env(safe-area-inset-top) + 58px);
    padding: calc(env(safe-area-inset-top) + 10px) 12px 10px;
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) 64px;
    align-items: center;
    gap: 8px;
    background: #000;
    border-bottom: 1px solid rgba(255,255,255,.10);
    color: #fff;
  }
  .ios-subpage-head strong {
    text-align: center;
    color: #fff;
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ios-subpage-head button {
    border: 0;
    background: transparent;
    color: #0a84ff;
    font-size: 16px;
    text-align: left;
    padding: 8px 4px;
  }
  .ios-subpage-head button:last-child { text-align: right; }
  .ios-settings-content {
    padding: 18px 16px calc(34px + env(safe-area-inset-bottom)) !important;
    overflow: auto;
    background: #000 !important;
    color: #fff !important;
  }
  .ios-settings-content h2 {
    color: #fff !important;
    font-size: 26px !important;
    margin: 0 0 8px !important;
  }
  .ios-settings-content .muted,
  .ios-settings-content .setting-card p,
  .ios-settings-content .setting-card small {
    color: #a1a1a6 !important;
  }
  .ios-settings-content .settings-grid,
  .ios-settings-content .form-grid,
  .ios-settings-content .two-col {
    grid-template-columns: 1fr !important;
  }
  .ios-settings-content .setting-card,
  .ios-settings-content .plugin-row,
  .ios-settings-content .feed-row,
  .ios-settings-content .subscription-row,
  .ios-settings-content .manual-row,
  .ios-settings-content .draft-card,
  .ios-settings-content .check-row,
  .ios-settings-content .preset-card,
  .ios-settings-content .premium-lock {
    background: #1c1c1e !important;
    border-color: rgba(255,255,255,.10) !important;
    color: #f5f5f7 !important;
    box-shadow: none !important;
  }
  .ios-settings-content .setting-card {
    border-radius: 16px !important;
    padding: 16px !important;
  }
  .ios-settings-content .setting-card h3,
  .ios-settings-content .plugin-row strong,
  .ios-settings-content .feed-row strong,
  .ios-settings-content .manual-row strong {
    color: #fff !important;
  }
  .ios-settings-content .field input,
  .ios-settings-content .field select,
  .ios-settings-content .field textarea,
  .ios-settings-content input,
  .ios-settings-content select,
  .ios-settings-content textarea {
    background: #2c2c2e !important;
    border-color: rgba(255,255,255,.12) !important;
    color: #fff !important;
  }
  .ios-settings-content .ghost-btn,
  .ios-settings-content .primary-btn,
  .ios-settings-content .danger-btn {
    min-height: 42px;
    border-radius: 12px;
  }
  .legal-consent-banner {
    grid-template-columns: 1fr;
    left: 12px;
    right: 12px;
    bottom: calc(90px + env(safe-area-inset-bottom));
    background: rgba(28,28,30,.96);
    border-color: rgba(255,255,255,.12);
    color: #fff;
  }
  .legal-consent-copy strong { color: #fff; }
  .legal-consent-copy span { color: #a1a1a6; }
  .legal-consent-actions { justify-content: stretch; }
  .legal-consent-actions button { flex: 1; }
}

/* Feed planner upgrade — keeps the existing Insightus visual language while making feeds easier to understand. */
.feed-settings-hero {
  display: grid;
  grid-template-columns: 1.45fr .95fr;
  gap: 18px;
  align-items: stretch;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface));
  box-shadow: 0 16px 40px rgba(15, 23, 42, .055);
  margin-bottom: 16px;
}
.feed-settings-hero h2 { margin: 4px 0 6px; color: var(--primary); letter-spacing: -.03em; }
.feed-settings-hero p { margin: 0; color: var(--muted); line-height: 1.5; max-width: 760px; }
.feed-stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.feed-stat-strip div { border: 1px solid var(--border); background: rgba(255,255,255,.72); border-radius: 18px; padding: 13px; display: grid; gap: 5px; min-width: 0; }
.feed-stat-strip strong { color: var(--primary); font-size: 18px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-stat-strip span { color: var(--muted); font-size: 12px; font-weight: 750; }
.feed-planner-card { display: grid; gap: 16px; }
.feed-step-head { display: flex; gap: 12px; align-items: flex-start; }
.feed-step-head > span { width: 30px; height: 30px; border-radius: 999px; background: var(--primary); color: white; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; flex: 0 0 auto; }
.feed-step-head h3 { margin: 0 0 3px; }
.feed-step-head p { margin: 0; color: var(--muted); line-height: 1.45; }
.feed-planner-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.feed-planner-grid .full { grid-column: 1 / -1; }
.weekday-picker, .feed-custom-days-mini { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.weekday-picker label, .feed-custom-days-mini label { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 8px 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; }
.feed-custom-days-mini { border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 8px; }
.feed-custom-days-mini > span { color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; margin-right: 3px; }
.feed-action-row { justify-content: flex-end; flex-wrap: wrap; }
.primary-btn.strong { box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 20%, transparent); }
.feed-template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.feed-template-card { border: 1px solid var(--border); background: var(--surface); border-radius: 16px; padding: 13px; display: grid; gap: 8px; min-width: 0; }
.feed-template-card strong { color: var(--primary); line-height: 1.2; }
.feed-template-card small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-management-section { margin-top: 18px; }
.feed-manager-row { border: 1px solid var(--border); border-radius: 18px; background: var(--surface); padding: 14px; margin: 10px 0; display: grid; gap: 12px; box-shadow: 0 8px 24px rgba(15,23,42,.035); }
.feed-manager-row.disabled { opacity: .64; }
.feed-manager-summary { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.feed-manager-summary strong { color: var(--primary); }
.feed-manager-summary small { display: block; color: var(--muted); margin-top: 2px; }
.feed-toggle input { display: none; }
.feed-toggle span { width: 44px; height: 26px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); position: relative; display: inline-block; transition: .2s ease; }
.feed-toggle span:after { content: ''; position: absolute; width: 20px; height: 20px; left: 2px; top: 2px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(15,23,42,.22); transition: .2s ease; }
.feed-toggle input:checked + span { background: var(--accent); border-color: var(--accent); }
.feed-toggle input:checked + span:after { transform: translateX(18px); }
.feed-inline-editor { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 10px; }
.feed-inline-editor label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 800; }
.feed-inline-editor input, .feed-inline-editor select { min-height: 38px; border: 1px solid var(--border); border-radius: 11px; padding: 0 10px; background: var(--surface); color: var(--text); }
.feed-row-actions { flex-wrap: wrap; justify-content: flex-end; }
.loaded-feed-panel { margin-top: 18px; }
.loaded-feed-row small { max-height: 2.7em; overflow: hidden; }
.feed-click-card { margin-top: 14px; }

@media (max-width: 900px) {
  .feed-settings-hero { grid-template-columns: 1fr; padding: 16px; }
  .feed-stat-strip { grid-template-columns: 1fr; }
  .feed-planner-grid, .feed-template-grid, .feed-inline-editor { grid-template-columns: 1fr; }
  .feed-manager-summary { grid-template-columns: auto 1fr; }
  .feed-manager-summary .badge { grid-column: 2; width: fit-content; }
  .feed-row-actions { justify-content: stretch; }
  .feed-row-actions button { flex: 1 1 130px; }
}
