:root{
  color-scheme: only light;
  --bg-0:#fff8ef;
  --bg-1:#fff2df;
  --bg-2:#f7dfbe;
  --surface:#fffdf9;
  --surface-strong:#ffffff;
  --surface-warm:#fff7eb;
  --text:#23160f;
  --muted:#6c5a4a;
  --muted-2:#8b7664;
  --accent:#8b4f1f;
  --accent-2:#b97443;
  --accent-3:#e5a85f;
  --accent-soft:#f8e3c6;
  --accent-softer:#fff1dc;
  --heart:#c94d4d;
  --heart-soft:#ffe3df;
  --success:#39715a;
  --success-soft:#e3f2ea;
  --warning:#8a5a17;
  --warning-soft:#fff2cd;
  --danger:#8a2828;
  --danger-soft:#ffe6e4;
  --border:#decab4;
  --border-strong:#c8a986;
  --focus:#173f68;
  --shadow:0 18px 42px rgba(92,56,22,.13);
  --shadow-soft:0 10px 26px rgba(92,56,22,.09);
  --radius-xl:28px;
  --radius-lg:22px;
  --radius-md:16px;
  --radius-sm:12px;
  --nav-height:72px;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{scroll-behavior:smooth;background:var(--bg-0);color-scheme:only light;-webkit-tap-highlight-color:transparent}
html:has(#appShell:not([hidden]) .tab-bar:not([hidden])){scroll-padding-bottom:calc(var(--measured-nav-height,var(--nav-height)) + env(safe-area-inset-bottom) + 1rem)}
body{
  margin:0;
  min-width:320px;
  min-height:100svh;
  background:var(--bg-0);
  isolation:isolate;
  color:var(--text);
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,"Segoe UI", sans-serif;
  font-size:16px;
  line-height:1.55;
  overflow-wrap:anywhere;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
}
/* Viewport canvas: tab height and scrolling must not move the warm background. */
body::after{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background:
    radial-gradient(circle at 18% -8%, rgba(229,168,95,.36), transparent 34rem),
    radial-gradient(circle at 95% 8%, rgba(201,77,77,.15), transparent 24rem),
    linear-gradient(160deg,var(--bg-0) 0%,var(--bg-1) 52%,var(--bg-2) 100%);
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background-image:
    linear-gradient(rgba(139,79,31,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,79,31,.03) 1px, transparent 1px);
  background-size:44px 44px;
  mask-image:linear-gradient(to bottom, rgba(0,0,0,.42), transparent 62%);
}
button,input,textarea,select{font:inherit}
button,.button-like{
  min-height:46px;
  border:1px solid rgba(139,79,31,.28);
  border-radius:999px;
  background:linear-gradient(135deg,#743e18 0%,#8b4f1f 58%,#955624 100%);
  color:#fff;
  padding:.78rem 1.08rem;
  cursor:pointer;
  font-weight:800;
  letter-spacing:.005em;
  box-shadow:0 10px 22px rgba(139,79,31,.18);
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
button:hover,.button-like:hover{transform:translateY(-1px);box-shadow:0 14px 28px rgba(139,79,31,.22)}
button:active,.button-like:active{transform:translateY(0);box-shadow:0 8px 18px rgba(139,79,31,.18)}
button[data-touch-pressed="true"]:not([disabled]):not([aria-disabled="true"]){box-shadow:0 8px 18px rgba(139,79,31,.18)}
button.secondary{
  background:linear-gradient(180deg,var(--surface-strong),var(--accent-softer));
  color:var(--accent);
  border-color:var(--border);
  box-shadow:0 8px 20px rgba(92,56,22,.08);
}
/* Keep own-control press feedback after the secondary base shadow. */
button.secondary:active:not([disabled]):not([aria-disabled="true"]){box-shadow:0 8px 18px rgba(139,79,31,.18)}
button.secondary[data-touch-pressed="true"]:not([disabled]):not([aria-disabled="true"]){box-shadow:0 8px 18px rgba(139,79,31,.18)}
button[disabled],button[aria-disabled="true"],input[disabled],textarea[disabled],select[disabled]{
  opacity:.72;
  cursor:not-allowed;
  transform:none!important;
  box-shadow:none;
}
#historyNext:disabled{
  background:#e8e3dd;
  color:#625a52;
  border-color:#aaa198;
  border-style:dashed;
  opacity:1;
}
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,a:focus-visible{
  outline:3px solid var(--focus);
  outline-offset:3px;
}
a{color:var(--accent);font-weight:750;text-underline-offset:.18em}
a:hover{color:#673513}
input:not([type="checkbox"]):not([type="radio"]),textarea,select{
  width:100%;
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  padding:.86rem .95rem;
  background:rgba(255,255,255,.86);
  color:var(--text);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
}
/* Keep the native timezone picker; ellipsize only its closed presentation. */
#timezone{
  appearance:none;
  -webkit-appearance:none;
  min-width:0;
  max-width:100%;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  padding-inline-start:.4em;
  padding-inline-end:1.4em;
  background-image:linear-gradient(45deg,transparent 50%,var(--text) 50%),linear-gradient(135deg,var(--text) 50%,transparent 50%);
  background-position:calc(100% - 1em) 50%,calc(100% - .75em) 50%;
  background-size:.25em .25em;
  background-repeat:no-repeat;
}
textarea{resize:vertical;min-height:5.2rem}
#contractTarget{max-height:50vh;overflow-y:auto}
/* Bound the History editor, not the unrelated contract criterion field. */
[data-history-edit-form] textarea{max-height:max(5.2rem,50dvh);overflow-y:auto}
#tab-week.screen-panel:not([hidden]):has([data-history-edit-form]){backdrop-filter:none}
label{display:block;margin-top:1rem;margin-bottom:.35rem;font-weight:850;color:#3a2416}
.hint-button-row{display:flex;flex-wrap:wrap;gap:.5rem;margin:.75rem 0}
#gratitudePractice details{margin-bottom:.75rem}
fieldset{border:0;padding:0;margin:1.1rem 0 0}
legend{font-weight:950;margin-bottom:.72rem;font-size:1.05rem;color:#3a2416}
/* Essential geometry also ships in index.html before the nonblocking stylesheet. */
.skip-link{
  position:absolute;left:.75rem;top:.75rem;z-index:50;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;
  background:var(--focus,#173f68);color:#fff;padding:0;border-radius:var(--radius-sm,12px);
}
.skip-link:focus{width:auto;height:auto;overflow:visible;clip-path:none;white-space:normal;padding:.7rem 1rem;outline:3px solid var(--focus,#173f68);outline-offset:3px}
.app-shell{display:flow-root;width:min(100%,760px);margin:0 auto;position:relative;padding:max(env(safe-area-inset-top),var(--vk-status-top,0px)) 0 calc(var(--measured-nav-height,var(--nav-height)) + 2rem + env(safe-area-inset-bottom))}
.top-card,.summary-card,.card-form,.contract-box,.screen-panel.screen-panel{
  position:relative;
}
.top-card,.summary-card,.card-form,.contract-box,.screen-panel:not(#tab-today):not([hidden]){
  color:var(--text);
  background:linear-gradient(180deg,rgba(255,255,255,.97),rgba(255,250,243,.94));
  border:1px solid rgba(222,202,180,.86);
  border-radius:var(--radius-xl);
  padding:.96rem;
  margin:1rem;
  box-shadow:var(--shadow-soft);
  backdrop-filter:blur(12px);
}
.top-card{
  margin-top:1.05rem;
  overflow:hidden;
  background:var(--surface);
  color:var(--text);
  border-color:var(--border);
  box-shadow:var(--shadow-soft);
}
.top-card::before{
  content:"❤";
  position:absolute;
  right:1rem;
  top:.66rem;
  width:2.82rem;
  height:2.82rem;
  display:grid;
  place-items:center;
  border-radius:1.15rem;
  background:var(--heart-soft);
  color:var(--heart);
  border:1px solid var(--border);
  font-size:1.28rem;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18);
}
.top-card .eyebrow{color:var(--text);font-size:1.12rem;letter-spacing:0;text-transform:none}
.eyebrow{
  margin:.05rem 4.2rem .28rem 0;
  color:rgba(255,255,255,.86);
  font-weight:950;
  letter-spacing:.09em;
  text-transform:uppercase;
  font-size:.78rem;
}
#connectionStatus{position:relative;margin:.12rem 3.7rem .02rem 0;font-size:.9rem;line-height:1.4;font-weight:650;color:var(--muted);max-width:28rem}
.recovery-notice{
  display:flex;
  gap:.75rem;
  align-items:flex-start;
  justify-content:space-between;
  margin:.85rem 1rem 0;
  padding:.86rem;
  border:1px solid rgba(57,113,90,.26);
  border-radius:var(--radius-lg);
  background:linear-gradient(180deg,var(--success-soft),#fffdf9);
  box-shadow:var(--shadow-soft);
}
.recovery-notice h2{margin:.05rem 0 .25rem;font-size:1.05rem;color:#244838}
.recovery-notice p{margin:0;color:#34483d}
.recovery-notice button{flex:0 0 auto;min-height:40px;padding:.55rem .82rem}
/* Clearance belongs after status and legal links, not just after the main panel. */
.main-content{padding-bottom:.75rem}
.install-home-offer{padding:.75rem 1rem}
.install-home-offer h2{margin:0}
.install-home-offer p{margin:.4rem 0 .65rem}
.install-home-offer button{margin:.15rem .5rem .15rem 0}
.screen-panel{padding:.05rem .25rem}
#tab-today.screen-panel{padding-top:.05rem}
.screen-panel>h1,.screen-panel>p,.screen-panel>h2{margin-left:1rem;margin-right:1rem}
h1{font-size:clamp(1.75rem,6.4vw,2.75rem);line-height:1.06;margin-top:1rem;margin-bottom:.35rem;letter-spacing:-.045em}
h2{font-size:1.22rem;line-height:1.2;letter-spacing:-.02em}
h3{letter-spacing:-.015em}
.screen-panel>p,.field-hint,.soft-note{color:var(--muted)}
#loginScreen.screen-panel:not([hidden]){
  width:min(calc(100% - 1.25rem),720px);
  margin:clamp(1.2rem,5vh,3.1rem) auto 1rem;
  padding:1.15rem;
  color:var(--text);
  background:linear-gradient(180deg,rgba(255,255,255,.985),rgba(255,247,235,.97));
  border:1px solid rgba(222,202,180,.95);
  box-shadow:0 22px 54px rgba(57,32,12,.24);
}
#loginScreen h1,#loginScreen h2{color:#2a160b;text-shadow:none}
#loginScreen>p{margin-left:0;margin-right:0;color:#4d3a2b;line-height:1.52}
#loginScreen .summary-card{margin:.9rem 0;background:#fffdf9;box-shadow:var(--shadow-soft)}
#loginScreen .soft-note{text-align:center;margin:.85rem 0 0;color:#5a4434}
#loginScreen .soft-note a{color:#7a4319;text-decoration-thickness:2px;text-underline-offset:.18em}
#loginScreen .status-region{margin:.55rem 0;color:var(--success)}
.login-landing{
  padding:.35rem .1rem .15rem;
}
.login-landing .eyebrow{
  margin:0 0 .42rem;
  color:var(--accent);
  letter-spacing:.12em;
}
.login-landing h1{
  margin:.1rem 0 .72rem;
  max-width:13em;
}
.landing-lead{
  margin:.2rem 0 1rem;
  max-width:42rem;
  color:#4d3a2b;
  font-size:1.05rem;
}
.landing-benefits{
  list-style:none;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.72rem;
  padding:0;
  margin:1rem 0 .25rem;
}
.landing-benefits li{
  display:flex;
  flex-direction:column;
  gap:.2rem;
  min-height:6rem;
  padding:.86rem;
  border:1px solid rgba(222,202,180,.9);
  border-radius:var(--radius-lg);
  background:linear-gradient(180deg,#fffdf9,var(--accent-softer));
  box-shadow:0 8px 20px rgba(92,56,22,.07);
}
.landing-benefits strong{color:#2a160b;font-size:1.02rem}
.landing-benefits span{color:var(--muted);line-height:1.38}
.login-methods-card h2{margin-top:.1rem}
.login-methods-card>p{color:#4d3a2b}
@media (max-width:620px){
  .landing-benefits{grid-template-columns:1fr}
  .landing-benefits li{min-height:auto}
}
.summary-card h1,.summary-card h2,.summary-card h3,.card-form h1,.card-form h2,.card-form h3,.contract-box h1,.contract-box h2,.contract-box h3{color:#2a160b}
.summary-card .soft-note,.card-form .soft-note,.contract-box .soft-note{color:var(--muted)}
.balance-summary{
  overflow:hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(201,77,77,.18), transparent 7.2rem),
    linear-gradient(145deg,#fff 0%,#fff5e8 58%,#ffe7cc 100%);
  border-color:rgba(201,169,134,.9);
  box-shadow:var(--shadow);
}
.balance-summary::before{
  content:"";
  position:absolute;
  right:1.05rem;
  top:.65rem;
  width:3.5rem;
  height:3.5rem;
  border-radius:50%;
  background:conic-gradient(from 210deg,var(--heart),#f2a766,var(--accent-2),var(--heart));
  opacity:.18;
}
.day-scene-card{overflow:hidden}
.day-scene-card h2{margin:.1rem 0 .8rem}
.day-scene-picture{position:relative;width:100%;aspect-ratio:3 / 4;border-radius:18px;overflow:hidden;background:#eee3cc}
.day-scene-picture>img{display:block;width:100%;height:100%;object-fit:cover}
.day-scene-layer{position:absolute;inset:0;pointer-events:none}
.day-scene-motif{position:absolute;display:block}
.day-scene-motif[hidden]{display:none}
.day-scene-motif img{display:block;width:100%;height:100%;object-fit:fill}
.day-scene-picture img:not([data-scene-loaded="true"]){visibility:hidden}
.day-scene-description{margin:.75rem 0;color:var(--muted);line-height:1.4}
#daySceneShare{width:100%;min-height:46px}
.big-number{
  position:relative;
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:.15em .28rem;
  font-size:clamp(2.25rem,12.2vw,4.4rem);
  line-height:1.1;
  margin:.42rem 0 .62rem;
  font-weight:1000;
  letter-spacing:-.075em;
  color:#2a160b;
}
.big-number #totalLife{font-variant-numeric:tabular-nums;margin-right:.18rem;max-width:100%;overflow-wrap:anywhere}
.big-number .life-unit{white-space:nowrap}
.hint-title{font-weight:900;font-size:1.02rem;color:#3a2416;margin:.15rem 0 .18rem}
.quick-action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.64rem}
.qa-item{min-width:0;display:flex;flex-direction:column;gap:.38rem;padding:.55rem;border:1px solid rgba(200,169,134,.88);border-radius:22px;background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(255,246,232,.96));box-shadow:0 10px 24px rgba(92,56,22,.08);cursor:pointer}
.qa-item:hover,.qa-item:focus-within{border-color:var(--accent-2)}
.qa-item[data-used-today="true"]{cursor:default}
.quick-action-grid button{width:100%;min-width:0;min-height:4.25rem;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.15rem;text-align:center;border-radius:15px;padding:.45rem .35rem;background:var(--surface-strong);color:var(--text);border-color:var(--border)}
.quick-action-grid button:hover{border-color:var(--accent-2)}
.quick-action-grid button[aria-disabled="true"]{background:#eef3e1;border-color:#87936b;color:var(--text)}
.quick-action-grid button[data-used-today="true"] .qa-icon{background:#fff9e9}
.quick-action-grid .qa-item[data-used-today="true"]{background:#eef3e1;border-color:#87936b}
.qa-icon{width:1.7rem;height:1.7rem;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:var(--accent-softer);color:var(--accent);font-size:1rem;line-height:1}
.qa-icon img{width:100%;height:100%;object-fit:contain}
.qa-title{font-weight:950;letter-spacing:-.02em;color:#2c190e;font-size:.91rem;line-height:1.2em;white-space:nowrap}
.qa-hint{color:var(--muted);font-size:.84rem;line-height:1.3;overflow-wrap:anywhere}
.qa-points{margin-top:auto;align-self:flex-start;display:inline-flex;align-items:center;border-radius:999px;padding:.2rem .42rem;background:var(--heart-soft);color:#8b2d2d;font-size:.78rem;font-weight:950}
.qa-item[data-used-today="true"] .qa-points{background:#dce8c3;color:#344b25}
.plain-list,.compact-list{list-style:none;margin:.55rem 0 0;padding:0}
.plain-list li,.compact-list li{
  margin:.45rem 0;
  padding:.72rem .82rem;
  border:1px solid rgba(222,202,180,.78);
  border-radius:var(--radius-md);
  background:rgba(255,250,243,.72);
}
.compact-list li{padding:.52rem .68rem;margin:.32rem 0}
/* Bound the native date border to this card without changing picker appearance. */
.history-picker input[type="date"]{width:100%;max-width:min(100%,19rem);min-width:0;box-sizing:border-box}
.history-nav,.history-entry-actions{display:flex;flex-wrap:wrap;gap:.55rem;margin-top:.75rem}
.history-nav button,.history-entry-actions button{flex:1 1 9.5rem}
.history-entry-list article h3{margin:.05rem 0 .2rem}
.history-entry-list article p{margin:.22rem 0}
.history-day-button{width:100%;display:flex;align-items:center;justify-content:space-between;gap:.75rem;text-align:left;border-radius:16px}
.history-day-button[aria-current="date"]{border:2px solid var(--accent);background:var(--accent-soft)}
.share-fallback{margin-top:1rem;padding:.8rem;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--accent-softer)}
.share-fallback input{background:#fff;font-weight:750}
.first-day-guide summary{cursor:pointer;font-weight:900;color:#3a2416}
.first-day-guide ol{margin:.8rem 0 .2rem;padding-left:1.35rem;color:var(--muted)}
.contract-box{background:linear-gradient(180deg,#fffdf9,#fff4e5)}
.contract-box p{margin:.48rem 0}.contract-box strong{font-size:1.08rem}
.contract-reminder{border-left:4px solid var(--accent);padding:.55rem .7rem;background:var(--accent-softer);border-radius:14px}
.template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.62rem;margin:.65rem 0 1rem}
.template-grid button{border-radius:18px;min-height:3.4rem;text-align:left;justify-content:flex-start}
.card-form button[type="submit"]{margin-top:1rem;width:100%}
.contract-counter{color:var(--muted);margin:.25rem 0 .75rem;font-size:.9em;line-height:1.5;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.close-actions{display:flex;flex-wrap:wrap;gap:.62rem;margin-top:.9rem}.close-actions button{flex:1 1 13rem}
.checkbox-label{display:flex;align-items:center;gap:.65rem;font-weight:780}.checkbox-label input{width:1.22rem;height:1.22rem;flex:0 0 auto;margin:0;padding:0;appearance:auto;box-shadow:none;accent-color:var(--accent)}
.language-switch{display:grid;grid-template-columns:1fr 1fr;gap:.62rem}.language-switch button[aria-pressed="true"]{background:linear-gradient(135deg,#285640,#39715a);color:#fff;border-color:#39715a}
.profile-hero{
  text-align:center;
  overflow:hidden;
  background:
    radial-gradient(circle at 50% 6%, rgba(201,77,77,.18), transparent 9rem),
    linear-gradient(180deg,#fff,#fff2e7);
}
.profile-name{font-size:1.45rem;margin:.2rem 0 .7rem}.badge-heart{
  width:7rem;height:7rem;margin:.25rem auto .75rem;border-radius:2.35rem;
  display:grid;place-items:center;
  background:radial-gradient(circle at 35% 22%,#fff 0 12%,transparent 13%),linear-gradient(135deg,#d84d55,#f29a75 58%,#f5c078);
  color:#fff;
  box-shadow:0 18px 36px rgba(201,77,77,.28);
  transform:rotate(-2deg);
}
.badge-heart::before{content:"❤";position:absolute;font-size:4.5rem;opacity:.22;transform:rotate(2deg)}
.badge-heart-count{color:#3b1712;position:relative;font-size:2.3rem;font-weight:1000;text-shadow:0 2px 8px rgba(92,20,20,.25)}
.badge-heart[data-size="large"]{width:8rem;height:8rem}.badge-heart[data-size="xlarge"]{width:9rem;height:9rem}
#refLink{font-weight:750;font-size:.95rem;background:#fff;overflow:hidden;text-overflow:ellipsis}
.support-badge{text-align:center;background:radial-gradient(circle at 50% 12%,rgba(255,232,142,.28),transparent 8rem),linear-gradient(180deg,#fff,#fff2df);color:#2a160b}
#tab-support h1{color:#241109;text-shadow:0 1px 0 rgba(255,255,255,.7)}
#tab-support h2{color:#241109}
#tab-support > p{color:#3f2a1c;font-weight:650}
#tab-support h1:focus-visible{outline:3px solid rgba(185,116,67,.42);outline-offset:.18rem;border-radius:16px}
.support-badge h2,.support-badge p{color:#2a160b}
.support-firefly{width:5.6rem;height:5.6rem;margin:.2rem auto .45rem;display:grid;place-items:center;border-radius:2rem;background:radial-gradient(circle,#fff8c7 0 16%,#f2c96b 18% 42%,#9b6328 74%);color:#fff8c7;font-size:2.5rem;text-shadow:0 0 18px rgba(255,244,160,.95);box-shadow:0 16px 36px rgba(154,98,40,.24)}
.support-actions-list{display:grid;gap:.78rem;margin-top:.85rem}
.support-action-card{border:1px solid rgba(222,202,180,.9);border-radius:22px;padding:.9rem;background:linear-gradient(180deg,#fffdf9,#fff4e5);box-shadow:0 10px 22px rgba(92,56,22,.08)}
.support-action-card.is-opened{background:linear-gradient(180deg,#f7fff9,#e7f5ec);border-color:rgba(91,150,116,.55)}
.support-action-card h3{margin:.05rem 0 .24rem;color:#241109}.support-action-card p{margin:.28rem 0;color:#3f2a1c}.support-action-meta{display:flex;flex-wrap:wrap;gap:.42rem;margin:.55rem 0}.support-pill{display:inline-flex;align-items:center;border-radius:999px;padding:.2rem .55rem;background:var(--warning-soft);color:#6f471b;font-size:.82rem;font-weight:900}.support-pill.done{background:var(--success-soft);color:#286346}.support-action-card button{width:100%;margin-top:.45rem}.support-action-card button.secondary{background:linear-gradient(180deg,var(--surface-strong),var(--accent-softer))}
.artifact-grid{display:grid;grid-template-columns:1fr;gap:.78rem;margin-top:.85rem}
#artifactsSection h2{color:#2a160b}
#artifactsIntro{color:#4d3a2b;line-height:1.48}
.artifact-progress{color:#473426;font-weight:750}.artifact-progress strong{color:#2a160b}
.artifact-card{
  display:grid;
  grid-template-columns:5.6rem 1fr;
  gap:.82rem;
  align-items:start;
  padding:.72rem;
  border:1px solid rgba(222,202,180,.9);
  border-radius:22px;
  background:linear-gradient(180deg,#fffdf9,#fff4e5);
  box-shadow:0 10px 22px rgba(92,56,22,.08);
}
.artifact-card img,.artifact-mystery{width:5.6rem;height:5.6rem;border-radius:20px;box-shadow:0 8px 18px rgba(92,56,22,.12)}
.artifact-card img{object-fit:cover}
.artifact-mystery{display:grid;place-items:center;background:radial-gradient(circle at 35% 22%,#5c4a3f,#211914 58%,#070504);border:1px solid rgba(0,0,0,.35);color:#f9d99e;font-size:2rem;font-weight:900;text-shadow:0 2px 10px rgba(255,205,133,.35)}
.artifact-card h3{margin:.05rem 0 .12rem;font-size:1.04rem;color:#2a160b}
.artifact-card p{margin:.22rem 0;line-height:1.36;color:#3f2a1b}.artifact-card .field-hint{color:#6b5140}.artifact-short{font-weight:900;color:#6f3b17}.artifact-date{font-size:.86rem;color:#2f674f;font-weight:850}
.artifact-card.is-locked{background:linear-gradient(180deg,#fffaf3,#efe3d5);color:#4d3a2b;border-style:dashed}.artifact-card.is-locked h3{color:#2b211b}.artifact-card.is-locked .artifact-short{color:#5a4535}
.artifact-toast{
  position:fixed;
  inset:0;
  z-index:50;
  display:grid;
  place-items:center;
  padding:1rem;
  background:rgba(36,20,10,.68);
  backdrop-filter:blur(14px);
}
.artifact-dialog-card{
  width:min(calc(100% - .6rem),500px);
  position:relative;
  max-height:calc(100vh - 2rem);
  max-height:calc(100dvh - 2rem);
  overflow:auto;
  overscroll-behavior:contain;
  display:grid;
  justify-items:center;
  gap:.72rem;
  padding:1.35rem 1.2rem 1.55rem;
  border-radius:36px;
  border:1px solid rgba(255,230,196,.9);
  background:linear-gradient(145deg,#633312,#743e18 52%,#814719);
  color:#fff;
  text-align:center;
  box-shadow:0 30px 80px rgba(27,13,5,.50),0 0 0 1px rgba(255,255,255,.18) inset;
}
.artifact-dialog-card::before,.artifact-dialog-card::after{content:"✦";position:absolute;color:rgba(255,244,204,.7);font-size:2.4rem;line-height:1;pointer-events:none;text-shadow:0 0 18px rgba(255,220,150,.62)}
.artifact-dialog-card::before{right:1.1rem;top:.85rem}.artifact-dialog-card::after{left:1.4rem;bottom:1rem;font-size:1.6rem}
.artifact-dialog-card img{width:10.2rem;height:10.2rem;border-radius:32px;object-fit:cover;background:#fff7eb;box-shadow:0 14px 34px rgba(0,0,0,.26),0 0 0 5px rgba(255,246,225,.30)}
.artifact-toast .eyebrow{margin:.1rem 0 .12rem;color:rgba(255,255,255,.92);font-size:.92rem;letter-spacing:.12em}.artifact-toast h2{margin:.04rem 0 .28rem;color:#fff;font-size:1.62rem;line-height:1.08}.artifact-toast p{margin:.28rem auto;line-height:1.5;max-width:25rem}.artifact-toast button{margin-top:.92rem;background:#fff;color:#7a4319;border-color:rgba(255,255,255,.75);min-height:3.15rem;font-size:1.03rem;box-shadow:0 10px 22px rgba(61,28,8,.20);width:min(100%,18rem)}
/* Empty notices occupy no hit area; the live region itself stays mounted. */
.status-notice:has(#statusRegion:not(:empty)){position:fixed;left:50%;transform:translateX(-50%);top:max(calc(env(safe-area-inset-top) + .5rem),var(--vk-status-top,0px));z-index:25;width:min(calc(100% - 2rem),700px);max-height:40vh;overflow:auto;display:flex;align-items:flex-start;gap:.75rem;padding:.65rem .9rem;background:#fffdf9;border:1px solid #c9b59e;border-radius:12px;box-shadow:var(--shadow-soft);pointer-events:none}
.status-notice #statusRegion{flex:1 1 0;min-width:0;margin:0;overflow-wrap:anywhere}
.status-notice #dismissStatus{flex:0 1 45%;min-width:0;max-width:45%;margin:0;padding:.45rem .6rem;font-size:1em;line-height:1.3;overflow-wrap:anywhere;pointer-events:auto}
.status-notice #dismissStatus[hidden]{display:none}
.status-notice:not(:has(#statusRegion:not(:empty))){pointer-events:none}
/* Old cached shells retain readable statuses until the HTML update arrives. */
#appShell > #statusRegion:not(:empty){position:fixed;left:1rem;right:1rem;top:max(calc(env(safe-area-inset-top) + .5rem),var(--vk-status-top,0px));z-index:25;max-height:25vh;overflow:auto;margin:0;padding:.65rem .9rem;background:#fffdf9;border:1px solid #c9b59e;border-radius:12px;pointer-events:none}
.status-region{
  min-height:1.4rem;
  margin:.85rem 1rem;
  color:var(--success);
  font-weight:780;
}
.status-region.error{color:var(--danger)}
.legal-links{text-align:center;font-size:.9rem;margin:0 1rem 1rem;overflow-wrap:anywhere}
.language-switch button{min-width:0;overflow-wrap:anywhere}
.tab-bar{
  position:fixed;
  left:50%;
  bottom:max(.75rem,env(safe-area-inset-bottom));
  transform:translateX(-50%);
  width:min(calc(100% - 1rem),720px);
  min-height:var(--nav-height);
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:.28rem;
  padding:.44rem .5rem;
  background:rgba(255,253,249,.92);
  border:1px solid rgba(222,202,180,.92);
  border-radius:26px;
  box-shadow:0 18px 44px rgba(67,42,21,.20);
  backdrop-filter:blur(16px);
  z-index:20;
}
.tab-bar button{
  min-width:0;
  overflow-wrap:anywhere;
  position:relative;
  min-height:3.15rem;
  padding:.32rem .2rem;
  border-radius:18px;
  border-color:transparent;
  background:transparent;
  color:var(--muted);
  box-shadow:none;
  font-size:.76rem;
  font-weight:880;
}
.tab-label{display:block}.tab-count{position:absolute;right:.12rem;top:.08rem;min-width:1.2rem;height:1.2rem;padding:0 .36rem;border-radius:999px;background:var(--heart);color:#fff;font-size:.62rem;line-height:1.2rem;font-weight:950;white-space:nowrap;box-shadow:0 6px 12px rgba(201,77,77,.25)}
.tab-bar button::before{display:block;font-size:.92rem;margin-bottom:.04rem;line-height:1}
#tab-button-today::before{content:"✦"}#tab-button-week::before{content:"☼"}#tab-button-contract::before{content:"✍"}#tab-button-settings::before{content:"⚙"}#tab-button-support::before{content:"✧"}#tab-button-profile::before{content:"❤"}
.tab-bar button[aria-selected="true"]{
  background:linear-gradient(180deg,var(--accent-soft),#fff2df);
  color:var(--accent);
  border-color:rgba(185,116,67,.25);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 8px 16px rgba(139,79,31,.1);
}
/* Press only the tab itself; retain selected colors and keyboard outlines. */
.tab-bar button:active:not([disabled]):not([aria-disabled="true"]){box-shadow:inset 0 0 0 2px rgba(139,79,31,.28)}
.tab-bar button[data-touch-pressed="true"]:not([disabled]):not([aria-disabled="true"]){box-shadow:inset 0 0 0 2px rgba(139,79,31,.28)}
.screen-panel:not(#tab-today):not([hidden]){margin-top:.8rem;padding-top:1.05rem}
.login-button{display:flex;justify-content:center;margin-top:.75rem;min-height:44px;align-items:center}
#vkLoginButton{
  width:100%;
  background:linear-gradient(180deg,var(--surface-strong),var(--accent-softer));
  color:var(--accent);border:1px solid var(--border);border-radius:999px;padding:.75rem 1rem;text-align:center;cursor:pointer;font-weight:850;
}
#vkLoginButton[disabled]{opacity:.6;cursor:not-allowed}
.button-like{display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
.screen-panel[aria-label="Публичный профиль"] .tab-bar{display:none}
@media (max-width:560px){
  :root{--nav-height:128px}
  body{font-size:15.5px}
  .app-shell{width:100%}
  .top-card,.summary-card,.card-form,.contract-box,.screen-panel:not(#tab-today):not([hidden]){margin:.72rem;border-radius:24px;padding:.92rem}
  h1{font-size:2.05rem}
  .quick-action-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,10rem),1fr));gap:.62rem}
  .quick-action-grid button{min-height:4.25rem}
  .template-grid{grid-template-columns:1fr}
  .tab-bar{width:calc(100% - .72rem);grid-template-columns:repeat(3,1fr);border-radius:24px;gap:.24rem;padding:.42rem}
  .tab-bar button{font-size:.76rem;min-height:3.15rem;padding:.3rem .24rem}
  .tab-count{right:.22rem;top:.12rem}
  .top-card::before{right:.8rem}.eyebrow,#connectionStatus{margin-right:3.6rem}
  .artifact-card{grid-template-columns:4.8rem 1fr}.artifact-card img,.artifact-mystery{width:4.8rem;height:4.8rem;border-radius:18px}.artifact-dialog-card{padding:1rem .95rem}.artifact-dialog-card img{width:min(10rem,54vw);height:min(10rem,54vw);border-radius:24px}.artifact-toast h2{font-size:1.34rem}.artifact-toast p{max-width:100%}
}
@media (min-width:820px){
  .app-shell{width:min(760px, calc(100% - 2rem))}
}
/* Legal reader is a top-layer modal; the app underneath is never rebuilt. */
html.document-view-gutter{scrollbar-gutter:stable}
html.document-view-open,html.document-view-open body{overflow:hidden;overscroll-behavior:none}
.document-dialog{
  padding:0;border:1px solid var(--border);border-radius:var(--radius-md);
  width:min(760px,calc(100% - 1rem));max-width:calc(100% - 1rem);
  height:calc(100dvh - 1rem);max-height:calc(100% - 1rem);
  color:var(--text);background:var(--surface);box-shadow:var(--shadow);
  overflow:hidden;
}
.document-dialog[open]{display:flex;flex-direction:column}
.document-dialog::backdrop{background:rgba(35,22,15,.55)}
.document-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;flex:none;padding:.75rem;border-bottom:1px solid var(--border)}
.document-toolbar span{flex:1 1 12rem;font-weight:850;min-width:0}
.document-toolbar button{flex:0 1 auto}
.document-content{overflow:auto;overscroll-behavior:contain;min-height:0;padding:1rem;padding-bottom:max(1rem,env(safe-area-inset-bottom))}
.document-content .summary-card{margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;backdrop-filter:none}
.document-content h1{font-size:1.65rem}
.document-content :focus-visible,.document-toolbar :focus-visible{outline:3px solid var(--focus);outline-offset:3px}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}
}
