/* Qetero: shared club calendar. Mobile first. */
@font-face{font-family:"Figtree";font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/figtree-latin-400-normal.woff2) format("woff2")}
@font-face{font-family:"Figtree";font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/figtree-latin-500-normal.woff2) format("woff2")}
@font-face{font-family:"Figtree";font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/figtree-latin-600-normal.woff2) format("woff2")}
@font-face{font-family:"Figtree";font-style:normal;font-weight:700;font-display:swap;src:url(../fonts/figtree-latin-700-normal.woff2) format("woff2")}

:root{
  --bg:#ffffff;--surface:#ffffff;--side:#fbf6f8;--ink:#241a1f;--muted:#75666e;--line:#efe4ea;--line2:#e2d2da;
  --brand:#d41367;--brand-ink:#fff;--brand-soft:#fde9f1;--hover:#f7eef2;--shadow:0 12px 40px rgba(60,10,30,.16);
  --ok:#1f7a35;--err:#c62828;--warn-bg:#fff4d6;--warn-ink:#7a5400;
  --c-club_event:#0e7c66;--c-service:#c25410;--c-district:#1f5fbf;--c-bod:#d41367;--c-ga:#6b3fa0;--c-holiday:#2e7d32;
  --c-intl:#00838f;--c-other:#6b6168;--c-rotary:#a87400;--c-birthday:#d0457c;
  --soft-holiday:#e7f4e8;--soft-intl:#e0f4f5;--soft-rotary:#fbf1dc;--soft-birthday:#fde8f0;
  --radius:14px;--bar-h:60px;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#1b1518;--surface:#231b1f;--side:#201a1d;--ink:#f4ecf0;--muted:#b5a6ae;--line:#382c33;--line2:#4a3a42;
    --brand:#ef4d8f;--brand-soft:#3d1f2c;--hover:#2b2227;--shadow:0 12px 40px rgba(0,0,0,.55);
    --ok:#7fd391;--err:#ff8a80;--warn-bg:#3a2f17;--warn-ink:#f1cf86;
    --c-club_event:#1fa386;--c-service:#e0702f;--c-district:#4a86e0;--c-bod:#e8337c;--c-ga:#9466cf;--c-holiday:#4caf50;
    --c-intl:#26a6b3;--c-other:#8d8187;--c-rotary:#c99a2e;--c-birthday:#e8659a;
    --soft-holiday:#1f3322;--soft-intl:#173336;--soft-rotary:#3a2f17;--soft-birthday:#3d1f2c;
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#1b1518;--surface:#231b1f;--side:#201a1d;--ink:#f4ecf0;--muted:#b5a6ae;--line:#382c33;--line2:#4a3a42;
  --brand:#ef4d8f;--brand-soft:#3d1f2c;--hover:#2b2227;--shadow:0 12px 40px rgba(0,0,0,.55);
  --ok:#7fd391;--err:#ff8a80;--warn-bg:#3a2f17;--warn-ink:#f1cf86;
  --c-club_event:#1fa386;--c-service:#e0702f;--c-district:#4a86e0;--c-bod:#e8337c;--c-ga:#9466cf;--c-holiday:#4caf50;
  --c-intl:#26a6b3;--c-other:#8d8187;--c-rotary:#c99a2e;--c-birthday:#e8659a;
  --soft-holiday:#1f3322;--soft-intl:#173336;--soft-rotary:#3a2f17;--soft-birthday:#3d1f2c;
  color-scheme:dark;
}
:root{box-sizing:border-box}
*,*::before,*::after{box-sizing:inherit}
[hidden]{display:none!important}
html{height:100%;-webkit-text-size-adjust:100%}
body{margin:0;min-height:100%;background:var(--bg);color:var(--ink);font:15px/1.45 "Figtree",system-ui,-apple-system,"Segoe UI",Roboto,"Noto Sans Ethiopic",sans-serif;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
a{color:var(--brand)}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.muted{color:var(--muted)}.small{font-size:13px}.center{text-align:center}
.ok-text{color:var(--ok)}.err-text{color:var(--err)}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:42px;padding:8px 16px;border-radius:999px;border:1px solid var(--line2);background:var(--surface);color:var(--ink);font-weight:600;text-decoration:none;white-space:nowrap}
.btn:hover{background:var(--hover)}
.btn.primary{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)}
.btn.primary:hover{filter:brightness(1.07)}
.btn.small{min-height:34px;padding:5px 12px;font-size:13.5px}
.btn.block{width:100%}
.btn.ghost{background:transparent;border-color:transparent}
.btn.danger{color:var(--err)}
.btn[disabled]{opacity:.45;cursor:not-allowed}
.linklike{border:0;background:none;padding:0;color:var(--ink);font-weight:600}
.icon-btn{width:44px;height:44px;border-radius:50%;border:0;background:transparent;display:grid;place-items:center;flex:none;color:var(--ink);position:relative}
.icon-btn:hover{background:var(--hover)}
.icon-btn svg{width:22px;height:22px}

