/* axi0 Calendar (/calendar/): the axi0 family look, as on Notes. True black or warm paper, Instrument Sans, the orange
   core as the accent; events wear one of eight colours as a bar and a faint tint, their text stays in the page's ink
   (AA in both themes). No inline styles in the markup (the page runs under style-src 'self'); positions in the week
   grid are set from the script through the style object, which the policy allows. */
@font-face {
  font-family: "Instrument Sans";
  src: url(/axi0/fonts/instrument-sans-latin-var.woff2) format("woff2");
  font-weight: 400 700;
  font-display: optional;
}
:root {
  --bg: #000; --panel: #0a0a0c; --panel2: #0d0d10; --panel-a: rgba(10, 10, 12, .9); --field: #050506; --hover: #141418; --raise: #18181d;
  --line: #1c1c21; --line1b: #1d1d23; --line2: #2a2a31; --line3b: #33333b; --line3: #3a3a42; --field-line: #2a2a31;
  --head: #fff; --ink: #f5f5f7; --ink2: #f1f1f4; --text: #d6d6dc; --text2: #c4c4cc; --icon: #b9b9c2; --soft: #b4b4bd; --soft2: #a9a9b3;
  --lede: #a3a3ad; --soft4: #9a9aa4; --mute: #8e8e98; --faint: #868692; --place: #7c7c87;
  --core: #f6a04d; --core-ink: #f6a04d; --core-hover: #ffb26a; --on-core: #000;
  --danger: #ff8f78; --danger-line: rgba(255, 143, 120, .4);
  --knob: #c8c8d0; --veil: rgba(255, 255, 255, .08); --uline: rgba(196, 196, 204, .45);
  --c-core: #f6a04d; --c-red: #ff6b6b; --c-rose: #f48fb8; --c-green: #3ddc84; --c-teal: #2dd4bf; --c-blue: #6f9dff; --c-violet: #b48cff; --c-gray: #9a9aa4;
  --tint: 18%; --today: rgba(246, 160, 77, .14); --out: #050506; --now: #ff6b6b; --hour: 48px;
  color-scheme: dark;
}
html[data-axi0-theme="light"] {
  --bg: #f6f2ea; --panel: #fffdf9; --panel2: #fffdf9; --panel-a: rgba(255, 253, 249, .92); --field: #fffdf9; --hover: #efe8dc; --raise: #ece5d8;
  --line: #e6dfd3; --line1b: #e6dfd3; --line2: #d3cabb; --line3b: #b9ae9c; --line3: #8a8174; --field-line: #8a8174;
  --head: #17140f; --ink: #17140f; --ink2: #1f1b16; --text: #2c2823; --text2: #3d3730; --icon: #4f4940; --soft: #4a433b; --soft2: #50483f;
  --lede: #4f4940; --soft4: #5d554b; --mute: #675f54; --faint: #675f54; --place: #6f665a;
  --core-ink: #9a4a0a; --danger: #b3261e; --danger-line: rgba(179, 38, 30, .4);
  --knob: #6f665a; --veil: rgba(60, 40, 20, .07); --uline: rgba(61, 55, 48, .45);
  --c-core: #e08a2e; --c-red: #d33f3f; --c-rose: #c2457a; --c-green: #1f9d55; --c-teal: #0f8f80; --c-blue: #3563d9; --c-violet: #7c4ddb; --c-gray: #7d7468;
  --tint: 14%; --today: rgba(224, 138, 46, .12); --out: #f1ece2; --now: #d33f3f;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  html:not([data-axi0-theme="dark"]) {
    --bg: #f6f2ea; --panel: #fffdf9; --panel2: #fffdf9; --panel-a: rgba(255, 253, 249, .92); --field: #fffdf9; --hover: #efe8dc; --raise: #ece5d8;
    --line: #e6dfd3; --line1b: #e6dfd3; --line2: #d3cabb; --line3b: #b9ae9c; --line3: #8a8174; --field-line: #8a8174;
    --head: #17140f; --ink: #17140f; --ink2: #1f1b16; --text: #2c2823; --text2: #3d3730; --icon: #4f4940; --soft: #4a433b; --soft2: #50483f;
    --lede: #4f4940; --soft4: #5d554b; --mute: #675f54; --faint: #675f54; --place: #6f665a;
    --core-ink: #9a4a0a; --danger: #b3261e; --danger-line: rgba(179, 38, 30, .4);
    --knob: #6f665a; --veil: rgba(60, 40, 20, .07); --uline: rgba(61, 55, 48, .45);
    --c-core: #e08a2e; --c-red: #d33f3f; --c-rose: #c2457a; --c-green: #1f9d55; --c-teal: #0f8f80; --c-blue: #3563d9; --c-violet: #7c4ddb; --c-gray: #7d7468;
    --tint: 14%; --today: rgba(224, 138, 46, .12); --out: #f1ece2; --now: #d33f3f;
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--bg);
  font: 15px/1.55 "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased;
}
a { color: var(--core-ink); text-underline-offset: 3px; }
::selection { background: rgba(246, 160, 77, .35); }
[hidden] { display: none !important; }
.is-locked .when-unlocked, .is-unlocked .when-locked { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 8px 14px; border-radius: 999px; background: var(--core); color: var(--on-core); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--core-ink); outline-offset: 2px; }

