@font-face { font-family: "DM Sans"; font-weight: 400; font-display: swap; src: url(assets/fonts/dm-400-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Sans"; font-weight: 400; font-display: swap; src: url(assets/fonts/dm-400-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-weight: 600; font-display: swap; src: url(assets/fonts/dm-600-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Sans"; font-weight: 600; font-display: swap; src: url(assets/fonts/dm-600-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-weight: 700; font-display: swap; src: url(assets/fonts/dm-700-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Sans"; font-weight: 700; font-display: swap; src: url(assets/fonts/dm-700-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Momenty shell: PIN screen, home tiles, persistent bottom navigation. Same brand tokens as the apps
   (momentycentrum.pl: ink #3D2011, green #3B4836, cream #F9F1E4, terracotta #C0795F). The apps' own dark set
   follows the OS theme, so this does too. */
:root {
	--ink: #22302a; --green: #1f3a2e; --cream: #f7f4ee; --paper: #fbf9f4; --accent: #8a6a2f; --accent-strong: #7a5c25; --ochre: #a88340;
	--line: #d8d2c4; --muted: #5f6a63; --danger: #a8402a; --tint: #ece6d8;
	--nav-h: 68px;
	font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	color-scheme: light;
}
html.dark { color-scheme: dark; --accent: #c3ad7a; --accent-strong: #c9b482; --ink: #e9e2d2; --green: #e9e2d2; --cream: #141c18; --paper: #1b2520; --line: #2b3730; --muted: #a0aaa2; --danger: #f0a590; --tint: #232f28; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--cream); color: var(--ink); font-family: inherit; -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
button, input { font-family: inherit; }
[hidden] { display: none !important; }
a { color: inherit; }

/* mask recolouring: the Doodle Line SVGs are single-colour outlines, so they take the text colour */
.doodle { display: inline-block; flex: none; width: var(--s, 24px); height: var(--s, 24px); background-color: currentColor; -webkit-mask: var(--u) center / contain no-repeat; mask: var(--u) center / contain no-repeat; }
.logo { display: block; height: 40px; width: auto; }
.logo-dark { display: none; }
html.dark .logo-light { display: none; }
html.dark .logo-dark { display: block; }

/* shell: stage fills what the bottom bar leaves, so the bar never covers an app */
#shell { position: fixed; inset: 0; display: flex; flex-direction: column; }
#stage { position: relative; flex: 1; min-height: 0; }
#home { position: absolute; inset: 0; overflow-y: auto; outline: none; -webkit-overflow-scrolling: touch; }
iframe.app { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--cream); }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px 28px; }

.top { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.lockbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--green); font-size: .9rem; font-weight: 600; cursor: pointer; transition: transform 160ms var(--ease-out); }
.intro { margin: 18px 0 8px; }
.hello { margin: 0; color: var(--muted); font-size: 1.02rem; }
h1 { font-family: var(--display); font-weight: 500; letter-spacing: -.015em; font-size: clamp(2.2rem, 9vw, 3rem); line-height: 1.08; margin: 4px 0 0; color: var(--green); }
/* section labels sit tight to their list: a label belongs to what follows, not to what came before */
.label { margin: 28px 0 0; padding-bottom: 8px; border-bottom: 1px solid var(--accent-strong); font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-strong); }
.help-list, .sheet ul { list-style: none; margin: 0; padding: 0; display: grid; }

/* Gabinet: no tinted tiles. Each tool is a ruled row with its icon in brass; groups open with a small-caps label that has a rule under it. */
.ico { display: grid; place-items: center; flex: none; width: 34px; height: 34px; color: var(--accent-strong); }
.ico .doodle { --s: 30px; }
.go, .tile { text-decoration: none; color: inherit; transition: transform 160ms var(--ease-out), background-color 200ms; }
.go { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.txt { display: grid; gap: 2px; min-width: 0; }
.go b { font-family: var(--display); font-size: 1.2rem; font-weight: 500; color: var(--green); line-height: 1.2; }
.go small { color: var(--muted); font-size: .88rem; line-height: 1.35; }
.chev { flex: none; width: 9px; height: 9px; margin: 0 6px 0 auto; border-top: 1.5px solid var(--muted); border-right: 1.5px solid var(--muted); transform: rotate(45deg); }
.go:active, .tile:active, .strip:active, .lockbtn:active { transform: scale(.98); }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.tiles li + li .tile { padding-left: 12px; border-left: 1px solid var(--line); }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; height: 100%; min-height: 128px; padding: 14px 8px 14px 0; }
.tile b { font-family: var(--display); font-size: 1.08rem; font-weight: 500; line-height: 1.2; color: var(--green); }
.tile small { margin-top: -6px; color: var(--muted); font-size: .78rem; }
.tile small:empty { display: none; }
@media (hover: hover) and (pointer: fine) { .go:hover, .tile:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); } }

