:root {
  --bg: #edf0f4;
  --surface: #ffffff;
  --surface-soft: #f7f8fa;
  --line: #e1e5eb;
  --line-strong: #d6dbe3;
  --ink: #15171c;
  --muted: #7e8590;
  --muted-2: #a3a9b2;
  --shadow: 0 14px 38px rgba(35, 42, 55, .06);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --sidebar: 154px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-width: 100%; height: 100%; min-height: 100%; overflow: hidden; background: var(--bg); }
html { height: -webkit-fill-available; }
button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgba(70,149,232,.24); outline-offset: 2px; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0,1fr); gap: 12px; width: 100vw; height: 100vh; height: -webkit-fill-available; height: 100dvh; height: var(--app-height, 100vh); min-height: 0; padding: 12px; }
.sidebar, .main-panel { background: var(--surface); border: 1px solid rgba(218,222,229,.75); box-shadow: var(--shadow); }
.sidebar { border-radius: var(--radius-xl); padding: 14px 12px 12px; display: flex; flex-direction: column; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 5px 4px 17px; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px; display: grid; place-items: center; background: #1b1d22; color: #fff; font-weight: 850; font-size: 17px; letter-spacing: -.02em; }
.brand-title { font-size: 16px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; }
.brand-subtitle { color: var(--muted); font-size: 11px; margin-top: 4px; }
.filter-list { display: flex; flex-direction: column; gap: 5px; }
.filter-chip { border: 0; background: transparent; display: grid; grid-template-columns: 12px minmax(0,1fr) auto; align-items: center; gap: 9px; min-height: 43px; padding: 0 10px; border-radius: 12px; color: #444852; text-align: left; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.filter-chip:hover { background: #f5f6f8; }
.filter-chip:active { transform: scale(.985); }
.filter-chip.active { background: #f1f3f6; color: var(--ink); box-shadow: inset 0 0 0 1px #e2e5ea; }
.filter-swatch { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.04); }
.filter-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; font-weight: 700; }
.filter-count { color: #9aa0aa; font-size: 10px; font-variant-numeric: tabular-nums; }
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 7px; }
.connection-card { width: 100%; display: grid; grid-template-columns: 25px minmax(0,1fr) auto; gap: 7px; align-items: center; border: 0; border-radius: 13px; padding: 9px; background: #f6f7f9; color: #4a4f58; text-align: left; cursor: pointer; }
.connection-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 9px; background: #fff; box-shadow: inset 0 0 0 1px #e6e9ee; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #b6bdc8; }
.status-dot.online { background: #31a56f; box-shadow: 0 0 0 4px rgba(49,165,111,.1); }
.status-dot.error { background: #e25252; box-shadow: 0 0 0 4px rgba(226,82,82,.1); }
.connection-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.connection-copy strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10.8px; }
.connection-copy small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 8.5px; color: #989faa; }
.chevron { color: #a3a9b2; font-size: 17px; }
.sidebar-action { text-decoration:none; border: 0; background: transparent; color: #7b818a; border-radius: 11px; min-height: 33px; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 10px; font-weight: 700; cursor: pointer; }
.sidebar-action:hover { background: #f5f6f8; color: #444852; }
.sidebar-action.active { background: #f1f3f6; color: var(--ink); box-shadow: inset 0 0 0 1px #e2e5ea; }
.fridge-action span:first-child { font-size: 12px; }

.sidebar-toggle {
  display: none;
  position: fixed;
  z-index: 45;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 58px;
  border: 1px solid rgba(210,215,223,.95);
  border-left: 0;
  border-radius: 0 14px 14px 0;
  background: rgba(255,255,255,.94);
  color: #555b65;
  box-shadow: 8px 10px 26px rgba(35,42,55,.10);
  font-size: 26px;
  line-height: 1;
  font-weight: 700;
  place-items: center;
  cursor: pointer;
  transition: left .22s ease, opacity .18s ease, background .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-toggle:active { background: #f1f3f6; }

.main-panel { min-width: 0; min-height: 0; border-radius: var(--radius-xl); padding: 14px 16px 14px; display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; gap: 10px; overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 9px; }
.week-heading { min-width: 0; }
.eyebrow, .status-kicker { display: block; color: #959ca7; font-size: 8.5px; line-height: 1; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 5px 0 0; font-size: 24px; line-height: 1; letter-spacing: -.045em; white-space: nowrap; }
h2 { margin: 6px 0 0; font-size: 21px; letter-spacing: -.035em; }
.icon-button, .ghost-button, .primary-button, .danger-button, .mini-add, .text-button { border: 0; cursor: pointer; transition: transform .14s ease, background .14s ease, opacity .14s ease; }
.icon-button:active, .ghost-button:active, .primary-button:active, .danger-button:active, .mini-add:active { transform: translateY(1px); }
.icon-button { width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; background: #f4f5f7; color: #555b65; font-size: 22px; font-weight: 700; }
.icon-button:hover { background: #eceff3; }
.icon-button.small { width: 34px; height: 34px; border-radius: 11px; font-size: 20px; }
.sync-button.syncing { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ghost-button { min-height: 39px; padding: 0 15px; border-radius: 12px; background: #f4f5f7; color: #494e57; font-weight: 750; font-size: 12px; }
.ghost-button:hover { background: #eceff3; }
.primary-button { min-height: 39px; padding: 0 16px; border-radius: 12px; background: #1b1d22; color: #fff; font-weight: 800; font-size: 12px; box-shadow: 0 6px 18px rgba(24,26,31,.12); }
.primary-button:hover { background: #101216; }
.plus { font-size: 17px; vertical-align: -1px; margin-right: 5px; }
.danger-button { min-height: 39px; padding: 0 14px; border-radius: 12px; background: #fff0f0; color: #c94242; font-weight: 800; font-size: 12px; }

.status-row { display: grid; grid-template-columns: minmax(230px,.9fr) minmax(300px,1.3fr) 92px; gap: 8px; }
.status-card { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: #fafbfc; padding: 9px 11px; min-height: 52px; display: flex; flex-direction: column; justify-content: center; }
.status-card strong { display: block; margin-top: 5px; font-size: 12px; letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-detail { color: #9299a3; font-size: 9.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clock-card { align-items: flex-end; text-align: right; }
.clock-card strong { font-size: 17px; font-variant-numeric: tabular-nums; }

.week-board { min-height: 0; border: 1px solid var(--line); border-radius: 17px; overflow: hidden; background: #fff; }
.week-grid { width: 100%; height: 100%; display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.day-column { min-width: 0; min-height: 0; display: grid; grid-template-rows: 44px minmax(0,1fr); border-right: 1px solid var(--line); background: #fff; position: relative; }
.day-column:last-child { border-right: 0; }
.day-column.today { background: #fbfbfc; }
.day-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.day-column.today .day-header { background: #1b1d22; color: #fff; border-color: #1b1d22; }
.day-name { color: #8b929c; font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.day-column.today .day-name { color: #c4c8cf; }
.day-number { font-size: 21px; font-weight: 850; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.day-events { padding: 8px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d9dde3 transparent; }
.day-events::-webkit-scrollbar { width: 5px; }
.day-events::-webkit-scrollbar-thumb { background: #d9dde3; border-radius: 10px; }
.event-card { position: relative; width: 100%; border: 0; margin: 0 0 7px; padding: 9px 9px 9px 10px; border-radius: 12px; background: var(--event-bg); color: var(--event-text); text-align: left; cursor: pointer; overflow: hidden; box-shadow: inset 3px 0 0 var(--event-accent); transition: transform .12s ease, filter .12s ease; }
.event-card:hover { filter: brightness(.985); }
.event-card:active { transform: scale(.985); }
.event-people { display: flex; align-items: center; gap: 5px; min-height: 10px; margin-bottom: 5px; }
.event-person-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8.5px; line-height: 1; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; opacity: .78; }
.mini-dots { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.mini-dot { width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.04); }
.event-title { font-size: 11.5px; line-height: 1.15; font-weight: 820; letter-spacing: -.02em; overflow-wrap: anywhere; }
.event-time { margin-top: 5px; font-size: 9.5px; line-height: 1.1; font-weight: 650; opacity: .72; font-variant-numeric: tabular-nums; }
.event-location { margin-top: 4px; font-size: 8.7px; opacity: .68; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-day { height: 100%; min-height: 90px; display: grid; place-items: start center; padding-top: 24px; color: #b5bac3; font-size: 9.5px; }

.bottom-strip { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 15px; background: #fafbfc; padding: 8px 10px; }
.pending-copy { min-width: 0; }
.pending-list { margin-top: 6px; display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.pending-list::-webkit-scrollbar { display: none; }
.pending-pill { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; min-height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 0 10px; font-size: 9.5px; font-weight: 650; color: #555b65; }
.pending-pill input { appearance: none; width: 13px; height: 13px; border: 1.5px solid #9da4ae; border-radius: 4px; margin: 0; cursor: pointer; }
.pending-pill input:checked { background: #1b1d22; box-shadow: inset 0 0 0 3px #fff; }
.mini-add { flex: 0 0 auto; min-height: 32px; padding: 0 11px; border-radius: 10px; background: #fff; color: #5f6570; border: 1px solid var(--line); font-size: 10px; font-weight: 750; }
.mini-add:hover { background: #f4f5f7; }


/* v3.6 · Tiempo de hoy */
.topbar { position: relative; }
.weather-card {
  min-width: 275px;
  max-width: 390px;
  height: 46px;
  margin-left: auto;
  margin-right: 10px;
  padding: 5px 10px 5px 8px;
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafbfc;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.weather-icon { font-size: 25px; line-height: 1; text-align: center; }
.weather-main { min-width: 0; }
.weather-line { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.weather-line strong { font-size: 18px; line-height: 1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.weather-range { color: #767e89; font-size: 9.5px; font-weight: 750; white-space: nowrap; }
.weather-bottom-line { margin-top: 4px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.weather-advice { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #404650; font-size: 9.5px; font-weight: 800; }
.weather-place { flex: 0 0 auto; color: #a0a6af; font-size: 7.7px; white-space: nowrap; }
.weather-rain { min-width: 42px; display: flex; align-items: center; justify-content: flex-end; gap: 3px; color: #52718f; }
.weather-rain-icon { font-size: 12px; opacity: .8; }
.weather-rain strong { font-size: 10px; font-variant-numeric: tabular-nums; }

body.fridge-idle .weather-card { opacity: .92; }

@media (max-width: 1300px) and (max-height: 850px) {
  .weather-card { min-width: 260px; max-width: 330px; height: 42px; padding-block: 4px; margin-right: 6px; }
  .weather-icon { font-size: 23px; }
  .weather-line strong { font-size: 17px; }
  .weather-advice { font-size: 9.2px; }
  .weather-place { font-size: 7.2px; }
}

@media (max-width: 1050px) {
  .weather-card { min-width: 205px; max-width: 250px; grid-template-columns: 32px minmax(0,1fr) auto; gap: 5px; }
  .weather-place { display: none; }
  .weather-range { font-size: 8.5px; }
}

.dialog { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; }
.dialog::backdrop { background: rgba(19,23,31,.34); backdrop-filter: blur(5px); }
.dialog-card { width: min(630px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; background: #fff; border-radius: 21px; padding: 20px; box-shadow: 0 28px 80px rgba(21,27,38,.24); }
.dialog-card.compact { width: min(460px, calc(100vw - 32px)); }
.settings-card { width: min(650px, calc(100vw - 32px)); }
.dialog-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 17px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field > span, .field-label-row > span, .toggle-field > span:first-child { color: #5d636c; font-size: 10px; font-weight: 800; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field-label-row small { color: #9ba1aa; font-size: 9px; }
.field input, .field textarea { width: 100%; border: 1px solid #dfe3e8; background: #fbfcfd; border-radius: 12px; padding: 0 12px; color: #21242a; font-size: 12px; outline: none; transition: border-color .14s ease, box-shadow .14s ease, background .14s ease; }
.field input { height: 42px; }
.field textarea { padding-top: 11px; padding-bottom: 11px; resize: vertical; min-height: 74px; }
.field input:focus, .field textarea:focus { border-color: #aab1bc; box-shadow: 0 0 0 3px rgba(93,104,120,.08); background: #fff; }
.field-help { margin-top: -2px; color: #9aa0aa; font-size: 9px; line-height: 1.35; }
.field-grid { display: grid; gap: 10px; }
.date-grid { grid-template-columns: 1.35fr .85fr 1fr 1fr; align-items: end; }
.person-picker { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 6px; }
.person-choice { min-width: 0; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 9px 5px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: #626871; font-size: 9.5px; font-weight: 750; cursor: pointer; transition: background .13s ease, border-color .13s ease, transform .13s ease; }
.person-choice:hover { background: #fafbfc; }
.person-choice.selected { background: var(--choice-bg); border-color: var(--choice-color); color: var(--choice-text); box-shadow: inset 0 0 0 1px var(--choice-color); }
.person-choice:active { transform: scale(.98); }
.avatar-dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.04); }
.toggle-field { display: grid; grid-template-columns: minmax(0,1fr) 40px; grid-template-rows: auto 42px; column-gap: 8px; align-items: center; margin-bottom: 14px; }
.toggle-field > span:first-child { grid-column: 1 / -1; }
.toggle-field input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { grid-column: 1 / -1; justify-self: start; width: 40px; height: 23px; border-radius: 999px; background: #dfe3e8; position: relative; cursor: pointer; transition: background .15s ease; }
.toggle-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.16); transition: transform .15s ease; }
.toggle-field input:checked + .toggle-ui { background: #24272d; }
.toggle-field input:checked + .toggle-ui::after { transform: translateX(17px); }
.timed-field.disabled { opacity: .36; pointer-events: none; }
.dialog-actions { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.spacer { flex: 1; }
.hidden { display: none !important; }

.setup-intro { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 12px; align-items: start; border: 1px solid var(--line); border-radius: 14px; background: #fafbfc; padding: 12px; margin-bottom: 15px; }
.setup-badge { min-width: 48px; height: 28px; border-radius: 999px; padding: 0 9px; display: grid; place-items: center; background: #eceff3; color: #6f7680; font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.setup-badge.online { background: #e7f6ee; color: #23744d; }
.setup-intro strong { font-size: 12px; }
.setup-intro p { margin: 4px 0 0; color: #858c96; font-size: 10px; line-height: 1.4; }
.origin-box { position: relative; border: 1px dashed #d6dbe2; border-radius: 13px; padding: 11px 86px 11px 11px; background: #fafbfc; margin-bottom: 12px; }
.origin-box > span { display: block; color: #7f8690; font-size: 9px; font-weight: 750; margin-bottom: 5px; }
.origin-box code { display: block; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: transparent; color: #525964; font-size: 9.5px; font-weight: 800; }
.settings-actions-grid { display: flex; gap: 8px; margin: 2px 0 12px; }
.mode-hint { border: 1px solid var(--line); border-radius: 14px; background: #fafbfc; padding: 11px 12px; margin-bottom: 14px; }
.mode-hint strong { display:block; font-size: 12px; }
.mode-hint p { margin: 5px 0 0; color: #7f8792; font-size: 10px; line-height: 1.45; }

.setup-help { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; margin-bottom: 14px; color: #626872; font-size: 10px; }
.setup-help summary { cursor: pointer; font-weight: 800; }
.setup-help ol { margin: 9px 0 0; padding-left: 18px; line-height: 1.55; }

.toast { position: fixed; left: 50%; bottom: 18px; z-index: 50; transform: translate(-50%, 20px); background: #1c1e23; color: #fff; border-radius: 999px; padding: 10px 14px; font-size: 10px; font-weight: 750; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; box-shadow: 0 14px 35px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.loading-overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; pointer-events: none; background: rgba(255,255,255,.18); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(27,29,34,.15); border-top-color: #1b1d22; animation: spin .8s linear infinite; }



/* v3.1 · menú familiar deslizable */
body.fridge-mode .app-shell {
  grid-template-columns: minmax(0,1fr);
}
body.fridge-mode .main-panel {
  grid-column: 1;
}
body.fridge-mode .sidebar {
  position: fixed;
  z-index: 44;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: var(--sidebar);
  transform: translateX(calc(-100% - 18px));
  opacity: .98;
  box-shadow: 0 18px 46px rgba(35,42,55,.18);
  transition: transform .22s cubic-bezier(.2,.75,.25,1);
}
body.fridge-mode.sidebar-open .sidebar {
  transform: translateX(0);
}
body.fridge-mode .sidebar-toggle {
  display: grid;
}
body.fridge-mode.sidebar-open .sidebar-toggle {
  left: calc(var(--sidebar) + 7px);
}
body.fridge-mode.fridge-idle .sidebar-toggle {
  opacity: .58;
}
body.fridge-mode.sidebar-open.fridge-idle .sidebar-toggle {
  opacity: .9;
}

/* v2.9 · modo pared */
body.fridge-mode .main-panel { grid-template-rows: auto minmax(0,1fr) auto; gap: 8px; }
body.fridge-mode .status-row { display: none; }
body.fridge-mode .event-card { padding: 10px 10px 10px 12px; margin-bottom: 8px; border-radius: 13px; }
body.fridge-mode .event-person-name { font-size: 9px; }
body.fridge-mode .event-title { font-size: 13px; line-height: 1.18; }
body.fridge-mode .event-time { margin-top: 6px; font-size: 10.4px; }
body.fridge-mode .event-location { font-size: 9.1px; }
body.fridge-mode .day-number { font-size: 22px; }
body.fridge-mode .day-events { padding: 7px; }
body.fridge-mode .bottom-strip { min-height: 54px; }
body.fridge-mode .pending-pill { min-height: 32px; font-size: 10px; }
body.fridge-mode .topbar { min-height: 44px; }
body.fridge-mode .brand-subtitle { display: none; }
body.fridge-mode .brand { padding-bottom: 12px; }
body.fridge-mode .connection-copy strong { font-size: 10px; }
body.fridge-mode .connection-copy small { font-size: 8px; }

body.fridge-idle .topbar-actions,
body.fridge-idle .sidebar-bottom .sidebar-action,
body.fridge-idle .sidebar-bottom .connection-card {
  opacity: .18;
  transition: opacity .18s ease;
}
body.fridge-idle .topbar-actions,
body.fridge-idle .sidebar-bottom .sidebar-action,
body.fridge-idle .sidebar-bottom .connection-card {
  pointer-events: none;
}
body.fridge-idle .week-heading,
body.fridge-idle .brand-copy { opacity: .96; }

@media (max-width: 1100px) {
  :root { --sidebar: 142px; }
  .app-shell { gap: 9px; padding: 9px; }
  .main-panel { padding: 11px 12px; gap: 8px; }
  .brand { gap: 8px; }
  .brand-mark { width: 38px; height: 38px; flex-basis: 38px; }
  .status-row { grid-template-columns: minmax(185px,.9fr) minmax(240px,1.3fr) 82px; }
  .day-events { padding: 6px; }
  .event-card { padding: 8px 7px 8px 8px; }
  .event-title { font-size: 10.5px; }
  .event-time { font-size: 8.8px; }
}

/* Lenovo Tab M10 HD: 1280×800 landscape */
@media (max-width: 1300px) and (max-height: 850px) {
  :root { --sidebar: 145px; }
  .app-shell { padding: 9px; gap: 9px; }
  .sidebar { border-radius: 21px; padding: 12px 10px 10px; }
  .main-panel { border-radius: 21px; padding: 11px 12px 10px; gap: 8px; }
  .brand { padding-bottom: 12px; }
  .filter-chip { min-height: 40px; padding-inline: 9px; }
  .topbar { min-height: 45px; }
  h1 { font-size: 22px; }
  .icon-button, .ghost-button, .primary-button { min-height: 37px; }
  .icon-button { width: 37px; height: 37px; }
  .status-card { min-height: 48px; padding: 7px 10px; }
  .week-board { border-radius: 15px; }
  .day-column { grid-template-rows: 42px minmax(0,1fr); }
  .day-header { padding-inline: 8px; }
  .day-number { font-size: 19px; }
  .bottom-strip { min-height: 53px; padding-block: 7px; }

  body.fridge-mode .app-shell { padding: 8px; gap: 8px; }
  body.fridge-mode .sidebar { padding: 10px 9px 9px; }
  body.fridge-mode .main-panel { padding: 9px 11px 9px; gap: 7px; }
  body.fridge-mode h1 { font-size: 23px; }
  body.fridge-mode .topbar { min-height: 42px; }
  body.fridge-mode .filter-chip { min-height: 38px; }
  body.fridge-mode .day-column { grid-template-rows: 43px minmax(0,1fr); }
  body.fridge-mode .event-card { padding: 11px 10px 11px 12px; margin-bottom: 9px; }
  body.fridge-mode .event-title { font-size: 15px; line-height: 1.18; }
  body.fridge-mode .event-time { font-size: 11.5px; }
  body.fridge-mode .event-person-name { font-size: 9.8px; }
  body.fridge-mode .filter-name { font-size: 13px; }
  body.fridge-mode .filter-count { font-size: 10.5px; }
  body.fridge-mode .day-name { font-size: 10.5px; }
  body.fridge-mode .day-number { font-size: 21px; }
  body.fridge-mode .bottom-strip { min-height: 50px; padding-block: 6px; }
  body.fridge-mode .sidebar { left: 6px; top: 6px; bottom: 6px; }
  body.fridge-mode.sidebar-open .sidebar-toggle { left: calc(var(--sidebar) + 4px); }
  body.fridge-mode .sidebar-toggle { width: 26px; height: 54px; font-size: 24px; }
}



@media (max-height: 650px) {
  .status-row { display: none; }
  .bottom-strip { min-height: 49px; }
  .brand { padding-bottom: 8px; }
  .filter-chip { min-height: 37px; }
}

@media (orientation: portrait) {
  html, body { overflow: auto; }
  .app-shell { min-width: 920px; min-height: 700px; }
}

/* v2.6 · Repetición de eventos */
.field select {
  width: 100%;
  height: 42px;
  border: 1px solid #dfe3e8;
  background: #fbfcfd;
  border-radius: 12px;
  padding: 0 34px 0 12px;
  color: #21242a;
  font: inherit;
  font-size: 12px;
  outline: none;
  cursor: pointer;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.field select:focus {
  border-color: #aab1bc;
  box-shadow: 0 0 0 3px rgba(93,104,120,.08);
  background: #fff;
}
.field select:disabled { color: #737983; background: #f3f5f7; cursor: default; }

#recurrenceScopeField {
  margin-top: -2px;
  padding: 10px 11px;
  border: 1px solid #e1e5ea;
  border-radius: 14px;
  background: #fafbfc;
}
#recurrenceScopeField > span { color: #343941; }
#recurrenceScopeField select { background: #fff; }

.repeat-custom {
  margin: -3px 0 14px;
  padding: 12px;
  border: 1px solid #e1e5ea;
  border-radius: 14px;
  background: #fafbfc;
}
.repeat-custom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.repeat-custom .field { margin-bottom: 10px; }
.repeat-every-row { display: grid; grid-template-columns: 72px minmax(0,1fr); gap: 7px; }
.repeat-every-row input { min-width: 0; }
.repeat-weekdays { margin: 0 0 11px; }
.repeat-section-label { display: block; color: #5d636c; font-size: 10px; font-weight: 800; margin-bottom: 7px; }
.weekday-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.weekday-picker button {
  width: 32px;
  height: 32px;
  border: 1px solid #dfe3e8;
  border-radius: 50%;
  background: #fff;
  color: #626872;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
  transition: background .13s ease, border-color .13s ease, color .13s ease, transform .13s ease;
}
.weekday-picker button:hover { background: #f3f5f7; }
.weekday-picker button.selected { background: #202329; border-color: #202329; color: #fff; }
.weekday-picker button:active { transform: scale(.95); }
.repeat-mark { display: inline-block; font-weight: 900; opacity: .72; transform: translateY(-.3px); }

@media (max-width: 1300px) and (max-height: 850px) {
  .event-dialog-card { width: min(670px, calc(100vw - 28px)); }
  .repeat-custom { padding: 10px; }
  .weekday-picker button { width: 30px; height: 30px; }
}

/* v3.0 · corrección de altura real en Android/PWA */
@supports not (height: 100dvh) {
  .app-shell { height: var(--app-height, 100vh); }
}


/* v3.2 · Google Tasks */
.pending-heading-row { display: flex; align-items: center; gap: 7px; }
.pending-source-badge { display: inline-flex; align-items: center; min-height: 16px; padding: 0 6px; border-radius: 999px; background: #eceff3; color: #7b828c; font-size: 7px; line-height: 1; font-weight: 900; letter-spacing: .08em; }
.pending-source-badge.online { background: #e7f6ee; color: #23744d; }
.pending-source-badge.error { background: #fff1df; color: #9a6818; }
.pending-pill { padding-left: 8px; }
.pending-pill.google-task { padding-right: 6px; }
.pending-check-wrap { display: grid; place-items: center; flex: 0 0 auto; cursor: pointer; }
.pending-title-button { border: 0; background: transparent; padding: 0 4px 0 0; color: inherit; display: flex; align-items: center; gap: 7px; cursor: pointer; font: inherit; font-weight: inherit; min-width: 0; }
.pending-title-button > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.pending-title-button small { color: #949ba5; font-size: 8px; font-weight: 800; white-space: nowrap; }
.pending-empty { padding-inline: 10px; }
.optional-label { margin-left: 5px; color: #a0a6af; font-size: 8px; font-weight: 650; }
.tasks-setup-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fafbfc; padding: 11px 12px; margin-bottom: 14px; }
.tasks-setup-card > div { min-width: 0; }
.tasks-setup-card strong { display: block; margin-top: 5px; font-size: 11px; }
.tasks-setup-card p { margin: 4px 0 0; color: #858c96; font-size: 9px; line-height: 1.4; }
.tasks-setup-badge { flex: 0 0 auto; min-height: 25px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; background: #eceff3; color: #727984; font-size: 7px; font-weight: 900; letter-spacing: .09em; }
.tasks-setup-badge.online { background: #e7f6ee; color: #23744d; }
.tasks-setup-badge.error { background: #fff1df; color: #9a6818; }


/* v3.3 · Eventos especiales */
.event-title { display:flex; align-items:flex-start; gap:6px; }
.event-type-icon { flex:0 0 auto; font-size:14px; line-height:1; transform:translateY(-1px); filter:saturate(.9); }
.special-birthday { box-shadow: inset 3px 0 0 var(--event-accent), inset 0 0 0 1px rgba(190,132,31,.13); }
.special-birthday::after { content:""; position:absolute; right:-16px; top:-20px; width:58px; height:58px; border-radius:50%; background:rgba(255,255,255,.26); pointer-events:none; }
body.fridge-mode .event-type-icon { font-size:16px; }

/* v3.3 · Configuración modo noche */
.night-settings-card { border:1px solid var(--line); border-radius:14px; background:#fafbfc; padding:12px; margin-bottom:14px; }
.night-settings-heading { display:flex; align-items:center; justify-content:space-between; gap:15px; }
.night-settings-heading strong { display:block; margin-top:5px; font-size:12px; }
.night-settings-heading p { margin:4px 0 0; color:#858c96; font-size:10px; }
.night-time-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:10px; }
.night-time-grid .field { margin-bottom:0; }
.night-preview-button { margin-top:10px; width:100%; }
.mini-switch { flex:0 0 auto; position:relative; width:42px; height:24px; }
.mini-switch input { position:absolute; opacity:0; }
.mini-switch span { display:block; width:42px; height:24px; background:#dfe3e8; border-radius:999px; cursor:pointer; transition:.18s ease; }
.mini-switch span::after { content:""; display:block; position:absolute; width:18px; height:18px; left:3px; top:3px; border-radius:50%; background:#fff; box-shadow:0 2px 5px rgba(0,0,0,.16); transition:.18s ease; }
.mini-switch input:checked + span { background:#1b1d22; }
.mini-switch input:checked + span::after { transform:translateX(18px); }

/* v3.3 · Pantalla nocturna */
.night-screen { position:fixed; inset:0; z-index:80; background:#050607; color:#f2f3f4; display:grid; place-items:center; padding:26px 34px; }
.night-inner { width:min(900px,92vw); height:100%; max-height:640px; display:grid; grid-template-rows:auto auto auto minmax(0,1fr) auto; align-content:center; }
.night-topline { display:flex; justify-content:space-between; align-items:center; color:#60646b; font-size:10px; font-weight:850; letter-spacing:.16em; text-transform:uppercase; }
.night-clock { margin-top:20px; font-size:clamp(72px,13vw,142px); line-height:.9; font-weight:250; letter-spacing:-.065em; font-variant-numeric:tabular-nums; color:#e9eaec; }
.night-date { margin-top:12px; color:#777c84; font-size:18px; font-weight:620; }
.night-tomorrow { margin-top:36px; min-height:0; }
.night-section-title { color:#53575e; font-size:9px; font-weight:900; letter-spacing:.19em; }
.night-tomorrow-title { margin-top:7px; color:#aaadb2; font-size:16px; font-weight:750; }
.night-events { margin-top:15px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 18px; max-height:210px; overflow:hidden; }
.night-event { min-width:0; display:grid; grid-template-columns:28px minmax(0,1fr); gap:9px; align-items:center; padding:9px 11px; border-left:3px solid var(--night-accent); background:#0d0f11; border-radius:9px; }
.night-event-icon { font-size:16px; text-align:center; opacity:.86; }
.night-event strong { display:block; color:#d5d7da; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.night-event small { display:block; margin-top:4px; color:#656a72; font-size:10px; }
.night-empty { color:#5c6066; font-size:13px; padding:13px 0; }
.night-wake-button { align-self:end; justify-self:center; border:1px solid #1d2024; background:#0b0d0f; color:#5f646b; border-radius:999px; min-height:36px; padding:0 16px; font-size:10px; font-weight:750; cursor:pointer; }
.night-wake-button:active { background:#121519; }
body.night-active .toast { z-index:90; }

@media (max-width: 1300px) and (max-height: 850px) {
  .night-screen { padding:20px 28px; }
  .night-inner { width:min(840px,90vw); max-height:560px; }
  .night-clock { font-size:104px; margin-top:14px; }
  .night-date { font-size:15px; margin-top:9px; }
  .night-tomorrow { margin-top:26px; }
  .night-events { max-height:170px; }
  .night-event { padding:7px 9px; }
}
