:root {
  --bg: #eef1f9;
  --panel: #ffffff;
  --line: #e8ebf3;
  --line-soft: #f1f3f9;
  --text: #1c2333;
  --muted: #8a93a6;
  --muted-2: #5f6880;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf0ff;
  --danger: #e11d48;
  --ok: #059669;
  --warn: #d97706;
  --radius: 16px;
  --hour: 84px;
  --times: 72px;
  --shadow: 0 1px 2px rgba(30, 41, 80, 0.04), 0 4px 16px rgba(30, 41, 80, 0.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; flex: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- boot / auth ---------- */
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.boot i, .spin i { width: 20px; height: 20px; border-radius: 50%; border: 3px solid #d6dcea; border-top-color: var(--primary); animation: sp 0.9s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.spin { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px 0; color: var(--muted); }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(circle at 20% 10%, #dfe8ff 0, transparent 45%), radial-gradient(circle at 90% 90%, #e9e2ff 0, transparent 40%), var(--bg); }
.auth-box { width: 100%; max-width: 420px; }
.auth-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 22px; }
.auth-card { background: var(--panel); border-radius: 20px; padding: 30px; box-shadow: 0 20px 60px rgba(30, 41, 80, 0.12); }
.auth-card h1 { font-size: 22px; }
.auth-card p.sub { color: var(--muted-2); margin: 6px 0 22px; line-height: 1.5; }

/* ---------- logo ---------- */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.logo-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; box-shadow: 0 6px 14px rgba(59, 130, 246, 0.35); }
.logo small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.02em; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; padding: 12px; gap: 0; }
.shell { flex: 1; display: flex; background: #f7f8fd; border-radius: 26px; overflow: hidden; box-shadow: var(--shadow); min-height: calc(100vh - 24px); }
.side { width: 236px; flex: none; background: var(--panel); border-right: 1px solid var(--line); padding: 26px 18px; display: flex; flex-direction: column; gap: 26px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button { display: flex; align-items: center; gap: 14px; border: 0; background: none; padding: 12px 14px; border-radius: 12px; color: var(--muted-2); font-weight: 500; font-size: 15px; text-align: left; }
.nav button:hover { background: #f4f6fc; color: var(--text); }
.nav button.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.side-card { margin-top: auto; background: linear-gradient(160deg, #eef3ff, #f3efff); border-radius: 16px; padding: 18px; }
.side-card .spark { color: #6366f1; }
.side-card h3 { font-size: 16px; margin: 10px 0 6px; line-height: 1.3; }
.side-card p { margin: 0 0 14px; color: var(--muted-2); line-height: 1.45; font-size: 13px; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.top { display: flex; align-items: center; gap: 14px; padding: 16px 26px; background: var(--panel); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; border: 0; background: none; padding: 6px; border-radius: 10px; }
.search { position: relative; flex: 1; max-width: 460px; }
.search input { width: 100%; border: 1px solid transparent; background: #f2f4fa; border-radius: 999px; padding: 11px 16px 11px 44px; outline: none; }
.search input:focus { border-color: #c7d5fb; background: #fff; }
.search > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 0; background: none; color: var(--muted-2); display: grid; place-items: center; }
.icon-btn:hover { background: #f2f4fa; }
.dot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }
.user-btn { display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 4px 6px 4px 4px; border-radius: 14px; text-align: left; }
.user-btn:hover { background: #f4f6fc; }
.user-btn b { display: block; font-size: 15px; }
.user-btn small { color: var(--muted); font-size: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; border: 2px solid #fff; }
.avatars { display: flex; align-items: center; }
.avatars .avatar.sm + .avatar.sm { margin-left: -7px; }
.avatars .more { font-size: 11px; color: var(--muted-2); margin-left: 6px; font-weight: 600; }

.dd-wrap { position: relative; }
.dd { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(30, 41, 80, 0.14); min-width: 240px; padding: 8px; z-index: 40; }
.dd.left { left: 0; right: auto; width: 100%; }
.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 10px 12px; border-radius: 10px; text-align: left; }
.dd-item:hover { background: #f4f6fc; }
.dd-item small { display: block; color: var(--muted); font-size: 12px; }
.dd-empty { padding: 12px; color: var(--muted); font-size: 13px; }
.dd-head { padding: 8px 12px 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.content { flex: 1; display: flex; gap: 20px; padding: 22px 26px 30px; min-width: 0; }
.page { flex: 1; min-width: 0; }
.rail { width: 300px; flex: none; display: flex; flex-direction: column; gap: 18px; }

/* ---------- common ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 18px 20px; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.ph-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.ph-icon svg { width: 24px; height: 24px; }
.page-head h1 { font-size: 21px; }
.page-head p { margin: 4px 0 0; color: var(--muted-2); }
.ph-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 10px 16px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-p { background: var(--primary); color: #fff; box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25); }
.btn-p:hover:not(:disabled) { background: var(--primary-dark); }
.btn-s { background: #fff; border-color: var(--line); color: var(--text); }
.btn-s:hover:not(:disabled) { background: #f6f8fd; }
.btn-d { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.link { border: 0; background: none; color: var(--primary); font-weight: 600; padding: 0; display: inline-flex; align-items: center; gap: 4px; }
.link svg { width: 16px; height: 16px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; font-size: 13px; color: var(--muted-2); margin-bottom: 6px; }
.input { width: 100%; border: 1px solid #dde2ee; border-radius: 10px; padding: 10px 12px; background: #fff; outline: none; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
textarea.input { resize: vertical; line-height: 1.45; }
.grid2f { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }

.alert { border-radius: 12px; padding: 11px 14px; margin: 0 0 14px; line-height: 1.45; }
.a-err { background: #fff1f3; color: #9f1239; border: 1px solid #fecdd6; }
.a-ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.a-info { background: #eff4ff; color: #1e3a8a; border: 1px solid #d3e0ff; }
.a-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ---------- range + view toggle ---------- */
.range { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.range .label { display: flex; align-items: center; gap: 8px; padding: 0 8px; font-weight: 600; white-space: nowrap; }
.range .label svg { width: 17px; height: 17px; color: var(--muted-2); }
.range button { border: 0; background: none; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--muted-2); }
.range button:hover { background: #f2f4fa; }
.seg { display: flex; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: none; padding: 7px 16px; border-radius: 9px; font-weight: 600; color: var(--muted-2); }
.seg button.on { background: var(--primary); color: #fff; box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25); }

/* ---------- week view ---------- */
.cal { overflow: hidden; }
.cal-scroll { overflow-x: auto; }
.week { min-width: calc(var(--times) + var(--cols) * 150px); }
.wk-head, .wk-body { display: grid; grid-template-columns: var(--times) repeat(var(--cols), minmax(0, 1fr)); }
.wk-head { border-bottom: 1px solid var(--line); }
.wk-day { padding: 14px 16px; border-left: 1px solid var(--line-soft); }
.wk-day span { display: block; color: var(--muted-2); font-weight: 600; }
.wk-day b { display: block; margin-top: 4px; font-weight: 500; color: var(--muted); font-size: 13px; }
.wk-day b::before { content: '• '; }
.wk-day.today span { color: var(--primary); }
.wk-day.today b { color: var(--primary); font-weight: 600; }
.wk-body { position: relative; }
.wk-times { position: relative; }
.wk-times div { position: absolute; left: 0; right: 10px; text-align: right; font-size: 12px; color: var(--muted); transform: translateY(-7px); }
.wk-col { position: relative; border-left: 1px solid var(--line-soft); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--line-soft) calc(var(--hour) - 1px), var(--line-soft) var(--hour)); }
.wk-col.today { background-color: #fbfcff; }
.now-line { position: absolute; left: var(--times); right: 0; height: 2px; background: var(--primary); z-index: 5; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -6px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); }
.wk-empty { position: absolute; left: var(--times); right: 0; top: 40%; text-align: center; color: var(--muted); pointer-events: none; }

.ev { position: absolute; left: 6px; right: 6px; border: 0; text-align: left; border-radius: 10px; padding: 8px 10px; background: var(--evbg); border-left: 3px solid var(--evc); overflow: hidden; display: flex; flex-direction: column; gap: 3px; transition: transform 0.12s, box-shadow 0.12s; }
.ev:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(30, 41, 80, 0.1); z-index: 3; }
.ev-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ev-ic { width: 24px; height: 24px; border-radius: 7px; background: var(--evic); color: var(--evc); display: grid; place-items: center; flex: none; }
.ev-ic svg { width: 14px; height: 14px; }
.ev-title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-time { font-size: 12px; color: var(--muted-2); padding-left: 32px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-foot { padding-left: 32px; margin-top: auto; display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; }
.ev .avatar.sm { width: 20px; height: 20px; font-size: 9px; border-width: 1.5px; }
.ev { gap: 2px; }
.ev.compact { padding: 5px 8px; }
.ev.compact .ev-time { display: none; }
.ev.compact .ev-foot { display: none; }

.c0 { --evc: #3b82f6; --evbg: #eef4ff; --evic: #dce7ff; }
.c1 { --evc: #8b5cf6; --evbg: #f4f0ff; --evic: #e6defe; }
.c2 { --evc: #10b981; --evbg: #e9f9f2; --evic: #cff2e2; }
.c3 { --evc: #f43f5e; --evbg: #fff0f3; --evic: #ffdbe2; }
.c4 { --evc: #f59e0b; --evbg: #fff6e9; --evic: #ffe7c4; }
.c5 { --evc: #06b6d4; --evbg: #e8f8fb; --evic: #c8eef5; }

.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.b-ok { background: #d1fae5; color: #047857; }
.b-todo { background: #fff; color: var(--evc, var(--primary)); box-shadow: inset 0 0 0 1px currentColor; }
.b-wait { background: #f1f3f8; color: var(--muted-2); }
.b-blue { background: var(--primary-soft); color: var(--primary); }

/* ---------- month view ---------- */
.mon-head, .mon-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mon-head div { padding: 12px; font-weight: 600; color: var(--muted-2); border-bottom: 1px solid var(--line); }
.mon-cell { min-height: 112px; border-left: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.mon-cell:nth-child(7n + 1) { border-left: 0; }
.mon-cell.out { background: #fafbfe; }
.mon-cell.out .mon-num { color: #c3c9d6; }
.mon-num { font-weight: 600; font-size: 13px; color: var(--muted-2); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.mon-cell.today .mon-num { background: var(--primary); color: #fff; }
.pill { border: 0; text-align: left; background: var(--evbg); border-left: 3px solid var(--evc); border-radius: 6px; padding: 4px 6px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- agenda ---------- */
.ag-month { padding: 14px 20px 6px; font-weight: 700; color: var(--muted-2); font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; }
.ag-row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.ag-date { width: 54px; text-align: center; border-radius: 12px; background: var(--evbg); color: var(--evc); padding: 6px 0; flex: none; }
.ag-date b { display: block; font-size: 20px; }
.ag-date small { font-size: 11px; font-weight: 600; text-transform: uppercase; }
.ag-main { flex: 1; min-width: 0; }
.ag-main b { display: block; font-size: 15px; }
.ag-main span { color: var(--muted-2); font-size: 13px; }

/* ---------- rail ---------- */
.rail .card { padding: 18px; }
.rail h3 { font-size: 16px; }
.rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rail-head .arrows { display: flex; gap: 4px; }
.rail-head .arrows button { border: 0; background: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--text); }
.rail-head .arrows button:hover { background: #f2f4fa; }
.mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; text-align: center; }
.mini .wd { font-size: 11px; color: var(--muted); padding-bottom: 8px; }
.mini button { border: 0; background: none; height: 34px; border-radius: 50%; font-size: 13px; font-weight: 500; position: relative; width: 34px; margin: 0 auto; }
.mini button:hover { background: #f2f4fa; }
.mini button.out { color: #c3c9d6; }
.mini button.inweek { background: #f1f4fd; border-radius: 8px; width: 100%; }
.mini button.today { background: var(--primary); color: #fff; border-radius: 50%; width: 34px; box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3); }
.mini button.has::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--primary); }
.mini button.today.has::after { background: #fff; }
.ev-list { display: flex; flex-direction: column; gap: 14px; }
.ev-item { display: flex; align-items: center; gap: 12px; border: 0; background: none; text-align: left; padding: 0; width: 100%; }
.ev-item .when { width: 58px; font-size: 12px; color: var(--muted-2); flex: none; }
.ev-item .ev-ic { width: 34px; height: 34px; border-radius: 10px; }
.ev-item .ev-ic svg { width: 17px; height: 17px; }
.ev-item b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-item small { color: var(--muted); font-size: 12px; }
.ev-item .txt { min-width: 0; flex: 1; }
.ring-row { display: flex; align-items: center; gap: 16px; }
.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.tiles div { padding: 0 8px; border-left: 1px solid var(--line-soft); }
.tiles div:first-child { border-left: 0; padding-left: 0; }
.tiles small { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted-2); }
.tiles small i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.tiles b { display: block; font-size: 22px; margin-top: 6px; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(17, 24, 39, 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 60; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 540px; max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px rgba(17, 24, 39, 0.3); }
.mh { position: sticky; top: 0; background: #fff; display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); z-index: 2; }
.mh h2 { flex: 1; font-size: 18px; }
.mb { padding: 18px 22px 22px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted-2); margin: 6px 0 16px; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta svg { width: 16px; height: 16px; }
.stars { display: flex; align-items: center; gap: 2px; margin-bottom: 16px; }
.star { border: 0; background: none; padding: 2px; color: #d6dbe6; }
.star svg { width: 30px; height: 30px; }
.star.on { color: #f59e0b; }
.stars .word { margin-left: 10px; color: var(--muted-2); font-weight: 500; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { border: 1px solid #dde2ee; background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 500; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.lab { display: block; font-weight: 600; font-size: 13px; color: var(--muted-2); margin-bottom: 6px; }

/* ---------- tables / lists ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 12px 18px; border-bottom: 1px solid var(--line); }
td { padding: 13px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.off td { color: #a5adbd; }
.mono { font-family: ui-monospace, Consolas, Menlo, monospace; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-grid .card { padding: 16px 18px; }
.stat-grid small { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-grid b { display: block; font-size: 26px; margin-top: 6px; }
.resp { padding: 16px 20px; margin-bottom: 12px; }
.resp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.resp dl { margin: 10px 0 0; }
.resp dt { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 10px; }
.resp dd { margin: 3px 0 0; white-space: pre-wrap; line-height: 1.5; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.list-row:last-child { border-bottom: 0; }
.grow { flex: 1; min-width: 200px; }
.section-title { font-size: 16px; margin: 0 0 12px; }
.mb16 { margin-bottom: 16px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; }
#toast div { background: #111827; color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); font-weight: 500; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .content { flex-direction: column; }
  .rail { width: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 900px) {
  .layout { padding: 0; }
  .shell { border-radius: 0; min-height: 100vh; }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 70; transform: translateX(-100%); transition: transform 0.2s; }
  .layout.nav-open .side { box-shadow: 0 0 40px rgba(0, 0, 0, 0.2); }
  .layout.nav-open .side { transform: none; }
  .layout.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(17, 24, 39, 0.4); z-index: 65; }
  .menu-btn { display: grid; }
  .top { padding: 12px 14px; gap: 8px; }
  .user-btn .who { display: none; }
  .content { padding: 16px 12px 24px; }
  .ph-tools { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .modal-bg { align-items: flex-end; padding: 0; }
  .modal { border-radius: 20px 20px 0 0; }
  .range .label { font-size: 13px; padding: 0 4px; }
  .seg button { padding: 7px 11px; }
  .mon-cell { min-height: 78px; padding: 4px; }
  .pill { font-size: 10px; padding: 2px 4px; }
}
@media print {
  .side, .top, .rail { display: none !important; }
}
