:root {
  --bg: #f5f3ee;
  --panel: #ffffff;
  --ink: #1c2626;
  --ink-2: #4a5655;
  --muted: #7d8786;
  --line: #e4e0d7;
  --line-2: #efece5;
  --accent: #2f6f62;
  --accent-ink: #ffffff;
  --accent-soft: #e3efeb;
  --side: #17302b;
  --side-ink: #d4e2de;
  --danger: #b4412f;
  --danger-soft: #f8e5e1;
  --warn: #a36a12;
  --warn-soft: #fbf0d9;
  --ok: #2f7a4a;
  --ok-soft: #e2f2e7;
  --t-individual: #3d6fb6;
  --t-doble: #2f6f62;
  --t-triple: #b07b1f;
  --s-booking: #1f4e9c;
  --s-ical: #5f7590;
  --s-manual: #2f7a4a;
  --s-directa: #8a4fa8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 30, .06), 0 4px 16px rgba(20, 30, 30, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 Inter, system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--bg); }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
a { color: var(--accent); }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); }
label > input, label > select, label > textarea { margin-top: 4px; }
input[type=checkbox] { width: auto; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-weight: 500; white-space: nowrap;
}
.btn:hover { background: var(--line-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: default; }
.link { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
.error-text { color: var(--danger); font-size: 13px; min-height: 18px; }

/* Login */
.login { min-height: 100%; display: grid; place-items: center; background: var(--side); padding: 16px; }
.login-card { width: 100%; max-width: 340px; background: #fff; border-radius: 14px; padding: 28px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.login-card h1 { margin-top: 6px; }
.brand-mark { width: 44px; height: 44px; border-radius: 11px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.brand-mark.sm { width: 34px; height: 34px; border-radius: 9px; font-size: 13px; }

/* Layout */
.app { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.sidebar { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px; }
.brand strong { display: block; color: #fff; }
.brand span { font-size: 12px; opacity: .7; }
nav { display: flex; flex-direction: column; padding: 6px 8px; gap: 2px; }
nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--side-ink); text-decoration: none; font-weight: 500; }
nav a:hover { background: rgba(255, 255, 255, .06); }
nav a.active { background: rgba(255, 255, 255, .12); color: #fff; }
nav .ic { width: 18px; text-align: center; opacity: .8; }
.badge { margin-left: auto; background: #e8a33d; color: #1c1c1c; border-radius: 99px; font-size: 11px; padding: 1px 7px; }
.sidebar-foot { margin-top: auto; padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .08); display: grid; gap: 10px; font-size: 13px; }
.live { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: .85; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #999; }
.live.on i { background: #5fd38d; box-shadow: 0 0 0 3px rgba(95, 211, 141, .2); }
.user-row { display: flex; justify-content: space-between; }
.main { padding: 22px 26px 40px; min-width: 0; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); gap: 8px; }
.card-b { padding: 14px 16px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; }
.row > .btn, .row > .shrink { flex: 0 0 auto; }
.stack { display: grid; gap: 12px; }

.kpi { padding: 14px 16px; }
.kpi .v { font-size: 26px; font-weight: 600; margin-top: 2px; letter-spacing: -.02em; }
.kpi .l { font-size: 12px; color: var(--muted); }

.alert { padding: 10px 14px; border-radius: 8px; display: flex; gap: 10px; align-items: center; font-size: 13px; }
.alert.warn { background: var(--warn-soft); color: #6d4609; }
.alert.danger { background: var(--danger-soft); color: #7c2617; }
.alert.info { background: var(--accent-soft); color: #1d4a40; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { color: var(--muted); padding: 14px 0; font-size: 13px; }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.chip.t-individual { background: #e4ecf8; color: var(--t-individual); }
.chip.t-doble { background: #e1efeb; color: var(--t-doble); }
.chip.t-triple { background: #f6ecd8; color: var(--t-triple); }
.chip.alta { background: var(--danger-soft); color: var(--danger); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.s-booking { background: #e3ebf8; color: var(--s-booking); }
.chip.s-ical { background: #e8edf3; color: var(--s-ical); }
.chip.s-manual { background: var(--ok-soft); color: var(--s-manual); }
.chip.s-directa { background: #f1e7f6; color: var(--s-directa); }
.room-num { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 38px; }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fbfaf7; position: sticky; top: 0; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr.click:hover td { background: #faf8f3; cursor: pointer; }
.tbl-wrap { overflow: auto; }

.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 120px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; font-size: 11px; color: var(--muted); }
.bar i { display: block; width: 100%; max-width: 38px; background: var(--accent); border-radius: 5px 5px 2px 2px; min-height: 3px; }
.bar b { color: var(--ink); font-weight: 600; }

/* Libro de habitaciones */
.book { overflow: auto; max-height: calc(100vh - 150px); }
.book-grid { display: grid; min-width: max-content; position: relative; }
.book-row { display: contents; }
.book-cell { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); height: 42px; position: relative; background: #fff; }
.book-cell.we { background: #faf8f3; }
.book-cell.today { background: #eef6f3; }
.book-cell.free:hover { background: var(--accent-soft); cursor: pointer; }
.book-head { position: sticky; top: 0; z-index: 3; background: #fbfaf7; height: 46px; font-size: 11px; text-align: center; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.book-head b { font-size: 14px; color: var(--ink); }
.book-head.today { background: var(--accent); color: #fff; }
.book-head.today b { color: #fff; }
.book-room { position: sticky; left: 0; z-index: 2; background: #fff; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-right: 1px solid var(--line); }
.book-room.corner { z-index: 4; top: 0; background: #fbfaf7; height: 46px; border-bottom: 1px solid var(--line); }
.book-room .hk { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; }
.hk.limpia { background: #5fbf85; } .hk.sucia { background: #e0a43a; } .hk.bloqueada { background: #c4594a; }
.book-room.unassigned { background: var(--warn-soft); color: #6d4609; font-weight: 600; }
.res-bar {
  position: absolute; top: 5px; bottom: 5px; border-radius: 6px; color: #fff; font-size: 12px; font-weight: 600;
  padding: 0 8px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; cursor: pointer; z-index: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15); gap: 6px;
}
.res-bar:hover { filter: brightness(1.1); z-index: 2; }
.res-bar.booking { background: var(--s-booking); }
.res-bar.ical { background: var(--s-ical); }
.res-bar.manual { background: var(--s-manual); }
.res-bar.directa { background: var(--s-directa); }
.res-bar.pendiente { background: repeating-linear-gradient(45deg, #8b8f8f, #8b8f8f 6px, #9da1a1 6px, #9da1a1 12px); }
.res-bar.estimated { outline: 2px dashed rgba(255,255,255,.75); outline-offset: -4px; opacity: .88; }
.res-bar.conflict { outline: 2px solid var(--danger); outline-offset: 1px; }
.res-bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.res-bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.res-bar .in { font-size: 10px; opacity: .85; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }

/* Correo */
.mail { display: grid; grid-template-columns: 180px 360px 1fr; gap: 0; height: calc(100vh - 110px); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; box-shadow: var(--shadow); }
.mail-folders { border-right: 1px solid var(--line); padding: 10px 8px; background: #fbfaf7; overflow: auto; }
.mail-folders a { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 7px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 13px; }
.mail-folders a.active { background: var(--accent-soft); color: var(--accent); }
.mail-folders h4 { margin: 14px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mail-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.mail-list .search { padding: 10px; border-bottom: 1px solid var(--line-2); }
.mail-items { overflow: auto; flex: 1; }
.mail-item { padding: 10px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; display: grid; gap: 3px; }
.mail-item:hover { background: #faf8f3; }
.mail-item.active { background: var(--accent-soft); }
.mail-item.unread .from, .mail-item.unread .subj { font-weight: 700; }
.mail-item .top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.mail-item .from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item .date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.mail-item .subj { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-item .snip { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-view { overflow: auto; min-width: 0; display: flex; flex-direction: column; }
.mail-view .head { padding: 16px 20px 12px; border-bottom: 1px solid var(--line-2); display: grid; gap: 8px; }
.ai-box { background: linear-gradient(0deg, #f4f8f6, #f4f8f6); border: 1px solid #d6e6e0; border-radius: 8px; padding: 10px 12px; font-size: 13px; display: grid; gap: 4px; }
.ai-box b { color: var(--accent); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.msg { padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.msg.out { background: #fafcfb; }
.msg .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; gap: 10px; }
.msg .meta strong { color: var(--ink); font-size: 13px; }
.msg .body { white-space: pre-wrap; word-wrap: break-word; font-size: 13.5px; }
.msg .body.collapsed { max-height: 160px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.composer { padding: 14px 20px 20px; display: grid; gap: 8px; border-top: 1px solid var(--line); background: #fbfaf7; position: sticky; bottom: 0; }
.composer textarea { min-height: 150px; background: #fff; }
.attach { font-size: 12px; color: var(--ink-2); display: flex; gap: 8px; flex-wrap: wrap; }

/* Chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - 110px); }
.chat-log { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: 760px; padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; line-height: 1.5; }
.bubble.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble.assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-form textarea { min-height: 44px; height: 44px; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 12px; }

/* Ajustes */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--accent); border-color: var(--accent); }
.switch { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.switch input { margin-top: 3px; }
.switch strong { display: block; font-size: 14px; color: var(--ink); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.on { background: #4cb377; } .status-dot.off { background: #c4594a; }
code.url { display: block; font-size: 11px; background: var(--line-2); padding: 6px 8px; border-radius: 6px; word-break: break-all; }

/* Modal y toasts */
.modal-back { position: fixed; inset: 0; background: rgba(15, 25, 25, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal .card-h { position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line-2); position: sticky; bottom: 0; background: #fff; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--side); color: #fff; padding: 10px 14px; border-radius: 9px; font-size: 13px; box-shadow: var(--shadow); max-width: 360px; animation: pop .2s ease; }
.toast.err { background: var(--danger); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3, .g-2 { grid-template-columns: 1fr; }
  .mail { grid-template-columns: 300px 1fr; }
  .mail-folders { display: none; }
}

/* ---------- Login con Google ---------- */
.google-btn { justify-content: center; gap: 10px; padding: 10px 12px; font-weight: 600; text-decoration: none; color: var(--ink); }
.sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Búsqueda ---------- */
.search-trigger { margin: 0 12px 6px; display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.08); color: var(--side-ink); border-radius: 8px; padding: 7px 10px; cursor: pointer; font-size: 13px; }
.search-trigger:hover { background: rgba(255,255,255,.12); }
kbd { font: 11px/1 ui-monospace, monospace; padding: 2px 5px; border-radius: 4px; background: rgba(255,255,255,.12); }
.search-box { max-width: 560px; margin-top: 10vh; align-self: start; }
.search-box input { border: 0; font-size: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none !important; }
.search-res { max-height: 60vh; overflow: auto; padding: 6px; }
.search-res h4 { margin: 10px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.search-res a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.search-res a:hover, .search-res a.sel { background: var(--accent-soft); }
.badge.soft { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- Puesta en marcha ---------- */
.steps { display: grid; gap: 0 24px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.step .grow { flex: 1; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.step { display: flex; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: var(--ink); }

.step .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; flex: none; }
.step.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.done .t { color: var(--muted); text-decoration: line-through; }
.progress { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* ---------- Limpieza ---------- */
.hk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.hk-card { border-radius: 12px; padding: 14px; border: 2px solid var(--line); background: #fff; cursor: pointer; display: grid; gap: 6px; user-select: none; transition: transform .08s; }
.hk-card:active { transform: scale(.97); }
.hk-card .n { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.hk-card.limpia { border-color: #9fd7b4; background: #f2faf5; }
.hk-card.sucia { border-color: #f0c77e; background: #fdf7ea; }
.hk-card.bloqueada { border-color: #e5a69c; background: #fbefed; }
.hk-card .st { font-size: 12px; font-weight: 600; }
.hk-card.limpia .st { color: var(--ok); } .hk-card.sucia .st { color: var(--warn); } .hk-card.bloqueada .st { color: var(--danger); }

/* ---------- Libro: arrastrar y fila de libres ---------- */
.res-bar[draggable=true] { cursor: grab; }
.res-bar.dragging { opacity: .45; }
.drop-ok { background: var(--accent-soft) !important; outline: 2px dashed var(--accent); outline-offset: -2px; }
.drop-bad { background: var(--danger-soft) !important; }
.book-free { font-size: 11px; text-align: center; color: var(--muted); display: flex; align-items: center; justify-content: center; height: 30px; border-right: 1px solid var(--line-2); background: #fbfaf7; position: sticky; bottom: 0; z-index: 2; border-top: 1px solid var(--line); }
.book-free.full { color: var(--danger); font-weight: 700; }
.book-room.foot { position: sticky; left: 0; bottom: 0; z-index: 4; height: 30px; background: #fbfaf7; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* ---------- Varios ---------- */
.back-btn { display: none; }
.quick-avail .row { gap: 8px; }
.attach a.chip { text-decoration: none; }
.attach a.chip:hover { background: var(--accent-soft); color: var(--accent); }
.kbd-hint { font-size: 11px; color: var(--muted); }
.kbd-hint kbd { background: var(--line-2); color: var(--ink-2); }
.room-opt-busy { color: var(--muted); }

@media (max-width: 760px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; z-index: 40; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(0,0,0,.15); }
  .brand, .sidebar-foot, .search-trigger { display: none; }
  nav { flex-direction: row; overflow-x: auto; padding: 4px; gap: 0; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav a { flex: 1 0 64px; flex-direction: column; gap: 2px; padding: 7px 4px; font-size: 10.5px; position: relative; text-align: center; }
  nav .ic { font-size: 17px; width: auto; }
  nav .long { display: none; }
  nav .badge { position: absolute; top: 2px; right: 8px; margin: 0; font-size: 9px; padding: 0 5px; }
  .main { padding: 14px 12px 24px; }
  .page-head h1 { font-size: 19px; }
  .page-head .actions { width: 100%; }
  .page-head .actions > * { flex: 1 1 auto; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .v { font-size: 22px; }
  .mail { grid-template-columns: 1fr; height: calc(100vh - 150px); }
  .mail-view { display: none; }
  .mail.show-detail .mail-list { display: none; }
  .mail.show-detail .mail-view { display: flex; }
  .back-btn { display: inline-flex; }
  .kbd-hint, .legend .muted { display: none; }
  .composer { position: static; }
  .book { max-height: calc(100vh - 230px); }
  .modal-back { padding: 0; align-items: end; }
  .modal { max-height: 92vh; border-radius: 16px 16px 0 0; }
  .search-box { margin-top: 0; border-radius: 0 0 16px 16px; align-self: start; }
  .row { flex-wrap: wrap; }
  .row > label { flex: 1 1 140px; }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); left: 12px; right: 12px; }
}
a.btn { text-decoration: none; color: var(--ink); }
a.btn.primary { color: var(--accent-ink); }
