:root{font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color-scheme:dark;--green:#102c2b;--deep:#081b1b;--light:#f8efd9;--gold:#e9c48e;--text:#f6f1e6;--muted:#b6c6bd;--red:#aa4645}
*{box-sizing:border-box}html{background:var(--deep);scroll-behavior:smooth}body{margin:0;min-height:100dvh;color:var(--text);background:radial-gradient(ellipse 100% 60% at 50% -13%,#31554a 0%,transparent 75%),linear-gradient(170deg,#0d2726 0%,#0a1e1d 100%)}
body::before{content:"✣  ·   ✧   ·   ✦   ·   ✣   ·   ✧   ·   ✦";position:absolute;top:100px;left:0;right:0;overflow:hidden;text-align:center;letter-spacing:18px;font-size:13px;color:#e6dbb71e;pointer-events:none}.snow-glow{position:fixed;inset:0;pointer-events:none;background-image:radial-gradient(#f6e8c844 1px,transparent 1.5px),radial-gradient(#eddec31f 1px,transparent 1.5px);background-position:7px 32px,41px 60px;background-size:91px 93px,139px 173px;opacity:.45}
.page{position:relative;z-index:1;max-width:760px;margin:0 auto;padding:max(19px,env(safe-area-inset-top)) 18px max(24px,env(safe-area-inset-bottom))}.app-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:4px 2px 23px;border-bottom:1px solid #d6b98839}.brand{display:flex;align-items:center;gap:10px}.brand-icon{width:40px;height:40px;border:1px solid #e9c48e99;color:var(--gold);border-radius:50%;display:grid;place-items:center;font-size:27px}.brand-name{display:block;font-family:Georgia,serif;font-size:19px;letter-spacing:.12em;font-weight:bold;color:#f4dab0}.brand-tagline{display:block;font-size:10px;color:#c3d0be;letter-spacing:.045em;margin-top:3px}.year-pill{font-size:10px;letter-spacing:.13em;border:1px solid #8c9e8480;border-radius:999px;padding:9px 10px;color:#dfd7b7;white-space:nowrap}
.nav-tabs{display:grid;grid-template-columns:1fr 1fr;gap:4px;background:#ffffff0a;border:1px solid #ffffff13;border-radius:13px;padding:4px;margin:20px 0 32px}.tab{background:transparent;color:#c0cfc5;border:0;padding:12px 4px;border-radius:9px;font:inherit;font-size:13px;font-weight:650;cursor:pointer}.tab.active{color:#132c27;background:#e5c691;box-shadow:0 2px 15px #050d0a44}
.eyebrow{display:block;text-transform:uppercase;letter-spacing:.18em;color:#e1c396;font-size:10px;font-weight:750;line-height:1.8}.welcome{text-align:center;max-width:500px;margin:0 auto;padding:12px 6px 30px}.welcome-ornament{margin:12px auto 26px;border:1px solid #c5a56a7b;background:radial-gradient(circle at 50% 25%,#46684e,#1b3630 72%);width:104px;height:104px;border-radius:50%;display:grid;place-items:center;font-size:49px;box-shadow:0 0 0 9px #e8c5900a,0 15px 38px #010f0f88}.welcome h1,.calendar-intro h1,.editor-intro h1{font-family:Georgia,"Times New Roman",serif;font-size:clamp(34px,7.9vw,51px);font-weight:400;line-height:1.16;letter-spacing:-.04em;margin:12px 0 17px}.welcome h1 em,.calendar-intro h1 em,.editor-intro h1 em{font-style:italic;color:#e7c58f}.welcome p,.editor-intro p,.calendar-intro p{color:#c0cbbd;line-height:1.7;font-size:14px;margin:0 auto 26px;max-width:450px}.primary,.secondary,.outline,.text-button,.subtle-danger{font-family:inherit;font-weight:750;cursor:pointer;touch-action:manipulation}.primary,.secondary{width:100%;border-radius:11px;min-height:54px;padding:13px 19px;font-size:14px;display:flex;align-items:center;justify-content:space-between;gap:15px}.primary{background:#ebc995;color:#21392f;border:1px solid #f3daac;box-shadow:0 5px 24px #00000035}.secondary{margin-top:12px;background:transparent;border:1px solid #d7be9390;color:#eacb9c}.text-button{margin-top:22px;background:transparent;border:0;color:#cdd0b5;font-size:12px;padding:9px}.outline{border:1px solid #abac9080;background:#ffffff09;border-radius:9px;color:#eee8d4;padding:12px 14px;font-size:12px}.subtle-danger{border:0;background:transparent;color:#dba6a2;font-size:12px;padding:9px 0}
.calendar-intro{text-align:center;padding:0 0 12px}.calendar-intro h1{margin-top:10px;margin-bottom:5px}.calendar-intro p.dedication{font-family:Georgia,serif;font-style:italic;font-size:16px;color:#ebccab;margin-bottom:13px}.thin-divider{display:flex;align-items:center;gap:11px;color:var(--gold);max-width:200px;margin:15px auto}.thin-divider:before,.thin-divider:after{content:"";display:block;flex:1;height:1px;background:#dfc08c75}.calendar-intro .calendar-hint{margin:9px auto 20px;font-size:12px}.calendar-switch{margin-bottom:19px;display:flex;align-items:center;gap:12px;justify-content:center}.calendar-switch label{font-size:12px;color:#d5c6a5}.calendar-switch select{max-width:65%;border:1px solid #ffffff3d;background:#173c35;color:#f8edd4;padding:10px;border-radius:8px}.door-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}.door{aspect-ratio:.78;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;border:2px solid #d3aa6b;border-radius:9px;color:#ffedcf;background:linear-gradient(135deg,#6e302e,#8b3b37 45%,#592a2b);cursor:pointer;box-shadow:inset 0 0 0 3px #fff3ca14,0 6px 14px #0005;overflow:hidden;touch-action:manipulation;transition:transform .13s ease,filter .13s ease}.door:nth-child(4n+2){background:linear-gradient(135deg,#28534a,#306655,#173b36)}.door:nth-child(4n+3){background:linear-gradient(125deg,#254946,#32645d,#143a36)}.door:nth-child(4n){background:linear-gradient(135deg,#823c42,#a04a4b,#60272e)}.door::before{content:"";position:absolute;inset:5px;border:1px dashed #e5c59266;border-radius:5px;pointer-events:none}.door::after{content:"✧";position:absolute;right:8px;top:6px;font-size:12px;color:#dfc58d80}.door:active{transform:scale(.96)}.door .door-date{font-family:Georgia,serif;font-size:clamp(30px,7vw,52px);line-height:1.08;color:#f8dba5;text-shadow:0 2px 2px #0004}.door .door-month{font-size:9px;letter-spacing:.14em;margin-top:7px;text-transform:uppercase;color:#f7deb9}.door .door-state{position:absolute;bottom:7px;font-size:11px;color:#f9e8ca}.door.locked{filter:saturate(.64) brightness(.67)}.door.opened{background:linear-gradient(130deg,#e3c990,#faedcd);border-color:#f9e9c0;color:#476052}.door.opened .door-date{color:#355c4d;text-shadow:none}.door.opened .door-month,.door.opened .door-state{color:#456451}.door.opened:after{color:#5c7764}.progress-caption{text-align:center;color:#d1c0a2;font-size:12px;margin:22px 0}.view-actions{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-top:20px}
.editor-intro{text-align:center;margin:5px 0 25px}.editor-intro h1{margin:9px 0}.editor-intro p{margin-bottom:0}.editor-card{border:1px solid #c2aa7d52;background:#102d2aba;border-radius:17px;padding:19px;margin:13px 0 20px;box-shadow:0 10px 30px #051a1740}.editor-card h2{font-family:Georgia,serif;color:#f8e4bc;font-size:21px;font-weight:400;display:flex;align-items:center;gap:11px;margin:0 0 22px}.step{width:30px;height:30px;border:1px solid #dfc28c;border-radius:50%;font:600 13px system-ui;display:inline-grid;place-items:center;flex:none;color:#f1d59f}.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:11px}.field{display:flex;flex-direction:column;margin-bottom:14px;min-width:0}.field label{font-size:12px;color:#e3dbca;font-weight:650;margin-bottom:7px}.field input,.field select,.message-editor textarea{border:1px solid #8da6965c;border-radius:9px;background:#071d1abf;color:#fff0d8;font:inherit;font-size:14px;width:100%;padding:13px 11px;min-height:46px;outline:none}.field input:focus,.field select:focus,.message-editor textarea:focus{border-color:#efcf94;box-shadow:0 0 0 3px #e3bc8230}.field input::placeholder{color:#aab3b8}.message-editor textarea::placeholder{color:#abb4b9;font-style:italic;opacity:1}.field select{font-size:13px}.field option{background:#173b32}.year-row{grid-template-columns:.58fr 1.42fr}.field-help{color:#9eaf9f;font-size:11px;line-height:1.6;margin:0}.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.section-head h2{margin-bottom:11px}.filled-pill{background:#e0c48b1d;border:1px solid #ddc59e45;padding:6px 10px;border-radius:20px;color:#efdaae;font-size:11px;white-space:nowrap}.muted{color:#b7c7ba;line-height:1.65;font-size:13px}.small{font-size:12px;margin:0 0 20px}.edit-door-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:6px;margin-bottom:20px}.edit-day{aspect-ratio:1;border:1px solid #a2ae9970;border-radius:7px;background:#214137;color:#e7e3ce;cursor:pointer;font-size:12px;font-weight:700;position:relative;touch-action:manipulation}.edit-day.filled::after{content:"";position:absolute;width:4px;height:4px;bottom:4px;left:calc(50% - 2px);background:#f0d198;border-radius:50%}.edit-day.selected{background:#e9c792;color:#1b332c;border-color:#f7e8bf;box-shadow:0 0 0 2px #f0cf9e47}.edit-day.selected.filled:after{background:#406150}.message-editor{background:#ffffff06;border:1px solid #ffffff19;border-radius:10px;padding:13px}.message-top{display:flex;justify-content:space-between;gap:15px;align-items:center;margin-bottom:10px}.message-top label{font-size:13px;color:#f1d9ae;font-weight:700}.message-top span{font-size:10px;color:#a4b5a8}.message-editor textarea{resize:vertical;min-height:130px;line-height:1.65}.editor-navigation{display:grid;grid-template-columns:1fr 1.25fr 1fr;gap:7px;margin-top:10px}.outline.compact{padding:10px 3px;font-size:11px}.export-card h2{margin-bottom:9px}.export-info{color:#ecc994;font-weight:750;font-size:13px;margin:14px 0}.export-card .field-help{margin-top:12px}.export-card code{color:#f4daad}
footer{text-align:center;color:#aaac8f;font-family:Georgia,serif;font-size:12px;letter-spacing:.03em;padding:40px 0 14px}footer span{padding:0 6px;color:#e4c895}
.letter-dialog{border:0;border-radius:16px;padding:0;background:transparent;color:#263b32;width:calc(100% - 36px);max-width:500px;max-height:90dvh;box-shadow:0 30px 80px #000b}.letter-dialog::backdrop{background:#031511d9;backdrop-filter:blur(7px)}.letter-shell{position:relative;max-height:90dvh;overflow-y:auto;text-align:center;padding:39px 26px 31px;background:linear-gradient(140deg,#fffcf0,#eedbbc);border:7px solid #f8ebd1;border-radius:16px;box-shadow:inset 0 0 0 1px #bb976057}.close-dialog{position:absolute;top:10px;right:12px;border:0;background:transparent;color:#63786a;font-size:30px;cursor:pointer;padding:5px 11px}.eyebrow.gold-letter{color:#927446}.letter-number{font-family:Georgia,serif;font-size:68px;color:#a0443e;margin:8px 0 -9px}.heart-divider{font-family:Georgia,serif;color:#a84e4d;font-size:27px}.letter-shell h2{font-family:Georgia,serif;font-size:24px;font-weight:400;margin:10px 0 20px}.letter-message{white-space:pre-wrap;overflow-wrap:anywhere;font-family:Georgia,serif;font-size:clamp(18px,5vw,23px);line-height:1.6;margin:18px auto 20px;max-width:360px}.letter-from{font-family:Georgia,serif;color:#815e4a;font-style:italic;font-size:16px}.letter-decoration{color:#a77e49;font-size:18px;letter-spacing:10px;margin-top:23px}.toast{pointer-events:none;opacity:0;position:fixed;z-index:5;left:50%;bottom:calc(23px + env(safe-area-inset-bottom));transform:translate(-50%,12px);min-width:min(320px,calc(100vw - 40px));max-width:calc(100vw - 40px);border:1px solid #d7ba83;border-radius:10px;padding:15px 20px;color:#f5e6ca;background:#204139;box-shadow:0 15px 40px #0008;text-align:center;font-size:13px;line-height:1.5;transition:opacity .2s,transform .2s}.toast.show{opacity:1;transform:translate(-50%,0)}
[hidden]{display:none!important}button:focus-visible{outline:3px solid #e9c48e;outline-offset:3px}
@media(min-width:620px){.page{padding-left:28px;padding-right:28px}.door-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:13px}.editor-card{padding:25px}.nav-tabs{max-width:440px;margin-left:auto;margin-right:auto}}
@media(max-width:380px){.page{padding-left:13px;padding-right:13px}.brand-name{font-size:16px}.brand-tagline{font-size:9px}.year-pill{font-size:9px;padding:7px}.door-grid{gap:7px}.door .door-month{font-size:8px}.edit-door-grid{grid-template-columns:repeat(6,1fr)}.editor-navigation{grid-template-columns:1fr 1fr}.editor-navigation button:nth-child(2){grid-row:2;grid-column:1/-1}.field-grid{grid-template-columns:1fr}.year-row{grid-template-columns:.65fr 1.35fr}}

/* Privat-modus: låst skjerm og passorddialog. */
#lockedView, #draftGate { margin-top: 28px; }
#lockedView .primary, #draftGate .primary { margin: 18px 0 10px; }
#lockedView .outline { margin: 10px 0; }
.security-dialog { width: min(92vw, 420px); max-height: 90dvh; overflow:auto; border: 1px solid #b89f79; border-radius: 22px; padding: 0; background:#fdf5e9; color: #1f312b; box-shadow:0 20px 70px #001e1a55; }
.security-dialog::backdrop { background: #061a18b9; backdrop-filter: blur(4px); }
.security-shell { padding: 27px 22px 24px; position:relative; }
.security-shell h2 { font-size:24px; line-height:1.2; margin:13px 25px 8px 0; }
.security-shell .muted, .security-shell .field-help { color:#57685e; }
.security-shell input { width:100%; min-height:49px; padding:11px; color:#18302a; background:white; border:1px solid #d1cabf; border-radius:11px; font:inherit; }
.security-shell .field { margin: 14px 0; }
.security-shell .primary { width:100%; margin:17px 0 12px; }
.security-shell .close-dialog { position:absolute; top:9px; right:10px; }
.security-error { padding:11px; border-radius:8px; color:#8b1921; background:#ffe0dd; font-size:14px; }
#saveIndicator { text-align:center; }

/* Eksempler vises tydelig som grå, ikke-lagret veiledning. */
.example-caption{font-size:11px;line-height:1.5;color:#b6bec2;font-style:italic;margin:8px 2px 0}.example-caption[hidden]{display:none}.lock-explainer{margin-top:10px;line-height:1.65}.view-actions .lock-explainer{margin-top:-2px;margin-bottom:8px}.lock-explainer strong{color:#e8d8b9}
