:root {
    --bg: #050912;
    --bg-soft: #08111f;
    --surface: #0b1423;
    --surface-2: #101d31;
    --surface-3: #13233a;
    --ink: #f7f9fc;
    --muted: #8d9ab0;
    --line: rgba(148, 163, 184, .16);
    --line-strong: rgba(212, 175, 55, .30);
    --blue: #2677ff;
    --blue-2: #4d91ff;
    --gold: #d4af37;
    --gold-soft: #f0cf69;
    --danger: #ef6461;
    --success: #48c78e;
    --warning: #e9b949;
    --shadow: 0 24px 70px rgba(0, 0, 0, .38);
    --shadow-soft: 0 12px 34px rgba(0, 0, 0, .22);
    --radius: 22px;
    --radius-sm: 14px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html {
    min-width: 0;
    min-height: 100%;
    background: var(--bg);
    color-scheme: dark;
}
body {
    margin: 0;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 50% -10%, rgba(38,119,255,.18), transparent 34%),
        linear-gradient(180deg, #050912 0%, #070d18 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.hidden { display: none !important; }

/* ---------- Identidad ---------- */
.brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    position: relative;
    flex: 0 0 auto;
    color: #050912;
    background: linear-gradient(145deg, var(--gold-soft), var(--gold));
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 10px 28px rgba(212,175,55,.18), inset 0 1px 0 rgba(255,255,255,.35);
    overflow: hidden;
}
.brand-mark::after {
    content: "";
    position: absolute;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    border: 2px solid rgba(5,9,18,.22);
}
.brand-mark span {
    position: relative;
    z-index: 1;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -.08em;
    transform: translateX(-1px);
}
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; }
.brand-mark.small::after { width: 30px; height: 30px; border-radius: 9px; }
.brand-mark.small span { font-size: 20px; }

.eyebrow {
    margin: 0 0 6px;
    font-size: 10px;
    line-height: 1.15;
    font-weight: 850;
    letter-spacing: .16em;
    color: var(--gold);
}

/* ---------- Estructura ---------- */
.app-shell { width: 100%; min-width: 0; }
.topbar {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 76px;
    padding-top: var(--safe-top);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
}
.brand-line { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-line strong {
    display: block;
    font-size: 17px;
    letter-spacing: -.02em;
    white-space: nowrap;
}
.top-actions { display: flex; gap: 8px; }
.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--line);
    color: #dbe7fb;
    background: rgba(11,20,35,.86);
    display: grid;
    place-items: center;
    position: relative;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.icon-btn:hover { background: var(--surface-2); border-color: rgba(77,145,255,.46); transform: translateY(-1px); }
.mini-indicator {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    right: 5px;
    top: 5px;
    background: #596478;
    border: 2px solid var(--surface);
}
.mini-indicator.on { background: var(--gold); }

.content {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 22px 0 calc(32px + var(--safe-bottom));
    min-width: 0;
}

