/* Calendar Sync. Leeway minimal web style (vault: "Design - Leeway minimal web style"):
   white page, black ink and slate greys, Inter regular and semibold, 1 px rules, 6 px buttons.
   The only colours are the calendar colours and the one blue accent. */
:root {
  --ink: #0F172A; --ink-soft: #1E293B; --body: #334155; --faint: #64748B; --slate: #94A3B8;
  --line: #E2E8F0; --rule: #D9DEE5; --shade: #F2F4F7; --page: #FFFFFF; --input: #CBD5E1;
  --panel: #F2F2F2; --panel-rule: #E3E3E3; --panel-label: #6B6B6B; --accent: #1F77B4;
  --status-bg: #F1F5F9; --hover-btn: #E2E7EE; --hover-soft: #F7F8FA;
  --top: 56px; --hour: 48px; --gutter: 56px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
b, strong, .semi { font-weight: 600; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.faint { color: var(--faint); }
svg.i { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.kbd { display: inline-block; min-width: 20px; padding: 0 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; font-size: 12px; line-height: 18px; text-align: center; color: var(--body); background: #fff; }

/* buttons, inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 6px; font-size: 14px; font-weight: 600; line-height: 1.3; cursor: pointer; transition: background-color .12s, border-color .12s; white-space: nowrap; }
.btn.dark { background: var(--ink); border: 1px solid var(--ink); color: #fff; }
.btn.dark:hover { background: var(--ink-soft); }
.btn.light { background: #fff; border: 1px solid var(--input); color: var(--ink); }
.btn.light:hover { border-color: var(--slate); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.wide { width: 100%; font-size: 16px; padding: 11px 16px; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.ib { width: 34px; height: 34px; border-radius: 8px; background: transparent; border: 0; color: #6B7280; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.ib:hover { background: rgba(15,23,42,.06); color: var(--ink); }
.ib:disabled { opacity: .3; cursor: default; background: none; }
.ib svg.i { width: 18px; height: 18px; }
.seg { display: inline-flex; border: 1px solid var(--input); border-radius: 6px; overflow: hidden; background: #fff; }
.seg button { background: transparent; border: 0; padding: 6px 12px; font-size: 14px; cursor: pointer; color: var(--body); }
.seg button + button { border-left: 1px solid var(--input); }
.seg button:hover { background: var(--shade); }
.seg button.on { background: var(--ink); color: #fff; font-weight: 600; }
input[type=text], input[type=password], input[type=date], input[type=time], select {
  background: #fff; border: 1px solid var(--input); border-radius: 8px; padding: 8px 10px; font-size: 14px; outline: none; width: 100%; }
input:focus, select:focus { border-color: var(--ink); }
input.title-in { font-size: 18px; font-weight: 600; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 6px 0; }
input.title-in:focus { border-bottom-color: var(--ink); }
label.field { display: block; font-size: 14px; color: var(--faint); margin-bottom: 14px; }
label.field > span { display: block; margin-bottom: 6px; }
.err { color: #9B1C1C; font-size: 14px; margin-top: 10px; min-height: 1em; }
.note { font-size: 13px; color: var(--faint); margin-top: 8px; line-height: 1.5; }

/* top bar */
.top { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 28px; height: var(--top); padding: 0 24px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.brand svg.i { width: 20px; height: 20px; }
.brand.big { font-size: 22px; margin-bottom: 28px; }
.brand.big svg.i { width: 26px; height: 26px; }
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; }
.nav a { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; height: var(--top); text-decoration: none; color: var(--faint); font-size: 14px; }
.nav a:hover { color: var(--ink); }
.nav a.on { color: var(--ink); font-weight: 600; }
.nav a.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--ink); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--shade); color: var(--body); font-size: 12px; line-height: 18px; text-align: center; font-weight: 600; }
.nav a.on .badge { background: var(--ink); color: #fff; }
.top-r { display: flex; align-items: center; gap: 12px; }
.sstate { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--faint); background: none; border: 0; cursor: pointer; padding: 6px 8px; border-radius: 6px; white-space: nowrap; }
.sstate:hover { background: var(--shade); color: var(--ink); }
.sstate .dot { width: 7px; height: 7px; }
.sstate.spin .dot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .2; } }
.menu-btn { display: none; }
.mnav { border-top: 1px solid var(--line); padding: 6px 12px 10px; }
.mnav a { display: flex; justify-content: space-between; padding: 10px 6px; text-decoration: none; border-bottom: 1px solid var(--line); }
.mnav a.on { font-weight: 600; }
.banner { background: var(--status-bg); border-left: 3px solid var(--accent); padding: 9px 24px; font-size: 14px; color: var(--body); }
.banner a { color: var(--ink); }

