*{box-sizing:border-box}
:root{color-scheme:light;font-family:system-ui,sans-serif;color:#172b46;background:#eef2f9;--line:#cbd7e8;--blue:#293f77;--muted:#4b5d77;--surface:#fff;--subtle:#f4f7fc;--accent:#e5ecfa;--focus:#536cae;--danger:#86253f}
:root[data-text="large"]{font-size:112.5%}
:root[data-contrast="high"]{color:#0e2038;--line:#66778d;--blue:#1b305f;--muted:#283b56;--surface:#fff;--subtle:#edf3fb;--accent:#e3ecf8;--focus:#172b46}
body{margin:0}
[hidden]{display:none!important}
.shell{width:min(100% - 2rem,76rem);margin-inline:auto}
.top{position:sticky;top:0;z-index:3;background:var(--surface);border-bottom:1px solid var(--line)}
html{scroll-padding-top:5rem}
.top-inner{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:4.5rem}
.brand{display:flex;align-items:center;gap:.7rem;font-weight:750;font-size:1.25rem;white-space:nowrap}
.logo{display:block;flex:none;border-radius:.72rem;width:2.45rem;height:2.45rem}
.top-line,.top-actions{display:flex;align-items:center;gap:.4rem}
.top-line{width:100%;justify-content:space-between}
.top-actions{flex:none}
#communicate-shortcut{color:var(--blue);padding-inline:.55rem}
#logout-shortcut{min-width:44px;padding-inline:.4rem;color:var(--muted);font-size:1.2rem}
@media(max-width:820px){.top .top-inner{flex-direction:column;align-items:start;gap:.4rem;padding-block:.45rem}.top .brand{gap:.38rem;font-size:1.04rem}.top .logo{width:1.95rem;height:1.95rem}#communicate-shortcut{font-size:.875rem}}
#app-nav{display:flex;flex-wrap:wrap;gap:.25rem}
#app-nav button{font-weight:650;background:transparent}
#app-nav [aria-current=page]{background:var(--accent);color:var(--blue)}
#app-nav [data-screen="tools"]:not([aria-current]){border-color:var(--line)}
#tools-content>button{margin-bottom:1rem}
@media(max-width:670px){html{scroll-padding-top:8.5rem}}
.main-shell{padding-block:1.7rem 2.5rem}
.skip-link{position:absolute;left:.5rem;top:.5rem;transform:translateY(-200%);padding:.7rem;background:white;z-index:5}
.skip-link:focus{transform:none}
h1,h2,h3,p{margin:0}
h1{font-size:clamp(2rem,5vw,3.1rem);letter-spacing:-.04em;line-height:1.12}
h2{font-size:clamp(1.15rem,3vw,1.45rem)}
h3{font-size:1.05rem}
small{font-size:.875rem}
p{line-height:1.5}
a{color:var(--blue)}
.intro{display:flex;align-items:end;justify-content:space-between;gap:.8rem;margin-bottom:1.35rem}
.intro p,.subtle-text{margin-top:.35rem;color:var(--muted)}
button,.button-link{font:inherit;cursor:pointer;color:inherit;min-height:44px;border:1px solid transparent;border-radius:.65rem;background:var(--accent);padding:.5rem .8rem}
.button-link{display:inline-flex;align-items:center;text-decoration:none}
button:hover,.button-link:hover{box-shadow:inset 0 0 0 2px var(--focus)}
:where(button,a,input,select,textarea):focus-visible{outline:3px solid var(--focus);outline-offset:2px}
button:disabled{cursor:wait;opacity:.72}
.outline{background:var(--surface);border-color:var(--line);font-weight:650}
.primary{background:var(--blue);color:white;font-weight:700}
.danger{background:#fae6ec;color:var(--danger);font-weight:650}
.board,.overview-card{background:var(--surface);border:1px solid var(--line);border-radius:1.05rem;padding:clamp(.75rem,2vw,1.45rem)}
.board+.board{margin-top:1rem}
.toolbar,.period,.calendar-actions,.actions{display:flex;align-items:center;flex-wrap:wrap;gap:.5rem}
.toolbar,.period{justify-content:space-between}
.tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));background:var(--subtle);padding:.2rem;border-radius:.75rem}
.tabs button{font-weight:650;padding-inline:.65rem}
.tabs [aria-pressed=true]{background:var(--blue);color:white}
.period{display:grid;grid-template-columns:auto 1fr auto;padding-block:.9rem}
.period h2{text-align:center}
.period button{min-width:44px;padding-inline:.65rem}
.calendar-actions{margin-bottom:.75rem}
.week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:.55rem}
.day-card{background:var(--subtle);border:1px solid var(--line);border-radius:.8rem;min-width:0;padding:.5rem;min-height:11rem}
.day-card.selected,.date.selected{box-shadow:inset 0 0 0 2px var(--focus)}
.day-label{width:100%;text-align:left;background:transparent;font-weight:750;padding-inline:.3rem}
.day-label small{display:block;color:var(--muted);font-weight:550}
.events{display:grid;gap:.45rem;margin-top:.5rem}
.event{display:grid;gap:.17rem;width:100%;text-align:left;font-weight:700;overflow-wrap:anywhere;font-size:.95rem}
.event small{font-size:.875rem;font-weight:550}
.esat,.tone-blue{background:#dbeaff;color:#173c73}
.ime,.tone-green{background:#d7f1e8;color:#145345}
.rest,.tone-violet{background:#ebe3fa;color:#493274}
.birthday,.tone-pink{background:#ffe1ec;color:#791e48}
.appointment,.tone-gold{background:#ffe8c8;color:#723c0b}
.activity,.tone-gray{background:#e8edf5;color:#233a53}
.changed{display:block;font-weight:650}
.legend{display:flex;flex-wrap:wrap;gap:.5rem;list-style:none;margin:.85rem 0 0;padding:0}
.legend li{padding:.4rem .7rem;border-radius:.55rem;font-size:.875rem;font-weight:700}
.single{max-width:46rem;margin:auto}
.single .event{padding:.85rem 1rem;font-size:1.02rem}
.empty{color:var(--muted);padding:.6rem .2rem}
.month{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:.25rem}
.weekday{text-align:center;font-weight:650;padding:.25rem 0;font-size:.875rem}
.date{display:flex;flex-direction:column;align-items:center;gap:.22rem;min-height:3.3rem;padding:.3rem .1rem;background:var(--subtle);font-weight:650}
.date[aria-current=date]{border-color:var(--blue)}
.markers{display:flex;flex-wrap:wrap;justify-content:center;gap:.12rem}
.marker{border-radius:.2rem;padding:0 .14rem;font-size:.875rem}
.year{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.65rem}
.month-choice{min-height:5rem;display:grid;place-content:center;gap:.25rem;font-weight:700}
.month-choice small{color:var(--muted);font-weight:550}
.overview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem;margin-bottom:1rem}
.overview-card{min-width:0}
.overview-card h2{margin-bottom:.5rem}
.overview-card .event{margin-block:.3rem}
.section-stack{display:grid;gap:.85rem}
.section-stack>p{color:var(--muted)}
.item-list{display:grid;gap:.52rem}
.item-row{border:1px solid var(--line);border-radius:.7rem;padding:.62rem .78rem;display:flex;justify-content:space-between;align-items:center;gap:.6rem;overflow-wrap:anywhere}
.item-row>div{min-width:0}
.item-row p{color:var(--muted)}
#sync-status:not(:empty){margin-bottom:.9rem;background:var(--surface);border-inline-start:4px solid var(--focus);padding:.55rem .75rem;color:var(--muted)}
dialog{width:min(38rem,calc(100% - 1.5rem));max-height:88dvh;border:1px solid var(--line);border-radius:1rem;padding:1.15rem;color:inherit;background:var(--surface);overflow:auto}
dialog::backdrop{background:#172b4685}
.dialog-close{display:flex;justify-content:end}
dialog h2{margin:.55rem 0 .3rem}
dialog dl{margin-block:.7rem}
dialog dt{font-weight:700;margin-top:.65rem}
dialog dd{margin:.15rem 0 0;white-space:pre-wrap;overflow-wrap:anywhere}
dialog section+section{margin-top:1rem}
.notice{background:#ffe8c8;color:#723c0b;border-radius:.65rem;padding:.6rem;margin-block:.45rem}
#editor-form{display:grid;gap:.75rem}
.editor-field{display:grid;gap:.3rem;font-weight:650;min-width:0}
.editor-field span+small{font-weight:400;color:var(--muted)}
.editor-field :is(input:not([type=checkbox]),select,textarea){font:inherit;font-weight:400;color:inherit;min-height:44px;min-width:0;width:100%;border:1px solid var(--line);border-radius:.55rem;padding:.44rem .55rem;background:var(--surface)}
.editor-field textarea{resize:vertical}
.check-row{display:flex;gap:.55rem;align-items:center;min-height:44px}
.check-row input{width:1.1rem;height:1.1rem;accent-color:var(--blue)}
.field-group{display:grid;gap:.5rem;border:1px solid var(--line);border-radius:.65rem;margin:0;padding:.6rem;min-width:0}
.field-group legend{font-weight:650}
.day-options{display:flex;flex-wrap:wrap;gap:.4rem .7rem}
.form-actions{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:end}
.editor-error{color:var(--danger)}
.place-photo{display:block;width:auto;max-width:100%;max-height:15rem;border-radius:.6rem;object-fit:contain;margin-top:.65rem}
.trip-steps{display:grid;gap:.7rem;margin:.6rem 0;padding-inline-start:1.55rem}
.trip-steps li{padding:.35rem 0;overflow-wrap:anywhere}
.trip-steps p{white-space:pre-wrap}
.date-picker{font:inherit;color:inherit;min-height:44px;border:1px solid var(--line);border-radius:.65rem;background:var(--surface);padding:.48rem .58rem}
.tools-shortcuts,.rules-board,.account-area{margin-top:1rem}
.tools-shortcuts{margin-bottom:1rem}
#editor-form details>summary{cursor:pointer;padding:.55rem 0}
#editor-form details>.field-group+.field-group{margin-top:.55rem}
.calendar-actions:empty{display:none}
#detail-content .actions{margin-top:.85rem}
@media(max-width:960px){.week{grid-template-columns:repeat(4,minmax(0,1fr))}.day-card{min-height:8rem}}
@media(max-width:670px){.top-inner{flex-direction:column;align-items:start;gap:.4rem;padding-block:.6rem .45rem}#app-nav{width:100%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}#app-nav button{font-size:.875rem;padding-inline:.25rem}.week,.overview{grid-template-columns:repeat(2,minmax(0,1fr))}.year{grid-template-columns:repeat(3,minmax(0,1fr))}.intro{align-items:start;flex-direction:column}.main-shell{padding-top:1.1rem}}
@media(max-width:460px){.shell{width:calc(100% - 1.1rem)}.week,.overview{grid-template-columns:1fr}.day-card{min-height:0}.tabs{width:100%}.tabs button{padding-inline:.2rem}.item-row{flex-wrap:wrap} .year{gap:.3rem} .month-choice{padding-inline:.2rem}}
@media(max-width:370px){.top-line{flex-wrap:wrap}.top .brand{font-size:1rem}#communicate-shortcut span{display:none}#communicate-shortcut{padding-inline:.4rem}#app-nav button{padding-inline:.15rem;font-size:.8rem;overflow-wrap:anywhere}}
@media print{.top,#sync-status,.skip-link,#app-content>section:not(.print-sheet){display:none!important}body{background:white;color:#000}.shell{width:100%}}