/* ---------- Reloj principal ---------- */
.hero-strip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 36px 0 28px;
}
.hero-time {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-time .eyebrow { margin-bottom: 10px; }
.clock {
    width: 100%;
    text-align: center;
    font-size: clamp(48px, 8vw, 88px);
    line-height: .95;
    font-weight: 850;
    letter-spacing: -.055em;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
    text-shadow: 0 10px 35px rgba(38,119,255,.18);
}
.date-line {
    width: 100%;
    margin-top: 14px;
    text-align: center;
    color: #aab8cd;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .01em;
}
.activity-now {
    width: min(620px, 100%);
    min-width: 0;
    padding: 15px 18px;
    border-radius: 17px;
    background: linear-gradient(135deg, rgba(38,119,255,.16), rgba(11,20,35,.92));
    border: 1px solid rgba(77,145,255,.26);
    box-shadow: var(--shadow-soft);
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: 12px;
}
.activity-label {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    color: #06101f;
    background: var(--gold);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .12em;
}
.activity-now strong { min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.activity-now small { color: #8fa2bd; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.schedule-strip {
    display: flex;
    width: 100%;
    min-width: 0;
    gap: 8px;
    padding: 2px 0 6px;
    overflow-x: auto;
    scrollbar-width: none;
}
.schedule-strip::-webkit-scrollbar { display: none; }
.schedule-chip {
    flex: 0 0 auto;
    min-width: 104px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(11,20,35,.66);
}
.schedule-chip span { font-size: 12px; font-weight: 750; }
.schedule-chip small { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.schedule-chip.active {
    background: rgba(38,119,255,.17);
    border-color: rgba(77,145,255,.54);
    color: #edf4ff;
}
.schedule-chip.active small { color: var(--gold-soft); }

/* ---------- Calendario ---------- */
.calendar-section {
    margin-top: 24px;
    padding: 24px;
    border-radius: 24px;
    background: rgba(11,20,35,.72);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}
.calendar-toolbar {
    display: grid;
    grid-template-columns: 46px minmax(0,1fr) 46px;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}
.calendar-toolbar > div { text-align: center; min-width: 0; }
.calendar-toolbar h2 { margin: 0; font-size: clamp(22px, 4vw, 30px); letter-spacing: -.035em; }
.month-nav {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    text-decoration: none;
    color: #f7f9fc;
    background: var(--surface-2);
    display: grid;
    place-items: center;
    font-size: 28px;
    line-height: 1;
    transition: .18s ease;
}
.month-nav:hover { border-color: var(--blue-2); background: rgba(38,119,255,.14); }
.calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0,1fr));
    width: 100%;
    gap: 8px;
    min-width: 0;
}
.weekday {
    text-align: center;
    color: #7f8ca2;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .12em;
    padding: 4px 0 8px;
}
.day-cell {
    min-width: 0;
    aspect-ratio: 1/.92;
    min-height: 76px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(16,29,49,.72);
    color: #edf3fb;
    position: relative;
    padding: 10px;
    text-align: left;
    overflow: hidden;
    transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.day-cell:not(.empty):hover { transform: translateY(-1px); border-color: rgba(77,145,255,.44); background: #12233b; }
.day-cell.empty { border-color: transparent; background: transparent; pointer-events: none; }
.day-cell.today { border-color: rgba(212,175,55,.68); box-shadow: inset 0 0 0 1px rgba(212,175,55,.12); }
.day-cell.today::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    right: 9px;
    top: 9px;
    box-shadow: 0 0 14px rgba(212,175,55,.55);
}
.day-cell.selected {
    background: linear-gradient(145deg, #1d62d2, #123d88);
    border-color: rgba(108,162,255,.72);
    color: #fff;
    box-shadow: 0 10px 26px rgba(38,119,255,.22);
}
.day-cell.selected::after { background: var(--gold-soft); }
.day-number { display: block; font-size: clamp(16px,2vw,23px); font-weight: 850; line-height: 1; font-variant-numeric: tabular-nums; }
.event-meta { position: absolute; left: 10px; bottom: 9px; display: flex; align-items: center; gap: 5px; }
.event-dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.has-events .event-dot { background: var(--gold); }
.event-count { font-size: 10px; font-weight: 850; color: #8390a4; }
.selected .event-count { color: #e6efff; }
.first-time { position: absolute; right: 10px; bottom: 8px; color: #8290a5; font-size: 9px; font-variant-numeric: tabular-nums; }
.selected .first-time { color: #dbe8ff; }

/* ---------- Panel del día ---------- */
.day-panel { margin-top: 26px; }
.day-panel-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 0 2px;
}
.day-panel-head h2 { margin: 0; font-size: clamp(22px,4vw,32px); letter-spacing: -.035em; }
.day-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(280px,.75fr); gap: 14px; min-width: 0; }
.agenda-card, .note-card {
    min-width: 0;
    background: rgba(11,20,35,.86);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-soft);
}
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-title-row h3 { margin: 0; font-size: 16px; }
.counter {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(38,119,255,.15);
    color: #9fc1ff;
    border: 1px solid rgba(77,145,255,.20);
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 850;
}
.agenda-list { display: grid; gap: 8px; min-width: 0; }
.agenda-empty { padding: 22px 4px; color: var(--muted); font-size: 13px; border-top: 1px dashed var(--line); }
.agenda-item {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 64px minmax(0,1fr) auto;
    gap: 12px;
    align-items: start;
    border: 0;
    border-top: 1px solid var(--line);
    background: transparent;
    text-align: left;
    padding: 13px 0 6px;
    color: var(--ink);
}
.agenda-item:first-child { border-top: 0; padding-top: 2px; }
.agenda-item:hover .agenda-main strong { color: #9fc1ff; }
.agenda-time { font-weight: 900; font-size: 13px; color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.agenda-main { min-width: 0; }
.agenda-main strong { display: block; font-size: 14px; overflow-wrap: anywhere; transition: color .15s ease; }
.agenda-main p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
.agenda-tag {
    font-size: 9px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #9db3d1;
    padding: 5px 7px;
    border-radius: 999px;
    background: var(--surface-2);
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.note-card textarea, .form-grid textarea {
    width: 100%;
    resize: vertical;
    min-height: 132px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #08111f;
    padding: 14px;
    color: var(--ink);
    outline: none;
    line-height: 1.5;
}
.note-card textarea:focus, .form-grid textarea:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(38,119,255,.11); }
.note-card .secondary-btn { margin-top: 10px; width: 100%; }
.save-state { color: var(--muted); font-size: 10px; }
.save-state.dirty { color: var(--warning); }
.save-state.saved { color: var(--success); }

/* ---------- Botones / formularios ---------- */
.primary-btn, .secondary-btn, .danger-btn, .text-btn {
    border: 0;
    border-radius: 12px;
    min-height: 44px;
    padding: 0 16px;
    font-weight: 850;
    font-size: 13px;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.primary-btn {
    color: #fff;
    background: linear-gradient(135deg, #2677ff, #165dcc);
    box-shadow: 0 8px 24px rgba(38,119,255,.18);
}
.primary-btn:hover { transform: translateY(-1px); background: linear-gradient(135deg, #3482ff, #1b67dd); }
.primary-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.primary-btn.compact { min-height: 40px; padding: 0 14px; white-space: nowrap; }
.secondary-btn { background: var(--surface-2); color: #e8eef8; border: 1px solid var(--line); }
.secondary-btn:hover { background: var(--surface-3); border-color: rgba(77,145,255,.38); }
.danger-btn { background: rgba(239,100,97,.12); color: #ff8b88; border: 1px solid rgba(239,100,97,.18); }
.text-btn { background: transparent; color: var(--muted); }
.text-btn:hover { color: #d9e3f2; }
.full { width: 100%; }

.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-grid label { display: block; min-width: 0; }
.form-grid label > span, .login-form label > span { display: block; margin-bottom: 7px; font-size: 11px; color: #91a0b5; font-weight: 750; }
.form-grid input, .form-grid select, .login-form input, .schedule-row input {
    width: 100%;
    min-width: 0;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #08111f;
    color: var(--ink);
    padding: 0 12px;
    outline: none;
}
.form-grid select { color-scheme: dark; }
.form-grid input:focus, .form-grid select:focus, .login-form input:focus, .schedule-row input:focus {
    border-color: var(--blue-2);
    box-shadow: 0 0 0 3px rgba(38,119,255,.11);
}
.span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 8px; align-items: center; padding-top: 4px; }
.spacer { flex: 1; }
.time-24 { font-variant-numeric: tabular-nums; letter-spacing: .03em; }

.schedule-editor { display: grid; gap: 8px; }
.schedule-row { display: grid; grid-template-columns: minmax(130px,1fr) 120px 16px 120px 36px; gap: 7px; align-items: center; min-width: 0; }
.schedule-row > span { color: var(--muted); text-align: center; }
.remove-schedule { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(239,100,97,.12); color: #ff8b88; font-size: 20px; }
.settings-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }

/* ---------- Footer / estados ---------- */
.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 22px 2px 0;
    color: #718099;
    font-size: 11px;
}
.app-footer > span { display: inline-flex; align-items: center; gap: 7px; }
.status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #596478; flex: 0 0 auto; }
.status-dot.on { background: var(--success); box-shadow: 0 0 11px rgba(72,199,142,.45); }
.status-dot.warn { background: var(--warning); }

/* ---------- Modales ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(1,5,11,.78);
    backdrop-filter: blur(12px);
    display: grid;
    place-items: center;
    padding: max(16px,var(--safe-top)) 16px max(16px,var(--safe-bottom));
    overflow-y: auto;
}
.modal-card {
    width: min(620px,100%);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    background: linear-gradient(180deg, #0d1829 0%, #0a1321 100%);
    border: 1px solid rgba(148,163,184,.18);
    border-radius: 24px;
    padding: 22px;
    box-shadow: var(--shadow);
}
.modal-card.wide { width: min(760px,100%); }
.modal-card.compact-modal { width: min(440px,100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.modal-head h2, .install-card h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.close-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface-2);
    color: #e8eef8;
    font-size: 24px;
    line-height: 1;
}
.modal-copy { color: #96a4b8; font-size: 13px; line-height: 1.58; margin: -5px 0 18px; }
.install-card { width: min(410px,100%); text-align: center; padding: 30px 24px 20px; }
.modal-icon { display: flex; justify-content: center; margin-bottom: 18px; }
.install-card > p:not(.eyebrow) { color: #96a4b8; line-height: 1.58; font-size: 13px; }
.install-card .primary-btn { margin-top: 12px; }
.install-card .text-btn { margin-top: 5px; }
.ios-help { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 10px; font-size: 12px; line-height: 1.5; color: var(--muted); }

.push-state { display: flex; align-items: center; gap: 9px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 14px 0; font-size: 12px; }
#testPushButton { margin-top: 8px; }
.push-diagnostic {
    margin: -4px 0 12px;
    padding: 11px 12px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: #9dacbf;
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.push-diagnostic.error { background: rgba(239,100,97,.09); border-color: rgba(239,100,97,.20); color: #ff9c99; }
.push-diagnostic.ok { background: rgba(72,199,142,.09); border-color: rgba(72,199,142,.19); color: #8ce0b8; }

.toast-stack {
    position: fixed;
    right: 16px;
    bottom: calc(16px + var(--safe-bottom));
    z-index: 1500;
    display: grid;
    gap: 8px;
    width: min(360px,calc(100% - 32px));
}
.toast {
    background: #0e1b2d;
    color: #fff;
    border: 1px solid rgba(77,145,255,.22);
    border-left: 3px solid var(--blue-2);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
    font-size: 12px;
    line-height: 1.45;
    animation: toast-in .18s ease-out;
}
.toast.error { background: #2a1216; border-color: rgba(239,100,97,.26); border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.skeleton-line { height: 12px; border-radius: 999px; background: linear-gradient(90deg,#101b2c 20%,#17263e 50%,#101b2c 80%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton-line.short { width: 68%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Login ---------- */
.login-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(circle at 50% 8%, rgba(38,119,255,.20), transparent 32%),
        radial-gradient(circle at 10% 92%, rgba(212,175,55,.08), transparent 30%),
        #050912;
}
.login-card {
    width: min(420px,100%);
    background: linear-gradient(180deg,#0d1829 0%,#0a1321 100%);
    border: 1px solid var(--line);
    border-top-color: rgba(212,175,55,.28);
    border-radius: 28px;
    padding: 32px;
    box-shadow: var(--shadow);
}
.login-card .brand-mark { margin-bottom: 24px; }
.login-card h1 { margin: 0; font-size: 36px; letter-spacing: -.055em; }
.login-copy { color: #94a3b8; font-size: 13px; line-height: 1.6; margin: 10px 0 24px; }
.login-form { display: grid; gap: 13px; }
.form-error { background: rgba(239,100,97,.10); color: #ff9c99; border: 1px solid rgba(239,100,97,.20); border-radius: 12px; padding: 11px 12px; font-size: 12px; }
.login-meta { display: flex; align-items: center; gap: 7px; margin-top: 18px; color: var(--muted); font-size: 11px; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
    .topbar, .content { width: min(100% - 20px,1180px); }
    .topbar { min-height: 66px; }
    .brand-line strong { font-size: 15px; }
    .hero-strip { padding: 28px 0 22px; gap: 18px; }
    .activity-now { padding: 13px 14px; }
    .calendar-section { margin-top: 18px; padding: 16px 12px; border-radius: 20px; }
    .calendar { gap: 5px; }
    .day-cell { min-height: 58px; border-radius: 12px; padding: 8px; }
    .event-meta { left: 7px; bottom: 7px; }
    .first-time { right: 7px; bottom: 6px; font-size: 8px; }
    .day-cell.today::after { top: 7px; right: 7px; }
    .day-grid { grid-template-columns: 1fr; }
    .agenda-card, .note-card { padding: 16px; border-radius: 18px; }
    .app-footer { flex-direction: column; gap: 6px; }
    .schedule-row { grid-template-columns: minmax(0,1fr) 1fr 12px 1fr 34px; }
    .schedule-row .schedule-name { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
    .topbar, .content { width: calc(100% - 16px); }
    .content { padding-top: 8px; }
    .hero-strip { padding: 22px 0 18px; }
    .clock { font-size: clamp(46px,15.6vw,64px); }
    .date-line { margin-top: 11px; font-size: 12px; line-height: 1.35; }
    .activity-now { grid-template-columns: auto minmax(0,1fr); gap: 8px 10px; }
    .activity-now small { grid-column: 2; white-space: normal; }
    .calendar-toolbar { grid-template-columns: 40px minmax(0,1fr) 40px; margin-bottom: 12px; }
    .month-nav { width: 38px; height: 38px; border-radius: 12px; }
    .calendar { gap: 3px; }
    .weekday { font-size: 9px; padding-bottom: 5px; }
    .day-cell { min-height: 44px; aspect-ratio: 1; border-radius: 10px; padding: 6px; }
    .day-number { font-size: 15px; }
    .first-time { display: none; }
    .event-meta { left: 6px; bottom: 5px; }
    .event-count { font-size: 9px; }
    .day-cell.today::after { width: 5px; height: 5px; top: 6px; right: 6px; }
    .day-panel { margin-top: 20px; }
    .day-panel-head { gap: 8px; }
    .day-panel-head h2 { font-size: 21px; }
    .primary-btn.compact { padding: 0 11px; font-size: 12px; }
    .agenda-item { grid-template-columns: 52px minmax(0,1fr); gap: 8px; }
    .agenda-tag { grid-column: 2; justify-self: start; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .form-actions { flex-wrap: wrap; }
    .form-actions .spacer { display: none; }
    .form-actions button { flex: 1; min-width: 100px; }
    .settings-actions { flex-direction: column; }
    .settings-actions button { width: 100%; }
    .modal-card { padding: 18px; border-radius: 20px; }
    .login-card { padding: 26px 20px; border-radius: 22px; }
    .login-card h1 { font-size: 32px; }
}

/* PWA instalada: conservar portrait y respetar safe-area. */
@media (display-mode: standalone) {
    .topbar { min-height: calc(68px + var(--safe-top)); }
}

/* Si un navegador ignora orientation del manifest fuera de la PWA, al menos no hay desbordamientos. */
@media (orientation: landscape) and (max-height: 520px) {
    .hero-strip { padding-top: 18px; }
    .clock { font-size: clamp(40px,9vw,58px); }
    .modal-card { max-height: calc(100dvh - 16px); }
}