/* plain pages (Sync, Conflicts, Calendars, Activity) */
.page { max-width: 1440px; margin: 0 auto; padding: 36px 48px 64px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { font-size: 30px; line-height: 1.25; letter-spacing: -.01em; font-weight: 600; margin: 0 0 6px; }
.page-head p { margin: 0; color: var(--body); max-width: 640px; line-height: 1.7; }
.stats { display: flex; gap: 48px; flex-wrap: wrap; padding: 4px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.stat .k { font-size: 13px; color: var(--faint); }
.stat .v { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
h2 { font-size: 17px; line-height: 1.4; font-weight: 600; margin: 44px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
h2:first-child { margin-top: 0; }
h2 .aside { font-size: 14px; font-weight: 400; color: var(--faint); }
.toolrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.empty { color: var(--faint); padding: 18px 0; }
.empty-big { text-align: center; padding: 64px 16px; color: var(--faint); }
.empty-big .t { font-size: 17px; color: var(--ink); font-weight: 600; margin-bottom: 6px; }

/* Walling grid table */
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-weight: 400; color: var(--faint); font-size: 14px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid th + th, .grid td + td { border-left: 1px solid var(--line); }
.grid th .h { display: inline-flex; align-items: center; gap: 8px; }
.grid td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid td.num { white-space: nowrap; }
.grid tr.item { cursor: pointer; transition: background-color .12s; }
.grid tr.item:hover { background: var(--shade); }
.grid tr.sec td { font-weight: 600; padding-top: 18px; }
.grid td.r, .grid th.r { text-align: right; }
.grid td.x { width: 56px; text-align: center; }
.cal { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.xbtn { width: 28px; height: 28px; border-radius: 7px; background: var(--shade); display: inline-flex; align-items: center; justify-content: center; color: var(--faint); }
tr.item:hover .xbtn, button.line:hover .xbtn { background: var(--hover-btn); color: var(--ink); }
.list { display: none; }
.list .hdr { display: flex; justify-content: space-between; font-size: 14px; color: var(--faint); padding: 8px 0; border-bottom: 1px solid var(--line); }
.list .sec { font-weight: 600; padding: 16px 0 6px; }
.list button.line { display: flex; width: 100%; align-items: center; gap: 10px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 11px 0; cursor: pointer; }
.list .line .nm { flex: 1; min-width: 0; }
.list .line .amt { color: var(--body); white-space: nowrap; font-size: 14px; }

/* summary (Walling, under a table) */
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 48px; }
.totals div { font-size: 17px; padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.totals div.big { font-size: 22px; font-weight: 600; border-bottom: 0; }
.info { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.info.flat { margin: 0; padding: 0; border: 0; }
.info .blk + .blk { margin-top: 16px; }
.info .blk div:first-child { font-weight: 600; }
.info .blk div + div { color: var(--body); }

/* calendars page */
.acc { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 24px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.acc .who { display: flex; align-items: center; gap: 12px; }
.acc .who .dot { width: 12px; height: 12px; }
.acc .nm { font-size: 17px; font-weight: 600; }
.acc .sub { font-size: 14px; color: var(--faint); }
.acc .k { font-size: 13px; color: var(--faint); }
.acc .v { color: var(--body); font-size: 14px; }
.status-ok { color: var(--ink); }
.status-bad { color: #9B1C1C; }
.device { margin-top: 16px; padding: 18px 20px; background: var(--status-bg); border-left: 3px solid var(--accent); }
.copyrow { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.copyrow code { font-size: 13px; background: #fff; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); word-break: break-all; }
.msform { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 10px; align-items: end; }
.msform .field { margin: 0; }
@media (max-width: 767px) { .msform { grid-template-columns: 1fr; } }
.device .code { font-size: 30px; font-weight: 600; letter-spacing: .12em; font-variant-numeric: tabular-nums; margin: 6px 0; }

/* the floating card (Walling) */
.backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 60; align-items: center; justify-content: center; padding: 24px; }
.backdrop.open { display: flex; animation: fade .12s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.card { width: 1060px; max-width: 100%; min-height: min(560px, 82vh); max-height: 86vh; background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(15,23,42,.25); display: flex; overflow: hidden; }
.card.narrow { width: 620px; min-height: 0; }
.pane { flex: 1; padding: 22px 40px 36px 48px; overflow: auto; }
.pane .top-row { display: flex; justify-content: flex-end; gap: 4px; margin: 0 -24px 6px 0; }
.pane .sec { font-size: 14px; color: var(--faint); }
.pane .title { font-size: 30px; line-height: 1.25; letter-spacing: -.01em; font-weight: 600; margin: 4px 0 18px; }
.pane .desc { font-size: 16px; line-height: 1.75; color: var(--body); max-width: 640px; }
.pane .desc p { margin: 0 0 12px; }
.side { width: 34%; max-width: 360px; background: var(--panel); padding: 22px 32px; overflow: auto; }
.side .top-row { display: flex; justify-content: flex-end; margin: 0 -14px 10px 0; }
.fld { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--panel-rule); }
.fld .l { display: flex; align-items: center; gap: 10px; color: var(--panel-label); font-weight: 600; font-size: 15px; }
.fld .l svg { color: #8A8A8A; }
.fld .v { font-size: 18px; line-height: 1.35; margin-top: 6px; word-break: break-word; }
.fld .v.small { font-size: 13px; color: var(--body); }
.form-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }
.homes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.homes label { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--input); border-radius: 999px; padding: 6px 12px 6px 10px; cursor: pointer; font-size: 14px; }
.homes label:has(input:checked) { border-color: var(--ink); background: var(--shade); font-weight: 600; }
.homes input { position: absolute; opacity: 0; pointer-events: none; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--body); cursor: pointer; }
.check input { accent-color: var(--ink); margin: 0; }
.preview { font-size: 14px; color: var(--body); background: var(--status-bg); border-radius: 8px; padding: 10px 12px; margin: 4px 0 16px; line-height: 1.6; }
.preview .row { display: flex; align-items: center; gap: 8px; }

/* popover (event details, quick create) */
.pop { position: fixed; z-index: 50; width: 360px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(15,23,42,.16); padding: 16px 18px 18px; animation: fade .1s ease-out; }
.pop .bar { height: 4px; border-radius: 2px; margin: -4px 0 12px; background: var(--c); }
.pop .x { position: absolute; top: 8px; right: 8px; }
.pop .pt { font-size: 18px; font-weight: 600; line-height: 1.35; padding-right: 30px; }
.pop .pl { display: flex; align-items: flex-start; gap: 10px; color: var(--body); font-size: 14px; margin-top: 8px; }
.pop .pl svg.i { margin-top: 2px; color: var(--faint); }
.pop .ph { font-size: 13px; color: var(--faint); margin: 14px 0 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.pop .mr { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 3px 0; }
.pop .mr .s { margin-left: auto; color: var(--faint); font-size: 13px; }
.pop .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; box-shadow: 0 8px 24px rgba(15,23,42,.2); }

/* ------------------------------------------------------------------ calendar page */
body[data-page=calendar] { overflow: hidden; }
.main-calendar { height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); }
.cal-shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); height: 100%; }
.cal-side { border-right: 1px solid var(--line); padding: 18px 18px 24px; overflow: auto; }
.cal-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cal-tool { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.cal-tool h1 { font-size: 20px; font-weight: 600; margin: 0 0 0 6px; white-space: nowrap; letter-spacing: -.01em; }
.cal-tool .sp { flex: 1; }
.cal-tool .side-btn { display: none; }
.cal-body { flex: 1; min-height: 0; overflow: auto; position: relative; scrollbar-gutter: stable; }

/* mini month */
.mini-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mini-h .t { font-weight: 600; font-size: 14px; }
.mini-h .ib { width: 28px; height: 28px; }
.mini { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; }
.mini .wd { color: var(--slate); padding: 4px 0; }
.mini button { position: relative; border: 0; background: none; height: 30px; border-radius: 8px; cursor: pointer; font-size: 12.5px; color: var(--body); font-variant-numeric: tabular-nums; }
.mini button:hover { background: var(--shade); }
.mini button.out { color: var(--slate); }
.mini button.inrange { background: var(--shade); border-radius: 0; }
.mini button.today { color: #fff; }
.mini button.today::before { content: ""; position: absolute; inset: 3px 5px; border-radius: 7px; background: var(--ink); z-index: -1; }
.mini button { z-index: 0; }
.mini button.has::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 3px; height: 3px; border-radius: 50%; background: var(--slate); transform: translateX(-50%); }
.mini button.today.has::after { background: #fff; }
.side-h { font-size: 13px; color: var(--faint); margin: 24px 0 8px; display: flex; justify-content: space-between; }
.calrow { display: flex; align-items: center; gap: 10px; padding: 6px 6px; margin: 0 -6px; border-radius: 8px; cursor: pointer; font-size: 14px; user-select: none; }
.calrow:hover { background: var(--shade); }
.calrow .box { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--c); background: var(--c); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.calrow.off .box { background: #fff; }
.calrow .box svg.i { width: 12px; height: 12px; stroke: #fff; stroke-width: 2.6; }
.calrow.off .box svg.i { display: none; }
.calrow .n { margin-left: auto; color: var(--slate); font-size: 12px; font-variant-numeric: tabular-nums; }
.calrow .only { margin-left: auto; display: none; font-size: 12px; color: var(--faint); background: none; border: 0; cursor: pointer; padding: 0; }
.calrow:hover .n { display: none; }
.calrow:hover .only { display: inline; }
.calrow .warn { font-size: 12px; color: #9B1C1C; }
.toggle { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; color: var(--body); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--ink); margin: 0; width: 15px; height: 15px; }
.side-foot { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--faint); line-height: 1.8; }

/* time grid (week and day) */
.tg { position: relative; min-width: 100%; }
.tg-head { position: sticky; top: 0; z-index: 6; background: #fff; display: grid; grid-template-columns: var(--gutter) repeat(var(--cols), minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.tg-head .tz { font-size: 11px; color: var(--slate); align-self: end; padding: 0 6px 6px 0; text-align: right; }
.dh { padding: 10px 8px 8px; display: flex; align-items: baseline; gap: 7px; cursor: pointer; border-left: 1px solid transparent; }
.dh:hover .dn { background: var(--shade); }
.dh .wd { font-size: 12px; color: var(--faint); text-transform: none; }
.dh .dn { font-size: 22px; font-weight: 600; line-height: 1; padding: 4px 7px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.dh.today .dn { background: var(--ink); color: #fff; }
.dh.today .wd { color: var(--ink); font-weight: 600; }
.dh.past .dn { color: var(--slate); }
.dh.acc-h { align-items: center; gap: 9px; font-weight: 600; font-size: 15px; cursor: default; }
.dh.acc-h .sub { font-weight: 400; font-size: 12px; color: var(--faint); }
.tg-all { grid-column: 1 / -1; display: grid; grid-template-columns: var(--gutter) repeat(var(--cols), minmax(0, 1fr)); border-top: 1px solid var(--line); }
.tg-all .lab { font-size: 11px; color: var(--slate); text-align: right; padding: 7px 6px 0 0; }
.tg-all .cell { border-left: 1px solid var(--line); padding: 3px 3px 4px; display: flex; flex-direction: column; gap: 3px; min-height: 26px; }
.tg-body { display: grid; grid-template-columns: var(--gutter) repeat(var(--cols), minmax(0, 1fr)); }
.gut { position: relative; height: calc(24 * var(--hour)); }
.gut span { position: absolute; right: 8px; font-size: 11px; color: var(--slate); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.col { position: relative; height: calc(24 * var(--hour)); border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hour)); cursor: cell; }
.col::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--hour) / 2), #F1F3F6 calc(var(--hour) / 2) calc(var(--hour) / 2 + 1px), transparent calc(var(--hour) / 2 + 1px) var(--hour)); }
.col.today { background-color: #FBFCFD; }
.col.weekend { background-color: #FCFCFD; }
.now { position: absolute; left: -1px; right: 0; height: 0; border-top: 2px solid var(--accent); z-index: 5; pointer-events: none; }
.now::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.sel { position: absolute; left: 3px; right: 3px; z-index: 4; border-radius: 6px; background: rgba(15,23,42,.08); border: 1px solid var(--ink); font-size: 12px; padding: 3px 7px; color: var(--ink); font-weight: 600; pointer-events: none; }

.ev { position: absolute; z-index: 2; border-radius: 6px; padding: 3px 7px 3px 9px; font-size: 12.5px; line-height: 1.3; overflow: hidden; cursor: pointer;
  background: color-mix(in srgb, var(--c) 11%, #fff); border: 1px solid color-mix(in srgb, var(--c) 22%, #fff); color: var(--ink);
  transition: box-shadow .12s, transform .12s; }
.ev::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.ev:hover { box-shadow: 0 2px 10px rgba(15,23,42,.12); z-index: 7; }
.ev.active { box-shadow: 0 0 0 2px var(--ink); z-index: 8; }
.ev .tt { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev .tm { color: var(--body); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .dots { position: absolute; right: 5px; bottom: 4px; display: flex; gap: 3px; }
.ev .dots .dot { width: 6px; height: 6px; }
.ev.short { padding-top: 1px; }
.ev.short .tt { display: inline; }
.ev.short .tm { display: inline; margin-left: 6px; }
.ev.past { opacity: .58; }
.ev.skip { background: #fff; border: 1px dashed var(--input); color: var(--faint); }
.ev.skip::before { opacity: .45; }
.ev.skip .tt { font-weight: 400; text-decoration: line-through; }
.ev.mirror { background: repeating-linear-gradient(135deg, #F1F4F7 0 5px, #fff 5px 10px); border: 1px solid var(--line); color: var(--body); }
.ev.planned { background: repeating-linear-gradient(135deg, #F1F4F7 0 5px, #fff 5px 10px); border: 1px dashed var(--slate); color: var(--body); }
.chip { position: relative; display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.3; border-radius: 5px; padding: 2px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  background: color-mix(in srgb, var(--c) 13%, #fff); color: var(--ink); }
.chip:hover { background: color-mix(in srgb, var(--c) 22%, #fff); }
.chip.skip { background: #fff; color: var(--faint); text-decoration: line-through; border: 1px dashed var(--input); }
.chip.planned, .chip.mirror { background: repeating-linear-gradient(135deg, #F1F4F7 0 4px, #fff 4px 8px); border: 1px dashed var(--slate); color: var(--body); }
.chip.line { background: none; padding: 1px 4px; }
.chip.line:hover { background: var(--shade); }
.chip.line .tm { color: var(--faint); font-variant-numeric: tabular-nums; }
.chip.line .tt { overflow: hidden; text-overflow: ellipsis; }

/* month */
.mo { display: grid; grid-template-rows: auto repeat(6, minmax(110px, 1fr)); min-height: 100%; }
.mo-h, .mo-r { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mo-h div { font-size: 12px; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.mo-c { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 4px 6px; min-width: 0; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.mo-c:nth-child(7n) { border-right: 0; }
.mo-c:hover { background: var(--hover-soft); }
.mo-c .d { font-size: 12.5px; font-weight: 600; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; margin: 0 0 2px 2px; font-variant-numeric: tabular-nums; }
.mo-c.out .d { color: var(--slate); font-weight: 400; }
.mo-c.today .d { background: var(--ink); color: #fff; }
.mo-c .more { font-size: 12px; color: var(--faint); padding: 1px 4px; border: 0; background: none; text-align: left; cursor: pointer; }
.mo-c .more:hover { color: var(--ink); }

/* agenda */
.ag { max-width: 920px; padding: 8px 28px 48px; }
.ag-day { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ag-day .dl { position: sticky; top: 8px; align-self: start; }
.ag-day .dl .n { font-size: 26px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.ag-day .dl .w { font-size: 13px; color: var(--faint); margin-top: 4px; }
.ag-day.today .dl .n { color: var(--accent); }
.ag-row { display: grid; grid-template-columns: 120px 14px 1fr auto; gap: 10px; align-items: center; padding: 7px 8px; margin: 0 -8px; border-radius: 8px; cursor: pointer; }
.ag-row:hover { background: var(--shade); }
.ag-row .tm { color: var(--body); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ag-row .tt { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-row .cl { font-size: 13px; color: var(--faint); white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; justify-self: end; }
.ag-row .ds { display: flex; gap: 3px; }
.ag-row.skip .tt { font-weight: 400; color: var(--faint); text-decoration: line-through; }
.ag-row.past { opacity: .6; }

/* help */
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 14px; color: var(--body); }

/* login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login { width: 360px; max-width: 100%; }
.login-foot { font-size: 12px; color: var(--faint); margin-top: 22px; }

/* ------------------------------------------------------------------ phones */
@media (max-width: 1023px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .top-in { gap: 12px; padding: 0 12px; justify-content: space-between; }
  .sstate .lbl { display: none; }
  .cal-shell { grid-template-columns: minmax(0, 1fr); }
  .cal-side { display: none; position: fixed; z-index: 40; top: var(--top); left: 0; bottom: 0; width: 290px; background: #fff; box-shadow: 8px 0 30px rgba(15,23,42,.15); }
  .cal-side.open { display: block; }
  .cal-tool .side-btn { display: inline-flex; }
}
@media (max-width: 767px) {
  #newBtn span { display: none; }
  #newBtn { padding: 8px 10px; }
  .page { padding: 24px 14px 48px; }
  .page-head h1 { font-size: 24px; }
  .stats { gap: 28px; }
  table.grid.collapse { display: none; }
  .list { display: block; }
  .summary { grid-template-columns: 1fr; gap: 28px; }
  .acc { grid-template-columns: 1fr; gap: 10px; }
  .cal-tool { padding: 10px 10px; gap: 6px; flex-wrap: wrap; }
  .cal-tool h1 { font-size: 17px; order: 5; width: 100%; margin: 4px 0 0 4px; }
  .seg button { padding: 6px 9px; font-size: 13px; }
  :root { --gutter: 44px; }
  .ag { padding: 4px 12px 40px; }
  .ag-day { grid-template-columns: 52px 1fr; gap: 10px; }
  .ag-row { grid-template-columns: 1fr auto; gap: 2px 10px; }
  .ag-row .tm { grid-column: 1 / -1; font-size: 13px; color: var(--faint); }
  .ag-row .dotc { display: none; }
  .mo { grid-template-rows: auto repeat(6, minmax(76px, 1fr)); }
  .mo-c .chip { font-size: 11px; padding: 1px 4px; }
  .backdrop { padding: 0; }
  .card { flex-direction: column; border-radius: 0; width: 100%; height: 100%; max-height: none; min-height: 0; }
  .pane { padding: 14px 16px 22px; flex: none; }
  .pane .title { font-size: 24px; }
  .side { width: 100%; max-width: none; flex: 1; padding: 18px 16px; }
  .side .top-row { display: none; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .form-row .full { grid-column: 1 / -1; }
  .pop { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100%; max-width: none; border-radius: 14px 14px 0 0; padding-bottom: 28px; }
}
@media print {
  .top, .banner, .cal-side, .cal-tool, .pop, .backdrop { display: none !important; }
}