.strip { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin: 24px 0 14px; border: 1px solid var(--accent-strong); border-radius: 2px; background: transparent; color: var(--green); text-decoration: none; transition: transform 160ms var(--ease-out), background-color 200ms; }
.strip .doodle { --s: 36px; flex: none; color: var(--accent-strong); }
.strip b { display: block; font-family: var(--display); font-size: 1.12rem; font-weight: 500; }
.strip small { color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .strip:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); } }

.card { padding: 16px; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); }
.privacy h2 { display: flex; font-family: var(--display); align-items: center; gap: 10px; margin: 0 0 6px; font-size: 1.05rem; color: var(--green); }
.privacy p { margin: 0 0 10px; line-height: 1.5; color: var(--muted); font-size: .92rem; }
.row { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.link { background: none; border: 0; padding: 10px 0; min-height: 44px; color: var(--green); font-size: .92rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link.danger { color: var(--danger); }
.crisis { margin: 18px 0 4px; line-height: 1.6; }
.crisis a { font-weight: 700; color: var(--accent-strong); white-space: nowrap; }
html.dark .crisis a { color: #c9b482; }
.fine { margin: 0; color: var(--muted); font-size: .85rem; }

/* bottom navigation: five equal buttons, always visible. The three on the left are the "when it is hard" tools, "Więcej" opens the everyday ones. */
#nav { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); min-height: var(--nav-h); padding-bottom: env(safe-area-inset-bottom); background: var(--paper); border-top: 1px solid var(--line); }
#nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: var(--nav-h); padding: 6px 2px; border: 0; background: none; color: var(--muted); font-size: .72rem; font-weight: 600; cursor: pointer; position: relative; transition: color 200ms; }
#nav button .doodle { --s: 28px; }
#nav button[aria-current="page"] { color: var(--green); }
#nav button::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 2px; background: var(--accent-strong); transform: scaleX(0); transition: transform 200ms var(--ease-out); }
#nav button[aria-current="page"]::before { transform: scaleX(1); }
#nav button:active .doodle { transform: scale(.92); }
#nav button .doodle { transition: transform 160ms var(--ease-out); }
#nav button:focus-visible, .go:focus-visible, .tile:focus-visible, .strip:focus-visible, .link:focus-visible, .lockbtn:focus-visible, .pad button:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }

/* PIN screen */
#lock { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow-y: auto; background: var(--cream); padding: 16px; outline: none; }
.lockbox { width: 100%; max-width: 340px; text-align: center; }
.lockbox .logo { height: 44px; margin: 0 auto 18px; }
.lockbox h2 { margin: 0 0 6px; font-family: var(--display); font-size: 1.7rem; color: var(--green); }
.sub { margin: 0 auto 16px; max-width: 30ch; color: var(--muted); font-size: .92rem; line-height: 1.45; }
.dots { display: flex; justify-content: center; gap: 16px; margin: 4px 0 8px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--green); transition: background-color .12s, transform .12s; }
.dots i.on { background: var(--green); transform: scale(1.1); }
.dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.msg { min-height: 1.4em; margin: 0 0 8px; font-size: .9rem; color: var(--danger); }
.pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; justify-content: center; margin-bottom: 10px; }
.pad button { width: 72px; height: 72px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); font-size: 1.6rem; font-weight: 600; cursor: pointer; transition: background-color .12s, transform .08s; }
.pad button:active { background: var(--tint); transform: scale(.94); }
@media (max-height: 640px) { .pad { gap: 8px; grid-template-columns: repeat(3, 60px); } .pad button { width: 60px; height: 60px; font-size: 1.4rem; } .lockbox .logo { margin-bottom: 8px; } }
@media (prefers-reduced-motion: reduce) { .dots.shake { animation: none; } * { transition: none !important; } }

