/* Keepsake app pages (login, dashboard, pricing) + shared modal */
[hidden] { display: none !important; }
:root { --bg: #EEEDF2; --panel: #fff; --ink: #17161C; --muted: #6A6875; --line: #E1DFE8; --brand: #E0245E; --soft: #F7F6FA; --gold: #B98A2E; --ok: #1E7F4F; --bad: #B4232C; }
.app-page { margin: 0; background: var(--bg); color: var(--ink); font-family: "Manrope", system-ui, sans-serif; line-height: 1.5; min-height: 100vh; }
.app-page *, .app-page *::before, .app-page *::after { box-sizing: border-box; }
.app-page :focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
.app-page button, .app-page input, .app-page select, .app-page textarea { font: inherit; color: inherit; }
.app-wrap { max-width: 1160px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.app-top { display: flex; align-items: center; gap: 14px; padding: 18px 0; flex-wrap: wrap; }
.app-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; }
.app-brand .mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--brand); color: #fff; }
.app-nav { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.app-nav a, .app-nav button { color: var(--ink); text-decoration: none; font-weight: 700; padding: 8px 12px; border-radius: 10px; border: 0; background: none; cursor: pointer; }
.app-nav a:hover, .app-nav button:hover { background: rgba(0,0,0,.05); }
.app-nav .cta { background: var(--ink); color: #fff; }
.app-nav .cta:hover { background: #2c2a33; }
.serif { font-family: "Gloock", Georgia, serif; font-weight: 400; letter-spacing: -.01em; }
.k-plan { display: inline-block; background: linear-gradient(135deg, #8C6420, #D9B25E); color: #fff; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.k-plan.free { background: #DCDAE3; color: var(--ink); }

/* buttons */
.k-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 800; cursor: pointer; text-decoration: none; box-shadow: 0 6px 16px rgba(224,36,94,.22); }
.k-btn:disabled { opacity: .6; cursor: progress; }
.k-btn.ghost { background: var(--panel); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.k-btn.ghost:hover { background: var(--soft); }
.k-btn.danger { color: var(--bad); }
.k-btn.dark { background: var(--ink); box-shadow: none; }
.k-btn.gold { background: linear-gradient(135deg, #8C6420, #C9A04E); box-shadow: 0 6px 16px rgba(140,100,32,.28); }
.k-btn.sm { padding: 7px 11px; font-size: .88rem; border-radius: 9px; }
.k-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.k-row.end { justify-content: flex-end; }

/* forms */
.k-f { display: grid; gap: 6px; margin-top: 14px; }
.k-f > span { font-size: .82rem; font-weight: 700; color: var(--muted); }
.k-f input, .k-f select, .k-f textarea { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); }
.k-f input:focus, .k-f select:focus, .k-f textarea:focus { outline: none; border-color: var(--brand); background: #fff; }
.k-msg { min-height: 1.4em; margin: 10px 0 0; font-size: .9rem; color: var(--muted); }
.k-msg.bad { color: var(--bad); }
.k-msg.good { color: var(--ok); }
.k-msg a { color: inherit; font-weight: 800; }

/* modal */
.k-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(15,14,20,.5); display: grid; place-items: center; padding: 16px; font-family: "Manrope", system-ui, sans-serif; color: var(--ink); animation: kfade .2s ease; }
.k-dialog { position: relative; background: var(--panel); border-radius: 18px; padding: 24px; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.k-dialog.wide { width: min(980px, 100%); }
.k-dialog h2 { margin: 0 0 4px; font-size: 1.3rem; }
.k-sub { margin: 0; color: var(--muted); font-size: .92rem; }
.k-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--soft); cursor: pointer; font-size: 14px; }
.k-slug { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); overflow: hidden; }
.k-slug:focus-within { border-color: var(--brand); background: #fff; }
.k-pre { padding: 11px 0 11px 12px; color: var(--muted); font-size: .9rem; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.k-slug input { border: 0 !important; background: none !important; padding-left: 2px !important; min-width: 0; flex: 1; }
.k-live { margin-top: 12px; padding: 12px; border-radius: 12px; background: #EEF8F2; border: 1px solid #CFE9DA; }
.k-live a#k-link { color: var(--ok); font-weight: 800; word-break: break-all; }
.k-live .k-row { margin-top: 10px; }
@keyframes kfade { from { opacity: 0 } }

/* auth */
.auth { min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 24px 0 60px; }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: clamp(22px, 4vw, 36px); width: min(440px, 100%); box-shadow: 0 30px 70px rgba(0,0,0,.08); }
.auth-card h1 { font-size: 2rem; margin: 0; }
.auth-card .hand { font-family: "Gochi Hand", cursive; color: var(--brand); font-size: 1.3rem; margin: 0; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 18px 0 4px; }
.auth-tabs button { border: 0; background: none; padding: 9px; border-radius: 9px; font-weight: 800; color: var(--muted); cursor: pointer; }
.auth-tabs button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.auth-card .k-btn { width: 100%; margin-top: 18px; padding: 12px; }
.linkish { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; font-size: .9rem; }
.fine { color: var(--muted); font-size: .82rem; margin-top: 16px; }

/* dashboard */
.dash-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 3vh 0 2vh; }
.dash-head h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); margin: 0; line-height: 1.05; }
.dash-head p { margin: 4px 0 0; color: var(--muted); }
.dash-head .k-row { margin: 0 0 0 auto; }
.plan-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-bottom: 18px; }
.plan-bar .meter { flex: 1; min-width: 160px; height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.plan-bar .meter i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.plan-bar small { color: var(--muted); }
.d-tabs { display: flex; gap: 8px; margin: 0 0 16px; }
.d-tabs button { border: 1px solid var(--line); background: var(--panel); padding: 8px 14px; border-radius: 999px; font-weight: 800; color: var(--muted); cursor: pointer; }
.d-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; padding-bottom: 8vh; }
.p-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.p-shot { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--soft); display: block; }
.p-shot iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; transform-origin: 0 0; pointer-events: none; }
.p-status { position: absolute; top: 10px; left: 10px; z-index: 2; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--muted); }
.p-status.live { background: #1E7F4F; color: #fff; }
.p-info { padding: 14px 16px 16px; display: grid; gap: 4px; flex: 1; }
.p-info h3 { margin: 0; font-size: 1.08rem; }
.p-info .meta { color: var(--muted); font-size: .85rem; }
.p-info .live-link { font-size: .85rem; color: var(--ok); font-weight: 700; word-break: break-all; }
.p-acts { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 16px; }
.p-acts .k-btn { flex: 1 1 auto; }
.empty { background: var(--panel); border: 1px dashed #CFCCD8; border-radius: 18px; padding: 48px 24px; text-align: center; }
.empty h2 { margin: 0 0 6px; }
.empty p { color: var(--muted); margin: 0 0 18px; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin-top: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--panel); }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: var(--soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.pill.yes { background: #E3F4EA; color: var(--ok); }
.pill.no { background: #FBE6E8; color: var(--bad); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.stat { background: var(--soft); border-radius: 12px; padding: 12px; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .82rem; }

/* pricing */
.price-hero { text-align: center; padding: 5vh 0 4vh; max-width: 44rem; margin: 0 auto; }
.price-hero h1 { font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4.2rem); line-height: 1; margin: .1em 0 .3em; }
.price-hero p { color: var(--muted); font-size: 1.1rem; margin: 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 20px; padding-bottom: 6vh; align-items: stretch; }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 26px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.plan.feat { border-color: #E3C98E; box-shadow: 0 0 0 1px #E3C98E inset, 0 30px 60px rgba(140,100,32,.12); }
.plan .tag { position: absolute; top: -12px; left: 24px; background: linear-gradient(135deg, #8C6420, #D9B25E); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.plan h2 { margin: 0; font-size: 1.3rem; }
.plan .price { font-size: 2.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; margin: 6px 0 0; }
.plan .price small { font-size: .95rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan p.blurb { color: var(--muted); margin: 0; }
.plan ul { list-style: none; padding: 0; margin: 8px 0 auto; display: grid; gap: 8px; }
.plan li { padding-left: 26px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: #E3F4EA; color: var(--ok); font-size: .72rem; font-weight: 900; display: grid; place-items: center; margin-top: 3px; }
.plan .k-btn { margin-top: 16px; width: 100%; padding: 12px; }
.faq { max-width: 48rem; margin: 0 auto; padding-bottom: 8vh; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { font-weight: 800; cursor: pointer; }
.faq p { color: var(--muted); margin: 8px 0 0; }
.app-foot { color: var(--muted); font-size: .88rem; padding: 3vh 0 6vh; display: flex; gap: 16px; flex-wrap: wrap; }
.app-foot a { color: var(--muted); }
.skeleton { height: 260px; border-radius: 18px; background: linear-gradient(90deg, #E6E4EC, #F2F1F5, #E6E4EC); background-size: 200% 100%; animation: shim 1.2s linear infinite; }
@keyframes shim { to { background-position: -200% 0 } }
@media (prefers-reduced-motion: reduce) { .skeleton, .k-modal { animation: none; } }
