/* Khurumjari admin — same tokens as the mobile app (src/theme/colors.ts). */
:root {
  --bg: #F5F4FA; --surface: #FFFFFF; --border: #ECE9F5; --border-strong: #E2DEEF; --divider: #F0EEF6;
  --text: #16142B; --text2: #3B3852; --muted: #5E5B73; --faint: #6E6A84;
  --primary: #4F35C9; --primary-deep: #3E27B5; --primary-soft: #ECE8FC; --hero: #2B1F6E; --hero-muted: #C9C0FF;
  --seg: #E9E6F4; --danger: #C2261F; --danger-soft: #FCE4E2;
  --fes-bg: #FDEBDD; --fes-fg: #9A3D00; --evt-bg: #E4EFFA; --evt-fg: #1B5888;
  --lun-bg: #FFF3D2; --lun-fg: #8A5A00; --tha-bg: #E9E8EF; --tha-fg: #16142B;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 'Plus Jakarta Sans', 'Noto Sans Bengali', 'Noto Sans Meetei Mayek', system-ui, sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-deep); }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }

/* Shell */
.topbar { background: var(--hero); color: #fff; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 24px; }
.brand { font-weight: 800; font-size: 18px; color: #fff; }
.brand small { display: block; font-size: 11px; font-weight: 600; color: var(--hero-muted); letter-spacing: .06em; text-transform: uppercase; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: var(--hero-muted); font-weight: 700; padding: 8px 14px; border-radius: 999px; }
.nav a.on, .nav a:hover { background: #3D3092; color: #fff; }
.who { display: flex; align-items: center; gap: 12px; color: var(--hero-muted); font-size: 13px; }
.who form { margin: 0; }
.who button { background: #3D3092; color: #fff; border: 0; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.page { max-width: 1200px; margin: 0 auto; padding: 24px 20px 48px; }

/* Bits */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.btn:hover { border-color: #C9C0F2; color: var(--text); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-deep); color: #fff; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-icon { width: 42px; padding: 0; }
.flash { margin-bottom: 16px; padding: 12px 16px; border-radius: 14px; background: var(--primary-soft); color: var(--primary-deep); font-weight: 700; }
.errors { margin-bottom: 16px; padding: 12px 16px; border-radius: 14px; background: var(--danger-soft); color: var(--danger); }
.errors ul { margin: 4px 0 0; padding-left: 18px; }
.muted { color: var(--muted); }
.seg { display: inline-flex; background: var(--seg); border-radius: 12px; padding: 3px; gap: 2px; }
.seg a { padding: 7px 14px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.seg a.on { background: var(--surface); color: var(--primary-deep); box-shadow: 0 1px 3px rgba(22,20,43,.12); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text2); font-weight: 700; font-size: 13px; }
.chip.on { background: var(--text); border-color: var(--text); color: #fff; }
.chip .n { font-size: 11px; opacity: .7; }

/* Entry colours by type */
.t-holiday { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger-soft); }
.t-festival { background: var(--fes-bg); color: var(--fes-fg); }
.t-event { background: var(--evt-bg); color: var(--evt-fg); }
.t-purnima { background: var(--lun-bg); color: var(--lun-fg); }
.t-ekadasi { background: var(--primary-soft); color: var(--primary-deep); }
.t-thasi { background: var(--tha-bg); color: var(--tha-fg); }
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.draft { background: var(--seg); color: var(--muted); }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav h2 { font-size: 22px; text-align: center; }
.search { display: flex; gap: 8px; }
.search input { height: 42px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); padding: 0 14px; font: inherit; min-width: 220px; }

/* Month grid */
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 12px; }
.wd { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.wd.sun { color: var(--danger); }
.day { min-height: 118px; border: 1px solid var(--border); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 4px; position: relative; background: var(--surface); }
.day.out { background: transparent; border-style: dashed; opacity: .45; }
.day.today { border: 2px solid var(--primary); padding: 7px; }
.day .num { font-weight: 800; font-size: 16px; }
.day .num.sun { color: var(--danger); }
.day .add { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 8px; display: none; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary-deep); font-weight: 800; font-size: 16px; }
.day:hover .add { display: flex; }
.pill { display: block; padding: 3px 7px; border-radius: 7px; font-size: 11.5px; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill:hover { filter: brightness(0.95); }
.pill.unpub { opacity: .55; text-decoration: line-through; }

/* Table */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--divider); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td .sub { font-size: 12px; color: var(--muted); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* Forms */
.form { max-width: 760px; }
.form-card { padding: 24px; display: grid; gap: 18px; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--text2); }
.field .hint { font-size: 12px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
  width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface);
  padding: 0 14px; font: inherit; font-size: 15px; color: var(--text);
}
textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.is-invalid { border-color: var(--danger) !important; }
.field .err { font-size: 12px; color: var(--danger); font-weight: 600; }
.types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.types label { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--border-strong); border-radius: 12px; padding: 10px 12px; cursor: pointer; font-weight: 700; color: var(--text2); }
.types input { accent-color: var(--primary); }
.types label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-deep); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.actions { display: flex; gap: 10px; align-items: center; }
.actions .grow { flex: 1; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 420px; overflow: hidden; }
.login-hero { background: var(--hero); color: #fff; padding: 28px; }
.login-hero small { color: var(--hero-muted); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.login-hero h1 { font-size: 26px; margin-top: 6px; }
.login form { padding: 24px 28px 28px; display: grid; gap: 16px; }

@media (max-width: 760px) {
  .row, .row-3, .types { grid-template-columns: 1fr; }
  .grid { gap: 3px; padding: 6px; }
  .day { min-height: 80px; padding: 4px; }
  .pill { font-size: 10px; padding: 2px 4px; }
  .nav { display: none; }
  .search input { min-width: 0; width: 100%; }
}

/* App-style day details (filled by public/js/admin-calendar.js) */
.month-title { display: flex; flex-direction: column; align-items: center; min-width: 220px; }
.month-title h2 { min-width: 0; }
.meitei-months { font-size: 13px; font-weight: 700; color: var(--primary); min-height: 18px; }
.day-top { display: flex; align-items: center; gap: 5px; min-height: 22px; }
.day-top .moon { display: inline-flex; }
.day-top .moon:empty { display: none; }
.lunar { font-size: 11px; color: var(--muted); line-height: 1.2; }
.lunar-month.start { font-weight: 800; color: var(--text2); }
.builtin { display: flex; flex-direction: column; gap: 1px; }
.builtin:empty { display: none; }
.bi { font-size: 11px; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 4px; }
a.bi:hover { text-decoration: underline; }
.bi-hol { color: var(--danger); }
.bi-fes { color: #B4500A; }
.bi-evt { color: var(--evt-fg); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 4px 16px 16px; font-size: 12.5px; color: var(--text2); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; }
.lg-moon { width: 13px; height: 13px; border-radius: 50%; }
.lg-pur { background: #F2C335; box-shadow: inset 0 0 0 1px #D9A514; }
.lg-tha { background: #2E2B45; }
.lg-eka { background: linear-gradient(90deg, #2E2B45 50%, #F6E3A6 50%); }
.lg-sq { width: 10px; height: 10px; border-radius: 2px; }
.lg-fes { background: #B4500A; }
.lg-hol { background: var(--danger); }
.lg-note { color: var(--muted); font-weight: 500; flex-basis: 100%; }

/* Built-in names by admin type */
.bi-holiday { color: var(--danger); }
.bi-festival { color: #B4500A; }
.bi-event { color: var(--evt-fg); }
.builtin-tag { background: var(--seg); color: var(--muted); }
.builtin-row td { background: #FBFAFE; }

/* Admin entries with delete */
.pill-row { display: flex; align-items: center; gap: 2px; }
.pill-row .pill { flex: 1; min-width: 0; }
.pill-row form { margin: 0; display: none; }
.day:hover .pill-row form, .pill-row:focus-within form { display: block; }
.pill-x { width: 20px; height: 20px; border-radius: 6px; border: 0; background: var(--danger-soft); color: var(--danger); font: inherit; font-weight: 800; line-height: 1; cursor: pointer; padding: 0; }
.pill-x:hover { background: var(--danger); color: #fff; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions form { display: inline; margin: 0 0 0 6px; }
@media (hover: none) { .pill-row form { display: block; } }

/* Confirm dialog (public/js/admin.js) */
.kj-dialog { border: 0; padding: 0; border-radius: 24px; width: min(380px, calc(100vw - 40px)); box-shadow: 0 20px 60px rgba(22,20,43,.25); }
.kj-dialog::backdrop { background: rgba(22,20,43,.45); }
.kj-dialog .body { padding: 26px 24px 20px; text-align: center; }
.kj-dialog .icon { width: 60px; height: 60px; border-radius: 20px; background: var(--danger-soft); color: var(--danger); display: grid; place-items: center; margin: 0 auto 16px; }
.kj-dialog h2 { font-size: 19px; font-weight: 800; }
.kj-dialog p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.kj-dialog .buttons { display: flex; gap: 10px; margin-top: 22px; }
.kj-dialog .buttons .btn { flex: 1; height: 48px; border-radius: 14px; }
.kj-dialog .btn-delete { background: var(--danger); border-color: var(--danger); color: #fff; }
.kj-dialog .btn-delete:hover { filter: brightness(.95); color: #fff; }

/* ── Sidebar layout ─────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex-shrink: 0; background: var(--hero); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; color: #fff; font-weight: 800; font-size: 18px; line-height: 1.15; }
.side-brand:hover { color: #fff; }
.side-brand small { display: block; font-size: 11px; font-weight: 700; color: var(--hero-muted); letter-spacing: .08em; text-transform: uppercase; }
.side-logo { width: 40px; height: 40px; border-radius: 12px; background: #3D3092; color: #F6E3A6; display: grid; place-items: center; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8F86D6; padding: 0 10px 6px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--hero-muted); font-weight: 700; }
.side-nav a:hover { background: #352A82; color: #fff; }
.side-nav a.on { background: #fff; color: var(--hero); }
.side-nav a.on svg { color: var(--primary); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid #463A95; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; flex-shrink: 0; text-transform: uppercase; }
.side-user-text { flex: 1; min-width: 0; line-height: 1.25; }
.side-user-text strong { display: block; font-size: 13px; }
.side-user-text small { display: block; font-size: 11px; color: var(--hero-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user form { margin: 0; }
.side-logout { width: 36px; height: 36px; border-radius: 10px; border: 0; background: #3D3092; color: #fff; display: grid; place-items: center; cursor: pointer; }
.side-logout:hover { background: var(--danger); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: rgba(245,244,250,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header-title { flex: 1; min-width: 0; }
.header-title h1 { font-size: 22px; font-weight: 800; line-height: 1.2; }
.crumb { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--primary); }
.header-actions { display: flex; gap: 10px; }
.menu-btn { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); place-items: center; cursor: pointer; }
.has-sidebar .page { max-width: 1240px; width: 100%; margin: 0; padding: 22px 28px 48px; }
.side-scrim { position: fixed; inset: 0; background: rgba(22,20,43,.45); z-index: 19; }

@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(22,20,43,.3); }
  .sidebar.open { transform: none; }
  .menu-btn { display: grid; }
  .header { padding: 12px 16px; }
  .has-sidebar .page { padding: 16px; }
}

/* Narrow screens: keep the month row and day cells inside the page */
.day { overflow: hidden; }
.lunar { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .month-nav { width: 100%; }
  .month-title { flex: 1; min-width: 0; }
  .month-nav h2 { font-size: 18px; }
  .header-actions .btn { height: 38px; padding: 0 12px; }
  .lunar { font-size: 9px; }
  .day-top { gap: 2px; }
  .day-top .moon svg { width: 14px; height: 14px; }
}

/* Devices */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat span { font-size: 12px; font-weight: 700; color: var(--muted); }
.stat strong { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }

/* Send notification */
.notify-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.notify-form .types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.notify-preview { padding: 18px; display: grid; gap: 12px; position: sticky; top: 90px; }
.phone-note { display: flex; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 18px; padding: 12px 14px; }
.phone-icon { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.phone-app { font-size: 11px; color: var(--muted); font-weight: 600; }
.phone-note strong { display: block; font-size: 14px; margin-top: 2px; word-break: break-word; }
.phone-note p { margin: 2px 0 0; font-size: 13px; color: var(--text2); white-space: pre-wrap; word-break: break-word; }
@media (max-width: 960px) { .notify-layout { grid-template-columns: 1fr; } .notify-preview { position: static; } }

.kj-dialog-neutral .icon { background: var(--primary-soft); color: var(--primary); }
.kj-dialog-neutral .btn-delete { background: var(--primary); border-color: var(--primary); }

/* Translations on the entry form */
.translations { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.translations legend { font-size: 13px; font-weight: 700; color: var(--text2); margin-bottom: 8px; }
.lang-panel { border: 1px solid var(--border-strong); border-radius: 14px; background: #FBFAFE; }
.lang-panel summary { cursor: pointer; padding: 12px 14px; font-weight: 700; display: flex; align-items: center; gap: 10px; list-style: none; }
.lang-panel summary::-webkit-details-marker { display: none; }
.lang-panel summary::before { content: '›'; font-size: 18px; line-height: 1; color: var(--muted); transition: transform .15s; }
.lang-panel[open] summary::before { transform: rotate(90deg); }
.lang-panel summary .tag { margin-left: auto; }
.lang-fields { padding: 4px 14px 14px; display: grid; gap: 14px; font-family: 'Noto Sans Bengali', 'Noto Sans Meetei Mayek', 'Plus Jakarta Sans', system-ui, sans-serif; }

/* Imports, Meitei year view */
.import-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.month-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
table.compact td { padding: 6px 16px; font-size: 13px; }
.t-holiday.tag, .tag.t-festival, .tag.t-event { white-space: nowrap; }
[hidden] { display: none !important; }
@media (max-width: 760px) { .import-grid { grid-template-columns: 1fr; } }

/* Wide tables scroll inside their card on narrow screens */
.card:has(> table) { overflow-x: auto; }
.card > table { min-width: 720px; }

/* Tatnaba */
table.tatnaba th.c, table.tatnaba td.c { text-align: center; }
table.tatnaba .tick { display: inline-flex; padding: 6px; cursor: pointer; }
table.tatnaba input { width: 18px; height: 18px; accent-color: var(--primary); }
.tat { display: inline-block; font-size: 10px; font-weight: 800; color: #8A5A00; background: var(--lun-bg); border-radius: 4px; padding: 0 4px; line-height: 15px; }
.lg-tat { width: 12px; height: 12px; border-radius: 3px; background: var(--lun-bg); box-shadow: inset 0 0 0 1px #E0B54D; }

/* Year view: day-off events in red */
.ev-off { color: var(--danger); font-weight: 600; }

/* ── Year view (Import › year): one row per day, each opens its edit page ── */
.year-toolbar { flex-wrap: wrap; align-items: center; }
.year-toolbar .month-nav { flex-wrap: wrap; gap: 8px; }
.year-toolbar .chip { height: 30px; padding: 0 11px; }
.year-hint { margin: 0; font-size: 13px; }
.year-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; align-items: start; }
.year-month { scroll-margin-top: 16px; }
.year-month h2 { font-size: 16px; margin: 0; padding: 14px 16px 8px; position: sticky; top: 0; background: var(--surface); z-index: 1; border-radius: var(--radius) var(--radius) 0 0; }
.yday { display: grid; grid-template-columns: 44px minmax(0, 1fr) 20px; gap: 10px; align-items: start; padding: 9px 12px 9px 16px; border-top: 1px solid var(--divider); color: var(--text); text-decoration: none; scroll-margin-top: 80px; }
.yday:hover, .yday:focus-visible { background: var(--primary-soft); outline: none; }
.yday:target { box-shadow: inset 3px 0 0 var(--primary); background: var(--primary-soft); }
.yday.is-today .yd-date b { background: var(--primary); color: #fff; }
.yd-date { display: grid; justify-items: center; line-height: 1.1; }
.yd-date b { font-size: 16px; font-weight: 800; min-width: 30px; text-align: center; border-radius: 8px; padding: 2px 0; }
.yd-date small { font-size: 11px; color: var(--muted); font-weight: 600; }
.yd-date.red b, .yd-date.red small { color: var(--danger); }
.yd-main { display: grid; gap: 5px; min-width: 0; }
.yd-line { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 0; }
.yd-meitei { font-size: 14px; }
.yd-wd { font-size: 12px; color: var(--muted); }
.yd-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.yd-tags .tag { font-size: 10.5px; padding: 2px 8px; }
.t-tatnaba { background: #F1EEE4; color: #6B5413; }
.yd-ev { display: flex; gap: 7px; align-items: baseline; font-size: 13px; font-weight: 700; line-height: 1.3; }
.yd-ev i { flex: none; width: 7px; height: 7px; border-radius: 2px; transform: translateY(-1px); background: var(--fes-fg); }
.yd-ev.ev-event i { background: var(--evt-fg); }
/* Name colour by type, as in the app: holiday red, festival orange, event blue (a day off makes the date red). */
.yd-ev.ev-holiday { color: var(--danger); }
.yd-ev.ev-holiday i { background: var(--danger); }
.yd-ev.ev-festival { color: var(--fes-fg); }
.yd-ev.ev-event { color: var(--evt-fg); }
.yd-ev small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.yd-edit { color: var(--faint); opacity: 0; padding-top: 2px; }
.yday:hover .yd-edit, .yday:focus-visible .yd-edit { opacity: 1; color: var(--primary); }
@media (hover: none) { .yd-edit { opacity: .6; } }
@media (max-width: 760px) { .year-hint { width: 100%; } }

/* ── Edit one day ── */
.day-events { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; }
.day-events legend { font-size: 13px; font-weight: 700; color: var(--text2); margin-bottom: 6px; }
[data-events] { display: grid; gap: 12px; }
.day-event { display: grid; gap: 12px; border: 1px solid var(--border-strong); border-radius: 14px; padding: 14px; background: var(--bg); }
.day-event-remove { justify-self: start; height: 36px; }
.day-events [data-add-event] { justify-self: start; }
/* Month chips scroll sideways on small screens instead of wrapping onto 3 lines */
@media (max-width: 760px) {
  .year-toolbar .month-nav { flex-wrap: nowrap; width: 100%; }
  .year-toolbar .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
  .year-toolbar .chip { flex: none; }
}