/* ---------- Normal pages ---------- */
.page-wrap{min-height:100vh;display:flex;flex-direction:column;padding-top:env(safe-area-inset-top,0px)}
.pbar{display:flex;align-items:center;gap:12px;padding:10px 18px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.pbrand{display:flex;align-items:center;gap:10px;color:var(--ink);text-decoration:none;font-weight:700;font-size:17px;min-width:0}
.pbrand span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.plogo{width:36px;height:36px;border-radius:10px;object-fit:cover;flex:none}
.pnav{margin-left:auto;display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.pnav a{color:var(--ink);text-decoration:none;font-weight:600}
.pnav a.btn{color:var(--ink)}
.inline{display:inline}
.pmain{flex:1;width:100%;max-width:1080px;margin:0 auto;padding:22px 18px 40px}
.pfoot{display:flex;justify-content:center;gap:14px;flex-wrap:wrap;padding:16px 18px calc(16px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--line);font-size:12.5px;color:var(--muted)}
.pfoot a,.credit a{color:inherit}
h1{font-size:26px;line-height:1.2;margin:0 0 12px;letter-spacing:-.01em}
h2{font-size:18px;margin:0 0 10px}
.narrow{max-width:520px;margin:0 auto}
.narrow-card{max-width:640px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:18px;margin:0 0 16px}
.flash{padding:12px 14px;border-radius:12px;margin:0 0 14px;background:var(--hover);white-space:pre-wrap;word-break:break-word}
.flash.success{background:#e6f4ea;color:#1b5e20}.flash.error{background:#fdecea;color:#b71c1c}.flash.warn{background:var(--warn-bg);color:var(--warn-ink)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .flash.success{background:#173a22;color:#a5d6a7}:root:not([data-theme="light"]) .flash.error{background:#3d1a1a;color:#ffab91}}
.form{display:flex;flex-direction:column;gap:14px}
.form label{display:flex;flex-direction:column;gap:6px;font-weight:600;font-size:14px}
.form small{font-weight:400;color:var(--muted);font-size:12.5px}
.form input:not([type=checkbox]):not([type=radio]):not([type=file]),.form select,.form textarea{border:1px solid var(--line2);background:var(--bg);border-radius:10px;padding:10px 12px;min-height:44px;width:100%;font-weight:400}
.form input[type=file]{font-weight:400;font-size:14px}
.form .check,.check{flex-direction:row!important;align-items:center;gap:10px!important;font-weight:500!important}
.check input{width:20px;height:20px;accent-color:var(--brand);flex:none;margin:0}
fieldset{border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin:0}
legend{font-weight:700;padding:0 4px}
.grid2,.grid3{display:grid;gap:14px;grid-template-columns:1fr}
@media (min-width:720px){.grid2{grid-template-columns:1fr 1fr}.grid3{grid-template-columns:repeat(3,1fr);align-items:end}.form.grid3{display:grid}}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.btn-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.inline-form{display:inline-flex;gap:8px;align-items:center;margin:0}
.inline-form.wrap{flex-wrap:wrap}
.form.compact{margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.prefix{display:flex;align-items:stretch;border:1px solid var(--line2);border-radius:10px;overflow:hidden;background:var(--bg)}
.prefix span{padding:10px 0 10px 12px;color:var(--muted);font-weight:400;font-size:13px;white-space:nowrap;align-self:center;max-width:55%;overflow:hidden;text-overflow:ellipsis}
.prefix input{border:0!important;border-radius:0!important;padding-left:2px!important}
.checks{list-style:none;padding:0;margin:0 0 16px;display:flex;flex-direction:column;gap:6px}
.checks li{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}
.checks li span{font-weight:700;width:16px}
.checks .ok span{color:var(--ok)}.checks .bad span{color:var(--err)}
.checks small{flex-basis:100%;padding-left:26px;color:var(--muted)}
.auth{padding-top:20px}
.auth-brand{display:flex;flex-direction:column;align-items:center;gap:10px;margin-bottom:18px;text-align:center}
.alogo{width:64px;height:64px;border-radius:16px;object-fit:cover}
.logo-initials{display:inline-grid;place-items:center;background:var(--brand);color:var(--brand-ink);font-weight:700}
.alogo.logo-initials{font-size:24px}
.plogo.logo-initials{font-size:14px}
.logo-edit{display:flex;gap:14px;align-items:center}
.logo-edit label{flex:1}
.pill{display:inline-block;padding:2px 9px;border-radius:999px;background:var(--hover);font-size:12px;font-weight:700;color:var(--muted);white-space:nowrap}
.pill.warn{background:var(--warn-bg);color:var(--warn-ink)}
.pill.delete{background:#fdecea;color:#b71c1c}.pill.create{background:#e6f4ea;color:#1b5e20}
.count{color:var(--muted);font-weight:600;font-size:15px}
.code{background:var(--hover);padding:12px;border-radius:10px;overflow-x:auto;font-size:13px;white-space:pre-wrap;word-break:break-all}
.help summary{cursor:pointer;font-weight:600;margin:10px 0}
details summary{cursor:pointer}

/* Directory */
.hero{display:flex;gap:16px;align-items:center;margin:8px 0 24px}
.hlogo{width:64px;height:64px;border-radius:16px}
.hero h1{margin:0}.hero p{margin:4px 0 0}
.dir-tools{margin-bottom:16px}
.search input{width:100%;max-width:420px;border:1px solid var(--line2);background:var(--bg);border-radius:999px;padding:11px 18px;min-height:46px}
.club-grid{list-style:none;padding:0;margin:0;display:grid;gap:14px;grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}
.club-card{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:18px;border:1px solid var(--line);border-radius:18px;background:var(--surface);text-decoration:none;color:var(--ink);height:100%;transition:transform .15s,box-shadow .15s}
.club-card:hover{transform:translateY(-2px);box-shadow:var(--shadow);border-color:transparent}
.clogo{width:56px;height:56px;border-radius:14px;object-fit:cover}
.clogo.logo-initials{font-size:20px}
.clogo.sm{width:40px;height:40px;border-radius:10px;font-size:15px}
.cname{font-weight:700;font-size:17px;line-height:1.25}
.cgo{margin-top:auto;font-size:13px;font-weight:700;color:var(--brand)}
.empty{text-align:center;color:var(--muted);padding:40px 0}

/* Admin */
.admin-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.admin-head h1,.admin-head h2{margin:0}
.tabs{display:flex;gap:4px;overflow-x:auto;border-bottom:1px solid var(--line);margin-bottom:18px;scrollbar-width:none}
.tabs a{padding:10px 14px;text-decoration:none;color:var(--muted);font-weight:600;border-bottom:2px solid transparent;white-space:nowrap}
.tabs a[aria-current]{color:var(--brand);border-bottom-color:var(--brand)}
.table-wrap{overflow-x:auto}
.tbl{width:100%;border-collapse:collapse;font-size:14px}
.tbl th{text-align:left;font-size:12.5px;color:var(--muted);font-weight:700;padding:8px;border-bottom:1px solid var(--line)}
.tbl td{padding:10px 8px;border-bottom:1px solid var(--line);vertical-align:top}
.tbl select{border:1px solid var(--line2);background:var(--bg);border-radius:8px;padding:6px 8px;min-height:36px}
.tbl input[type=date]{border:1px solid var(--line2);background:var(--bg);border-radius:8px;padding:6px 8px;min-height:36px}
.actions{display:flex;gap:6px;flex-wrap:wrap}
.log{list-style:none;padding:0;margin:0}
.log li{display:flex;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}
.log li > div{flex:1;min-width:0;display:flex;flex-direction:column}
.club-admin-list{list-style:none;margin:0;padding:0}
.club-row{border-bottom:1px solid var(--line);padding:12px 0}
.club-row-head{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.club-row-head > div:nth-child(2){flex:1;min-width:180px;display:flex;flex-direction:column}
.club-row details{margin-top:10px}
.club-row details .form{margin-top:12px}
.feeds{list-style:none;padding:0;margin:0 0 12px;display:flex;flex-direction:column;gap:14px}
.feed-row{display:flex;gap:8px;margin-top:6px;flex-wrap:wrap}
.feed-row input{flex:1;min-width:200px;border:1px solid var(--line2);border-radius:10px;padding:8px 10px;background:var(--hover);font-size:13px}
.inline-form + .inline-form{margin-left:2px}

/* ---------- Calendar app ---------- */
body.cal{height:100%;overflow:hidden;overscroll-behavior:none}
.app{position:fixed;inset:0;display:flex;flex-direction:column;padding-top:env(safe-area-inset-top,0px);background:var(--bg)}
.boot{margin:auto;color:var(--muted)}
.bar{height:var(--bar-h);flex:none;display:flex;align-items:center;gap:4px;padding:0 8px 0 4px;border-bottom:1px solid var(--line);background:var(--bg);position:relative;z-index:5}
.bar .title{display:flex;flex-direction:column;align-items:flex-start;min-width:0;border:0;background:none;padding:4px 8px;border-radius:10px;text-align:left}
.bar .title:hover{background:var(--hover)}
.bar .title b{font-size:20px;font-weight:700;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.bar .title small{font-size:11.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.bar .spacer{flex:1}
.bar .navs{display:none}
.today-btn{width:44px;height:44px;border:0;background:transparent;border-radius:50%;display:grid;place-items:center;color:var(--ink)}
.today-btn:hover{background:var(--hover)}
.today-btn span{display:grid;place-items:center;width:26px;height:26px;border:2px solid currentColor;border-radius:7px;font-size:11.5px;font-weight:800;line-height:1}
.avatar{text-decoration:none;flex:none;width:36px;height:36px;border-radius:50%;background:var(--brand);color:var(--brand-ink);display:grid;place-items:center;font-weight:700;font-size:14px;border:0}
.seg{display:none;border:1px solid var(--line2);border-radius:999px;overflow:hidden}
.seg button{border:0;background:transparent;padding:8px 13px;font-weight:600;color:var(--muted);font-size:14px}
.seg button[aria-pressed="true"]{background:var(--brand-soft);color:var(--brand)}
.date-jump{position:absolute;opacity:0;pointer-events:none;width:1px;height:1px;left:60px;top:40px}
.banner{display:flex;gap:10px;align-items:center;padding:8px 8px 8px 16px;background:var(--brand-soft);font-size:14px;flex:none}
.banner b{color:var(--brand)}
.banner .grow{flex:1;min-width:0}
.notice{padding:8px 16px;font-size:13.5px;background:var(--warn-bg);color:var(--warn-ink);flex:none}
.body{flex:1;display:flex;min-height:0;position:relative}
.side{position:absolute;z-index:30;inset:0 auto 0 0;width:min(320px,86vw);background:var(--side);border-right:1px solid var(--line);overflow-y:auto;padding:14px 14px calc(24px + env(safe-area-inset-bottom,0px));transform:translateX(-104%);transition:transform .22s ease;box-shadow:var(--shadow);overscroll-behavior:contain}
.side.open{transform:none}
.scrim{position:absolute;inset:0;z-index:29;background:rgba(25,8,16,.35);opacity:0;pointer-events:none;transition:opacity .22s}
.scrim.open{opacity:1;pointer-events:auto}
.side h3{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;margin:18px 4px 6px}
.club-head{display:flex;gap:12px;align-items:center;padding:4px}
.club-head img,.club-head .ci{width:44px;height:44px;border-radius:12px;object-fit:cover;flex:none;display:grid;place-items:center;background:var(--brand);color:var(--brand-ink);font-weight:700}
.club-head b{display:block;font-size:16px;line-height:1.2}
.club-head small{color:var(--muted)}
.create{display:none;margin:14px 0 4px;box-shadow:0 2px 10px rgba(212,19,103,.25)}
.nav-list{display:flex;flex-direction:column;gap:2px}
.nav-item{display:flex;align-items:center;gap:14px;width:100%;padding:11px 12px;border:0;border-radius:999px;background:transparent;text-align:left;color:var(--ink);text-decoration:none;font-weight:500;min-height:46px}
.nav-item:hover{background:var(--hover)}
.nav-item[aria-pressed="true"],.nav-item.current{background:var(--brand-soft);color:var(--brand);font-weight:700}
.nav-item svg{width:20px;height:20px;flex:none}
.up{display:flex;gap:12px;width:100%;padding:8px;border:0;border-radius:12px;background:transparent;text-align:left;color:var(--ink)}
.up:hover{background:var(--hover)}
.up .when{flex:none;width:46px;text-align:center;border-radius:10px;padding:4px 0;background:var(--surface);border:1px solid var(--line)}
.up .when b{display:block;font-size:18px;line-height:1.1}
.up .when i{font-style:normal;font-size:11px;color:var(--muted)}
.up .what{min-width:0;flex:1}
.up .what strong{display:block;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.up .what span{font-size:12.5px;color:var(--muted)}
.tag{display:inline-block;font-size:11px;font-weight:800;color:var(--c);margin-right:5px}
.filter{display:flex;align-items:center;gap:12px;padding:8px 6px;font-size:14.5px;cursor:pointer;border-radius:10px}
.filter:hover{background:var(--hover)}
.filter input{appearance:none;-webkit-appearance:none;width:20px;height:20px;border-radius:5px;border:2px solid var(--c);margin:0;display:grid;place-items:center;flex:none;cursor:pointer}
.filter input:checked{background:var(--c)}
.filter input:checked::after{content:"";width:9px;height:5px;border:2px solid #fff;border-top:0;border-right:0;transform:rotate(-45deg) translate(1px,-1px)}
.side .credit,.side .side-foot{display:block;margin:20px 6px 0;font-size:12px;color:var(--muted)}
.empty-note{color:var(--muted);font-size:13.5px;margin:4px 6px}
.main{flex:1;min-width:0;display:flex;flex-direction:column;overflow:hidden;position:relative}
.view{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.cfoot{flex:none;text-align:center;font-size:11.5px;color:var(--muted);padding:6px 10px calc(6px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--line)}
.cfoot a{color:inherit}

/* chips */
.chip{display:flex;align-items:center;gap:5px;width:100%;border:0;background:transparent;padding:1px 5px;border-radius:5px;font-size:12px;text-align:left;white-space:nowrap;overflow:hidden;min-height:19px;color:var(--ink);user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.chip:hover{background:var(--hover)}
.chip .dot{width:8px;height:8px;border-radius:50%;background:var(--c);flex:none}
.chip .t{color:var(--muted);flex:none}
.chip .n{overflow:hidden;text-overflow:ellipsis}
.chip.fill{background:var(--c);color:#fff;font-weight:600}
.chip.fill:hover{filter:brightness(1.08)}
.chip.soft{background:var(--soft);color:var(--c);font-weight:600}
.chip.lifted,.ev.lifted{opacity:.3}
.more{border:0;background:transparent;font-size:11.5px;font-weight:700;color:var(--muted);text-align:left;padding:0 5px;border-radius:5px}
.more:hover{color:var(--ink);background:var(--hover)}
.drag-ghost{position:fixed;z-index:80;pointer-events:none;box-shadow:var(--shadow);border-radius:7px;opacity:.95;transform:rotate(-2deg) scale(1.03)}

/* month */
.month{flex:1;display:flex;flex-direction:column;min-height:0;overflow-y:auto}
.dows{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));flex:none;border-bottom:1px solid var(--line)}
.dows div{padding:6px 2px 4px;font-size:11px;font-weight:700;color:var(--muted);text-align:center;text-transform:uppercase;letter-spacing:.04em}
.mgrid{flex:1;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));grid-template-rows:repeat(6,minmax(78px,1fr))}
.cell{border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:2px 1px 3px;min-width:0;display:flex;flex-direction:column;gap:1px;cursor:pointer;overflow:hidden}
.cell:nth-child(7n){border-right:0}
.cell.out .dnum{color:var(--muted);opacity:.55}
.cell.drop{background:var(--brand-soft)}
.dhead{display:flex;align-items:center;justify-content:center;gap:3px;margin-bottom:1px;flex:none}
.dnum{min-width:24px;height:24px;padding:0 3px;border-radius:12px;display:grid;place-items:center;font-weight:600;font-size:12.5px}
.cell.today .dnum{background:var(--brand);color:var(--brand-ink)}
.eth{font-size:10px;color:var(--muted)}
.eth.first{color:var(--brand);font-weight:700}
.cell .chip{font-size:10.5px;padding:0 3px;gap:3px;min-height:17px;border-radius:4px}
.cell .chip .t{display:none}

/* time grid */
.tg{flex:1;display:flex;flex-direction:column;min-height:0}
.tg-cols{display:grid;grid-template-columns:48px repeat(var(--n),minmax(0,1fr))}
.tg-head{flex:none;border-bottom:1px solid var(--line)}
.tg-head .wd{text-align:center;padding:6px 2px 4px;cursor:pointer;border:0;background:none;color:var(--ink)}
.tg-head .wd small{display:block;font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase}
.tg-head .wd b{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:50%;font-size:19px;font-weight:600}
.tg-head .wd.today b{background:var(--brand);color:var(--brand-ink)}
.tg-head .wd.today small{color:var(--brand)}
.tg-head .eth{display:block}
.tg-all{flex:none;border-bottom:1px solid var(--line2);max-height:120px;overflow-y:auto}
.tg-all .lbl{font-size:10px;color:var(--muted);text-align:right;padding:5px 6px 0 0}
.tg-all .ad{border-left:1px solid var(--line);padding:2px;min-height:28px;display:flex;flex-direction:column;gap:2px;min-width:0}
.tg-all .ad.drop{background:var(--brand-soft)}
.tg-all .chip{font-size:11.5px}
.tg-scroll{flex:1;overflow-y:auto;overflow-x:hidden;position:relative;overscroll-behavior:contain}
.tg-body{position:relative;height:calc(24 * var(--hour))}
.hours{position:relative}
.hours div{position:absolute;right:6px;font-size:10.5px;color:var(--muted);transform:translateY(-50%);white-space:nowrap}
.col{position:relative;border-left:1px solid var(--line);background-image:linear-gradient(var(--line) 1px,transparent 1px);background-size:100% var(--hour);cursor:pointer}
.col.drop{background-color:var(--brand-soft)}
.col.today{background-color:color-mix(in srgb,var(--brand-soft) 35%,transparent)}
.ev{position:absolute;border:0;border-radius:7px;background:var(--c);color:#fff;text-align:left;padding:3px 6px;font-size:12px;overflow:hidden;line-height:1.25;border-left:3px solid rgba(255,255,255,.55);user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.ev:hover{filter:brightness(1.07)}
.ev b{display:block;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ev span{display:block;opacity:.92;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nowline{position:absolute;left:0;right:0;height:2px;background:var(--brand);z-index:2;pointer-events:none}
.nowline::before{content:"";position:absolute;left:-5px;top:-4px;width:10px;height:10px;border-radius:50%;background:var(--brand)}
.slot{position:absolute;left:2px;right:2px;border-radius:7px;background:var(--brand);opacity:.28;pointer-events:none;z-index:1}

/* schedule */
.sched{flex:1;overflow-y:auto;padding:4px 0 90px;overscroll-behavior:contain}
.sched-month{margin:14px 12px 4px;padding:18px 16px;border-radius:16px;background:linear-gradient(135deg,var(--brand) 0%,#8f0d48 100%);color:#fff;font-size:20px;font-weight:700}
.sday{display:grid;grid-template-columns:56px 1fr;gap:6px;padding:6px 12px}
.sday .sd{text-align:center;padding-top:6px}
.sday .sd small{display:block;font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase}
.sday .sd b{display:inline-grid;place-items:center;width:36px;height:36px;border-radius:50%;font-size:20px;font-weight:600}
.sday .sd .eth{display:block}
.sday.today .sd b{background:var(--brand);color:var(--brand-ink)}
.sday.today .sd small{color:var(--brand)}
.sitems{display:flex;flex-direction:column;gap:6px;min-width:0}
.sitem{display:flex;flex-direction:column;align-items:flex-start;gap:1px;width:100%;border:0;border-radius:12px;padding:10px 12px;background:var(--c);color:#fff;text-align:left;min-height:48px;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.sitem.soft{background:var(--soft);color:var(--c)}
.sitem strong{font-weight:600;font-size:15px;line-height:1.3;overflow-wrap:anywhere}
.sitem span{font-size:13px;opacity:.92}
.sempty{padding:40px 20px;text-align:center;color:var(--muted)}
.load-more{display:block;margin:16px auto}

/* FAB */
.fab{position:absolute;right:16px;bottom:calc(16px + env(safe-area-inset-bottom,0px));width:58px;height:58px;border-radius:18px;border:0;background:var(--brand);color:#fff;display:grid;place-items:center;box-shadow:0 6px 20px rgba(212,19,103,.4);z-index:20}
.fab svg{width:28px;height:28px}
.fab:active{transform:scale(.96)}

/* Sheets (bottom sheet on phones, centered dialog on desktop) */
.sheet-wrap{position:fixed;inset:0;z-index:60;display:flex;align-items:flex-end;justify-content:center}
.sheet-back{position:absolute;inset:0;background:rgba(25,8,16,.42);animation:fade .2s ease}
.sheet{position:relative;width:100%;max-height:calc(100% - 40px - env(safe-area-inset-top,0px));background:var(--surface);border-radius:20px 20px 0 0;box-shadow:var(--shadow);display:flex;flex-direction:column;animation:up .24s cubic-bezier(.2,.8,.2,1);padding-bottom:env(safe-area-inset-bottom,0px)}
.sheet.dragging{transition:none;animation:none}
.sheet-grip{flex:none;padding:8px 0 2px;display:grid;place-items:center;touch-action:none;cursor:grab}
.sheet-grip span{width:40px;height:5px;border-radius:3px;background:var(--line2)}
.sheet-head{flex:none;display:flex;align-items:center;gap:4px;padding:0 8px 4px 12px;touch-action:none}
.sheet-head h2{flex:1;margin:0;font-size:17px}
.sheet-body{flex:1;overflow-y:auto;padding:4px 18px 18px;overscroll-behavior:contain}
.sheet-foot{flex:none;display:flex;gap:8px;justify-content:flex-end;padding:10px 16px 14px;border-top:1px solid var(--line);flex-wrap:wrap}
.sheet-foot .left{margin-right:auto}
@keyframes up{from{transform:translateY(100%)}}
@keyframes fade{from{opacity:0}}
@keyframes pop{from{transform:scale(.96);opacity:0}}

/* details */
.det-title{display:flex;gap:12px;align-items:flex-start;margin:4px 0 12px}
.det-title .sw{width:16px;height:16px;border-radius:5px;background:var(--c);flex:none;margin-top:6px}
.det-title h3{margin:0;font-size:22px;line-height:1.25;overflow-wrap:anywhere}
.det-title p{margin:4px 0 0;color:var(--muted)}
.det-rows{display:flex;flex-direction:column;gap:10px;margin:0 0 8px 28px;font-size:14.5px}
.det-row{display:flex;gap:10px;align-items:flex-start;overflow-wrap:anywhere}
.det-row .k{color:var(--muted);flex:none;min-width:74px}
.det-notes{white-space:pre-wrap;display:block!important}
.badge{display:inline-flex;align-items:center;gap:4px;padding:2px 9px;border-radius:999px;font-size:12px;font-weight:700;background:var(--hover);color:var(--muted)}
.badge.pub{background:#e6f4ea;color:#1b5e20}.badge.bod{background:var(--brand-soft);color:var(--brand)}
.det-links{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0 4px 28px}
.link-btn{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line2);background:transparent;border-radius:999px;padding:8px 14px;font-size:13.5px;font-weight:600;color:var(--ink);text-decoration:none;min-height:40px}
.link-btn:hover{background:var(--hover)}
.link-btn small{color:var(--muted);font-weight:500}

/* event form */
.ef{display:flex;flex-direction:column;gap:14px;padding-top:4px}
.ef .title-in{font-size:22px;font-weight:600;border:0;border-bottom:2px solid var(--line2);border-radius:0;padding:8px 2px;background:transparent;width:100%}
.ef .title-in:focus{outline:none;border-bottom-color:var(--brand)}
.ef label.f{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600;color:var(--muted)}
.ef input:not([type=checkbox]):not([type=radio]),.ef select,.ef textarea{border:1px solid var(--line2);background:var(--bg);border-radius:10px;padding:9px 11px;min-height:44px;width:100%;color:var(--ink);font-weight:400;font-size:15px}
.ef textarea{min-height:90px;resize:vertical}
.ef .row{display:flex;gap:10px}
.ef .row > *{flex:1;min-width:0}
.ef .ticks{display:flex;flex-direction:column;gap:4px;border:1px solid var(--line);border-radius:12px;padding:6px 12px}
.tick{display:flex;align-items:center;gap:12px;padding:8px 0;font-size:15px;cursor:pointer}
.tick input{width:22px;height:22px;accent-color:var(--brand);flex:none;margin:0}
.tick small{display:block;color:var(--muted);font-size:12.5px}
.timesel{display:flex;gap:6px;align-items:center}
.timesel select{flex:1;min-width:0;padding:9px 6px!important}
.custom-rep{border:1px solid var(--line);border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:12px}
.custom-rep .line{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.custom-rep .line input[type=number]{width:76px!important;flex:none}
.custom-rep .line select{width:auto!important;flex:1}
.wdchips{display:flex;gap:6px;flex-wrap:wrap}
.wdchips button{width:40px;height:40px;border-radius:50%;border:1px solid var(--line2);background:var(--bg);font-weight:700;font-size:13px;color:var(--ink)}
.wdchips button[aria-pressed="true"]{background:var(--brand);border-color:var(--brand);color:#fff}
.radio{display:flex;align-items:center;gap:10px;font-size:14.5px;color:var(--ink);font-weight:500;flex-wrap:wrap}
.radio input[type=radio]{width:20px;height:20px;accent-color:var(--brand);margin:0}
.radio input:not([type=radio]){width:auto!important;flex:1;min-width:130px}
.ferr{color:var(--err);font-size:14px;min-height:0;margin:0}
.ferr:empty{display:none}

/* choice dialog */
.choice-wrap{position:fixed;inset:0;z-index:70;display:grid;place-items:center;padding:20px;background:rgba(25,8,16,.45);animation:fade .15s}
.choice{width:min(380px,100%);background:var(--surface);border-radius:20px;box-shadow:var(--shadow);padding:20px;animation:pop .16s ease}
.choice h3{margin:0 0 6px;font-size:18px}
.choice p{margin:0 0 14px;color:var(--muted);font-size:14.5px}
.choice .opts{display:flex;flex-direction:column;gap:4px;margin-bottom:12px}
.choice .opts label{display:flex;gap:12px;align-items:center;padding:10px 6px;border-radius:10px;cursor:pointer;font-size:15px}
.choice .opts label:hover{background:var(--hover)}
.choice .opts input{width:20px;height:20px;accent-color:var(--brand);margin:0}
.choice .btns{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}

.toasts{position:fixed;left:50%;top:calc(10px + env(safe-area-inset-top,0px));transform:translateX(-50%);display:flex;flex-direction:column;gap:8px;z-index:90;width:min(440px,calc(100vw - 24px));pointer-events:none}
.toast{display:flex;align-items:center;gap:12px;background:var(--ink);color:var(--bg);padding:12px 12px 12px 16px;border-radius:12px;box-shadow:var(--shadow);font-size:14.5px;animation:pop .18s ease;pointer-events:auto}
.toast span{flex:1}
.toast button{border:0;background:transparent;color:#ff8fbd;font-weight:800;padding:6px 8px;border-radius:8px}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

/* ---------- Larger screens ---------- */
@media (min-width:700px){
  .mgrid{grid-template-rows:repeat(6,minmax(96px,1fr))}
  .cell{padding:4px 4px 6px;gap:2px}
  .cell .chip{font-size:12px;padding:1px 6px;min-height:20px}
  .cell .chip .t{display:inline}
  .dnum{min-width:26px;height:26px;font-size:13px}
  .eth{font-size:10.5px}
  .tg-cols{grid-template-columns:60px repeat(var(--n),minmax(0,1fr))}
  .seg{display:flex}
  .sheet-wrap{align-items:center;padding:20px}
  .sheet{width:min(520px,100%);border-radius:20px;max-height:calc(100vh - 40px);animation:pop .18s ease}
  .sheet-grip{display:none}
  .sheet-head{padding:12px 8px 4px 18px}
}
@media (min-width:1000px){
  :root{--bar-h:64px}
  .bar{padding:0 14px 0 8px;gap:8px}
  .bar .navs{display:flex;gap:2px;align-items:center}
  .bar .menu-btn{display:none}
  .side{position:static;transform:none;box-shadow:none;width:272px;flex:none;z-index:auto}
  .scrim{display:none}
  .create{display:inline-flex}
  .fab{display:none}
  .side .views-nav{display:none}
}
@media print{.bar,.side,.fab,.cfoot,.banner{display:none!important}.app{position:static}}
.form > .btn{align-self:flex-start}
.form > .btn.block{align-self:stretch}
