:root {
  --bg: #f7f4ee;
  --card: #ffffff;
  --ink: #151515;
  --muted: #6b6862;
  --line: #e6e1d8;
  --brand: #05694b;
  --brand-ink: #ffffff;
  --brand-soft: #e2efe9;
  --vac: #05694b;
  --vac-soft: #dcede5;
  --sen: #151515;
  --sen-soft: #e9e6df;
  --ok: #2f7d4f;
  --ok-soft: #e0f1e6;
  --warn: #9a6200;
  --warn-soft: #fff1d6;
  --bad: #b3372b;
  --bad-soft: #fbe3e0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 45, 30, 0.05), 0 4px 16px rgba(60, 45, 30, 0.05);
  --side: 232px;
  --top: 60px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
body.modal-open { overflow: hidden; }
a { color: inherit; }
h1 { font-size: 26px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small, small { font-size: 13px; }
.err { color: var(--bad); background: var(--bad-soft); padding: 8px 12px; border-radius: 10px; }
.warn { color: var(--warn); background: var(--warn-soft); padding: 8px 12px; border-radius: 10px; }
.neg { color: var(--bad); font-weight: 600; }
.ic { width: 20px; height: 20px; flex: none; }
.grow { flex: 1; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 10px 16px; border-radius: 999px; cursor: pointer; text-decoration: none; min-height: 42px;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { border-color: #d8cfc2; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: #04573e; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger-text { color: var(--bad); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn .ic { width: 18px; height: 18px; }
.iconbtn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink); cursor: pointer; position: relative;
}
.iconbtn:hover { background: #f1ebe2; }

input, select, textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: 1px solid #ddd4c8; border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 44px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
select:disabled { background: #f6f2ec; color: var(--muted); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 14px; }
.field small { color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.actions.left { justify-content: flex-start; }

.seg { display: flex; gap: 8px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; width: 1px; }
.seg span {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: 12px;
  border: 1.5px solid var(--line); font-weight: 600; cursor: pointer; background: #fff;
}
.seg span.vac::before, .seg span.sen::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--vac); }
.seg span.sen::before { background: var(--sen); }
.seg input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.seg input:checked + span.vac { border-color: var(--vac); background: var(--vac-soft); }
.seg input:checked + span.sen { border-color: var(--sen); background: var(--sen-soft); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); }
.seg.small { max-width: 280px; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; }
.switch > span { width: 44px; height: 26px; border-radius: 13px; background: #d9d0c4; position: relative; flex: none; transition: background 0.15s; }
.switch > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.checks { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.checks legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; margin: 1px 0 0; accent-color: var(--brand); flex: none; }

/* ---------- layout ---------- */
.top {
  position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; padding-top: env(safe-area-inset-top); height: calc(var(--top) + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 30px; width: auto; }
.wordmark { font-family: "Helvetica Neue", Arial, sans-serif; font-weight: 800; font-size: 19px; letter-spacing: 0.04em; color: var(--brand); text-transform: uppercase; transform: scaleX(1.12); transform-origin: left; }
.product { font-size: 14px; color: var(--muted); padding-left: 14px; border-left: 1px solid var(--line); margin-left: 6px; }
@media (max-width: 420px) { .product { display: none; } }
.top-right { display: flex; align-items: center; gap: 6px; }
.me-chip { display: flex; align-items: center; gap: 8px; text-decoration: none; padding: 4px 10px 4px 4px; border-radius: 999px; }
.me-chip:hover, .me-chip.on { background: #f1ebe2; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex: none;
}
.avatar.big { width: 52px; height: 52px; font-size: 18px; }
.badge {
  min-width: 18px; height: 18px; border-radius: 9px; background: #151515; color: #fff; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center; padding: 0 5px;
}
#bell .badge { position: absolute; top: 3px; right: 2px; }

.side {
  position: fixed; top: calc(var(--top) + env(safe-area-inset-top)); bottom: 0; left: 0; width: var(--side);
  padding: 16px 12px; overflow-y: auto; border-right: 1px solid var(--line);
}
.side h4 { margin: 18px 12px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.side a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 500;
}
.side a:hover { background: #f1ebe2; }
.side a.on { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.side a .badge { margin-left: auto; }

main { margin-left: var(--side); padding: 24px 32px 48px; max-width: calc(980px + var(--side)); }
.tabs { display: none; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.attention { border-color: #cfc8bb; background: #fbf9f5; }
.list .card { margin-bottom: 12px; }
.loading { height: 120px; display: grid; place-items: center; }
.loading::after { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat {
  display: grid; gap: 2px; padding: 16px 18px; border-radius: var(--radius); text-decoration: none; border: 1px solid transparent;
}
.stat.vac { background: var(--vac-soft); }
.stat.sen { background: var(--sen-soft); }
.stat span { font-size: 13px; font-weight: 600; }
.stat b { font-size: 34px; line-height: 1.1; letter-spacing: -0.02em; }
.stat.vac b { color: #05694b; }
.stat.sen b { color: #151515; }
.stat small { color: #6d655d; }

.kv { display: grid; gap: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.kv > div.total { border-bottom: 0; font-size: 17px; padding-top: 12px; }
.kv > div.total b { color: var(--brand); font-size: 22px; }
.kv > div.total.soft { font-size: 15px; padding-top: 4px; }
.kv > div.total.soft b { font-size: 17px; color: var(--ink); }

.years { display: grid; gap: 12px; margin-top: 8px; }
.year { display: grid; grid-template-columns: 52px 1fr; gap: 4px 12px; align-items: center; }
.year span { grid-column: 2; font-size: 14px; color: var(--muted); }
.bar { height: 10px; border-radius: 5px; background: var(--sen-soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--sen); border-radius: 5px; }

/* ---------- requests ---------- */
.req { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.card > .req:first-of-type, .card > h2 + .req { border-top: 0; padding-top: 4px; }
.req-main { flex: 1; min-width: 200px; display: grid; gap: 3px; }
.req-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--vac); flex: none; }
.sen .dot { background: var(--sen); }
.req-sub { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.req-note, .req-reason { font-size: 14px; }
.req-note { color: var(--muted); }
.req-reason { background: #f6f2ec; padding: 6px 10px; border-radius: 8px; }
.proposal { background: var(--sen-soft); color: #151515; padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.req-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.status { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #f1ebe2; color: var(--muted); white-space: nowrap; }
.status.pending { background: var(--warn-soft); color: var(--warn); }
.status.approved { background: var(--ok-soft); color: var(--ok); }
.status.proposed { background: var(--sen-soft); color: #151515; }
.status.rejected, .status.cancelled { background: var(--bad-soft); color: var(--bad); }
.pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }

.mreq { display: grid; gap: 12px; border-left: 4px solid var(--vac); }
.mreq.sen { border-left-color: var(--sen); }
.mreq-top { display: flex; align-items: center; gap: 12px; }
.mreq-top > div { flex: 1; min-width: 0; }
.mreq-body { display: grid; gap: 6px; }

.emp.inactive { opacity: 0.6; }
.emp { display: grid; gap: 12px; }
.emp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 0; }
.emp .emp-grid { margin: 0; }
.emp-grid > div { display: grid; gap: 2px; }
.emp-grid span { font-size: 12px; color: var(--muted); }

.row-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.card > .row-item:first-child, h2 + .row-item { border-top: 0; }
.row-item select { width: auto; min-width: 160px; }
.perms { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.inline-form { display: flex; gap: 10px; }

.tabbar { display: flex; gap: 4px; background: #f1ebe2; padding: 4px; border-radius: 12px; margin-bottom: 12px; width: fit-content; max-width: 100%; }
.tabbar button { font: inherit; font-weight: 600; border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; cursor: pointer; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tabbar button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input { width: auto; min-width: 180px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font: inherit; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--muted); min-height: 38px;
}
.chip i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; }
.chip.vac.on { border-color: var(--vac); background: var(--vac-soft); color: #04573e; }
.chip.vac.on i { background: var(--vac); border-color: var(--vac); }
.chip.sen.on { border-color: var(--sen); background: var(--sen-soft); color: #151515; }
.chip.sen.on i { background: var(--sen); border-color: var(--sen); }
#cf { margin: 4px 0 14px; }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.cal-head h3 { flex: 1; text-align: center; font-size: 18px; text-transform: capitalize; order: 0; }
.cal-head [data-cal="-1"] { order: -1; }
.cal-head [data-cal="0"] { order: 2; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.wd { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.day {
  min-height: 88px; border-radius: 10px; background: #faf7f2; padding: 4px; display: flex; flex-direction: column; gap: 3px; overflow: hidden;
  border: 1px solid transparent;
}
.day.wkend { background: #f5f0e8; }
.day.out { opacity: 0.4; }
.day.click { cursor: pointer; }
.day.click:hover { border-color: #d8cfc2; }
.day.today { border-color: var(--brand); }
.day.today .dn { background: var(--brand); color: #fff; }
.dn { font-size: 12px; font-weight: 700; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.ev {
  font-size: 11.5px; font-weight: 600; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--vac-soft); color: #04573e; border-left: 3px solid var(--vac);
}
.ev.sen { background: var(--sen-soft); color: #151515; border-left-color: var(--sen); }
.ev.st-pending { background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(255,255,255,.75) 5px 9px); }
.ev.st-proposed { border-left-style: dashed; outline: 1px dashed currentColor; outline-offset: -1px; }
.ev.more { background: transparent; border: 0; color: var(--muted); }
.dots { display: none; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 12px; border-radius: 3px; background: var(--vac-soft); border-left: 3px solid var(--vac); }
.legend i.sen { background: var(--sen-soft); border-left-color: var(--sen); }
.legend i.neutral { background-color: #e9e2d8; border-left-color: #a59a8c; }
.legend i.st-pending { background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgba(255,255,255,.8) 3px 6px); }
.legend i.st-proposed { outline: 1px dashed #a59a8c; outline-offset: -1px; border-left-style: dashed; }

/* ---------- notifications ---------- */
.notif { display: grid; gap: 2px; padding: 12px; border-radius: 10px; text-decoration: none; border-top: 1px solid var(--line); }
.notif:first-child { border-top: 0; }
.notif.unread { background: #f1f7f3; }
.notif.unread b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--vac); margin-right: 8px; vertical-align: middle; }
.install { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- modal & toast ---------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 100; background: rgba(42, 35, 28, 0.35); display: grid; place-items: center; padding: 16px;
  animation: fade 0.15s;
}
.modal {
  background: #fff; border-radius: 18px; padding: 22px; width: 100%; max-width: 480px; max-height: calc(100dvh - 32px); overflow-y: auto;
  box-shadow: 0 20px 60px rgba(40, 30, 20, 0.25); animation: rise 0.18s;
}
.modal.wide { max-width: 680px; }
.modal h2 { font-size: 20px; }
.preview:empty { display: none; }
.preview p:last-child { margin-bottom: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.more-list { display: grid; gap: 4px; }
.more-list a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; text-decoration: none; font-weight: 500; }
.more-list a.on, .more-list a:hover { background: var(--brand-soft); }
.more-list .badge { margin-left: auto; }
.linkbox { display: flex; gap: 8px; margin: 8px 0 12px; }
.linkbox input { font-size: 14px; }

#toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: 24px; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { background: #2a2723; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: rise 0.2s; transition: opacity 0.4s; }
.toast.bad { background: var(--bad); }
.toast.out { opacity: 0; }

.block-box { display: grid; gap: 10px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: #faf7f2; }
.block-box.on { border-color: var(--sen); background: var(--sen-soft); }
.block-box input[type=date] { max-width: 220px; }
.block-box small { color: var(--muted); }

/* ---------- signed out ---------- */
.center-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; position: relative; }
.auth { width: 100%; max-width: 400px; text-align: left; }
.auth h1 { font-size: 24px; }
.auth-logo { border-radius: 14px; }
.lang-switch { position: absolute; top: calc(16px + env(safe-area-inset-top)); right: 16px; display: flex; gap: 4px; background: #f1ebe2; padding: 3px; border-radius: 10px; }
.lang-switch button { font: inherit; font-size: 13px; font-weight: 700; border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.lang-switch button.on { background: #fff; color: var(--ink); }

/* ---------- phone ---------- */
@media (max-width: 860px) {
  .side { display: none; }
  main { margin-left: 0; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  .me-name { display: none; }
  .me-chip { padding: 4px; }
  .tabs {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(8px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabs a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; font-size: 11px; font-weight: 600;
    color: var(--muted); padding: 4px 2px; border-radius: 10px; position: relative; min-width: 0;
  }
  .tabs a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabs a.on { color: var(--brand); }
  .tabs a .ic { width: 22px; height: 22px; }
  .tabs a .badge { position: absolute; top: 0; left: calc(50% + 6px); }
  h1 { font-size: 22px; }
  .page-head .btn { padding: 8px 14px; min-height: 40px; }
  .stat b { font-size: 28px; }
  .stat { padding: 14px; }
  .card { padding: 14px; }
  .emp-grid { grid-template-columns: 1fr 1fr; }
  .day { min-height: 52px; padding: 3px; }
  .ev { display: none; }
  .dots { display: flex; gap: 2px; flex-wrap: wrap; margin-top: auto; }
  .dots i { width: 100%; height: 5px; border-radius: 3px; background: var(--vac); }
  .dots i.sen { background: var(--sen); }
  .dots i.st-pending { background-image: repeating-linear-gradient(135deg, transparent 0 2px, rgba(255,255,255,.75) 2px 4px); }
  .dots i.st-proposed { opacity: 0.5; }
  .dn { font-size: 12px; }
  .cal-grid { gap: 3px; }
  .filters select, .filters input { min-width: 0; flex: 1; }
  .tabbar { width: 100%; }
  .tabbar button { flex: 1; justify-content: center; padding: 8px 6px; }
  .modal-wrap { place-items: end center; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92dvh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  #toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) {
  .row2 { grid-template-columns: 1fr; }
  .stats { gap: 8px; }
  .stat b { font-size: 26px; }
  .stat small { font-size: 12px; }
  .inline-form { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.auth-brand img { height: 44px; width: auto; }
.auth-brand .wordmark { font-size: 24px; }
[hidden] { display: none !important; }
.seg.three span { padding: 10px 6px; font-size: 14px; }
.day.holiday { background: #fbf3e4; }
.day.holiday .dn { color: #9a6200; }
.hol-tag { font-size: 10.5px; line-height: 1.2; color: #9a6200; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend i.holi { background: #fbf3e4; border-left-color: #e0b35a; }
.hol { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.card > h2 + .hol, .card > p + .hol { border-top: 0; }
.hol.past { opacity: 0.5; }
.hol-date { display: grid; min-width: 96px; }
.hol-date small { color: var(--muted); }
.hol-name { flex: 1; font-weight: 500; }
.pill.soft { background: #f1ebe2; color: var(--muted); }
.demo-box { margin-top: 6px; padding-top: 16px; border-top: 1px dashed var(--line); display: grid; gap: 6px; }
.demo-box p { margin: 0; }
.demo-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-btns .btn { flex: 1; min-width: 110px; }
@media (max-width: 860px) { .hol-tag { display: none; } }
.hol-name small { display: block; font-weight: 400; }
.pill.role { background: color-mix(in srgb, var(--rc) 13%, white); color: var(--rc); border: 1px solid color-mix(in srgb, var(--rc) 30%, white); }
.role-card { border-left: 4px solid var(--rc); }
.role-card .pill.role { font-size: 14px; padding: 4px 12px; }
.swatches { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatches legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.swatches label { cursor: pointer; }
.swatches input[type=radio] { position: absolute; opacity: 0; width: 1px; }
.swatches span { display: block; width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.swatches input:checked + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.swatches input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.swatches .own input[type=color] { width: 38px; height: 38px; min-height: 0; padding: 2px; border-radius: 50%; cursor: pointer; }
.swatches .own input[type=radio]:checked + input[type=color] { outline: 3px solid var(--ink); outline-offset: 2px; }
/* month / year switch and year view */
.seg.mini { gap: 0; background: #f1ebe2; padding: 3px; border-radius: 10px; }
.seg.mini span { border: 0; padding: 5px 12px; font-size: 13px; border-radius: 8px; background: transparent; color: var(--muted); }
.seg.mini input:checked + span { background: #fff; color: var(--ink); border: 0; box-shadow: var(--shadow); }
.cal-head .view-toggle { order: 1; }
.cal.cal-year .cal-head h3 { font-size: 20px; }
.year-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 22px; }
.ym-name { font: inherit; font-weight: 700; font-size: 14px; text-transform: capitalize; border: 0; background: none; padding: 2px 0 6px; cursor: pointer; color: var(--ink); }
.ym-name:hover { color: var(--brand); text-decoration: underline; }
.ym-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ym-grid em { font-style: normal; font-size: 10px; font-weight: 700; color: var(--muted); text-align: center; }
.yd {
  position: relative; aspect-ratio: 1; display: grid; place-items: center; font-size: 11px; font-weight: 500; border-radius: 5px;
  color: var(--ink); background: transparent; min-height: 0; padding: 0; border: 0; flex-direction: row; overflow: visible;
}
.yd.y-wk { color: var(--muted); }
.yd.y-hol { background: #fbf3e4; color: #9a6200; font-weight: 700; }
.yd.y-vac { background: var(--vac); color: #fff; font-weight: 700; }
.yd.y-sen { background: var(--sen); color: #fff; font-weight: 700; }
.yd.y-both { background: linear-gradient(135deg, var(--vac) 50%, var(--sen) 50%); color: #fff; font-weight: 700; }
.yd.y-pend { background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgba(255,255,255,.55) 3px 6px); }
.yd.y-vac.y-pend { background-color: var(--vac); }
.yd.y-sen.y-pend { background-color: var(--sen); }
.yd.y-many { box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); }
.yd.y-today { outline: 2px solid var(--brand); outline-offset: 1px; }
.yd.click { cursor: pointer; }
.yd.click:hover { outline: 2px solid #c9c0b3; }
.yd sup { position: absolute; top: -4px; right: -3px; font-size: 8.5px; line-height: 1; background: #fff; color: var(--ink); border-radius: 6px; padding: 1px 3px; box-shadow: 0 0 0 1px var(--line); }
@media (max-width: 1100px) { .year-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .cal-head { flex-wrap: wrap; } .cal-head .view-toggle { order: 3; } }
@media (max-width: 380px) { .yd { font-size: 10px; } }
.pill.dept { font-size: 14px; padding: 5px 14px; }
@media (max-width: 860px) { #cdept, #deptf { flex: 1 1 100%; } }
/* timeline */
.tl { --tl-name: 190px; --tl-day: 30px; }
.tl-2w { --tl-day: 46px; }
.tl-q { --tl-day: 13px; }
.tl .cal-head h3 { text-transform: capitalize; }
.tl-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 10px; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check-inline input { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); }
.tl-scroll { overflow-x: auto; margin: 0 -18px; padding: 0 18px 6px; -webkit-overflow-scrolling: touch; }
.tl-grid { min-width: max-content; }
.tl-row { display: grid; grid-auto-rows: 38px; align-items: center; position: relative; border-bottom: 1px solid var(--line); }
.tl-row > * { grid-row: 1; }
.tl-name {
  grid-column: 1; position: sticky; left: 0; z-index: 3; background: var(--card); height: 100%; display: flex; align-items: center; gap: 8px;
  padding-right: 10px; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; border-right: 1px solid var(--line);
}
.tl-name > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.tl-head { grid-auto-rows: 46px; border-bottom: 2px solid var(--line); position: sticky; top: 0; z-index: 4; background: var(--card); }
.tl-head .tl-name { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.tl-head .tl-name small { font-weight: 600; text-transform: none; background: #f1ebe2; border-radius: 8px; padding: 1px 7px; }
.tl-day { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 5px; font-size: 11px; color: var(--muted); line-height: 1.15; }
.tl-day b { font-size: 13px; color: var(--ink); font-weight: 650; }
.tl-day em { position: absolute; top: 3px; left: 3px; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--brand); text-transform: capitalize; white-space: nowrap; }
.tl-day.we b, .tl-day.we span { color: #a09a91; }
.tl-day.hol b { color: #9a6200; }
.tl-day.now b { background: var(--brand); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }
.tl-q .tl-day b { font-size: 10.5px; }
.tl-bg { height: 100%; }
.tl-bg.we { background: #f7f3ec; }
.tl-bg.hol { background: #fbf3e4; }
.tl-bg.mon { box-shadow: inset 1px 0 0 var(--line); }
.tl-bg.now { box-shadow: inset 2px 0 0 var(--brand); background-color: rgba(5,105,75,.05); }
.tl-bar {
  z-index: 2; height: 26px; margin: 0 1px; border: 0; border-radius: 7px; font: inherit; font-size: 12px; font-weight: 650; text-align: left;
  padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; color: #fff; background: var(--vac); min-width: 0;
}
.tl-bar.sen { background: var(--sen); }
.tl-bar.st-pending { background: var(--vac-soft); color: #04573e; box-shadow: inset 0 0 0 1.5px var(--vac); background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(5,105,75,.12) 6px 12px); }
.tl-bar.sen.st-pending { background-color: var(--sen-soft); color: var(--sen); box-shadow: inset 0 0 0 1.5px var(--sen); background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0,0,0,.08) 6px 12px); }
.tl-bar.st-proposed { background: #fff; color: #04573e; box-shadow: inset 0 0 0 1.5px var(--vac); outline: 1.5px dashed var(--vac); outline-offset: -1.5px; }
.tl-bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.tl-bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.tl-bar:hover { filter: brightness(1.08); }
.tl-q .tl-bar { height: 20px; font-size: 11px; padding: 0 5px; border-radius: 5px; }
.tl-group { position: sticky; left: 0; padding: 12px 0 6px; font-weight: 700; color: var(--brand); font-size: 13px; width: max-content; }
.tl-empty { padding: 16px 0; }
.away h2 { font-size: 15px; margin-bottom: 8px; }
.away h2.mt { margin-top: 14px; }
.away-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; flex-wrap: wrap; }
.away-row .dot.vac { background: var(--vac); } .away-row .dot.sen { background: var(--sen); }
.phone-only { display: none; }
@media (max-width: 860px) {
  .phone-only { display: block; }
  .tl { --tl-name: 128px; }
  .tl-2w { --tl-day: 34px; }
  .tl-name { font-size: 12.5px; gap: 6px; }
  .tl-name .avatar { display: none; }
  .tl-scroll { margin: 0 -14px; padding: 0 14px 6px; }
}
.seg.mini span { white-space: nowrap; }