/* confirm dialog */
dialog { width: min(92vw, 380px); padding: 20px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgba(29, 22, 18, .55); }
dialog h2 { margin: 0 0 8px; font-family: var(--display); font-size: 1.3rem; color: var(--green); }
dialog p { margin: 0 0 16px; line-height: 1.5; color: var(--muted); }
dialog .row { justify-content: flex-end; gap: 10px; }
/* same rhythm as the apps' buttons: 52 px tall, centred label */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px; border: 1.5px solid var(--green); border-radius: 2px; background: var(--cta); color: var(--cta-ink); border-color: var(--cta); font-size: 1rem; font-weight: 600; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--green); border-color: var(--line); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
html.dark .btn.danger { color: #141c18; }
html.dark .btn.ghost { color: var(--green); }

/* Entrance: content rises 12 px and fades, staggered 40 ms, in 360 ms with a strong ease-out. Short and small on purpose: this screen is opened many times a day.
   Toggling [hidden] restarts a CSS animation, so no script replays it on each visit. */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { from { opacity: 0; } }
.wrap > *, .lockbox > * { animation: rise 360ms var(--ease-out) both; }
.wrap > :nth-child(2) { animation-delay: 40ms; } .wrap > :nth-child(3) { animation-delay: 80ms; } .wrap > :nth-child(4) { animation-delay: 120ms; } .wrap > :nth-child(5) { animation-delay: 160ms; } .wrap > :nth-child(6) { animation-delay: 200ms; } .wrap > :nth-child(n+7) { animation-delay: 240ms; }
.lockbox > :nth-child(2) { animation-delay: 40ms; } .lockbox > :nth-child(3) { animation-delay: 80ms; } .lockbox > :nth-child(4) { animation-delay: 120ms; } .lockbox > :nth-child(5) { animation-delay: 160ms; } .lockbox > :nth-child(6) { animation-delay: 200ms; } .lockbox > :nth-child(7) { animation-delay: 240ms; }
iframe.app { animation: fade 200ms ease both; }

/* "Więcej" bottom sheet: native <dialog>, so focus trap, Escape and the backdrop come free. Enters slowly (300 ms) where the user is deciding, leaves fast (200 ms). */
.sheet { position: fixed; inset: auto 0 0 0; margin: 0 auto; width: min(100%, 640px); max-width: none; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-bottom: 0; border-radius: 4px 4px 0 0; transform: translateY(100%); transition: transform 200ms var(--ease-drawer), overlay 200ms allow-discrete, display 200ms allow-discrete; }
.sheet[open] { transform: none; transition-duration: 300ms; }
@starting-style { .sheet[open] { transform: translateY(100%); } }
.sheet::backdrop { opacity: 0; transition: opacity 200ms, overlay 200ms allow-discrete, display 200ms allow-discrete; }
.sheet[open]::backdrop { opacity: 1; }
@starting-style { .sheet[open]::backdrop { opacity: 0; } }
.grab { width: 40px; height: 4px; margin: 0 auto 14px; border-radius: 4px; background: var(--line); }
.sheet h2 { margin: 0 0 12px; }
.sheet .link { display: block; margin: 6px auto 0; }
.sheet .go { min-height: 68px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
