* { box-sizing: border-box; }
:root {
  color-scheme: dark;
  --bg: #0b1220; --panel: #121e30; --panel2: #19283d;
  --line: #2a3b53; --text: #eef4fc; --muted: #9aabc1;
  --accent: #66a9ef; --accent2: #254d78;
}
html, body { margin:0; width:100%; min-height:100%; background:var(--bg); color:var(--text); font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
body { min-height:100vh; min-height:100dvh; padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
.dashboard { width:100%; min-height:calc(100vh - 28px); min-height:calc(100dvh - 28px); display:grid; grid-template-columns:minmax(245px, .78fr) minmax(0, 1.7fr); gap:16px; }
.clock-panel,.calendar-panel { background:var(--panel); border:1px solid #1c2b40; border-radius:22px; box-shadow:0 18px 50px rgba(0,0,0,.18); }
.clock-panel { padding:clamp(22px,3vw,42px); display:flex; flex-direction:column; justify-content:center; background:linear-gradient(155deg,#172940,#101a2a 72%); }
.eyebrow { color:var(--muted); font-size:clamp(9px,.85vw,12px); font-weight:700; letter-spacing:.16em; }
.clock { margin-top:18px; font-size:clamp(64px,9vw,128px); font-weight:650; line-height:.95; letter-spacing:-.075em; font-variant-numeric:tabular-nums; white-space:nowrap; }
.ampm { min-height:25px; color:var(--muted); font-size:clamp(14px,1.5vw,20px); font-weight:600; letter-spacing:.16em; margin-top:12px; }
.rule { height:1px; background:var(--line); margin:28px 0 22px; }
.weekday { font-size:clamp(23px,2.8vw,38px); font-weight:600; }
.full-date { color:var(--muted); margin-top:8px; font-size:clamp(14px,1.5vw,19px); }
.clock-footer { margin-top: auto; padding-top:35px; display:flex; align-items:center; gap:9px; color:var(--muted); font-size:12px; }
.status-dot { width:8px; height:8px; border-radius:50%; background:#66758a; }
.status-dot.connected { background:#54c69a; box-shadow:0 0 12px #54c69a66; }
.calendar-panel { padding:clamp(18px,2.3vw,30px); display:flex; flex-direction:column; min-width:0; }
.calendar-header,.agenda-heading,.calendar-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; }
h1 { margin:7px 0 0; font-size:clamp(24px,3vw,38px); font-weight:650; letter-spacing:-.04em; }
.header-actions,.footer-actions { display:flex; align-items:center; gap:8px; }
button { font:inherit; color:var(--text); cursor:pointer; border:1px solid var(--line); background:var(--panel2); border-radius:10px; min-height:38px; }
.icon-button { width:40px; font-size:26px; line-height:1; }
.today-button,.refresh-button,.quiet-button { padding:0 13px; color:#c6d5e8; font-size:13px; }
.calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px; margin-top:22px; }
.weekday-label { color:var(--muted); text-align:center; font-size:10px; font-weight:700; letter-spacing:.1em; padding:7px 0; }
.day { position:relative; min-height:clamp(38px,5.2vw,63px); padding:7px 8px; border-radius:10px; background:#17263a; border:1px solid transparent; font-size:clamp(12px,1.3vw,16px); font-variant-numeric:tabular-nums; }
.day.other { color:#60718a; background:transparent; }
.day.today { border-color:var(--accent); background:#1c3857; }
.day.selected { background:#254d78; }
.day-number { display:block; }
.event-dots { display:flex; gap:3px; margin-top:6px; }
.event-dot { width:5px; height:5px; border-radius:50%; background:#75b7f7; }
.agenda { margin-top:clamp(16px,2vw,24px); border-top:1px solid var(--line); padding-top:16px; min-height:0; }
h2 { margin:5px 0 0; font-size:clamp(16px,1.8vw,22px); font-weight:600; }
.refresh-button { width:38px; padding:0; font-size:21px; }
.agenda-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:12px; max-height:190px; overflow:auto; }
.event-card { display:flex; gap:10px; padding:10px 12px; background:#17263a; border-radius:10px; min-width:0; }
.event-time { color:#8fc5fa; font-size:11px; font-weight:700; white-space:nowrap; min-width:58px; }
.event-info { min-width:0; }
.event-title { font-size:12px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.event-meta { color:var(--muted); font-size:10px; margin-top:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.empty-state { color:var(--muted); font-size:12px; padding:12px 0; grid-column:1/-1; }
.calendar-footer { border-top:1px solid var(--line); margin-top:auto; padding-top:14px; color:var(--muted); font-size:11px; min-width:0; }
#account-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.primary-button { background:#27649d; border-color:#367dbb; padding:0 15px; font-size:12px; font-weight:650; }
.quiet-button { background:transparent; }
.message { color:#f2c67c; font-size:11px; min-height:14px; margin-top:8px; }
button:active { transform:scale(.98); }
button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media (orientation:portrait), (max-width:700px) {
  .dashboard { grid-template-columns:1fr; }
  .clock-panel { min-height:230px; }
  .clock { font-size:76px; }
  .clock-footer { padding-top:20px; }
  .calendar-panel { min-height:620px; }
  .agenda-list { grid-template-columns:1fr; max-height:220px; }
}
