/* Signed-in pages, sign-up and log-in, admin, and the legal pages. */
.page { max-width: 820px; margin: 0 auto; padding: 32px 18px 80px; }
.page.wide { max-width: 1180px; }
.page-title { font-size: 2.2rem; margin-bottom: 18px; }
.card { background: var(--paper); border-radius: 20px; padding: clamp(20px, 3vw, 28px); margin-top: 22px; box-shadow: inset 0 0 0 1.5px var(--line); }
.card h2 { font-size: 1.45rem; }
.sub { color: var(--muted); margin-top: 4px; }
.card > .sub { margin-bottom: 14px; }
.hint { display: block; color: var(--muted); font-size: 0.92rem; font-weight: 400; margin-top: 2px; }
.empty { color: var(--muted); margin-top: 12px; }
.msg { color: var(--muted); font-size: 0.97rem; min-height: 1.2em; }
.msg.err { color: var(--red-deep); font-weight: 700; }
.msg.ok { color: var(--pine); font-weight: 700; }
.flash { padding: 14px 18px; border-radius: 14px; background: #e3f3ea; color: #14532d; font-weight: 700; box-shadow: inset 0 0 0 1.5px #b9dfc8; }
.flash.warn { background: #fff4d6; color: #6b4a00; box-shadow: inset 0 0 0 1.5px #f0d98a; }

/* forms */
form label { display: block; font-weight: 800; margin-top: 16px; }
form input:not([type="checkbox"]), form textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-weight: 400; }
form textarea { min-height: 70px; resize: vertical; }
form input:focus, form textarea:focus { outline: 3px solid rgba(200, 16, 46, 0.22); border-color: var(--red); }
label.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
label.check input { width: 20px; height: 20px; margin: 3px 0 0; flex: none; accent-color: var(--red); }
.row { display: grid; grid-template-columns: 1fr 130px; gap: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; }
.actions.tight { margin-top: 12px; }
h3.group { margin-top: 30px; font-size: 1.2rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-form label { margin-top: 0; flex: 1 1 200px; }

/* sign up and log in */
.auth { min-height: 70vh; display: grid; place-items: start center; padding: clamp(28px, 6vw, 72px) 18px 80px; }
.auth-card { width: min(100%, 470px); background: var(--paper); border-radius: 24px; padding: clamp(24px, 4vw, 38px); box-shadow: inset 0 0 0 1.5px var(--line); }
.auth-card h1 { font-size: 2rem; }
.auth-card .btn.wide { margin-top: 20px; }
.auth-card .aside { margin-top: 18px; color: var(--muted); font-size: 0.97rem; }
.auth-card > p > .btn { margin-top: 22px; }
fieldset.confirm { border: 0; padding: 0; margin: 22px 0 0; }
fieldset.confirm legend { font-weight: 800; padding: 0; }
fieldset.confirm label.check { margin-top: 12px; font-weight: 400; font-size: 0.97rem; }

/* account */
.balance { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: center; justify-content: space-between; background: var(--night); color: #fff; border-radius: 24px; padding: clamp(22px, 4vw, 34px); margin-top: 16px; }
.balance-label { color: rgba(255, 255, 255, 0.7); font-weight: 700; }
.balance-number { font-family: var(--display); font-size: 4.2rem; font-weight: 560; line-height: 1; }
.buy { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; max-width: 460px; }
.buy .fine { flex-basis: 100%; color: rgba(255, 255, 255, 0.62); }
.balance .btn.secondary { box-shadow: none; }

.families { list-style: none; margin: 8px 0 0; padding: 0; }
.families > li { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 16px 0; border-top: 1.5px solid var(--line); }
.families > li:first-child { border-top: 0; }
.who { font-weight: 800; font-size: 1.1rem; }
.who small { display: block; font-weight: 400; color: var(--muted); font-size: 0.92rem; }
.do { display: flex; flex-wrap: wrap; gap: 8px; }
.memory { flex-basis: 100%; padding: 12px 16px; border-radius: 12px; background: var(--ice); color: var(--muted); font-size: 0.95rem; }
.memory summary { cursor: pointer; font-weight: 800; color: var(--ink); }
.memory ul { margin: 8px 0 4px; padding-left: 18px; }
.memory .btn.quiet { padding: 4px 0; }

fieldset.child { position: relative; border: 1.5px solid var(--line); border-radius: 16px; padding: 4px 18px 18px; margin: 16px 0 0; background: #f8fbfd; min-width: 0; }
fieldset.child legend { font-family: var(--display); font-weight: 650; font-size: 1.15rem; padding: 0 8px; color: var(--red-deep); }
fieldset.child .remove { position: absolute; top: -2px; right: 8px; padding: 6px 8px; font-size: 0.9rem; }
.notes { margin: 10px 0 0; padding-left: 20px; color: var(--muted); }
.notes li { margin-top: 6px; }

/* tables (history and admin) */
.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
th { text-align: left; font-weight: 800; color: var(--muted); padding: 8px 12px 8px 0; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; }
td .btn { padding: 6px 14px; font-size: 0.9rem; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 800; font-size: 0.85rem; background: var(--ice); color: var(--muted); }
.pill.good { background: #e3f3ea; color: #14532d; }
.pill.bad { background: #fde8ea; color: var(--red-deep); }

/* admin */
.pause { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.pause.paused { box-shadow: inset 0 0 0 3px var(--red); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 22px; }
.stat { background: var(--paper); border-radius: 18px; padding: 18px; box-shadow: inset 0 0 0 1.5px var(--line); }
.stat b { display: block; font-family: var(--display); font-size: 2.1rem; font-weight: 560; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 0.93rem; font-weight: 700; }
.checks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.checks li { padding-left: 30px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 4px; top: 0.5em; width: 12px; height: 12px; border-radius: 50%; background: var(--pine); }
.checks li.todo::before { background: var(--red); }
.checks li.todo span { display: block; color: var(--muted); font-size: 0.93rem; }

/* legal */
.legal { max-width: 800px; margin: 0 auto; padding: clamp(28px, 5vw, 60px) 18px 90px; }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3rem); }
.legal h2 { font-size: 1.5rem; margin-top: 40px; }
.legal p, .legal ul { margin-top: 14px; }
.legal ul { padding-left: 22px; }
.legal li { margin-top: 8px; }
.legal table { margin-top: 16px; }
.legal td, .legal th { padding-right: 16px; }
.legal th { white-space: normal; }
.legal .flash { margin-bottom: 24px; }

@media (max-width: 560px) { .row { grid-template-columns: 1fr; } .balance-number { font-size: 3.2rem; } }
.optional { font-weight: 400; color: var(--muted); }
.with-password { margin-top: 26px; padding-top: 18px; border-top: 1.5px solid var(--line); }
.with-password summary { cursor: pointer; font-weight: 800; color: var(--muted); }
.with-password .aside { margin-top: 12px; }
.guide-link { margin-top: 14px; }
.card.consent { box-shadow: inset 0 0 0 3px var(--red); }
form.locked { opacity: 0.45; pointer-events: none; }
.gift-link { margin-top: 16px; padding-top: 14px; border-top: 1.5px solid var(--line); }
.gift-link .inline-form label { flex: 1 1 320px; }