/* ---- header ------------------------------------------------------------------------------------------------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1080px; margin: 0 auto; padding: 22px 20px 8px; }
.mark { display: inline-flex; align-items: baseline; gap: .12em; color: var(--head); text-decoration: none; font-size: 26px; font-weight: 600; letter-spacing: -.045em; white-space: nowrap; }
.mark-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--core); box-shadow: 0 0 9px var(--core); transform: translateY(-2px); }
.mark-s { color: var(--mute); font-weight: 500; }
.top-nav { display: flex; gap: 20px; }
.top-nav a { color: var(--soft); text-decoration: none; font-size: 14px; }
.top-nav a:hover { color: var(--head); text-decoration: underline; }
.top-right { display: flex; align-items: center; gap: 14px; }
.top-nav a { line-height: 44px; }
.theme-btn {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line2); border-radius: 50%;
  background: var(--panel); color: var(--icon); cursor: pointer; transition: border-color .15s, color .15s;
}
.theme-btn:hover { border-color: var(--core); color: var(--head); }
.theme-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .i-moon, html[data-axi0-theme="light"] .theme-btn .i-sun { display: none; }
html[data-axi0-theme="light"] .theme-btn .i-moon { display: block; }
@media (prefers-color-scheme: light) {
  html:not([data-axi0-theme="dark"]) .theme-btn .i-sun { display: none; }
  html:not([data-axi0-theme="dark"]) .theme-btn .i-moon { display: block; }
}
.me-slot { position: relative; flex: none; width: 36px; height: 36px; }
.me-slot:empty { display: none; }

/* ---- layout ------------------------------------------------------------------------------------------------- */
main { max-width: 1080px; margin: 0 auto; padding: 4px 20px 24px; }
h1 { margin: 22px 0 8px; color: var(--head); font-size: clamp(32px, 5vw, 44px); font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
.lede { max-width: 46em; margin: 0; color: var(--lede); }
.is-unlocked h1 { margin-top: 12px; font-size: 30px; }
.is-unlocked .lede { font-size: 14px; }
.card { margin-top: 18px; padding: 22px 24px 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); }
h2 { margin: 0 0 12px; color: var(--head); font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
h3 { margin: 22px 0 6px; color: var(--head); font-size: 15px; font-weight: 600; }
.card > p { margin: 0 0 10px; }
.facts { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; color: var(--lede); font-size: 14px; }
.facts li { padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; }
.facts strong { display: block; margin-bottom: 4px; color: var(--head); font-weight: 600; }
@media (min-width: 860px) { .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- form controls ------------------------------------------------------------------------------------------- */
label { display: block; margin: 16px 0 6px; color: var(--head); font-size: 14px; }
label.inline { display: inline; margin: 0; color: var(--text); }
input[type="text"], input[type="search"], textarea, select {
  width: 100%; min-height: 42px; padding: 9px 13px; border: 1px solid var(--field-line); border-radius: 12px;
  background: var(--field); color: var(--head); font: inherit; font-size: 15px;
}
select { width: auto; min-width: 120px; }
input::placeholder, textarea::placeholder { color: var(--place); }
input[type="text"]:focus, input[type="search"]:focus, select:focus { outline: none; border-color: var(--core); box-shadow: 0 0 0 3px rgba(246, 160, 77, .18); }
.hint { margin: 6px 0 0; color: var(--mute); font-size: 13px; }
.error { margin: 6px 0 0; color: var(--danger); font-size: 13px; }
.error:empty, .note:empty { display: none; }
.note { margin: 8px 0 0; color: var(--core-ink); font-size: 13px; }
.warn { color: var(--head); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.row.tight { flex-wrap: nowrap; margin-top: 0; }
.row.tight input { flex: 1 1 auto; min-width: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; margin: 0;
  border: 1px solid var(--line2); border-radius: 999px; background: var(--panel); color: var(--head); font: inherit; font-size: 14px;
  white-space: nowrap; cursor: pointer; transition: border-color .15s, background .15s;
}
.btn:hover { border-color: rgba(246, 160, 77, .7); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { border-color: var(--core); background: var(--core); color: var(--on-core); font-weight: 600; }
.btn.primary:hover { background: var(--core-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.file { position: relative; overflow: hidden; }
.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.btn.file:focus-within { outline: 2px solid var(--core-ink); outline-offset: 2px; }
.check { display: inline-flex; align-items: center; gap: 9px; margin: 0; font-size: 14px; color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--core); }
.icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--soft2); cursor: pointer; }
.icon:hover { background: var(--hover); color: var(--head); }
.icon:disabled { opacity: .35; cursor: default; background: none; }
.icon svg { width: 19px; height: 19px; }
.icon[aria-pressed="true"] { color: var(--core-ink); }

/* ---- the Key ---------------------------------------------------------------------------------------------- */
.key .new { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.key .new h3 { margin-top: 0; }
.key .new p { margin: 0 0 12px; }
.keytext { margin: 10px 0 0; padding: 14px 16px; border: 1px dashed rgba(246, 160, 77, .55); border-radius: 12px; background: rgba(246, 160, 77, .05);
  color: var(--head); font: 15px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; overflow-wrap: anywhere; user-select: all; }


/* ---- status, undo, footer -------------------------------------------------------------------------------- */
.sync { display: flex; align-items: center; gap: 8px; min-height: 22px; margin: 12px 0 0; color: var(--mute); font-size: 13px; }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line3); flex: none; }
.sync:empty::before { display: none; }
.sync.is-ok::before { background: var(--core); box-shadow: 0 0 7px rgba(246, 160, 77, .8); }
.sync.is-busy::before { background: var(--icon); }
.sync.is-bad { color: var(--danger); }
.sync.is-bad::before { background: var(--danger); }
.undo { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 10px 0 0; padding: 10px 12px 10px 16px; border: 1px solid var(--line2); border-radius: 14px; color: var(--head); font-size: 14px; }
.undo .btn { min-height: 34px; }
.foot { max-width: 1080px; margin: 0 auto; padding: 4px 20px 44px; color: var(--faint); font-size: 12.5px; }
.foot p { margin: 0 0 6px; max-width: 60em; }
.foot a { color: var(--text2); text-decoration: underline; text-decoration-color: var(--uline); }
.foot a:hover { text-decoration-color: currentColor; }
.locker { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.locker .row { margin-top: 8px; }
.locker .btn { min-height: 36px; font-size: 13px; }
.locker select { min-height: 36px; padding: 5px 10px; font-size: 13px; }
.meter { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.meter-bar { display: inline-block; width: 140px; height: 6px; overflow: hidden; border-radius: 999px; background: var(--line1b); }
.meter-fill { display: block; width: 0; height: 100%; border-radius: 999px; background: var(--core); }
.meter-fill.is-full { background: var(--danger); }


/* ---- the calendar ------------------------------------------------------------------------------------------------ */
main { max-width: 1240px; }
.top, .foot { max-width: 1240px; }
.cal { margin-top: 14px; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
.bar-nav { display: flex; align-items: center; gap: 4px; min-width: 0; }
.bar-nav h2 { margin: 0 0 0 8px; font-size: 22px; letter-spacing: -.02em; white-space: nowrap; }
.views { display: inline-flex; padding: 3px; border: 1px solid var(--line2); border-radius: 999px; background: var(--panel); }
.views button {
  min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--soft); font: inherit; font-size: 14px; cursor: pointer;
}
.views button:hover { color: var(--head); }
.views button[aria-pressed="true"] { background: var(--core); color: var(--on-core); font-weight: 600; }
.bar-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.bar-tools input[type="search"] { width: 220px; min-height: 40px; }
.icon svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.view { border: 1px solid var(--line); border-radius: 20px; background: var(--panel); overflow: hidden; }
.ev { --ev: var(--c-core); }
.ev-red { --ev: var(--c-red); } .ev-rose { --ev: var(--c-rose); } .ev-green { --ev: var(--c-green); } .ev-teal { --ev: var(--c-teal); }
.ev-blue { --ev: var(--c-blue); } .ev-violet { --ev: var(--c-violet); } .ev-gray { --ev: var(--c-gray); }
.chip, .blk, .item {
  background: var(--panel2); background: color-mix(in srgb, var(--ev) var(--tint), var(--panel));
  border: 0; border-left: 3px solid var(--ev); color: var(--head); font: inherit; text-align: left; cursor: pointer;
}
.chip:hover, .blk:hover, .item:hover { background: color-mix(in srgb, var(--ev) calc(var(--tint) + 10%), var(--panel)); }
.chip:focus-visible, .blk:focus-visible, .item:focus-visible { outline: 2px solid var(--core-ink); outline-offset: 1px; }

/* month */
.month { width: 100%; border-collapse: collapse; table-layout: fixed; }
.month caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.month th { padding: 10px 8px 6px; color: var(--mute); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.month td { height: 118px; padding: 4px 4px 6px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); vertical-align: top; }
.month td:first-child { border-left: 0; }
.month td.out { background: var(--out); }
.month td.is-sel { box-shadow: inset 0 0 0 2px var(--line3b); }
.month td.is-today { background: var(--today); }
.daynum {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border: 0; border-radius: 999px;
  background: none; color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer;
}
.out .daynum { color: var(--mute); }
.daynum:hover { background: var(--hover); color: var(--head); }
.daynum[aria-current="date"] { background: var(--core); color: var(--on-core); font-weight: 700; }
.chips { display: grid; gap: 2px; margin: 2px 0 0; padding: 0; list-style: none; }
.chip { display: block; width: 100%; min-height: 24px; padding: 3px 6px; overflow: hidden; border-radius: 6px; font-size: 12.5px; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; }
.chip .tm { color: var(--soft); font-variant-numeric: tabular-nums; }
.more { display: block; width: 100%; min-height: 24px; padding: 2px 6px; border: 0; border-radius: 6px; background: none; color: var(--soft); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.more:hover { background: var(--hover); color: var(--head); }
.dots { display: none; }

/* week and day */
.wk { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
.wk.n1 { grid-template-columns: 56px minmax(0, 1fr); }
.wk-h { position: sticky; top: 0; z-index: 2; display: contents; }
.colh { padding: 8px 6px 6px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); text-align: center; }
.colh button { display: inline-flex; flex-direction: column; align-items: center; gap: 0; min-width: 44px; padding: 2px 8px; border: 0; border-radius: 12px; background: none; color: var(--soft); font: inherit; cursor: pointer; }
.colh button:hover { background: var(--hover); color: var(--head); }
.colh .dn { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.colh .dd { color: var(--head); font-size: 20px; font-weight: 600; line-height: 1.2; }
.colh button[aria-current="date"] .dd { color: var(--core-ink); }
.corner { border-bottom: 1px solid var(--line); }
.alld { min-height: 30px; padding: 3px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.alld-l { padding: 6px 6px 0 0; border-bottom: 1px solid var(--line); color: var(--mute); font-size: 11px; text-align: right; }
.alld .chips { margin: 0; }
.tg-wrap { max-height: 66vh; overflow-y: auto; overscroll-behavior: contain; }
.tg { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
.tg.n1 { grid-template-columns: 56px minmax(0, 1fr); }
.hours { position: relative; height: calc(24 * var(--hour)); }
.hours span { position: absolute; right: 8px; color: var(--mute); font-size: 11px; font-variant-numeric: tabular-nums; transform: translateY(-50%); }
.dcol {
  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));
}
.dcol.is-today { background-color: var(--today); }
.dcol ul { margin: 0; padding: 0; list-style: none; }
.blk { position: absolute; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; text-align: left; overflow: hidden; padding: 2px 6px; border-radius: 6px; font-size: 12px; line-height: 1.3; box-shadow: 0 0 0 1px var(--panel); }
.blk-more { display: grid; place-items: center; border: 1px dashed var(--line3); background: var(--panel); color: var(--head); font-weight: 600; }
.blk-more:hover { background: var(--hover); }
.blk .tm { display: block; color: var(--soft); font-size: 11px; font-variant-numeric: tabular-nums; }
.blk .tt { display: block; font-weight: 600; overflow-wrap: break-word; }
.blk.slim { padding: 2px 4px; }
.blk.slim .tt, .blk.slim .tm { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nowline { position: absolute; left: 0; right: 0; z-index: 1; height: 2px; background: var(--now); pointer-events: none; }
.nowline::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--now); }

/* agenda, search results, the day under a phone's month */
.agenda { padding: 6px 18px 16px; }
.agenda h3 { margin: 16px 0 6px; color: var(--head); font-size: 14px; font-weight: 600; }
.agenda h3 .rel { margin-left: 8px; color: var(--core-ink); font-weight: 500; }
.agenda ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.item { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 2px 14px; width: 100%; padding: 9px 12px; border-radius: 10px; }
.item .tm { color: var(--soft); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.item .tt { color: var(--head); font-weight: 600; overflow-wrap: anywhere; }
.item .sub { grid-column: 2; color: var(--lede); font-size: 13px; overflow-wrap: anywhere; }
.agenda .empty { margin: 16px 0 6px; }
.agenda .btn { margin-top: 14px; }
.daylist { border-top: 1px solid var(--line); }

/* the editor and the "which ones?" question */
#ed-form.is-allday .when-timed { display: none; }
dialog.dlg {
  width: min(600px, calc(100vw - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 0; overflow: auto;
  border: 1px solid var(--line2); border-radius: 20px; background: var(--panel); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
dialog.dlg.small { width: min(420px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
.dlg form { padding: 18px 22px 20px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dlg-head h2 { margin: 0; }
.dlg label { margin: 14px 0 6px; }
.dlg .check { margin: 12px 0 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
input[type="date"], input[type="time"], input[type="number"] {
  width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--field-line); border-radius: 12px; background: var(--field); color: var(--head); font: inherit; font-size: 15px;
}
input[type="number"] { width: 92px; }
input:disabled { opacity: .5; }
input[type="date"]:focus, input[type="time"]:focus, input[type="number"]:focus, textarea:focus { outline: none; border-color: var(--core); box-shadow: 0 0 0 3px rgba(246, 160, 77, .18); }
.dlg textarea { min-height: 76px; resize: vertical; }
.dlg select { width: 100%; }
fieldset { min-width: 0; margin: 14px 0 0; padding: 0; border: 0; }
legend { margin: 0 0 6px; padding: 0; color: var(--head); font-size: 14px; }
.rule { padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: 14px; }
.rule .row { margin-top: 10px; }
.rule .row:first-child { margin-top: 0; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.days label { position: relative; margin: 0; }
.days input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.days span { display: inline-grid; place-items: center; min-width: 44px; height: 36px; padding: 0 8px; border: 1px solid var(--line2); border-radius: 999px; color: var(--soft); font-size: 13px; cursor: pointer; }
.days input:checked + span { border-color: var(--core); background: var(--core); color: var(--on-core); font-weight: 600; }
.days input:focus-visible + span { outline: 2px solid var(--core-ink); outline-offset: 2px; }
.colors { display: flex; flex-wrap: wrap; gap: 8px; }
.colors label { position: relative; margin: 0; }
.colors input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.colors span { display: block; width: 32px; height: 32px; border: 2px solid transparent; border-radius: 50%; background: var(--ev); box-shadow: inset 0 0 0 3px var(--panel); cursor: pointer; }
.colors input:checked + span { border-color: var(--head); }
.colors input:focus-visible + span { outline: 2px solid var(--core-ink); outline-offset: 2px; }
.dlg-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.dlg-acts .sp { flex: 1 1 auto; }
.scope-acts { display: grid; gap: 8px; margin-top: 14px; }
.scope-acts .btn { justify-content: flex-start; }
.alert { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 10px 0 0; padding: 10px 12px 10px 16px; border: 1px solid var(--core); border-radius: 14px; color: var(--head); }
.keys { margin: 8px 0 0; color: var(--lede); font-size: 13px; }
.keys summary { cursor: pointer; color: var(--text2); }
.keys dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0 0; }
.keys dt { color: var(--head); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.keys dd { margin: 0; }
.foot .row label.inline { margin-right: -4px; }
.foot select { max-width: 240px; }

@media (max-width: 900px) {
  .bar-tools { width: 100%; margin-left: 0; }
  .bar-tools input[type="search"] { flex: 1 1 auto; width: auto; }
}
@media (max-width: 600px) {
  .top { padding: 16px 16px 4px; }
  .mark { font-size: 22px; }
  .top-nav { gap: 14px; }
  .top { flex-wrap: wrap; gap: 4px 12px; padding-bottom: 2px; }
  .mark { margin-right: auto; }
  .top-right { display: contents; }
  .top-nav { order: 3; flex-basis: 100%; margin: 0; }
  main { padding: 0 10px 20px; }
  .card { padding: 18px 16px 20px; border-radius: 18px; }
  .row.tight { flex-wrap: wrap; }
  .row.tight input { flex-basis: 100%; }
  .foot { padding: 4px 16px 36px; }
  .bar { gap: 8px; }
  .bar-nav { width: 100%; }
  .bar-nav h2 { flex: 1 1 0; min-width: 0; font-size: 19px; line-height: 1.2; white-space: normal; overflow-wrap: anywhere; }
  .views { width: 100%; }
  .views button { flex: 1 1 0; padding: 0 6px; }
  .view { border-radius: 16px; }
  .month th { padding: 8px 2px 4px; font-size: 11px; text-align: center; }
  .month td { height: 56px; padding: 2px; text-align: center; }
  .daynum { min-width: 32px; height: 32px; padding: 0 4px; }
  .month .chips, .month .more { display: none; }
  .dots { display: flex; justify-content: center; gap: 3px; height: 6px; margin-top: 2px; }
  .dots i { display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--ev); }
  .wk, .tg { grid-template-columns: 40px repeat(7, minmax(64px, 1fr)); }
  .wk.n1, .tg.n1 { grid-template-columns: 40px minmax(0, 1fr); }
  .scrollx { overflow-x: auto; }
  .scrollx > .wk, .scrollx > .tg-wrap { min-width: 500px; }
  .scrollx.n1 > .wk, .scrollx.n1 > .tg-wrap { min-width: 0; }
  .hours span { right: 4px; font-size: 10px; }
  .agenda { padding: 4px 12px 14px; }
  .item { grid-template-columns: 1fr; }
  .item .sub { grid-column: 1; }
  .grid2 { gap: 0 8px; }
  .dlg form { padding: 16px 16px 18px; }
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
