/* =========================================================
   MailMind — app pages (settings, sign-in, beta, billing,
   contact, legal, errors). Builds on universal.css.
   ========================================================= */

.g { color: var(--gray-2); }
.app-page .main-content { position: relative; isolation: isolate; overflow: hidden; }
.app-page .aurora { opacity: .5; height: 640px; }

.page {
    max-width: 1080px;
    margin: 0 auto;
    padding: clamp(56px, 10vh, 110px) 24px 130px;
}
.page.narrow { max-width: 780px; }
.page.center { text-align: center; }

.page-head { margin-bottom: 44px; }
.page-title {
    font-size: clamp(44px, 7vw, 84px);
    font-weight: 800;
    letter-spacing: -0.058em;
    line-height: .96;
    margin: 0;
}
.lede {
    font-size: clamp(18px, 2vw, 22px);
    color: var(--gray);
    line-height: 1.45;
    letter-spacing: -0.015em;
    margin: 22px 0 0;
    max-width: 560px;
}
.page.center .lede { margin-left: auto; margin-right: auto; }

/* ---------- cards ---------- */
.card {
    position: relative;
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 30px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .07), 0 0 0 1px rgba(0, 0, 0, .045);
    padding: 36px;
}
.card + .card { margin-top: 22px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.card-head h2 { font-size: 26px; font-weight: 750; letter-spacing: -0.035em; margin: 0; }
.card-head .hint { margin-top: 6px; max-width: 520px; }
.card-foot { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

.stack > * + * { margin-top: 22px; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: 220px 1fr; gap: 44px; align-items: start; }
.side-nav { position: sticky; top: 100px; display: grid; gap: 4px; }
.side-nav a {
    text-decoration: none; color: var(--gray); font-size: 15px; font-weight: 550;
    padding: 10px 14px; border-radius: 12px; transition: background .2s ease, color .2s ease;
}
.side-nav a:hover { background: rgba(0, 0, 0, .04); color: var(--ink); }
.side-nav .who { padding: 0 14px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.side-nav .who b { display: block; font-size: 15px; letter-spacing: -0.01em; word-break: break-all; }
.side-nav .who span { font-size: 13px; color: var(--gray-2); }
section[id] { scroll-margin-top: 100px; }

.acct-list { list-style: none; margin: 0; padding: 0; }
.acct {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 0; border-top: 1px solid var(--line);
}
.acct:first-child { border-top: 0; padding-top: 4px; }
.acct-icon {
    width: 46px; height: 46px; border-radius: 14px; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: #fff; box-shadow: 0 0 0 1px var(--line), 0 6px 16px rgba(0, 0, 0, .05);
}
.acct-main { flex: 1; min-width: 0; }
.acct-email { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; align-items: center; font-size: 14px; color: var(--gray-2); }
.tag { font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: var(--gray); }
.tag.warn { background: var(--accent-soft); color: var(--accent-ink); }
.tag.ok { background: #eaf8ee; color: #1a7f37; }
.acct-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.acct-actions form { margin: 0; }

.connect-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 20px; border-top: 1px solid var(--line); }

/* delivery schedule */
.sched-top { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; }
.picked { display: flex; gap: 8px; flex-wrap: wrap; min-height: 40px; align-items: center; margin: 24px 0 14px; }
.picked .chip-on {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 10px 8px 14px; border-radius: 999px;
    background: var(--ink); color: #fff; font-weight: 650; font-size: 15px;
    font-variant-numeric: tabular-nums;
}
.picked .chip-on button {
    border: 0; background: rgba(255, 255, 255, .18); color: #fff; width: 22px; height: 22px;
    border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1;
}
.picked .empty-note { color: var(--gray-2); font-size: 15px; }
.count { font-size: 14px; font-weight: 650; color: var(--gray-2); font-variant-numeric: tabular-nums; }
.count.full { color: var(--accent-ink); }

.time-grid {
    max-height: 380px; overflow: auto;
    border-radius: 20px; background: var(--soft);
    padding: 8px;
    display: grid; gap: 2px;
    -webkit-mask-image: linear-gradient(#000 92%, transparent);
    mask-image: linear-gradient(#000 92%, transparent);
}
.hour-row { display: grid; grid-template-columns: 72px repeat(4, 1fr); gap: 6px; align-items: center; padding: 3px 6px; }
.hour-row .hr { font-size: 13px; font-weight: 650; color: var(--gray-2); font-variant-numeric: tabular-nums; }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.slot span {
    display: block; text-align: center; padding: 9px 0; border-radius: 12px;
    background: #fff; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .04); transition: background .15s ease, color .15s ease, transform .15s ease;
}
.slot:hover span { box-shadow: 0 0 0 1px rgba(0, 0, 0, .14); }
.slot input:checked + span { background: var(--ink); color: #fff; box-shadow: 0 6px 16px rgba(255, 106, 43, .3); }
.slot input:focus-visible + span { outline: 3px solid rgba(255, 106, 43, .45); outline-offset: 1px; }
.slot input:disabled + span { opacity: .35; }

/* plan */
.plan { display: flex; align-items: center; gap: 16px; }
.plan-dot { width: 12px; height: 12px; border-radius: 50%; background: #1a7f37; box-shadow: 0 0 0 5px #eaf8ee; flex: none; }
.plan-dot.off { background: #c7c7cc; box-shadow: 0 0 0 5px var(--soft); }
.plan b { font-size: 18px; letter-spacing: -0.02em; }

/* danger zone */
.danger { box-shadow: 0 30px 80px rgba(0, 0, 0, .05), 0 0 0 1px rgba(215, 0, 21, .14); }
.danger details summary { cursor: pointer; list-style: none; }
.danger details summary::-webkit-details-marker { display: none; }
.danger .confirm { margin-top: 20px; display: grid; gap: 14px; max-width: 460px; }

/* ---------- sign-in ---------- */
.auth-card { max-width: 460px; margin: 44px auto 0; text-align: left; }
.provider-btn {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    width: 100%; min-height: 56px; border-radius: 16px;
    background: #fff; color: var(--ink); text-decoration: none;
    font-size: 17px; font-weight: 650; letter-spacing: -0.01em;
    box-shadow: 0 0 0 1px #d2d2d7, 0 6px 18px rgba(0, 0, 0, .04);
    transition: box-shadow .2s ease, transform .25s cubic-bezier(.16, 1, .3, 1);
}
.provider-btn:hover { box-shadow: 0 0 0 1px var(--ink), 0 12px 28px rgba(0, 0, 0, .08); transform: translateY(-1px); }
.provider-btn + .provider-btn { margin-top: 12px; }
.divider { display: flex; align-items: center; gap: 14px; margin: 26px 0; color: var(--gray-2); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.fine { font-size: 14px; color: var(--gray-2); margin: 18px 0 0; line-height: 1.5; }
.fine a { color: var(--ink); font-weight: 600; }

/* ---------- split (beta / contact) ---------- */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; }
.perks { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 14px; font-size: 18px; font-weight: 550; letter-spacing: -0.012em; }
.perks li { display: flex; align-items: center; gap: 12px; }
.ck-mini { width: 22px; height: 22px; border-radius: 50%; background: var(--grad); position: relative; flex: none; box-shadow: 0 4px 10px rgba(255, 106, 43, .3); }
.ck-mini::after { content: ''; position: absolute; left: 7px; top: 3.5px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.2px 2.2px 0; transform: rotate(45deg); }
.form-card .beta-btn, .form-card .btn-primary { width: 100%; justify-content: center; margin-top: 24px; border: none; cursor: pointer; font-family: inherit; }
.form-card .fine { text-align: center; }

/* ---------- pricing ---------- */
.price-card { max-width: 520px; margin: 44px auto 0; text-align: left; }
.price { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 6px; }
.price b { font-size: 64px; font-weight: 800; letter-spacing: -0.06em; line-height: 1; }
.price span { color: var(--gray); font-size: 18px; }
.tos { display: flex; gap: 12px; align-items: flex-start; margin-top: 24px; font-size: 15px; color: var(--gray); cursor: pointer; }
.tos input { margin-top: 2px; flex: none; }
.tos a { color: var(--ink); font-weight: 600; }

/* ---------- code ---------- */
.code-input { text-align: center; font-size: 26px !important; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; padding: 18px !important; }
.inline-error { color: var(--danger); font-size: 15px; font-weight: 600; margin: 0 0 16px; }

/* ---------- thanks / errors ---------- */
.big-mark { filter: drop-shadow(0 16px 30px rgba(255, 106, 43, .25)); margin-bottom: 28px; }
.err-code {
    font-size: clamp(110px, 20vw, 200px); font-weight: 800; letter-spacing: -0.07em; line-height: .9;
    background: linear-gradient(180deg, #1d1d1f 30%, #c7c7cc 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    margin: 0 0 12px; font-variant-numeric: tabular-nums;
}
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 36px; }

/* ---------- legal prose ---------- */
.prose { font-size: 17px; line-height: 1.7; color: var(--ink-2); }
.prose h2 { font-size: 30px; font-weight: 750; letter-spacing: -0.04em; color: var(--ink); margin: 0 0 6px; }
.prose h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); margin: 28px 0 6px; }
.prose p { margin: 10px 0; }
.prose ul { padding-left: 20px; margin: 8px 0; }
.prose li { margin: 6px 0; }
.prose .updated { font-size: 14px; color: var(--gray-2); margin: 0 0 18px; }
.prose a { color: var(--accent-ink); }
.toc { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .settings-grid { grid-template-columns: 1fr; gap: 20px; }
    .side-nav { position: static; display: flex; gap: 6px; overflow-x: auto; }
    .side-nav .who { display: none; }
    .side-nav a { white-space: nowrap; background: rgba(0, 0, 0, .04); }
    .split { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 560px) {
    .card { padding: 26px 20px; border-radius: 26px; }
    .card-head { flex-direction: column; }
    .acct { flex-wrap: wrap; }
    .acct-actions { width: 100%; padding-left: 62px; }
    .sched-top { grid-template-columns: 1fr; }
    .hour-row { grid-template-columns: 54px repeat(4, 1fr); gap: 4px; padding: 3px 2px; }
    .slot span { font-size: 13px; padding: 8px 0; }
}

/* ---------- the list ---------- */
.notice {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 14px 16px 14px 20px; margin-bottom: 16px; border-radius: 18px;
    background: var(--accent-soft); color: var(--accent-ink); font-size: 15px;
}
.list-panel { padding: 34px 36px 22px; }
.list-top { display: flex; justify-content: space-between; align-items: flex-start; }
.list-title { font-size: 34px; font-weight: 750; letter-spacing: -0.04em; line-height: 1.1; }
.list-title.small { font-size: 20px; letter-spacing: -0.025em; }
.list-sub { color: var(--gray-2); font-size: 15px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.progress { height: 4px; border-radius: 4px; background: var(--line); margin: 18px 0 8px; overflow: hidden; }
.progress span {
    display: block; height: 100%; background: var(--grad); transform-origin: 0 50%;
    transition: transform .6s cubic-bezier(.16, 1, .3, 1);
}
.group-label { margin: 22px 0 0; font-size: 13px; font-weight: 700; color: var(--gray-2); letter-spacing: .01em; }
.todos { list-style: none; margin: 0; padding: 0; }
.todo { display: flex; align-items: flex-start; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.todo:last-child { border-bottom: 0; }
.todo-form { margin: 0; padding-top: 1px; }
.todo .ck {
    width: 28px; height: 28px; border-radius: 50%; border: 2px solid #c7c7cc; background: #fff;
    position: relative; cursor: pointer; padding: 0; flex: none;
    transition: background .3s ease, border-color .3s ease, box-shadow .3s ease, transform .2s ease;
}
.todo .ck:hover { border-color: var(--accent); }
.todo .ck:active { transform: scale(.9); }
.todo .ck::after {
    content: ''; position: absolute; left: 8.5px; top: 4.5px; width: 6px; height: 12px;
    border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0);
    transition: transform .35s cubic-bezier(.34, 1.56, .64, 1) .05s;
}
.todo.done .ck { background: var(--grad); border-color: transparent; box-shadow: 0 4px 12px rgba(255, 106, 43, .35); }
.todo.done .ck::after { transform: rotate(45deg) scale(1); }
.todo-main { flex: 1; min-width: 0; }
.todo-action { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.35; transition: color .3s ease; }
.todo.done .todo-action { color: var(--gray-2); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .25); }
.todo-meta { margin: 4px 0 0; font-size: 14px; color: var(--gray-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-meta span + span::before { content: '·'; margin: 0 7px; }
.todo .cal { flex: none; }
.earlier { margin-top: 22px; padding-top: 22px; }
.earlier summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; padding-bottom: 4px; }
.earlier summary::-webkit-details-marker { display: none; }
.empty { text-align: center; padding: 48px 36px; }
.empty img { filter: drop-shadow(0 12px 24px rgba(255, 106, 43, .22)); }
.empty p { font-size: 18px; color: var(--gray); max-width: 440px; margin: 18px auto 0; line-height: 1.5; }
.empty .btn { margin-top: 22px; }

@media (max-width: 560px) {
    .list-panel { padding: 26px 20px 12px; }
    .todo { flex-wrap: wrap; }
    .todo-main { flex-basis: calc(100% - 44px); }
    .todo .cal { margin-left: 44px; }
    .todo-action { font-size: 17px; }
    .notice { flex-direction: column; align-items: flex-start; }
}

/* ---------- forwarding ---------- */
.fwd-address {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 10px 10px 18px; border-radius: 16px; background: var(--soft);
}
.fwd-address code {
    flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap;
    font: 600 16px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -0.01em; color: var(--ink);
}
.fwd-status { margin-top: 10px; }
.fwd-code {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
    margin-top: 18px; padding: 18px 20px; border-radius: 18px;
    background: var(--accent-soft); box-shadow: 0 0 0 1.5px rgba(255, 106, 43, .35);
}
.fwd-code .label { margin: 0; color: var(--accent-ink); }
.code-big { margin: 6px 0; font-size: 32px; font-weight: 800; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.fwd-guides { margin-top: 20px; display: grid; gap: 10px; }
.guide { border-radius: 16px; box-shadow: 0 0 0 1px var(--line); padding: 4px 18px; }
.guide[open] { padding-bottom: 16px; }
.guide summary {
    display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none;
    padding: 12px 0; font-weight: 650; font-size: 16px;
}
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after { content: '+'; margin-left: auto; color: var(--gray-2); font-size: 20px; font-weight: 400; }
.guide[open] summary::after { content: '\2212'; }
.guide ol { margin: 4px 0 12px; padding-left: 22px; display: grid; gap: 8px; font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.guide a { color: var(--accent-ink); font-weight: 600; }
@media (max-width: 560px) {
    .fwd-address { flex-direction: column; align-items: stretch; }
    .fwd-address code { font-size: 14px; white-space: normal; word-break: break-all; }
    .fwd-code { flex-direction: column; }
}
