:root {
  --ink: #281d35;
  --ink-soft: #6e6078;
  --navy: #170f28;
  --navy-raised: #281a3d;
  --paper: #fbf8fc;
  --white: #ffffff;
  --coral: #ef89a3;
  --coral-deep: #c85272;
  --sky: #eadff6;
  --line: #e8e0eb;
  --green: #54d6a1;
  --shadow: 0 20px 50px rgba(23, 31, 54, 0.12);
}

/* Account, casting, and control-room surfaces share the product's midnight
   intimacy, with a deliberately theatrical "casting card" catalog. */
.install-app { width:100%; border:0; background:transparent; text-align:left; }
.install-seal { display:grid;place-items:center;width:22px;height:22px;border-radius:48% 52% 44% 56%;background:var(--coral);color:var(--navy);font:600 14px "Iowan Old Style",serif;transform:rotate(-5deg) }
.install-seal.large { width:54px;height:54px;margin-bottom:19px;font-size:30px }
.install-dialog { max-width:430px;padding:35px;border:0;border-radius:18px;color:var(--ink);box-shadow:var(--shadow) }
.install-dialog::backdrop { background:rgba(10,15,28,.7) }
.install-dialog h2 { margin:6px 0 14px;font:500 32px "Iowan Old Style",serif }
.install-dialog p:not(.eyebrow) { color:var(--ink-soft);line-height:1.6 }
.install-dialog .primary-action { width:100%;margin-top:12px }
.install-steps{display:grid;gap:10px;margin:20px 0 8px;padding:0;list-style:none}.install-steps[hidden],#install-browser-help[hidden]{display:none}.install-steps li{display:grid;grid-template-columns:30px 1fr;align-items:start;gap:11px;padding:12px;border:1px solid var(--line);border-radius:11px;background:#f8f9fc}.install-steps li>span{display:grid;width:27px;height:27px;place-items:center;border-radius:50%;background:var(--coral);color:var(--navy);font:700 10px "Cascadia Mono",monospace}.install-steps li>div{display:grid;gap:3px}.install-steps strong{font-size:13px}.install-steps small{color:var(--ink-soft);font-size:10px;line-height:1.45}
.offline-body { min-height:100%;display:grid;place-items:center;overflow:auto;padding:24px;background:radial-gradient(circle at 70% 20%,rgba(255,119,109,.18),transparent 24%),var(--navy);color:white }
.offline-card { width:min(520px,100%);padding:45px;border:1px solid rgba(255,255,255,.13);border-radius:20px;background:rgba(255,255,255,.055);box-shadow:0 30px 80px rgba(0,0,0,.28) }
.offline-card .brand-mark { margin-bottom:42px }
.offline-card h1 { margin:9px 0 18px;font:500 48px/1 "Iowan Old Style",serif;letter-spacing:-.035em }
.offline-card>p:not(.eyebrow) { margin-bottom:28px;color:rgba(255,255,255,.65);line-height:1.7 }
@media (display-mode: standalone) {
  .install-app { display:none !important }
  .shell { width:100%;box-shadow:none }
}
.portal-body,.catalog-body,.utility-body,.admin-body { min-height:100%; overflow:auto; background:#eef0f6; }
.portal-shell { min-height:100dvh; display:grid; grid-template-columns:minmax(330px,1.05fr) minmax(420px,.95fr); }
.portal-story { display:flex; flex-direction:column; justify-content:space-between; padding:50px clamp(34px,7vw,110px); color:white; background:radial-gradient(circle at 80% 24%,rgba(239,137,163,.28),transparent 25%),linear-gradient(145deg,#170f28,#35204a); }
.portal-brand { display:flex; align-items:center; gap:11px; color:white; text-decoration:none; font:500 21px "Iowan Old Style",serif; }
.portal-brand span { display:grid; place-items:center; width:39px;height:39px;border-radius:49% 51% 44% 56%;background:var(--coral);color:var(--navy);transform:rotate(-5deg); }
.portal-brand-lockup,.catalog-brand-lockup{display:grid;justify-items:start;gap:5px}.portal-publisher,.catalog-brand-lockup>small,.brand-publisher{color:rgba(255,255,255,.42);font:600 8px "Cascadia Mono","SFMono-Regular",monospace;letter-spacing:.12em;text-transform:uppercase}.portal-brand-lockup .portal-publisher{margin-left:50px}.catalog-brand-lockup{margin-bottom:65px}.catalog-brand-lockup .portal-brand.dark{margin-bottom:0}.catalog-brand-lockup>small{margin-left:50px}
.portal-story h1,.catalog-header h1,.utility-page h1 { margin:12px 0 22px; font:500 clamp(48px,6vw,86px)/.94 "Iowan Old Style","Baskerville",serif; letter-spacing:-.055em; }
.portal-story>div>p:last-child { max-width:510px;color:rgba(255,255,255,.67);font-size:17px;line-height:1.7; }
.portal-story small { color:rgba(255,255,255,.45); }
.portal-form { display:grid;align-content:center;padding:50px clamp(30px,7vw,100px);background:white; }
.portal-form form { max-width:460px;width:100%; }
.portal-form h2,.utility-card h2,.persona-dialog h2 { margin:7px 0 30px;font:500 33px "Iowan Old Style",serif; }
.auth-tabs { display:flex;gap:22px;margin-bottom:55px;border-bottom:1px solid var(--line); }
.auth-tabs button { padding:14px 0;border:0;border-bottom:2px solid transparent;background:none;color:var(--ink-soft);cursor:pointer; }
.auth-tabs button.active { border-color:var(--coral);color:var(--ink); }
.guest-entry {
  max-width:460px;
  margin:-34px 0 34px;
  padding:18px;
  border:1px solid #f2d2cf;
  border-radius:12px;
  background:#fff8f7;
}
.guest-entry p { margin:0 0 10px;color:var(--ink);font-weight:650; }
.guest-entry small { display:block;margin-top:9px;color:var(--ink-soft); }
.guest-action {
  width:100%;
  padding:12px 16px;
  border:1px solid var(--coral);
  border-radius:9px;
  background:white;
  color:var(--coral-deep);
  font-weight:700;
  cursor:pointer;
}
.portal-form label,.stack-form label { display:grid;gap:8px;margin:0 0 18px;color:var(--ink-soft);font-size:12px;font-weight:600; }
.portal-form input,.stack-form input,.stack-form textarea,.admin-search input { width:100%;padding:13px 14px;border:1px solid var(--line);border-radius:9px;background:#fafbfe;color:var(--ink);font:15px "Segoe UI",sans-serif; }
.portal-form label small { font-weight:400;color:#8a91a3; }
.adult-check { display:flex;gap:24px;margin:20px 0;padding:17px;border:1px solid var(--line);border-radius:10px; }
.adult-check legend { padding:0 7px;color:var(--ink);font-size:13px;font-weight:600; }.adult-check label{display:flex;margin:0;align-items:center}.adult-check input{width:auto}
.primary-action { padding:13px 20px;border:0;border-radius:9px;background:var(--coral);color:var(--navy);font-weight:700;cursor:pointer; }
.quiet-action { padding:12px 18px;border:0;background:transparent;color:var(--ink-soft);cursor:pointer; }
.form-error { min-height:20px;color:#b73d3d;font-size:13px; }
.form-success { color:#277a57;font-size:13px;line-height:1.5; }
.auth-text-action { display:block;margin:14px auto 0;padding:7px;border:0;background:transparent;color:var(--coral-deep);font-weight:600;cursor:pointer; }
.auth-text-action:hover { text-decoration:underline; }
.recovery-explainer { max-width:450px;margin:-12px 0 24px;color:var(--ink-soft);font-size:14px;line-height:1.6; }
.age-dialog,.persona-dialog { max-width:440px;padding:34px;border:0;border-radius:18px;box-shadow:var(--shadow); }.age-dialog::backdrop,.persona-dialog::backdrop,.chat-review::backdrop,.admin-image-dialog::backdrop{background:rgba(10,15,28,.7)}
.age-dialog .dialog-mark { width:auto;padding:0 10px;border-radius:20px;display:inline-grid;background:var(--coral); }
.age-dialog .primary-action { width:100%;margin-top:15px; }
.catalog-page { min-height:100dvh;display:grid;grid-template-columns:380px 1fr; }
.catalog-header { position:sticky;top:0;height:100dvh;padding:45px 45px;background:var(--navy);color:white;overflow:auto; }
.portal-brand.dark { margin-bottom:65px; }.catalog-header .back-link{position:absolute;right:35px;top:57px;color:rgba(255,255,255,.65)}
.catalog-header h1 { font-size:53px; }.catalog-header>p:not(.eyebrow):not(.catalog-count){color:rgba(255,255,255,.6);line-height:1.6}
.type-choice { display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:38px; }.type-choice button{padding:13px 5px;border:1px solid rgba(255,255,255,.16);border-radius:8px;background:transparent;color:white;cursor:pointer}.type-choice button.active{border-color:var(--coral);background:var(--coral);color:var(--navy)}
.catalog-count{margin-top:16px;color:rgba(255,255,255,.45);font:10px "Cascadia Mono",monospace;text-transform:uppercase;letter-spacing:.08em}
.active-companions{display:grid;gap:6px;margin-top:24px}.active-companions>small{color:rgba(255,255,255,.42);font:9px "Cascadia Mono",monospace;letter-spacing:.1em}.active-companions>div{display:grid;grid-template-columns:34px 1fr 34px;align-items:center}.active-companions button{padding:8px 10px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.05);color:white;text-align:left;cursor:pointer}.active-companions button:last-child{text-align:center;color:var(--coral)}
.active-companion-avatar{width:30px;height:30px;border-radius:50%;object-fit:cover;background:var(--sky);display:grid;place-items:center;color:var(--navy)}
.persona-grid { display:grid;grid-template-columns:repeat(2,minmax(260px,1fr));gap:1px;padding:1px;background:#d9dde8;align-content:start; }
.persona-card { position:relative;min-height:330px;padding:35px;text-align:left;border:0;background:#f8f9fc;color:var(--ink);cursor:pointer;display:grid;grid-template-columns:86px 1fr;gap:26px;transition:background .18s,transform .18s; }
.persona-card:hover { z-index:2;background:white;transform:translateY(-3px);box-shadow:0 18px 50px rgba(20,29,52,.13); }
.persona-number { position:absolute;right:24px;top:22px;color:#b3b8c6;font:10px "Cascadia Mono",monospace; }.persona-avatar{display:grid;place-items:center;width:82px;height:102px;border-radius:43% 57% 47% 53%;background:linear-gradient(155deg,var(--sky),#ffc9c4);font:50px "Iowan Old Style",serif;object-fit:cover}
.persona-card small,.chemistry{font:9px "Cascadia Mono",monospace;letter-spacing:.08em;color:#82899b}.persona-card h2{margin:10px 0;font:500 32px "Iowan Old Style",serif}.persona-card p{min-height:84px;color:var(--ink-soft);line-height:1.55}.chemistry{display:block;margin-top:22px;color:var(--coral-deep)}
.persona-dialog .primary-action{width:100%;margin-top:16px}.persona-dialog .quiet-action{width:100%}.chosen-avatar{display:block;width:116px;height:116px;margin:0 auto 22px;border-radius:48% 52% 45% 55%;object-fit:cover}
.utility-page { width:min(820px,calc(100% - 32px));margin:auto;padding:55px 0 100px; }.utility-page h1{font-size:60px}.utility-card{margin-top:20px;padding:35px;background:white;border-radius:15px;box-shadow:0 10px 35px rgba(20,29,52,.06)}.stack-form textarea{min-height:100px;resize:vertical}
.account-email-heading{display:flex;align-items:start;justify-content:space-between;gap:20px}.account-email-heading h2{margin-bottom:8px}.account-email-address{margin:0;color:var(--ink-soft);font-size:13px}.email-verification-badge{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border:1px solid rgba(143,52,86,.2);border-radius:20px;background:#fff7f9;color:#8f3456;font-size:9px;font-weight:750;letter-spacing:.04em;text-transform:uppercase}.email-verification-badge.verified{border-color:rgba(53,126,93,.2);background:#f1faf5;color:#357e5d}.account-email-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:20px}.account-email-actions .quiet-action{padding-left:0}.account-email-status{min-height:18px;margin:13px 0 0;color:var(--ink-soft);font-size:11px}.account-email-status.error{color:#a5413a}.email-change-form{margin-top:22px;padding-top:22px;border-top:1px solid var(--line)}.email-change-form[hidden]{display:none}
.admin-page { width:min(1500px,100%);margin:auto;padding:38px; }.admin-header{display:flex;justify-content:space-between;align-items:end;margin-bottom:35px}.admin-header h1{font:500 43px "Iowan Old Style",serif;margin:7px 0}.admin-search{width:320px;color:var(--ink-soft);font-size:11px}
.admin-analytics-section{margin-bottom:24px;padding:30px;border:1px solid #d8dceb;border-radius:16px;background:linear-gradient(135deg,#fff 58%,#f5f2fa);box-shadow:0 16px 46px rgba(28,37,63,.05)}.admin-analytics-section>header{display:flex;align-items:end;justify-content:space-between;gap:24px}.admin-analytics-section h2{margin:4px 0 0;font:500 32px "Iowan Old Style",serif}.analytics-note{max-width:760px;margin:12px 0 22px;color:var(--ink-soft);font-size:12px;line-height:1.5}.analytics-controls{display:flex;align-items:end;gap:8px}.analytics-controls label{display:grid;gap:5px;color:var(--ink-soft);font-size:10px;text-transform:uppercase;letter-spacing:.06em}.analytics-controls select,.analytics-controls button{height:38px;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:white;color:var(--ink)}.analytics-controls button{cursor:pointer}.analytics-summary{display:grid;grid-template-columns:repeat(5,1fr);gap:1px;margin-bottom:22px;padding:1px;background:var(--line)}.analytics-summary article{display:grid;gap:5px;padding:18px;background:white}.analytics-summary article.conversion{background:var(--navy);color:white}.analytics-summary strong{font:500 28px "Iowan Old Style",serif}.analytics-summary span{color:var(--ink-soft);font-size:10px}.analytics-summary .conversion span{color:rgba(255,255,255,.62)}.analytics-grid{display:grid;grid-template-columns:minmax(430px,1.1fr) minmax(360px,.9fr);gap:18px}.analytics-grid h3{margin:0 0 14px;font-size:13px}.analytics-funnel-panel,.analytics-breakdowns>div{padding:20px;border:1px solid var(--line);border-radius:11px;background:white}.analytics-funnel{position:relative;display:grid;gap:0}.analytics-funnel:before{content:"";position:absolute;top:20px;bottom:20px;left:15px;width:1px;background:var(--coral)}.analytics-funnel article{position:relative;display:grid;grid-template-columns:32px 1fr;gap:12px;padding:8px 0}.funnel-index{z-index:1;display:grid;place-items:center;width:31px;height:31px;border:1px solid rgba(255,119,109,.5);border-radius:50%;background:white;color:var(--coral-deep);font:9px "Cascadia Mono",monospace}.analytics-funnel article>div{min-width:0}.analytics-funnel header{display:flex;justify-content:space-between;gap:12px}.analytics-funnel header b{font-size:12px}.funnel-track{height:5px;margin:7px 0 4px;overflow:hidden;border-radius:9px;background:#eceef4}.funnel-track i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--coral),#c34f91)}.analytics-funnel small{color:var(--ink-soft);font-size:9px}.analytics-breakdowns{display:grid;align-content:start;gap:12px}.analytics-breakdowns>div>div>p{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0;padding:9px 0;border-top:1px solid var(--line)}.analytics-breakdowns p>span{display:grid;min-width:0;gap:3px}.analytics-breakdowns p strong{font-size:11px;text-transform:capitalize}.analytics-breakdowns p small{max-width:250px;overflow:hidden;color:var(--ink-soft);font-size:9px;text-overflow:ellipsis;white-space:nowrap}.analytics-breakdowns p b{font:10px "Cascadia Mono",monospace;white-space:nowrap}
.analytics-details>summary{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:13px 15px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.72);cursor:pointer;list-style:none}.analytics-details>summary::-webkit-details-marker{display:none}.analytics-details>summary>span{display:grid;gap:3px}.analytics-details>summary strong{font-size:11px}.analytics-details>summary small{color:var(--ink-soft);font-size:9px}.analytics-details>summary>i{width:9px;height:9px;border-right:2px solid var(--ink-soft);border-bottom:2px solid var(--ink-soft);transform:rotate(45deg);transition:transform .18s ease}.analytics-details[open]>summary>i{transform:rotate(225deg)}.analytics-details .analytics-grid{margin-top:12px}
.admin-layout{display:grid;grid-template-columns:minmax(420px,.9fr) minmax(420px,1.1fr);min-height:540px;border:1px solid var(--line);background:white}.admin-users{border-right:1px solid var(--line)}.table-heading{display:grid;grid-template-columns:1fr 1fr;padding:15px 20px;background:var(--navy);color:white;font:9px "Cascadia Mono",monospace;text-transform:uppercase;letter-spacing:.1em}
.admin-global-prompt-section{margin-top:45px;padding:30px;background:white;border:1px solid var(--line);border-radius:14px}.admin-global-prompt-section>header{display:flex;justify-content:space-between;gap:25px;margin-bottom:22px}.admin-global-prompt-section h2{margin:4px 0;font:500 31px "Iowan Old Style",serif}.admin-global-prompt-section>header>p{max-width:440px;color:var(--ink-soft);line-height:1.5}.admin-global-prompt-section form>label:not(.admin-global-prompt-toggle){display:grid;gap:8px;color:var(--ink-soft);font-size:12px;font-weight:600}.admin-global-prompt-section textarea{width:100%;padding:15px;border:1px solid var(--line);border-radius:9px;background:#fafbfe;color:var(--ink);font:14px/1.55 "Cascadia Mono",monospace;resize:vertical}.admin-global-prompt-toggle{display:flex;align-items:flex-start;gap:12px;margin-bottom:18px;padding:14px;border:1px solid var(--line);border-radius:9px;background:#fafbfe}.admin-global-prompt-toggle span{display:grid;gap:3px}.admin-global-prompt-toggle small,.admin-global-prompt-footer small{color:var(--ink-soft);font-weight:400}.admin-global-prompt-footer{display:flex;justify-content:space-between;align-items:center;gap:20px}.admin-global-prompt-footer>div{display:flex;gap:8px}.admin-global-prompt-footer button{padding:11px 14px;border:1px solid var(--line);border-radius:8px;background:white;cursor:pointer}.admin-global-prompt-footer .primary-action{border-color:var(--coral);background:var(--coral)}
@media(max-width:700px){.admin-global-prompt-section>header,.admin-global-prompt-footer{display:grid}.admin-global-prompt-footer>div{display:grid}.admin-global-prompt-footer button{width:100%}}
.admin-user-row{display:block;border-bottom:1px solid var(--line);background:white}.admin-user{width:100%;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:15px;padding:18px 20px;background:transparent;text-align:left}.admin-user,.admin-user>span{min-width:0}.admin-user-row:hover{background:#f7f8fc}.admin-user span{display:grid;align-content:start;gap:4px}.admin-user small,.admin-user strong{max-width:100%;overflow-wrap:anywhere}.admin-user small{color:var(--ink-soft)}.admin-user-identity a{display:block;width:100%;min-width:0;overflow-wrap:anywhere;word-break:break-word;color:inherit;text-decoration:none}.admin-user-identity a:hover strong,.admin-user-identity a:hover small{color:var(--coral-deep);text-decoration:underline;text-underline-offset:3px}.admin-user-identity a:focus-visible{outline:2px solid var(--coral);outline-offset:3px;border-radius:3px}.admin-user .admin-last-message{margin-top:2px;color:#70788d;font:9px/1.35 "Cascadia Mono",monospace}.admin-user b{width:max-content;max-width:100%;padding:3px 7px;border-radius:9px;background:#dff6eb;color:#277a57;font-size:10px;white-space:normal}.admin-user b.banned{background:#ffe2df;color:#a5413a}.admin-view-latest{justify-self:start;margin-top:6px;padding:8px 10px;border:1px solid var(--line);border-radius:7px;background:white;color:var(--navy);font-size:11px;white-space:normal;cursor:pointer}.admin-view-latest:hover:not(:disabled){border-color:var(--coral);color:var(--coral)}.admin-view-latest:disabled{opacity:.45;cursor:not-allowed}
.admin-pagination{display:flex;align-items:center;justify-content:center;gap:10px;padding:14px;border-top:1px solid var(--line);background:#f7f8fc}.admin-pagination button,.admin-pagination select{height:34px;border:1px solid var(--line);border-radius:7px;background:white;color:var(--ink)}.admin-pagination button{padding:0 12px;cursor:pointer}.admin-pagination button:disabled{cursor:default;opacity:.45}.admin-pagination label{display:flex;align-items:center;gap:6px;color:var(--ink-soft);font-size:10px}.admin-pagination select{min-width:58px;padding:0 8px}.admin-pagination>span{color:var(--ink-soft);font:9px "Cascadia Mono",monospace}
.admin-detail{padding:32px;overflow:auto}.empty-admin{color:var(--ink-soft)}.admin-detail h2{font:500 32px "Iowan Old Style",serif;margin:5px 0}.admin-actions{display:flex;gap:8px;margin:25px 0}.admin-actions button,.admin-conversations button{padding:10px 13px;border:1px solid var(--line);border-radius:7px;background:white;cursor:pointer}.admin-conversations{display:grid}.admin-conversations button{display:flex;justify-content:space-between;text-align:left;border-radius:0;border-width:1px 0 0}.admin-conversations small{color:var(--ink-soft)}
.admin-user-name-row{display:inline-flex;max-width:100%;align-items:center;flex-wrap:nowrap;gap:7px;vertical-align:middle}.admin-user-name-row h2{min-width:0;overflow-wrap:anywhere}.admin-nickname-edit{appearance:none;-webkit-appearance:none;display:inline-grid;flex:0 0 28px;place-items:center;width:28px;height:28px;margin:0;padding:0;border:0;border-radius:50%;box-shadow:none;background:none;color:var(--ink-soft);font:inherit;line-height:1;cursor:pointer;transition:color .16s,background .16s,transform .16s}.admin-nickname-edit svg{display:block;width:16px;height:16px;overflow:visible;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.admin-nickname-edit:hover{background:rgba(255,119,109,.1);color:var(--coral-deep);transform:translateY(-1px)}.admin-nickname-edit:focus-visible{outline:2px solid var(--coral);outline-offset:2px}.admin-nickname-edit[hidden]{display:none}.admin-nickname-form{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;margin:12px 0 6px;padding:11px;border:1px solid var(--line);border-radius:9px;background:#fafbfe}.admin-nickname-form[hidden]{display:none}.admin-nickname-form input{height:38px;padding:0 11px;border:1px solid var(--line);border-radius:7px;background:white;color:var(--ink);font-size:14px}.admin-nickname-form>div{display:flex;gap:6px}.admin-nickname-form button{height:38px;padding:0 12px;border:1px solid var(--line);border-radius:7px;background:white;color:var(--ink);cursor:pointer}.admin-nickname-form .admin-nickname-save{border-color:var(--navy);background:var(--navy);color:white}.admin-nickname-form button:disabled{opacity:.55}.admin-nickname-form p{grid-column:1/-1;min-height:13px;margin:0;color:#a5413a;font-size:10px}
.admin-conversations button span{display:flex;align-items:center;gap:8px}.admin-conversations button b{padding:3px 6px;border-radius:8px;background:#e7e5f2;color:#594b7a;font:600 8px "Cascadia Mono",monospace;text-transform:uppercase;letter-spacing:.04em}.admin-conversations .user-deleted-chat{background:#f7f5f5;color:#756b70}.admin-conversations .user-deleted-chat b{background:#eadfdf;color:#865049}
.chat-review{position:fixed;inset:0 0 0 auto;box-sizing:border-box;width:min(760px,calc(100vw - 24px));max-width:none;height:100dvh;max-height:none;margin:0;padding:30px;border:0;border-radius:18px 0 0 18px;overflow-y:auto;box-shadow:-18px 0 55px rgba(10,15,28,.22)}.chat-review>#close-chat{position:sticky;z-index:8;top:0;float:right;margin:0 0 10px 14px;padding:8px 12px;border:1px solid var(--line);border-radius:999px;background:rgba(255,255,255,.94);box-shadow:0 6px 20px rgba(22,31,54,.12);color:var(--navy);font-weight:650;cursor:pointer;backdrop-filter:blur(10px)}.chat-review>#close-chat:hover{border-color:var(--coral);color:var(--coral-deep)}.chat-review>#close-chat:focus-visible{outline:2px solid var(--coral);outline-offset:2px}.chat-review-heading{padding-right:70px}.chat-review-heading h2{margin-bottom:6px}.chat-review-heading span{display:inline-flex;align-items:center;gap:6px;color:var(--ink-soft);font-size:11px}.chat-review-heading span i{width:7px;height:7px;border-radius:50%;background:#35a46f;box-shadow:0 0 0 3px rgba(53,164,111,.13)}.chat-review article{margin:15px 0;padding:15px;border-radius:12px;background:#f0f2f7}.chat-review article.assistant{margin-right:15%}.chat-review article.user{margin-left:15%;background:#fff0ef}.chat-review img{max-width:260px;display:block;margin-top:8px;border-radius:9px}.chat-review small{text-transform:uppercase;color:var(--ink-soft)}.chat-review audio{display:block;width:min(360px,100%);margin:8px 0}.admin-voice-label{margin-top:9px;color:var(--ink-soft);font:9px "Cascadia Mono",monospace;text-transform:uppercase;letter-spacing:.06em}.admin-message-markdown{line-height:1.5}.admin-message-markdown> :first-child{margin-top:8px}.admin-message-markdown> :last-child{margin-bottom:0}.admin-message-markdown ul,.admin-message-markdown ol{padding-left:22px}.admin-message-markdown blockquote{margin:10px 0;padding-left:12px;border-left:3px solid var(--coral);color:var(--ink-soft)}.admin-message-markdown code{padding:2px 5px;border-radius:4px;background:rgba(22,31,54,.08);font:12px "Cascadia Mono",monospace}.admin-message-markdown pre{max-width:100%;overflow:auto;padding:10px;border-radius:7px;background:var(--navy);color:white}.admin-message-markdown pre code{padding:0;background:transparent;color:inherit}.admin-message-markdown .katex-display{max-width:100%;overflow-x:auto;overflow-y:hidden;padding-bottom:3px}
.admin-chat-mode-control{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:7px 14px;margin:18px 0 8px;padding:12px;border:1px solid var(--line);border-radius:11px;background:#fafbfe}.admin-chat-mode-control>span{font-size:11px;font-weight:700}.admin-chat-mode-control>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.admin-chat-mode-control button{min-height:36px;padding:7px;border:1px solid var(--line);border-radius:8px;background:white;color:var(--ink);font-size:11px;cursor:pointer}.admin-chat-mode-control button.active{border-color:var(--coral-deep);background:var(--coral-deep);color:white}.admin-chat-mode-control button:disabled{cursor:wait;opacity:.6}.admin-chat-mode-control>small{grid-column:1/-1;min-height:13px;text-transform:none}
.admin-nudge-panel{margin:24px 0 0;padding:16px;border:1px solid #ddcce3;border-radius:12px;background:linear-gradient(135deg,#fbf7fc,#f4eef8)}.admin-nudge-panel>header{display:flex;align-items:start;justify-content:space-between;gap:15px}.admin-nudge-panel>header>div{display:grid;gap:3px}.admin-nudge-panel>header strong{font-size:12px}.admin-nudge-panel>header small{font-size:8px;letter-spacing:.04em}.admin-nudge-panel>header>span{padding:4px 7px;border-radius:9px;color:#6b4778;background:#e9dcef;font:600 8px "Cascadia Mono",monospace;text-transform:uppercase}.admin-nudge-panel form{position:sticky;bottom:-30px;margin:8px -16px -16px;padding:12px 16px 16px;border-top:1px solid rgba(92,68,105,.13);border-radius:0 0 12px 12px;background:rgba(248,243,250,.97);backdrop-filter:blur(10px)}.admin-nudge-panel textarea{width:100%;padding:11px 12px;border:1px solid var(--line);border-radius:8px;background:white;color:var(--ink);font:12px/1.45 "Segoe UI",sans-serif;resize:vertical}.admin-nudge-panel form>div{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:7px}.admin-nudge-panel form>div small{font-size:8px}.admin-nudge-panel form button{padding:8px 11px;border:0;border-radius:7px;color:white;background:var(--navy);font-size:10px;cursor:pointer}.admin-nudge-panel form button:disabled{opacity:.55}.admin-nudge-panel form>p{min-height:14px;margin:5px 0 0;color:#a5413a;font-size:10px}.admin-nudge-list{display:grid;max-height:180px;margin-top:10px;overflow:auto}.chat-review .admin-nudge-item{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;margin:0;padding:9px 0;border-top:1px solid rgba(92,68,105,.13);border-radius:0;background:transparent}.admin-nudge-item p{margin:0 0 3px;font-size:11px;line-height:1.4}.admin-nudge-item small{font-size:7px}.admin-nudge-item button{padding:5px 7px;border:1px solid var(--line);border-radius:6px;background:white;color:#8a4654;font-size:9px;cursor:pointer}.admin-nudge-item.status-consumed{opacity:.68}.admin-nudge-item.status-cancelled{opacity:.48}.admin-nudge-item.status-cancelled p{text-decoration:line-through}.admin-nudge-empty{margin:0;color:var(--ink-soft);font-size:10px}
.admin-direct-message-panel{margin:24px 0 0;padding:16px;border:1px solid #efb4af;border-radius:12px;background:linear-gradient(135deg,#fff8f6,#fff1ef)}.admin-direct-message-panel>header{display:flex;align-items:start;justify-content:space-between;gap:15px}.admin-direct-message-panel>header>div{display:grid;gap:3px}.admin-direct-message-panel>header strong{font-size:12px}.admin-direct-message-panel>header small{font-size:8px;letter-spacing:.03em}.admin-direct-message-panel>header>span{padding:4px 7px;border-radius:9px;color:#8b443e;background:#f8d9d5;font:600 8px "Cascadia Mono",monospace;text-transform:uppercase}.admin-direct-message-panel form{margin-top:10px}.admin-direct-message-panel textarea{width:100%;padding:11px 12px;border:1px solid var(--line);border-radius:8px;background:white;color:var(--ink);font:12px/1.45 "Segoe UI",sans-serif;resize:vertical}.admin-direct-message-panel form>div{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:7px}.admin-direct-message-panel form>div small{font-size:8px}.admin-direct-message-panel form button{padding:9px 13px;border:0;border-radius:7px;color:white;background:var(--coral-deep);font-size:10px;cursor:pointer}.admin-direct-message-panel form button:disabled{opacity:.55}.admin-direct-message-panel form>p{min-height:14px;margin:5px 0 0;color:#52775f;font-size:10px}.admin-direct-message-panel form>p.error{color:#a5413a}.admin-direct-message-panel .admin-direct-message-preview{display:grid;grid-template-columns:58px minmax(0,1fr) auto;align-items:center;gap:10px;padding:9px;border:1px solid rgba(179,88,79,.24);border-radius:9px;background:rgba(255,255,255,.7)}.admin-direct-message-preview[hidden]{display:none}.admin-direct-message-preview img{width:58px;height:58px;object-fit:cover;border-radius:7px}.admin-direct-message-preview>span{display:grid;min-width:0;gap:3px}.admin-direct-message-preview>span strong{overflow:hidden;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.admin-direct-message-preview>span small{color:#52775f}.admin-direct-message-preview button{padding:6px 8px!important;border:1px solid var(--line)!important;background:white!important;color:#8b443e!important}.admin-direct-message-actions>span{display:flex;align-items:center;gap:8px}.admin-direct-message-actions #admin-direct-message-attach{padding:7px 9px;border:1px solid #dba9a4;background:white;color:#8b443e}.chat-review article.admin-sent{outline:1px dashed rgba(179,88,79,.45);outline-offset:-1px}.chat-review article.admin-sent>small{color:#a54f47}
.admin-collapsible-summary{display:grid;grid-template-columns:minmax(0,1fr) auto 13px;align-items:center;gap:12px;cursor:pointer;list-style:none}.admin-collapsible-summary::-webkit-details-marker{display:none}.admin-collapsible-summary:after{content:"";width:7px;height:7px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;color:var(--ink-soft);transform:rotate(45deg) translateY(-2px);transition:transform .16s ease}.admin-direct-message-panel[open]>.admin-collapsible-summary:after,.admin-nudge-panel[open]>.admin-collapsible-summary:after{transform:rotate(225deg) translate(-2px,-1px)}.admin-collapsible-summary:focus-visible{outline:2px solid var(--coral);outline-offset:5px;border-radius:4px}.admin-collapsible-copy{display:grid;min-width:0;gap:3px}.admin-collapsible-copy strong{font-size:12px}.admin-collapsible-copy small{overflow:hidden;color:var(--ink-soft);font-size:8px;letter-spacing:.03em;text-overflow:ellipsis;white-space:nowrap}.admin-collapsible-badge{padding:4px 7px;border-radius:9px;color:#8b443e;background:#f8d9d5;font:600 8px "Cascadia Mono",monospace;text-transform:uppercase;white-space:nowrap}.admin-nudge-panel .admin-collapsible-badge{color:#6b4778;background:#e9dcef}.admin-collapsible-body{padding-top:10px}.admin-direct-message-panel:not([open]),.admin-nudge-panel:not([open]){background:white}.admin-direct-message-panel:not([open]):hover,.admin-nudge-panel:not([open]):hover{background:#fffaf9}
.admin-image-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:4px 0 30px;padding:17px 0;border-block:1px solid var(--line)}.admin-image-heading h3,.admin-image-heading p{margin:0}.admin-image-heading p{margin-top:4px;color:var(--ink-soft);font-size:12px}.admin-image-heading button{padding:10px 14px;border:1px solid var(--navy);border-radius:7px;background:var(--navy);color:white;cursor:pointer;white-space:nowrap}.admin-image-dialog{width:min(960px,calc(100vw - 32px));max-width:960px;height:min(780px,calc(100dvh - 40px));padding:0;border:0;border-radius:16px;background:#f5f6fa;box-shadow:var(--shadow)}.admin-image-dialog>header{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:22px 26px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.96)}.admin-image-dialog h2{margin:3px 0 0;font:500 29px "Iowan Old Style",serif}.admin-image-dialog>header button{padding:8px 11px;border:1px solid var(--line);border-radius:7px;background:white;cursor:pointer}.admin-image-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;padding:20px}.admin-image-gallery article{min-width:0;overflow:hidden;border:1px solid var(--line);border-radius:11px;background:white}.admin-image-gallery article>a{display:block;aspect-ratio:1;background:#e9ebf1}.admin-image-gallery img{width:100%;height:100%;display:block;object-fit:cover;transition:transform .2s ease}.admin-image-gallery a:hover img{transform:scale(1.025)}.admin-image-gallery article>div{padding:12px}.admin-image-gallery strong,.admin-image-gallery p,.admin-image-gallery small{display:block;overflow:hidden;text-overflow:ellipsis}.admin-image-gallery strong,.admin-image-gallery p{white-space:nowrap}.admin-image-gallery p{margin:6px 0;color:var(--ink);font-size:12px}.admin-image-gallery small{color:var(--ink-soft);font-size:10px;line-height:1.45}
#temp-password{display:block;padding:18px;margin:20px 0;background:var(--navy);color:white;font-size:20px;text-align:center}
#temp-password-recipient,#temp-password-expiry{color:var(--ink-soft);font-size:13px;line-height:1.5}
@media(max-width:850px){.portal-shell,.catalog-page{grid-template-columns:1fr}.portal-story{min-height:330px;padding:30px}.portal-story h1{font-size:48px}.portal-story>small:not(.portal-publisher){display:none}.portal-form{padding:35px 24px}.catalog-header{position:relative;height:auto;padding:30px}.portal-brand.dark{margin-bottom:0}.catalog-brand-lockup{margin-bottom:45px}.catalog-header .back-link{top:42px}.persona-grid{grid-template-columns:1fr}.admin-page{padding:20px}.admin-header{display:block}.admin-search{width:100%}.admin-layout{grid-template-columns:minmax(0,1fr)}.admin-users{min-width:0;border-right:0}.admin-detail{border-top:1px solid var(--line)}.table-heading,.admin-user{grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);gap:10px}.admin-user{padding:14px 12px}.admin-view-latest{max-width:100%;margin-top:5px;padding:7px 8px;font-size:10px}}
@media(max-width:950px){.analytics-summary{grid-template-columns:repeat(2,1fr)}.analytics-grid{grid-template-columns:1fr}}@media(max-width:650px){.admin-analytics-section{padding:20px}.admin-analytics-section>header{align-items:stretch;flex-direction:column}.analytics-controls{display:grid;grid-template-columns:1fr auto}.analytics-controls select{width:100%}.analytics-summary{grid-template-columns:1fr 1fr}.analytics-summary article{padding:14px}.analytics-summary strong{font-size:23px}}
@media(max-width:650px){.admin-image-heading{align-items:stretch;flex-direction:column}.admin-image-heading button{width:100%}.admin-image-dialog{width:calc(100vw - 18px);height:calc(100dvh - 18px)}.admin-image-dialog>header{padding:18px}.admin-image-dialog h2{font-size:23px}.admin-image-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;padding:10px}}
@media(max-width:650px){.chat-review{width:100vw;padding:22px 18px;border-radius:0}.chat-review article.assistant{margin-right:8%}.chat-review article.user{margin-left:8%}}

.admin-memory-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-top:28px;
}
.admin-memory-heading h3 { margin:0; }
.admin-memory-heading span { color:var(--ink-soft);font-size:12px; }
.admin-memory-list { display:grid;gap:10px;margin:12px 0 30px; }
.admin-memory-card {
  padding:14px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#fafbfe;
}
.admin-memory-card:not(.status-active) { opacity:.7; }
.admin-memory-card header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.admin-memory-card header > div { display:flex;align-items:center;gap:7px; }
.admin-memory-card header button {
  padding:5px 8px;
  border:1px solid var(--line);
  border-radius:6px;
  background:white;
  cursor:pointer;
}
.admin-memory-card .danger-text { color:#a5413a; }
.admin-memory-card p { margin:12px 0 8px;line-height:1.45; }
.admin-memory-card small { color:var(--ink-soft);line-height:1.5; }
.admin-memory-status {
  padding:3px 7px;
  border-radius:10px;
  background:#dff6eb;
  color:#277a57;
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.05em;
}
.status-expired .admin-memory-status,
.status-superseded .admin-memory-status,
.status-unapproved .admin-memory-status {
  background:#f1e7e5;
  color:#865049;
}
.admin-memory-dialog { width:min(760px,calc(100% - 32px));max-width:760px; }
.admin-memory-dialog label { display:grid;gap:6px;color:var(--ink-soft);font-size:11px; }
.admin-memory-dialog textarea,
.admin-memory-dialog input,
.admin-memory-dialog select {
  width:100%;
  padding:10px 11px;
  border:1px solid var(--line);
  border-radius:7px;
  background:#fafbfe;
  color:var(--ink);
  font:14px "Segoe UI",sans-serif;
}
.admin-memory-dialog textarea { resize:vertical; }
.admin-memory-form-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-top:14px;
}
.admin-memory-checks { display:flex;gap:18px;margin:18px 0; }
.admin-memory-checks label { display:flex;align-items:center;gap:7px; }
.admin-memory-checks input { width:auto; }
@media(max-width:650px) {
  .admin-memory-form-grid { grid-template-columns:1fr; }
  .admin-memory-checks { align-items:flex-start;flex-direction:column;gap:8px; }
}
.admin-persona-section { margin-top:45px; }
.admin-persona-section > header {
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:20px;
  margin-bottom:18px;
}
.admin-persona-section h2 {
  margin:4px 0 0;
  font:500 30px "Iowan Old Style",serif;
}
.admin-persona-section header > p { color:var(--ink-soft); }
.admin-persona-grid {
  display:grid;
  grid-template-columns:repeat(5,minmax(150px,1fr));
  gap:10px;
}
.admin-persona-card {
  display:grid;
  grid-template-columns:58px 1fr;
  align-items:center;
  gap:12px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:white;
  color:var(--ink);
  text-align:left;
  cursor:pointer;
}
.admin-persona-card:hover { transform:translateY(-2px);box-shadow:var(--shadow); }
.admin-persona-card img {
  width:58px;
  height:68px;
  border-radius:42% 58% 48% 52%;
  background:var(--sky);
  object-fit:cover;
}
.admin-persona-card span { display:grid;gap:4px; }
.admin-persona-card small { color:var(--ink-soft);text-transform:capitalize; }
.admin-persona-dialog { width:min(760px,calc(100% - 32px));max-width:760px; }
.admin-persona-dialog > form > label,
.admin-persona-portrait-row label,
.admin-persona-traits label {
  display:grid;
  gap:6px;
  color:var(--ink-soft);
  font-size:11px;
}
.admin-persona-dialog textarea,
.admin-persona-dialog input,
.admin-persona-dialog select {
  width:100%;
  padding:10px 11px;
  border:1px solid var(--line);
  border-radius:7px;
  background:#fafbfe;
  color:var(--ink);
  font:14px "Segoe UI",sans-serif;
}
.admin-persona-portrait-row {
  display:grid;
  grid-template-columns:112px 1fr;
  align-items:center;
  gap:20px;
  margin-bottom:16px;
}
.admin-persona-portrait-row img {
  width:112px;
  height:112px;
  border-radius:46% 54% 48% 52%;
  object-fit:cover;
  background:var(--sky);
}
.admin-persona-traits {
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:10px;
  margin-top:14px;
}
@media(max-width:1000px) {
  .admin-persona-grid { grid-template-columns:repeat(3,minmax(150px,1fr)); }
}
@media(max-width:650px) {
  .admin-persona-grid { grid-template-columns:repeat(2,minmax(130px,1fr)); }
  .admin-persona-traits { grid-template-columns:repeat(2,1fr); }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #e9ecf4;
  color: var(--ink);
  font-family: "Aptos", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  width: min(1440px, 100%);
  height: 100dvh;
  margin: 0 auto;
  background: var(--white);
  box-shadow: var(--shadow);
}

.sidebar {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 34px 24px 24px;
  background:
    radial-gradient(circle at 10% 90%, rgba(255, 119, 109, 0.1), transparent 34%),
    var(--navy);
  color: var(--white);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50% 50% 46% 54%;
  background: var(--coral);
  color: var(--navy);
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 24px;
  font-weight: 600;
  transform: rotate(-5deg);
}

.eyebrow,
.nav-label,
.model-tag {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.brand .eyebrow {
  margin: 0 0 3px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 9px;
}

.brand h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.brand-publisher {
  display: block;
  margin-top: 3px;
}

.new-chat {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin: 16px 0 20px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  font-size: 13px;
  transition: background 160ms ease, border-color 160ms ease;
}

.new-chat:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
}

.new-chat span {
  color: var(--coral);
  font-size: 18px;
}

.sidebar nav {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  min-height: 0;
  margin-top: 2px;
  overflow: hidden;
}

.nav-label {
  margin: 0 10px 10px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 9px;
}

.conversation-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  max-height: none;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(255, 157, 166, 0.42) transparent;
  scrollbar-width: thin;
}

.conversation-list::-webkit-scrollbar {
  width: 5px;
}

.conversation-list::-webkit-scrollbar-track {
  background: transparent;
}

.conversation-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 157, 166, 0.35);
}

.conversation-entry {
  position: relative;
  flex: 0 0 auto;
}

.conversation-item {
  width: 100%;
  overflow: hidden;
  padding: 11px 12px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 4px 9px 9px 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.57);
  cursor: pointer;
  text-align: left;
  text-overflow: ellipsis;
  touch-action: pan-y;
  -webkit-touch-callout: none;
  white-space: nowrap;
}

.conversation-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
}

.conversation-item.active {
  border-left-color: var(--coral);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.sidebar-tools {
  display: grid;
  flex: none;
  gap: 2px;
  margin-top: 0;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 10px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  text-decoration: none;
  transition: color 160ms ease;
}

.settings-link:hover {
  color: var(--white);
}

.settings-link svg {
  width: 17px;
  fill: none;
  stroke: var(--coral);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

/* Settings folio */

.settings-body {
  min-height: 100%;
  height: auto;
  overflow: auto;
  background:
    linear-gradient(rgba(234, 237, 245, 0.92), rgba(234, 237, 245, 0.92)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 95px,
      rgba(24, 32, 57, 0.06) 96px
    );
}

.settings-page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 60px;
}

.settings-header {
  position: relative;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 150px;
  align-items: start;
  min-height: 250px;
  padding: 22px 0 42px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--ink-soft);
  font-size: 12px;
  text-decoration: none;
}

.back-link:hover {
  color: var(--ink);
}

.back-link svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.settings-title {
  max-width: 620px;
}

.settings-nav {
  display: grid;
  align-content: start;
  gap: 15px;
}

.guided-link {
  width: fit-content;
  color: var(--coral-deep);
  font-size: 10px;
  text-decoration: none;
}

.guided-link:hover {
  text-decoration: underline;
}

.settings-title .eyebrow {
  margin: 4px 0 15px;
  color: var(--coral-deep);
  font-size: 9px;
}

.settings-title h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 70px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.settings-title > p:last-child {
  max-width: 560px;
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

.folio-mark {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 5px;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 27px;
}

.folio-mark span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(24, 32, 57, 0.16);
  border-radius: 50% 47% 53% 46%;
  background: var(--white);
}

.folio-mark span:first-child {
  border: 0;
  background: var(--coral);
  transform: rotate(-5deg);
}

.folio-mark i {
  width: 22px;
  height: 1px;
  background: rgba(24, 32, 57, 0.28);
}

.settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.profile-sheet {
  position: relative;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid rgba(24, 32, 57, 0.09);
  border-radius: 3px 22px 22px 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 45px rgba(23, 31, 54, 0.08);
}

.profile-sheet::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 17px;
  width: 1px;
  background: rgba(255, 119, 109, 0.2);
  content: "";
}

.user-sheet {
  margin-top: 48px;
  margin-bottom: -48px;
}

.sheet-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.sheet-heading .eyebrow {
  margin: 0 0 8px;
  color: var(--coral-deep);
  font-size: 8px;
}

.sheet-heading h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 31px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.sheet-tab {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--ink-soft);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: block;
  margin-bottom: 24px;
}

.field > span,
.trait label {
  display: block;
  margin-bottom: 8px;
  color: #4e566c;
  font-size: 11px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  border: 1px solid #d9dce5;
  border-radius: 10px;
  outline: 0;
  background: #fbfcfe;
  color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input,
.field select {
  height: 43px;
  padding: 0 12px;
}

.field textarea {
  min-height: 92px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.55;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #9ca8bf;
  box-shadow: 0 0 0 3px rgba(115, 143, 195, 0.13);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a1a7b6;
}

.field small {
  display: block;
  margin-top: 7px;
  color: #969cac;
  font-size: 9px;
}

.compact-field {
  max-width: 130px;
}

.trait-group {
  display: grid;
  gap: 17px;
  margin: 3px 0 28px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.trait > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trait label {
  margin: 0;
}

.trait output {
  color: var(--coral-deep);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.trait input[type="range"] {
  width: 100%;
  height: 3px;
  margin: 11px 0 0;
  appearance: none;
  border-radius: 3px;
  background:
    linear-gradient(
      90deg,
      var(--coral) var(--range-progress),
      #dfe2ea var(--range-progress)
    );
}

.trait input[type="range"]::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  appearance: none;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--navy-raised);
  box-shadow: 0 1px 5px rgba(16, 24, 45, 0.25);
  cursor: pointer;
}

.trait input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--navy-raised);
  box-shadow: 0 1px 5px rgba(16, 24, 45, 0.25);
  cursor: pointer;
}

.privacy-note {
  display: flex;
  gap: 10px;
  margin: -5px 0 27px;
  padding: 13px 14px;
  border: 1px solid #dfe5ef;
  border-radius: 12px;
  background: #f3f7fd;
  color: #5f6b82;
  font-size: 10px;
  line-height: 1.55;
}

.privacy-note span {
  color: var(--coral-deep);
  font-size: 15px;
}

.privacy-note p {
  margin: 0;
}

.persona-preview {
  margin-top: 8px;
  padding: 22px;
  border-radius: 3px 16px 16px 16px;
  background: var(--navy);
  color: var(--white);
}

.persona-preview .eyebrow {
  margin: 0 0 13px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 8px;
}

.persona-preview blockquote {
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.35;
}

.persona-preview > p:last-child {
  margin: 13px 0 0;
  color: var(--coral);
  font-size: 10px;
}

.settings-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 64px;
  padding: 22px 25px;
  border-radius: 15px;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 18px 45px rgba(16, 24, 45, 0.14);
}

.settings-actions p {
  min-height: 18px;
  margin: 0;
  color: var(--green);
  font-size: 12px;
}

.settings-actions span {
  color: rgba(255, 255, 255, 0.46);
  font-size: 10px;
}

.save-button {
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 13px 15px 13px 18px;
  border: 0;
  border-radius: 11px;
  background: var(--coral);
  color: var(--navy);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.save-button:hover {
  background: #ff8d85;
}

.save-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.save-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.chat {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
  grid-template-areas:
    "header"
    "guest"
    "messages"
    "error"
    "install"
    "composer";
  min-width: 0;
  min-height: 0;
  background:
    linear-gradient(rgba(247, 248, 252, 0.87), rgba(247, 248, 252, 0.87)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 79px,
      rgba(24, 32, 57, 0.045) 80px
    );
}

.guest-banner {
  grid-area:guest;
  position:relative;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:11px clamp(24px,5vw,68px);
  border-bottom:1px solid #f0c7c3;
  background:#fff3f1;
  color:var(--ink);
  font-size:12px;
}
.guest-banner[hidden] { display:none; }
#admin-link[hidden] { display:none; }
#account-button[hidden] { display:none; }
.guest-banner div { display:grid;gap:2px; }
.guest-banner span { color:var(--ink-soft); }
.guest-banner a {
  flex:none;
  padding:9px 12px;
  border-radius:8px;
  background:var(--coral);
  color:var(--navy);
  text-decoration:none;
  font-weight:750;
}

.guest-account-nudge {
  position:absolute;
  right:clamp(18px,5vw,68px);
  bottom:104px;
  z-index:7;
  display:grid;
  grid-template-columns:58px minmax(0,1fr) auto;
  align-items:center;
  width:min(700px,calc(100% - 36px));
  gap:16px;
  padding:18px 20px 18px 17px;
  overflow:hidden;
  border:1px solid rgba(200,82,114,.25);
  border-radius:18px;
  background:rgba(255,255,255,.97);
  box-shadow:0 20px 55px rgba(31,22,45,.18);
  backdrop-filter:blur(16px);
  animation:guest-nudge-in .28s ease-out;
}
.guest-account-nudge[hidden] { display:none; }
.guest-account-nudge::before {
  position:absolute;
  inset:0 auto 0 0;
  width:4px;
  background:var(--coral);
  content:"";
}
.guest-account-nudge.urgent::before {
  width:6px;
  background:var(--coral-deep);
}
.guest-nudge-mark {
  display:grid;
  min-height:52px;
  place-items:center;
  padding:7px;
  border:1px dashed rgba(200,82,114,.38);
  border-radius:14px 14px 14px 5px;
  background:#fff2f4;
  color:var(--coral-deep);
  font:700 9px/1.2 "Cascadia Mono",monospace;
  letter-spacing:.04em;
}
.guest-account-nudge>div:nth-of-type(2) {
  display:grid;
  min-width:0;
  gap:4px;
}
.guest-account-nudge .eyebrow {
  margin:0;
  color:var(--coral-deep);
}
.guest-account-nudge strong {
  color:var(--ink);
  font-size:15px;
}
.guest-account-nudge span {
  color:var(--ink-soft);
  font-size:12px;
  line-height:1.45;
}
.guest-nudge-action {
  min-height:42px;
  padding:10px 15px;
  border:0;
  border-radius:11px;
  background:var(--navy);
  color:white;
  cursor:pointer;
  font-weight:750;
  white-space:nowrap;
}
.guest-nudge-action:hover { background:#222d4d; }
.guest-nudge-action:focus-visible,
.guest-nudge-dismiss:focus-visible {
  outline:2px solid var(--coral-deep);
  outline-offset:2px;
}
.guest-nudge-dismiss {
  position:absolute;
  top:5px;
  right:7px;
  display:grid;
  width:28px;
  height:28px;
  place-items:center;
  border:0;
  background:transparent;
  color:var(--ink-soft);
  cursor:pointer;
  font-size:20px;
}
@keyframes guest-nudge-in {
  from { opacity:0;transform:translateY(12px) scale(.985); }
  to { opacity:1;transform:translateY(0) scale(1); }
}

.chat::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: clamp(35px, 8vw, 110px);
  width: 1px;
  background: rgba(255, 119, 109, 0.22);
  content: "";
  pointer-events: none;
}

.chat-header {
  grid-area:header;
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  min-height: 88px;
  padding: 18px clamp(24px, 5vw, 68px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 252, 0.82);
  backdrop-filter: blur(12px);
}

.companion {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 45% 55% 52% 48%;
  background: var(--sky);
  color: #36517f;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 23px;
}
.avatar img {
  width:100%;
  height:100%;
  border-radius:inherit;
  object-fit:cover;
}
.wizard-portrait img {
  width:100%;
  height:100%;
  border-radius:inherit;
  object-fit:cover;
}

.presence {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--green);
}

.companion h2 {
  margin: 0 0 3px;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 19px;
  font-weight: 600;
}

.companion p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.model-tag {
  margin-left: auto;
  color: var(--ink-soft);
  font-size: 9px;
}

.secret-chat-button {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  margin-left: auto;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(24, 32, 57, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink-soft);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.secret-chat-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.secret-chat-button:hover {
  border-color: rgba(255, 119, 109, 0.5);
  color: var(--coral-deep);
  transform: translateY(-1px);
}

.secret-chat-button.active {
  border-color: rgba(159, 51, 46, 0.48);
  background: #ffe6e3;
  color: #9f332e;
  box-shadow: 0 0 0 3px rgba(255, 119, 109, 0.1);
}

.secret-lock-open {
  display: none;
}

.secret-chat-button.active .secret-lock-closed {
  display: none;
}

.secret-chat-button.active .secret-lock-open {
  display: block;
}

.secret-chat-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.theme-toggle {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  margin-left: auto;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(24, 32, 57, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink-soft);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.theme-toggle:hover {
  border-color: rgba(200, 82, 114, 0.4);
  color: var(--coral-deep);
  transform: rotate(-7deg);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.theme-sun { display: none; }

.chat-utility-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.chat-utility-controls > button {
  margin-left: 0;
}

.secret-chat-coachmark {
  position: absolute;
  z-index: 12;
  top: calc(100% - 8px);
  right: clamp(20px, 4vw, 56px);
  display: grid;
  width: min(286px, calc(100vw - 24px));
  gap: 2px;
  padding: 14px 40px 14px 16px;
  border: 1px solid rgba(159, 51, 46, 0.2);
  border-radius: 16px 5px 16px 16px;
  background: rgba(255, 250, 250, 0.98);
  color: #6f2d35;
  box-shadow: 0 15px 38px rgba(68, 30, 48, 0.18);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
  animation: secret-chat-coachmark-in 180ms ease-out both;
  backdrop-filter: blur(12px);
}

.secret-chat-coachmark::before {
  position: absolute;
  top: -7px;
  right: 68px;
  width: 12px;
  height: 12px;
  border-top: 1px solid rgba(159, 51, 46, 0.2);
  border-left: 1px solid rgba(159, 51, 46, 0.2);
  background: rgba(255, 250, 250, 0.98);
  content: "";
  transform: rotate(45deg);
}

.secret-chat-coachmark[hidden] {
  display: none;
}

.secret-chat-coachmark strong {
  font-size: 13px;
  font-weight: 750;
}

.secret-chat-coachmark span {
  color: #845b64;
}

.secret-chat-coachmark-close {
  position: absolute;
  z-index: 1;
  top: 6px;
  right: 7px;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #906a72;
  font: inherit;
  font-size: 20px;
  cursor: pointer;
}

.secret-chat-coachmark-close:hover {
  background: rgba(159, 51, 46, 0.08);
  color: #6f2d35;
}

@keyframes secret-chat-coachmark-in {
  from { opacity: 0; transform: translateY(-5px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.secret-mode-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  border-top: 1px dotted rgba(159, 51, 46, 0.32);
  border-bottom: 1px dotted rgba(159, 51, 46, 0.32);
  background: #fff3f1;
  color: #87332f;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.secret-mode-notice[hidden] {
  display: none;
}

.secret-mode-notice svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.chat.secret-mode .chat-header {
  background: linear-gradient(90deg, rgba(255, 243, 241, 0.94), rgba(255, 255, 255, 0.96));
}

.menu-button {
  display: none;
}

.messages {
  grid-area:messages;
  position: relative;
  overflow-y: auto;
  padding: 42px clamp(24px, 8vw, 112px) 30px;
  scroll-behavior: smooth;
}

.jump-latest {
  grid-area: messages;
  z-index: 4;
  align-self: end;
  justify-self: center;
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(24, 32, 57, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: var(--navy);
  box-shadow: 0 9px 28px rgba(16, 24, 45, 0.18);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.jump-latest[hidden] {
  display: none;
}

.jump-latest svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.jump-latest:hover {
  border-color: rgba(255, 119, 109, 0.55);
  color: var(--coral-deep);
  transform: translateY(-2px);
}

.jump-latest:focus-visible {
  outline: 3px solid rgba(255, 119, 109, 0.35);
  outline-offset: 3px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding-bottom: 6vh;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.thread-orbit {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 24px;
  border: 1px solid rgba(24, 32, 57, 0.16);
  border-radius: 50% 47% 53% 46%;
  animation: breathe 5s ease-in-out infinite;
}

.thread-orbit::after {
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(255, 119, 109, 0.48);
  border-radius: 46% 54% 48% 52%;
  content: "";
}

.thread-orbit span {
  position: absolute;
  z-index: 2;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.thread-orbit span:first-child {
  top: 7px;
  right: 9px;
  background: var(--coral);
}

.thread-orbit span:last-child {
  bottom: 13px;
  left: 11px;
  background: #738fc3;
}

@keyframes breathe {
  0%,
  100% {
    transform: rotate(-4deg) scale(1);
  }
  50% {
    transform: rotate(5deg) scale(1.04);
  }
}

/* Disappearing photos */
.attachment-menu {
  width:min(420px,calc(100vw - 24px));
  max-width:none;
  padding:0;
  border:0;
  border-radius:22px;
  background:transparent;
  color:var(--ink);
  box-shadow:0 28px 80px rgba(15,10,28,.28);
}
.attachment-menu::backdrop { background:rgba(12,8,22,.62);backdrop-filter:blur(3px); }
.attachment-menu-sheet { padding:22px;background:var(--white);border:1px solid var(--line);border-radius:22px; }
.attachment-menu-sheet>header { display:flex;align-items:start;justify-content:space-between;gap:18px;margin-bottom:16px; }
.attachment-menu-sheet h2 { margin:3px 0 0;font:500 28px "Iowan Old Style",serif; }
.attachment-menu-sheet>header>button { width:34px;height:34px;border:1px solid var(--line);border-radius:50%;background:transparent;color:var(--ink-soft);font-size:20px;cursor:pointer; }
.attachment-menu-actions { display:grid;gap:8px; }
.attachment-menu-actions[hidden],.attachment-duration[hidden] { display:none; }
.attachment-menu-actions>button { display:grid;grid-template-columns:46px minmax(0,1fr);align-items:center;gap:13px;width:100%;padding:12px;border:1px solid var(--line);border-radius:13px;background:var(--white);color:var(--ink);text-align:left;cursor:pointer; }
.attachment-menu-actions>button:hover { border-color:rgba(200,82,114,.38);background:#fff7fa; }
.attachment-menu-actions>button>span:last-child { display:grid;gap:3px; }
.attachment-menu-actions small { color:var(--ink-soft);font-size:10px; }
.attachment-action-icon { display:grid;width:46px;height:46px;place-items:center;border-radius:14px;background:#f1edf7;color:#6b4b81; }
.attachment-action-icon.timed { background:#fff0f4;color:var(--coral-deep); }
.attachment-action-icon svg { width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round; }
.attachment-duration { display:grid;gap:15px; }
.attachment-duration-back { width:max-content;padding:5px 0;border:0;background:transparent;color:var(--ink-soft);cursor:pointer; }
.attachment-duration>strong { font-size:14px; }
.attachment-duration>div { display:grid;grid-template-columns:repeat(5,1fr);gap:7px; }
.attachment-duration [data-photo-seconds] { height:44px;border:1px solid var(--line);border-radius:11px;background:var(--white);color:var(--ink);font:600 11px "Cascadia Mono",monospace;cursor:pointer; }
.attachment-duration [data-photo-seconds].selected,.attachment-duration [data-photo-seconds]:hover { border-color:var(--coral);background:var(--coral);color:var(--navy); }
.composer-attachment.disappearing { border-color:#efb5c5;background:#fff5f8; }
.composer-attachment.disappearing #attachment-detail { color:var(--coral-deep);font-weight:650; }
.disappearing-photo { position:relative;overflow:hidden;padding:0!important;background:#171020!important; }
.disappearing-photo .message-image { width:100%;max-height:390px;margin:0;transition:filter .28s ease,transform .28s ease; }
.disappearing-photo .message-image.covered { filter:blur(18px) brightness(.55);transform:scale(1.07); }
.disappearing-photo-cover { position:absolute;inset:0;display:grid;place-content:center;justify-items:center;gap:11px;color:white;background:linear-gradient(rgba(23,16,32,.16),rgba(23,16,32,.38)); }
.disappearing-photo-cover small { max-width:220px;color:rgba(255,255,255,.82);font-size:9px;text-align:center; }
.disappearing-photo-cover[hidden],.disappearing-photo-timer[hidden] { display:none; }
.disappearing-photo-cover button { padding:8px 12px;border:1px solid rgba(255,255,255,.55);border-radius:999px;background:rgba(20,12,29,.7);color:white;cursor:pointer; }
.disappearing-photo-ring { width:34px;height:34px;border:3px solid rgba(255,255,255,.28);border-top-color:white;border-radius:50%;animation:disappearing-spin .9s linear infinite; }
@keyframes disappearing-spin { to { transform:rotate(360deg); } }
.disappearing-photo-timer { position:absolute;z-index:2;top:10px;right:10px;display:flex;align-items:center;gap:5px;padding:6px 8px;border-radius:999px;background:rgba(17,10,26,.78);color:white;font:700 10px "Cascadia Mono",monospace;backdrop-filter:blur(8px); }
.disappearing-photo-timer svg { width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round; }
.disappearing-photo-caption { padding:10px 13px;color:white;background:#171020; }
.expired-photo-bubble { display:flex!important;align-items:center;gap:9px;min-height:44px;color:var(--ink-soft)!important;background:#f1f2f6!important;border:1px dashed #c5c9d3; }
.expired-photo-bubble span { display:grid;width:28px;height:28px;place-items:center;border-radius:50%;background:#e3e5eb; }
.expired-photo-bubble svg { width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round; }
.admin-disappearing-controls { grid-column:1/-1;display:grid!important;gap:8px!important;margin:2px 0 0!important;padding:9px;border-top:1px solid rgba(179,88,79,.18); }
.admin-disappearing-controls label { display:flex!important;align-items:center;gap:7px;color:var(--ink);font-size:10px; }
.admin-disappearing-controls input { width:auto; }
#admin-disappearing-durations { display:flex;gap:5px; }
#admin-disappearing-durations[hidden] { display:none; }
#admin-disappearing-durations button { min-width:36px;padding:6px!important;border:1px solid var(--line)!important;background:white!important;color:var(--ink)!important;font:600 9px "Cascadia Mono",monospace!important; }
#admin-disappearing-durations button.selected { border-color:var(--coral)!important;background:var(--coral)!important;color:var(--navy)!important; }
.admin-expiry-tag { display:inline-flex;margin:7px 4px 0 0;padding:4px 7px;border-radius:999px;background:#f8d9d5;color:#8b443e;font:650 8px "Cascadia Mono",monospace;text-transform:uppercase; }
html[data-theme="dark"] .attachment-menu-sheet { background:#20142b;border-color:#46354f; }
html[data-theme="dark"] .attachment-menu-actions>button,html[data-theme="dark"] .attachment-duration [data-photo-seconds] { background:#191021;border-color:#46354f;color:#f5edf8; }
html[data-theme="dark"] .attachment-menu-actions>button:hover { background:#2b1b35; }
html[data-theme="dark"] .expired-photo-bubble { border-color:#53475b;background:#2a2330!important;color:#c9becf!important; }
html[data-theme="dark"] .composer-attachment.disappearing { border-color:#704253;background:#2c1a2b; }
@media(prefers-reduced-motion:reduce) { .disappearing-photo-ring { animation:none; } }
@media(max-width:650px) {
  .attachment-menu { width:100vw;margin:auto 0 0;border-radius:22px 22px 0 0; }
  .attachment-menu-sheet { border-radius:22px 22px 0 0;padding:20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .disappearing-photo .message-image { max-height:56vh; }
}

.pwa-truth-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px!important;overflow:hidden;border:1px solid var(--line);border-radius:9px;background:var(--line)}
.pwa-truth-grid article{display:grid;gap:3px;padding:12px;background:white}
.pwa-truth-grid strong{font:500 21px "Iowan Old Style",serif}
.pwa-truth-grid span{color:var(--ink-soft);font-size:9px}
.pwa-truth-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.pwa-truth-heading h3{margin:0!important}
.pwa-truth-heading a{color:var(--coral-deep);font-size:10px;font-weight:700;text-decoration:none}
.pwa-truth-heading a:hover{text-decoration:underline}
html[data-theme="dark"] .pwa-truth-grid article{background:#151d31}
@media(max-width:650px){.pwa-truth-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
.admin-observability-overview .analytics-details[hidden],
.admin-diagnostics-section[hidden]{display:none!important}
.admin-observability-links{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px
}
.admin-observability-links a{
  display:grid;align-content:start;min-height:105px;padding:16px;
  border:1px solid var(--line);border-radius:11px;background:white;
  color:var(--ink);text-decoration:none;transition:border-color .15s,transform .15s
}
.admin-observability-links a:hover{
  border-color:var(--coral);transform:translateY(-1px)
}
.admin-observability-links span{
  color:var(--ink-soft);font:700 9px "Cascadia Mono",monospace;
  letter-spacing:.05em;text-transform:uppercase
}
.admin-observability-links strong{
  margin:9px 0 4px;font:500 27px "Iowan Old Style",serif
}
.admin-observability-links small{
  color:var(--ink-soft);font-size:9px;line-height:1.4
}
html[data-theme="dark"] .admin-observability-links a{
  border-color:var(--line);background:#21172d;color:var(--ink)
}
@media(max-width:900px){
  .admin-observability-links{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:460px){
  .admin-observability-links{grid-template-columns:1fr}
}

/* Boyfriend profile: a familiar contact sheet with one editorial portrait moment. */
.companion-profile-trigger {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.companion-profile-trigger:hover h2,
.companion-profile-trigger:focus-visible h2 { color:var(--coral-deep); }
.companion-profile-trigger:focus-visible {
  border-radius:12px;
  outline:2px solid rgba(200,82,114,.55);
  outline-offset:6px;
}
.companion-profile-chevron {
  width:15px;height:15px;margin-left:2px;
  fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.6;
  opacity:.38;transition:transform 180ms ease,opacity 180ms ease;
}
.companion-profile-trigger:hover .companion-profile-chevron { transform:translateX(2px);opacity:.72; }
.companion-profile-dialog {
  width:min(760px,calc(100vw - 32px));max-width:none;
  max-height:min(880px,calc(100dvh - 32px));padding:0;overflow:hidden;
  border:0;border-radius:24px;background:var(--paper);color:var(--ink);
  box-shadow:0 34px 100px rgba(23,15,40,.38);
}
.companion-profile-dialog::backdrop { background:rgba(14,8,22,.72);backdrop-filter:blur(6px); }
.companion-profile-sheet {
  position:relative;max-height:min(880px,calc(100dvh - 32px));
  overflow-y:auto;overscroll-behavior:contain;
}
.companion-profile-close {
  position:sticky;z-index:5;top:18px;float:right;display:grid;
  width:38px;height:38px;margin:18px 18px -56px 0;place-items:center;
  border:1px solid rgba(255,255,255,.22);border-radius:50%;
  background:rgba(23,15,40,.58);color:white;cursor:pointer;backdrop-filter:blur(12px);
}
.companion-profile-close svg,.companion-profile-photo-viewer button svg {
  width:18px;height:18px;fill:none;stroke:currentColor;stroke-linecap:round;stroke-width:1.7;
}
.companion-profile-hero {
  position:relative;display:grid;min-height:292px;grid-template-columns:235px 1fr;
  align-items:end;gap:clamp(24px,5vw,52px);padding:45px clamp(30px,6vw,64px) 38px;
  overflow:hidden;color:white;
  background:radial-gradient(circle at 18% 28%,rgba(239,137,163,.36),transparent 30%),
    radial-gradient(circle at 86% 2%,rgba(234,223,246,.34),transparent 34%),
    linear-gradient(145deg,#170f28,#35204a);
}
.companion-profile-hero::after {
  position:absolute;right:-42px;bottom:-80px;width:250px;height:250px;
  border:1px solid rgba(255,255,255,.11);border-radius:48% 52% 45% 55%;
  content:"";transform:rotate(18deg);
}
.companion-profile-portrait {
  position:relative;z-index:1;display:grid;width:210px;height:238px;place-items:center;
  overflow:hidden;border:1px solid rgba(255,255,255,.3);
  border-radius:45% 55% 47% 53% / 39% 42% 58% 61%;
  background:linear-gradient(150deg,#eadff6,#ef89a3);
  box-shadow:0 24px 55px rgba(0,0,0,.3);color:var(--navy);
  font:500 92px "Iowan Old Style","Baskerville",serif;transform:rotate(-2deg);
}
.companion-profile-portrait img { width:100%;height:100%;object-fit:cover; }
.companion-profile-heading { position:relative;z-index:1;min-width:0;padding-bottom:12px; }
.companion-profile-heading .eyebrow { color:rgba(255,255,255,.48); }
.companion-profile-heading h2 {
  margin:7px 0 8px;font:500 clamp(43px,7vw,67px)/.95 "Iowan Old Style","Baskerville",serif;
  letter-spacing:-.045em;
}
.companion-profile-tagline {
  max-width:390px;margin:0;color:rgba(255,255,255,.78);
  font:italic 17px/1.5 "Iowan Old Style","Baskerville",serif;
}
.companion-profile-meta {
  display:flex;align-items:center;gap:9px;margin:20px 0 0;color:rgba(255,255,255,.58);
  font:600 9px "Cascadia Mono","SFMono-Regular",monospace;letter-spacing:.1em;text-transform:uppercase;
}
.companion-profile-meta span + span::before { margin-right:9px;content:"•";color:var(--coral); }
.companion-profile-body { display:grid;gap:28px;padding:34px clamp(30px,6vw,64px) 38px; }
.companion-profile-about>p:last-child {
  max-width:650px;margin:8px 0 0;color:var(--ink-soft);font-size:14px;line-height:1.75;
}
.companion-profile-section-heading {
  display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;
}
.companion-profile-section-heading p { margin:0; }
.companion-profile-section-heading span {
  color:var(--ink-soft);font:600 9px "Cascadia Mono","SFMono-Regular",monospace;
  letter-spacing:.08em;text-transform:uppercase;
}
.companion-profile-gallery {
  display:grid;grid-template-columns:repeat(3,1fr);grid-auto-rows:116px;gap:8px;
}
.companion-profile-photo {
  position:relative;min-width:0;padding:0;overflow:hidden;border:0;border-radius:12px;
  background:var(--sky);cursor:zoom-in;
}
.companion-profile-photo:first-child { grid-row:span 2;grid-column:span 2; }
.companion-profile-photo img {
  width:100%;height:100%;object-fit:cover;transition:transform 300ms ease,filter 220ms ease;
}
.companion-profile-photo:hover img,.companion-profile-photo:focus-visible img {
  filter:saturate(1.04);transform:scale(1.035);
}
.companion-profile-photo:focus-visible { outline:3px solid var(--coral-deep);outline-offset:2px; }
.companion-profile-empty,.companion-profile-status {
  margin:0;color:var(--ink-soft);font-size:12px;line-height:1.6;
}
.companion-profile-status:empty { display:none; }
.companion-profile-actions {
  display:grid;grid-template-columns:1fr 1.25fr;gap:10px;padding-top:2px;
}
.companion-profile-actions button { width:100%;margin:0; }
.companion-profile-photo-viewer {
  position:absolute;z-index:8;inset:0;display:grid;min-height:100%;place-items:center;
  padding:60px clamp(20px,5vw,46px) 36px;background:rgba(13,8,20,.94);
  color:white;backdrop-filter:blur(12px);touch-action:pan-y pinch-zoom;
}
.companion-profile-photo-viewer[hidden] { display:none; }
.companion-profile-photo-viewer button {
  position:absolute;top:18px;right:18px;display:grid;width:40px;height:40px;
  place-items:center;border:1px solid rgba(255,255,255,.22);border-radius:50%;
  background:rgba(255,255,255,.08);color:white;cursor:pointer;
}
.companion-profile-photo-viewer img {
  max-width:100%;max-height:calc(100dvh - 170px);border-radius:14px;object-fit:contain;
  box-shadow:0 28px 80px rgba(0,0,0,.5);user-select:none;-webkit-user-drag:none;
}
.companion-profile-photo-viewer img.profile-photo-next {
  animation:profile-photo-from-right 220ms ease-out;
}
.companion-profile-photo-viewer img.profile-photo-previous {
  animation:profile-photo-from-left 220ms ease-out;
}
@keyframes profile-photo-from-right {
  from { opacity:.3;transform:translateX(28px) scale(.985); }
  to { opacity:1;transform:translateX(0) scale(1); }
}
@keyframes profile-photo-from-left {
  from { opacity:.3;transform:translateX(-28px) scale(.985); }
  to { opacity:1;transform:translateX(0) scale(1); }
}
.companion-profile-photo-viewer p {
  align-self:start;max-width:580px;margin:16px 0 0;color:rgba(255,255,255,.68);
  font-size:11px;line-height:1.5;text-align:center;
}
html[data-theme="dark"] .companion-profile-dialog { background:#160d20;color:#f4edf6; }
html[data-theme="dark"] .companion-profile-about>p:last-child,
html[data-theme="dark"] .companion-profile-section-heading span,
html[data-theme="dark"] .companion-profile-empty,
html[data-theme="dark"] .companion-profile-status { color:#aa9cb3; }
html[data-theme="dark"] .companion-profile-photo { background:#281a35; }
@media(max-width:640px) {
  .companion-profile-dialog {
    width:100vw;height:100dvh;max-height:none;margin:0;border-radius:0;
  }
  .companion-profile-sheet { min-height:100dvh;max-height:100dvh; }
  .companion-profile-hero {
    min-height:300px;grid-template-columns:132px 1fr;gap:20px;padding:54px 22px 30px;
  }
  .companion-profile-portrait { width:132px;height:176px;font-size:66px; }
  .companion-profile-heading { padding-bottom:4px; }
  .companion-profile-heading h2 { font-size:clamp(38px,13vw,54px); }
  .companion-profile-tagline { font-size:14px; }
  .companion-profile-meta {
    align-items:flex-start;flex-direction:column;gap:5px;margin-top:15px;
  }
  .companion-profile-meta span + span::before { display:none; }
  .companion-profile-body {
    gap:25px;padding:28px 20px calc(26px + env(safe-area-inset-bottom));
  }
  .companion-profile-gallery { grid-auto-rows:28vw;gap:6px; }
  .companion-profile-photo { border-radius:9px; }
  .companion-profile-actions {
    position:sticky;z-index:3;bottom:0;margin:0 -20px -26px;
    padding:12px 20px calc(12px + env(safe-area-inset-bottom));
    background:color-mix(in srgb,var(--paper) 92%,transparent);backdrop-filter:blur(14px);
  }
  html[data-theme="dark"] .companion-profile-actions { background:rgba(22,13,32,.92); }
}
@media(prefers-reduced-motion:reduce) {
  .companion-profile-chevron,.companion-profile-photo img { transition:none; }
  .companion-profile-photo-viewer img.profile-photo-next,
  .companion-profile-photo-viewer img.profile-photo-previous { animation:none; }
}

.canonical-persona-note {
  display:grid;
  grid-template-columns:46px minmax(0,1fr);
  gap:16px;
  margin:0 0 26px;
  padding:18px;
  border:1px solid color-mix(in srgb,var(--user-rose) 42%,transparent);
  border-radius:18px;
  background:linear-gradient(135deg,
    color-mix(in srgb,var(--user-rose) 12%,transparent),
    color-mix(in srgb,var(--user-plum) 8%,transparent));
}
.canonical-persona-note[hidden] { display:none; }
.persona-canon-mark {
  display:grid;
  place-items:center;
  width:46px;
  height:46px;
  border:1px solid color-mix(in srgb,var(--user-rose) 55%,transparent);
  border-radius:50%;
  color:var(--user-rose);
  font-family:Georgia,"Times New Roman",serif;
  font-size:22px;
}
.canonical-persona-note strong { display:block;font-size:18px; }
.canonical-persona-note p {
  max-width:680px;
  margin:5px 0 13px;
  color:var(--user-muted);
  line-height:1.55;
}
.canonical-persona-note button {
  min-height:40px;
  padding:0 15px;
  border:1px solid color-mix(in srgb,var(--user-rose) 55%,transparent);
  border-radius:999px;
  background:transparent;
  color:var(--user-ink);
  font:inherit;
  font-weight:700;
  cursor:pointer;
}
.canonical-persona-note button:hover {
  background:color-mix(in srgb,var(--user-rose) 14%,transparent);
}
.canonical-persona-note small { display:block;margin-top:8px;color:var(--user-muted); }
.persona-fields-locked {
  opacity:.62;
  filter:saturate(.75);
}
.persona-fields-locked :disabled { cursor:not-allowed; }

@media(max-width:520px) {
  .canonical-persona-note { grid-template-columns:36px minmax(0,1fr);gap:12px;padding:15px; }
  .persona-canon-mark { width:36px;height:36px;font-size:18px; }
}

/* Presence and delivery states stay quiet until there is live activity. */
.presence {
  background:#a9a2b0;
  transition:background-color 180ms ease,box-shadow 180ms ease;
}
.presence[data-state="active"] { background:#9c94a4; }
.presence[data-state="checked_in"] { background:var(--coral); }
.presence[data-state="online"] { background:var(--green); }
.presence[data-state="typing"],
.presence[data-state="recording"] {
  background:var(--coral);
  box-shadow:0 0 0 0 rgba(239,137,163,.38);
  animation:presence-pulse 1.5s ease-out infinite;
}
@keyframes presence-pulse {
  70%,100% { box-shadow:0 0 0 7px rgba(239,137,163,0); }
}
#chat-privacy-label {
  min-height:14px;
  transition:color 160ms ease;
}
.companion:has(.presence[data-state="typing"]) #chat-privacy-label,
.companion:has(.presence[data-state="recording"]) #chat-privacy-label {
  color:var(--coral-deep);
}
.message-delivery-state {
  flex-basis:100%;
  margin:4px 3px 0;
  color:#8c8592;
  font:600 8px "Cascadia Mono","SFMono-Regular",monospace;
  letter-spacing:.015em;
  text-align:right;
}
.assistant.streaming .message-bubble:empty::after { display:none; }
.assistant.streaming.typing .message-bubble:empty {
  display:flex;
  min-width:50px;
  min-height:35px;
  align-items:center;
}
.assistant.streaming.typing .message-bubble:empty::after {
  display:block;
  width:5px;
  height:5px;
  margin:0 16px 0 2px;
  border-radius:50%;
  background:var(--coral);
  box-shadow:9px 0 rgba(239,137,163,.62),18px 0 rgba(239,137,163,.34);
  content:"";
  animation:typing-dots 900ms ease-in-out infinite alternate;
}
@keyframes typing-dots {
  to {
    background:rgba(239,137,163,.34);
    box-shadow:9px 0 var(--coral),18px 0 rgba(239,137,163,.62);
    transform:translateY(-1px);
  }
}

/* Public pages share the same typography and material without exposing the
   signed-in navigation before a session exists. */
body.public-user-page {
  min-height:100dvh;
  height:auto;
  overflow:auto;
  background:
    radial-gradient(circle at 82% 8%,rgba(232,120,154,.18),transparent 28%),
    linear-gradient(150deg,#f5edf4,#fcf9fc 48%,#efe5f0);
}

.public-user-page :where(.portal-shell,.wizard-shell,.auth-shell) {
  min-height:100dvh;
}

.public-user-page .portal-story {
  background:
    radial-gradient(circle at 78% 20%,rgba(232,120,154,.28),transparent 27%),
    linear-gradient(145deg,#170f28,#3a2449);
}

.public-user-page .portal-form {
  background:rgba(255,255,255,.94);
}

.public-user-page :where(.portal-story>div>p:last-child,.portal-form p,.wizard-main p) {
  font-size:16px;
}

.public-user-page :where(.portal-form label,.stack-form label,.wizard-main label) {
  color:var(--user-muted);
  font-size:14px;
}

.public-user-page :where(input,select,textarea) {
  min-height:48px;
  padding:13px 15px;
  border:1px solid var(--user-line);
  border-radius:12px;
  background:#fff;
  color:var(--user-ink);
  font-size:16px;
}

.public-user-page :where(.primary-action,.quiet-action,.guest-action,.auth-text-action) {
  min-height:46px;
  padding:12px 18px;
  border-radius:12px;
  font-size:15px;
}

.public-user-page .wizard-aside {
  background:
    radial-gradient(circle at 35% 82%,rgba(232,120,154,.17),transparent 34%),
    linear-gradient(180deg,#1b1029,#140c20);
}

.public-user-page .wizard-main { background:rgba(255,255,255,.95); }

.public-user-page .offline-card,
.public-user-page .auth-card {
  width:min(560px,100%);
  padding:clamp(28px,6vw,52px);
  border:1px solid rgba(255,255,255,.14);
  border-radius:24px;
  background:rgba(31,19,41,.92);
  box-shadow:0 28px 80px rgba(28,14,36,.24);
  color:#fff;
}

.public-user-page .offline-card h1,
.public-user-page .auth-card h1 {
  font-size:clamp(38px,7vw,58px);
  line-height:1;
}

.public-user-page .offline-card>p:not(.eyebrow),
.public-user-page .auth-card p {
  font-size:16px;
  line-height:1.65;
}

.transfer-page-body .auth-shell {
  display:grid;
  place-items:center;
  padding:24px;
  background:transparent;
}

html[data-theme="dark"] body.public-user-page {
  background:
    radial-gradient(circle at 82% 8%,rgba(232,120,154,.12),transparent 28%),
    #110a19;
}

html[data-theme="dark"] .public-user-page .portal-form,
html[data-theme="dark"] .public-user-page .wizard-main {
  background:#191020;
  color:#f7eff8;
}

html[data-theme="dark"] .public-user-page :where(input,select,textarea) {
  border-color:#443449;
  background:#21162a;
  color:#f7eff8;
}

@media(max-width:760px) {
  .public-user-page .portal-shell { grid-template-columns:1fr; }
  .public-user-page .portal-story {
    min-height:260px;
    padding:28px 22px;
  }
  .public-user-page .portal-form { padding:34px 20px 48px; }
  .public-user-page .wizard-shell { grid-template-columns:1fr; }
  .public-user-page .wizard-aside { min-height:230px; }
}

/* Expanded boyfriend catalogue: a quiet casting ledger, not a swipe feed. */
.persona-browser {
  min-width:0;
  background:#eef0f6;
}
.persona-filter-bar {
  position:sticky;
  top:0;
  z-index:8;
  display:grid;
  grid-template-columns:minmax(210px,1.6fr) repeat(5,minmax(112px,.8fr)) auto;
  gap:8px;
  padding:16px 20px;
  border-bottom:1px solid #d9dce6;
  background:rgba(248,249,252,.96);
  box-shadow:0 8px 24px rgba(23,15,40,.05);
  backdrop-filter:blur(14px);
}
.persona-filter-bar label {
  display:grid;
  min-width:0;
  gap:5px;
  color:#777d8e;
  font:700 8px "Cascadia Mono","SFMono-Regular",monospace;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.persona-filter-bar :is(input,select),
.persona-filter-bar>button {
  min-width:0;
  height:42px;
  padding:0 11px;
  border:1px solid #d9dce6;
  border-radius:9px;
  background:#fff;
  color:var(--ink);
  font:600 11px "Segoe UI",sans-serif;
}
.persona-filter-bar>button {
  align-self:end;
  cursor:pointer;
}
.persona-filter-bar :is(input,select):focus,
.persona-filter-bar>button:focus-visible {
  outline:2px solid var(--coral);
  outline-offset:2px;
}
.persona-results-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:18px 24px;
  color:#7b8190;
  font-size:11px;
}
.persona-results-heading strong {
  color:var(--ink);
  font:500 20px "Iowan Old Style","Baskerville",serif;
}
.persona-browser .persona-grid {
  grid-template-columns:repeat(3,minmax(220px,1fr));
  background:#d9dce6;
}
.persona-browser .persona-card {
  min-height:330px;
  grid-template-columns:92px minmax(0,1fr);
  padding:30px 26px;
  gap:21px;
}
.persona-browser .persona-avatar {
  width:90px;
  height:118px;
  border-radius:42% 58% 46% 54%;
}
.persona-browser .persona-card p {
  min-height:58px;
  margin:9px 0 10px;
}
.persona-card-job {
  display:block;
  min-height:28px;
  color:#525a6c;
  font-size:10px;
  line-height:1.4;
}
.persona-browser .chemistry {
  margin-top:12px;
  line-height:1.45;
}
.persona-no-results {
  grid-column:1/-1;
  min-height:360px;
  display:grid;
  place-content:center;
  justify-items:center;
  padding:40px;
  background:#fff;
  text-align:center;
}
.persona-no-results strong {
  font:500 31px "Iowan Old Style","Baskerville",serif;
}
.persona-no-results p { color:var(--ink-soft); }
.persona-no-results button {
  padding:11px 16px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#fff;
  color:var(--ink);
  cursor:pointer;
}
.chosen-persona-facts {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:1px;
  margin:20px 0 14px;
  padding:1px;
  background:var(--line);
}
.chosen-persona-facts>div {
  min-width:0;
  padding:11px;
  background:#fff;
}
.chosen-persona-facts dt {
  color:var(--ink-soft);
  font:700 8px "Cascadia Mono",monospace;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.chosen-persona-facts dd {
  margin:4px 0 0;
  overflow-wrap:anywhere;
  font-size:11px;
}
.chosen-persona-tags {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-bottom:18px;
}
.chosen-persona-tags span {
  padding:6px 9px;
  border-radius:999px;
  background:#f1edf7;
  color:#6b4b81;
  font-size:9px;
}
html[data-theme="dark"] .persona-browser { background:#130c1b; }
html[data-theme="dark"] .persona-filter-bar {
  border-color:#423348;
  background:rgba(24,15,31,.96);
}
html[data-theme="dark"] .persona-filter-bar :is(input,select),
html[data-theme="dark"] .persona-filter-bar>button {
  border-color:#49384f;
  background:#211629;
  color:#f4edf6;
}
html[data-theme="dark"] .persona-results-heading,
html[data-theme="dark"] .persona-card-job { color:#b9adbf; }
html[data-theme="dark"] .persona-results-heading strong { color:#f6eef8; }
html[data-theme="dark"] .persona-browser .persona-grid { background:#392b40; }
html[data-theme="dark"] .persona-browser .persona-card,
html[data-theme="dark"] .persona-no-results,
html[data-theme="dark"] .chosen-persona-facts>div {
  background:#1b1123;
  color:#f6eef8;
}
html[data-theme="dark"] .persona-browser .persona-card:hover { background:#24172e; }
html[data-theme="dark"] .chosen-persona-facts { background:#49384f; }
html[data-theme="dark"] .chosen-persona-tags span {
  background:#2d1d37;
  color:#d9bce3;
}
@media(max-width:1180px) {
  .persona-filter-bar {
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .persona-filter-bar>button { min-height:42px; }
  .persona-browser .persona-grid { grid-template-columns:repeat(2,minmax(240px,1fr)); }
}
@media(max-width:760px) {
  .catalog-page { display:block; }
  .catalog-header {
    position:relative;
    width:100%;
    height:auto;
    min-height:390px;
    padding:32px 24px 36px;
  }
  .persona-filter-bar {
    position:relative;
    grid-template-columns:1fr 1fr;
    padding:13px;
  }
  .persona-filter-bar .persona-search { grid-column:1/-1; }
  .persona-results-heading { padding:16px; }
  .persona-results-heading span { display:none; }
  .persona-browser .persona-grid { grid-template-columns:1fr; }
  .persona-browser .persona-card {
    min-height:250px;
    grid-template-columns:98px minmax(0,1fr);
    padding:25px 22px;
  }
  .persona-browser .persona-avatar { width:96px;height:124px; }
}
@media(max-width:430px) {
  .persona-filter-bar { grid-template-columns:1fr; }
  .persona-filter-bar .persona-search { grid-column:auto; }
  .chosen-persona-facts { grid-template-columns:1fr; }
}
.voice-message {
  flex-wrap:wrap;
  gap:5px;
}
.message-row.user .voice-message { justify-content:flex-end; }
.message-row.user .assistant-voice-toggle {
  border-color:rgba(255,255,255,.12);
  background:var(--navy-raised);
  color:white;
}
.message-row.user .assistant-voice-toggle:hover {
  border-color:rgba(255,255,255,.24);
  background:#34234a;
}
.message-row.user .assistant-voice-icon {
  background:var(--coral);
  color:var(--navy);
}
.message-row.user .assistant-voice-copy small,
.message-row.user .assistant-voice-toggle time {
  color:rgba(255,255,255,.58);
}
.voice-transcript-toggle {
  flex-basis:100%;
  width:max-content;
  margin:1px 4px 0;
  padding:3px 0;
  border:0;
  background:transparent;
  color:var(--ink-soft);
  font:600 8px "Cascadia Mono","SFMono-Regular",monospace;
  cursor:pointer;
}
.message-row.user .voice-transcript-toggle {
  margin-left:auto;
  color:#8c8592;
}
.voice-transcript-toggle:hover,
.voice-transcript-toggle:focus-visible { color:var(--coral-deep); }
.voice-transcript {
  flex-basis:100%;
  max-width:min(520px,78%);
  margin-top:3px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.64);
  color:var(--ink-soft);
  font-size:11px;
  line-height:1.55;
}
.voice-transcript[hidden] { display:none; }
.message-row.user .voice-transcript {
  margin-left:auto;
  border-color:rgba(255,255,255,.12);
  background:var(--navy-raised);
  color:rgba(255,255,255,.78);
}
.voice-reply-status {
  display:flex;
  align-items:center;
  gap:9px;
}
.voice-status-wave {
  display:flex;
  height:18px;
  align-items:center;
  gap:2px;
}
.voice-status-wave i {
  width:2px;
  height:6px;
  border-radius:2px;
  background:var(--coral);
  animation:voice-status-wave 700ms ease-in-out infinite alternate;
}
.voice-status-wave i:nth-child(2) { height:13px;animation-delay:-.4s; }
.voice-status-wave i:nth-child(3) { height:9px;animation-delay:-.2s; }
.voice-status-wave i:nth-child(4) { height:5px;animation-delay:-.55s; }
@keyframes voice-status-wave {
  to { transform:scaleY(1.45);opacity:.55; }
}
html[data-theme="dark"] .voice-transcript {
  border-color:rgba(255,255,255,.1);
  background:#211629;
  color:#c1b5c8;
}
@media(max-width:760px) {
  .chat-header .companion #chat-privacy-label {
    display:block;
    overflow:hidden;
    max-width:38vw;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .assistant-voice-toggle { min-width:min(260px,82vw); }
  .voice-transcript { max-width:88%; }
}
@media(prefers-reduced-motion:reduce) {
  .presence[data-state="typing"],
  .presence[data-state="recording"],
  .assistant.streaming.typing .message-bubble:empty::after,
  .voice-status-wave i { animation:none; }
}

.empty-state .eyebrow {
  margin: 0 0 12px;
  color: var(--coral-deep);
  font-size: 9px;
}

.empty-state h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: clamp(35px, 5vw, 52px);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.empty-state > p:last-child {
  max-width: 430px;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.message-row {
  display: flex;
  width: 100%;
  margin-bottom: 22px;
  animation: message-in 220ms ease-out both;
}

.message-row {
  position: relative;
  flex-wrap: wrap;
}

.message-actions {
  display: flex;
  flex-basis: 100%;
  gap: 3px;
  margin-top: 5px;
  opacity: 0;
  transition: opacity 150ms ease;
}

.message-row.user .message-actions {
  justify-content: flex-end;
}

.message-row:hover .message-actions,
.message-row:focus-within .message-actions {
  opacity: 1;
}

.message-action {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #8991a3;
  cursor: pointer;
}

.message-action:hover,
.message-action.active {
  background: rgba(24, 32, 57, 0.07);
  color: var(--coral-deep);
}

.message-action svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.message-options-trigger {
  display: none;
}

.message-action-dialog {
  width: min(390px, calc(100vw - 24px));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(15, 10, 28, 0.3);
}

.message-action-dialog::backdrop {
  background: rgba(12, 8, 22, 0.62);
  backdrop-filter: blur(3px);
}

.message-action-sheet {
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
}

.message-action-sheet > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.message-action-sheet h2 {
  margin: 3px 0 0;
  font: 500 28px "Iowan Old Style", serif;
}

.message-action-sheet > header > button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 20px;
  cursor: pointer;
}

.message-action-list {
  display: grid;
  gap: 7px;
}

.message-sheet-action {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.message-sheet-action > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: #f1edf7;
  color: #6b4b81;
}

.message-sheet-action svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.message-sheet-action:hover,
.message-sheet-action:focus-visible,
.message-sheet-action.active {
  border-color: rgba(200, 82, 114, 0.45);
  background: #fff7fa;
}

.message-sheet-action.destructive {
  color: #a13b54;
}

.message-sheet-action.destructive > span {
  background: #fff0f3;
  color: #a13b54;
}

.message-action-cancel {
  width: 100%;
  margin-top: 10px;
  padding: 11px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 700;
  cursor: pointer;
}

.message-row.action-sheet-open .message-bubble {
  outline: 2px solid rgba(200, 82, 114, 0.42);
  outline-offset: 2px;
}

.conversation-entry.action-sheet-open .conversation-item {
  outline: 2px solid rgba(200, 82, 114, 0.34);
  outline-offset: -2px;
}

html[data-theme="dark"] .message-action-sheet {
  border-color: #46354f;
  background: #20142b;
}

html[data-theme="dark"] .message-sheet-action {
  border-color: #46354f;
  background: #191021;
  color: #f5edf8;
}

html[data-theme="dark"] .message-sheet-action > span {
  background: #2b1b35;
  color: #d7b8e2;
}

html[data-theme="dark"] .message-sheet-action:hover,
html[data-theme="dark"] .message-sheet-action:focus-visible,
html[data-theme="dark"] .message-sheet-action.active {
  border-color: #9b5b78;
  background: #2b1b35;
}

html[data-theme="dark"] .message-sheet-action.destructive {
  color: #ff9eb5;
}

html[data-theme="dark"] .message-sheet-action.destructive > span {
  background: #3a1d2c;
  color: #ff9eb5;
}

@media (hover: none) and (pointer: coarse) {
  .message-row .message-bubble,
  .message-row .message-markdown {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}

@media (max-width: 650px) {
  .message-action-dialog {
    width: 100vw;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }

  .message-action-sheet {
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
  }
}

.message-row.user {
  justify-content: flex-end;
}

.chat-session-divider {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  width:100%;
  margin:10px 0 24px;
  color:var(--ink-soft);
  font:600 9px "Cascadia Mono",monospace;
  letter-spacing:.025em;
  text-align:center;
}
.chat-session-divider::before,
.chat-session-divider::after {
  width:min(70px,15vw);
  height:1px;
  background:rgba(106,112,133,.18);
  content:"";
}
.admin-chat-session-divider {
  flex-wrap:wrap;
  margin:18px 4% 12px;
}
.admin-chat-session-divider small {
  color:var(--ink-soft);
  font:500 8px "Cascadia Mono",monospace;
}
.chat-review article.admin-retained-message {
  border:1px dashed rgba(143,52,86,.38);
}
.admin-retained-message-tag {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:6px 12px;
  margin:12px -5px -5px;
  padding:8px 10px;
  border-radius:8px;
  background:rgba(143,52,86,.08);
  color:var(--ink-soft);
  font:600 8px "Cascadia Mono",monospace;
}
.admin-retained-message-tag strong {
  color:var(--coral-deep);
  text-transform:uppercase;
  letter-spacing:.04em;
}
html[data-theme="dark"] .admin-retained-message-tag {
  background:rgba(240,137,163,.1);
}
html[data-theme="dark"] .admin-retained-message-tag strong {
  color:#f3a0b5;
}
html[data-theme="dark"] .chat-session-divider::before,
html[data-theme="dark"] .chat-session-divider::after {
  background:rgba(235,226,241,.15);
}
@media(max-width:600px) {
  .admin-chat-session-divider small {
    flex-basis:100%;
  }
}

.email-continuation-offer {
  width:min(520px,calc(100% - 28px));
  margin:18px auto 8px;
  padding:18px;
  border:1px solid rgba(181,79,112,.25);
  border-radius:17px;
  background:linear-gradient(135deg,#fff8fb,#f6eef8);
  box-shadow:0 14px 36px rgba(45,27,55,.08);
}
.email-continuation-offer>div small {
  display:block;
  margin-bottom:5px;
  color:#a34867;
  font:700 8px "Cascadia Mono",monospace;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.email-continuation-offer>div strong {
  display:block;
  color:var(--ink);
  font:500 18px "Iowan Old Style",serif;
}
.email-continuation-offer>div p {
  margin:7px 0 13px;
  color:var(--ink-soft);
  font-size:11px;
  line-height:1.5;
}
.email-continuation-offer form {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:7px;
}
.email-continuation-offer input,
.email-continuation-offer button {
  min-height:41px;
  border-radius:10px;
  font:600 10px "Segoe UI",sans-serif;
}
.email-continuation-offer input {
  min-width:0;
  padding:0 12px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--ink);
  font-weight:400;
}
.email-continuation-offer button {
  padding:0 12px;
  border:0;
  color:#fff;
  background:var(--navy);
  cursor:pointer;
}
.email-continuation-offer button:disabled { opacity:.55;cursor:wait; }
.email-continuation-offer .email-offer-dismiss {
  color:var(--ink-soft);
  background:transparent;
}
.email-continuation-offer .email-offer-status {
  grid-column:1/-1;
  min-height:14px;
  margin:0;
  color:#a5413a;
  font-size:9px;
}
@media(max-width:620px) {
  .email-continuation-offer form { grid-template-columns:1fr 1fr; }
  .email-continuation-offer input { grid-column:1/-1; }
}

.message-bubble {
  position: relative;
  max-width: min(680px, 78%);
  padding: 14px 17px;
  border: 2px solid transparent;
  border-radius: 7px 18px 18px 18px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(28, 37, 63, 0.07);
  font-size: 14px;
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: min(680px, 78%);
}

.message-stack .message-bubble {
  max-width: 100%;
  box-shadow: 0 5px 18px rgba(28, 37, 63, 0.065);
}

.message-stack .message-bubble + .message-bubble {
  border-radius: 7px 18px 18px 18px;
}

.assistant-voice-reply {
  display: flex;
  flex-basis: 100%;
  margin-top: 7px;
}

.assistant-voice-reply audio {
  display: none;
}

.assistant-voice-toggle {
  appearance: none;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) 34px auto;
  align-items: center;
  gap: 9px;
  min-width: min(270px, 78%);
  padding: 8px 11px 8px 8px;
  border: 1px solid rgba(184, 82, 118, 0.19);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  box-shadow: 0 6px 19px rgba(28, 37, 63, 0.06);
  text-align: left;
  cursor: pointer;
}

.assistant-voice-toggle:hover {
  border-color: rgba(184, 82, 118, 0.38);
  background: #fff;
}

.assistant-voice-toggle:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.assistant-voice-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.assistant-voice-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
}

.assistant-voice-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.voice-pause-mark,
.assistant-voice-reply.playing .voice-play-mark {
  display: none;
}

.assistant-voice-reply.playing .voice-pause-mark {
  display: block;
}

.assistant-voice-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.assistant-voice-copy strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-voice-copy small,
.assistant-voice-toggle time {
  color: var(--ink-soft);
  font: 8px "Cascadia Mono", monospace;
}

.assistant-voice-toggle time {
  white-space: nowrap;
}

.assistant-voice-wave {
  display: flex;
  height: 20px;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.assistant-voice-wave i {
  width: 2px;
  height: 7px;
  border-radius: 3px;
  background: var(--coral);
}

.assistant-voice-wave i:nth-child(2) { height: 13px; }
.assistant-voice-wave i:nth-child(3) { height: 10px; }
.assistant-voice-wave i:nth-child(4) { height: 5px; }

.assistant-voice-reply.playing .assistant-voice-wave i {
  animation: voice-wave 0.72s ease-in-out infinite alternate;
}

.assistant-voice-reply.playing .assistant-voice-wave i:nth-child(2) {
  animation-delay: -0.45s;
}

.assistant-voice-reply.playing .assistant-voice-wave i:nth-child(3) {
  animation-delay: -0.25s;
}

.assistant-voice-reply.playing .assistant-voice-wave i:nth-child(4) {
  animation-delay: -0.6s;
}

.voice-reply-status {
  flex-basis: 100%;
  margin-top: 7px;
  color: var(--ink-soft);
  font: 9px "Cascadia Mono", monospace;
}

@keyframes voice-wave {
  to { transform: scaleY(1.65); }
}

.chat.secret-mode .message-bubble {
  border-color: rgba(159, 51, 46, 0.42);
  border-style: dotted;
}

.chat.secret-mode .message-row.user .message-bubble {
  border-color: rgba(255, 255, 255, 0.58);
}

.message-bubble.markdown {
  white-space: normal;
}

.message-markdown .katex-display {
  max-width:100%;
  margin:.55em 0;
  overflow-x:auto;
  overflow-y:hidden;
  padding-bottom:3px;
}

.message-markdown .katex {
  font-size:1.02em;
}

.message-image {
  display: block;
  width: min(360px, 100%);
  max-height: 420px;
  margin-bottom: 11px;
  object-fit: cover;
  border-radius: 5px 12px 12px 12px;
}

.locked-photo-card {
  position:relative;
  width:min(330px,100%);
  aspect-ratio:4/5;
  margin-bottom:12px;
  overflow:hidden;
  border:1px solid rgba(239,137,163,.28);
  border-radius:7px 16px 16px 16px;
  background:#24172f;
  box-shadow:0 15px 38px rgba(16,9,24,.18);
}
.locked-photo-card>img {
  width:100%;
  height:100%;
  object-fit:cover;
  filter:blur(16px) saturate(.75);
  transform:scale(1.18);
}
.locked-photo-card::after {
  position:absolute;
  inset:0;
  content:"";
  background:linear-gradient(180deg,rgba(16,9,24,.08) 15%,rgba(16,9,24,.88) 92%);
  pointer-events:none;
}
.locked-photo-overlay {
  position:absolute;
  z-index:1;
  inset:auto 0 0;
  display:grid;
  justify-items:start;
  gap:7px;
  padding:22px;
  color:white;
}
.locked-photo-mark {
  display:grid;
  width:34px;
  height:34px;
  place-items:center;
  border:1px solid rgba(255,255,255,.28);
  border-radius:50%;
  background:rgba(255,255,255,.1);
  backdrop-filter:blur(8px);
}
.locked-photo-mark svg {
  width:17px;
  fill:none;
  stroke:currentColor;
  stroke-linecap:round;
  stroke-linejoin:round;
  stroke-width:1.7;
}
.locked-photo-overlay strong {
  font:500 21px/1.15 "Iowan Old Style",serif;
}
.locked-photo-overlay small {
  max-width:250px;
  color:rgba(255,255,255,.72);
  font-size:10px;
  line-height:1.45;
}
.locked-photo-overlay button {
  width:100%;
  margin-top:5px;
  padding:11px 14px;
  border:0;
  border-radius:9px;
  background:var(--coral);
  color:var(--navy);
  font-size:11px;
  font-weight:750;
  cursor:pointer;
}
.locked-photo-overlay button:focus-visible {
  outline:3px solid rgba(255,255,255,.65);
  outline-offset:3px;
}

.message-markdown:empty {
  display: none;
}

.message-bubble.markdown > :first-child {
  margin-top: 0;
}

.message-bubble.markdown > :last-child {
  margin-bottom: 0;
}

.message-markdown > :first-child {
  margin-top: 0;
}

.message-markdown > :last-child {
  margin-bottom: 0;
}

.message-bubble.markdown p {
  margin: 0 0 0.8em;
}

.message-bubble.markdown ul,
.message-bubble.markdown ol {
  margin: 0.45em 0 0.8em;
  padding-left: 1.45em;
}

.message-bubble.markdown li {
  margin: 0.32em 0;
  padding-left: 0.16em;
}

.message-bubble.markdown li::marker {
  color: var(--coral-deep);
}

.user .message-bubble.markdown li::marker {
  color: var(--coral);
}

.message-bubble.markdown h1,
.message-bubble.markdown h2,
.message-bubble.markdown h3,
.message-bubble.markdown h4 {
  margin: 0.85em 0 0.35em;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.2;
}

.message-bubble.markdown h1 {
  font-size: 1.5em;
}

.message-bubble.markdown h2 {
  font-size: 1.32em;
}

.message-bubble.markdown h3,
.message-bubble.markdown h4 {
  font-size: 1.13em;
}

.message-bubble.markdown blockquote {
  margin: 0.75em 0;
  padding: 0.12em 0 0.12em 0.9em;
  border-left: 2px solid var(--coral);
  color: var(--ink-soft);
}

.user .message-bubble.markdown blockquote {
  color: rgba(255, 255, 255, 0.7);
}

.message-bubble.markdown code {
  padding: 0.14em 0.35em;
  border-radius: 5px;
  background: #eef0f6;
  color: #9d3832;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.88em;
}

.user .message-bubble.markdown code {
  background: rgba(255, 255, 255, 0.1);
  color: #ffc1bc;
}

.message-bubble.markdown pre {
  max-width: 100%;
  margin: 0.8em 0;
  overflow-x: auto;
  border-radius: 9px;
  background: #11182a;
}

.message-bubble.markdown pre code {
  display: block;
  padding: 13px 14px;
  background: transparent;
  color: #e8ebf3;
  font-size: 0.82em;
  line-height: 1.55;
  white-space: pre;
}

.message-bubble.markdown a {
  color: #476da9;
  text-decoration-color: rgba(71, 109, 169, 0.4);
  text-underline-offset: 2px;
}

.user .message-bubble.markdown a {
  color: #b9d2ff;
  text-decoration-color: rgba(185, 210, 255, 0.5);
}

.message-bubble.markdown hr {
  margin: 1em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.user .message-bubble {
  border-radius: 18px 7px 18px 18px;
  background: var(--navy-raised);
  color: var(--white);
  box-shadow: 0 8px 24px rgba(16, 24, 45, 0.14);
}

.assistant.streaming .message-bubble::after {
  display: inline-block;
  width: 6px;
  height: 14px;
  margin-left: 4px;
  background: var(--coral);
  content: "";
  vertical-align: -2px;
  animation: cursor 0.8s steps(2) infinite;
}

@keyframes cursor {
  50% {
    opacity: 0;
  }
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.error-banner {
  grid-area:error;
  margin: 0 clamp(24px, 8vw, 112px) 12px;
  padding: 11px 14px;
  border: 1px solid rgba(233, 93, 85, 0.25);
  border-radius: 9px;
  background: #fff0ef;
  color: #9f332e;
  font-size: 12px;
}

.error-retry {
  margin-left: 10px;
  padding: 5px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.install-nudge {
  grid-area:install;
  display:grid;
  grid-template-columns:44px minmax(0,1fr) auto;
  align-items:center;
  gap:13px;
  margin:0 clamp(24px,8vw,112px) 10px;
  padding:11px 12px 11px 11px;
  overflow:hidden;
  border:1px solid rgba(200,82,114,.22);
  border-radius:15px;
  background:
    linear-gradient(105deg,rgba(255,240,245,.92),rgba(255,255,255,.98) 54%);
  box-shadow:0 10px 30px rgba(31,22,45,.09);
  animation:install-nudge-in .24s ease-out;
}
.install-nudge[hidden] { display:none; }
.install-nudge-mark {
  display:grid;
  width:44px;
  height:44px;
  place-items:center;
  border-radius:13px 13px 13px 5px;
  background:var(--navy);
  color:#fff;
}
.install-nudge-mark svg {
  width:21px;
  height:21px;
  fill:none;
  stroke:currentColor;
  stroke-linecap:round;
  stroke-linejoin:round;
  stroke-width:1.8;
}
.install-nudge-copy {
  display:grid;
  min-width:0;
  gap:2px;
}
.install-nudge-copy .eyebrow {
  margin:0;
  color:var(--coral-deep);
  font-size:8px;
}
.install-nudge-copy strong {
  color:var(--ink);
  font-size:13px;
}
.install-nudge-copy span {
  color:var(--ink-soft);
  font-size:11px;
  line-height:1.4;
}
.install-nudge-actions {
  display:flex;
  align-items:center;
  gap:7px;
}
.install-nudge-actions button {
  min-height:36px;
  padding:8px 11px;
  border:0;
  border-radius:10px;
  cursor:pointer;
  font:700 11px/1 inherit;
  white-space:nowrap;
}
#install-nudge-dismiss {
  background:transparent;
  color:var(--ink-soft);
}
#install-nudge-dismiss:hover { background:#f2f3f7; }
#install-nudge-action {
  background:var(--navy);
  color:#fff;
}
#install-nudge-action:hover { background:#222d4d; }
.proactive-nudge-mark {
  overflow:hidden;
  border-radius:50% 50% 14px 50%;
  background:linear-gradient(145deg,var(--coral),#ffd7e1);
  color:var(--navy);
  font:600 20px "Iowan Old Style",serif;
  transform:rotate(-3deg);
}
.proactive-nudge-mark img {
  width:100%;
  height:100%;
  object-fit:cover;
  transform:rotate(3deg) scale(1.08);
}
.proactive-nudge-mark span {
  display:grid;
  width:100%;
  height:100%;
  place-items:center;
  transform:rotate(3deg);
}
#notification-nudge-action {
  background:var(--navy);
  color:#fff;
}
#notification-nudge-dismiss {
  background:transparent;
  color:var(--ink-soft);
}
#notification-nudge-action:disabled {
  cursor:wait;
  opacity:.58;
}
.install-nudge-actions button:focus-visible {
  outline:2px solid var(--coral-deep);
  outline-offset:2px;
}
@keyframes install-nudge-in {
  from { opacity:0;transform:translateY(7px); }
  to { opacity:1;transform:translateY(0); }
}

.composer {
  grid-area:composer;
  position: relative;
  margin: 0 clamp(24px, 8vw, 112px) 26px;
  padding: 10px 145px 10px 16px;
  border: 1px solid #d5d9e4;
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 16px 36px rgba(22, 31, 54, 0.1);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.composer.voice-unavailable { padding-right:104px; }

.composer-attachment {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 4px 0 6px;
  padding: 7px 9px 7px 7px;
  border: 1px solid #e1e4ec;
  border-radius: 11px;
  background: #f6f7fa;
}

.composer-attachment[hidden] {
  display: none;
}

.composer-attachment img {
  width: 52px;
  height: 48px;
  object-fit: cover;
  border-radius: 7px;
}

.composer-attachment div {
  min-width: 0;
}

.composer-attachment strong,
.composer-attachment span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-attachment strong {
  font-size: 10px;
  font-weight: 600;
}

.composer-attachment span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 8px;
}

.composer-attachment button {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 18px;
}

.composer-attachment button:hover {
  background: #e9ebf1;
  color: var(--coral-deep);
}

.composer:focus-within {
  border-color: #9ea8bf;
  box-shadow: 0 16px 40px rgba(22, 31, 54, 0.13);
}

.attach-button {
  position: absolute;
  right: 60px;
  bottom: 13px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #747d90;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.voice-button {
  position:absolute;
  right:101px;
  bottom:13px;
  display:grid;
  width:36px;
  height:36px;
  place-items:center;
  border:1px solid transparent;
  border-radius:11px;
  background:transparent;
  color:#747d90;
  cursor:pointer;
  transition:background 150ms ease,color 150ms ease,transform 150ms ease;
}
.voice-button:hover {
  background:#f3edfa;
  color:#7d4ca0;
  transform:translateY(-1px);
}
.voice-button:focus-visible {
  outline:2px solid var(--coral-deep);
  outline-offset:2px;
}
.voice-button:disabled { cursor:not-allowed;opacity:.4;transform:none; }
.voice-button svg {
  width:19px;
  height:19px;
  fill:none;
  stroke:currentColor;
  stroke-linecap:round;
  stroke-linejoin:round;
  stroke-width:1.65;
}
.voice-button.recording {
  background:#fff0f1;
  color:#d24455;
  animation:voice-pulse 1.2s ease-in-out infinite;
}
@keyframes voice-pulse {
  50% { box-shadow:0 0 0 5px rgba(210,68,85,.12); }
}
.voice-recording-status {
  display:grid;
  grid-template-columns:auto 1fr auto auto;
  align-items:center;
  gap:9px;
  margin:2px 0 7px;
  padding:9px 10px;
  border-radius:10px;
  background:#fff3f3;
  color:#81313d;
  font-size:11px;
}
.voice-recording-status[hidden] { display:none; }
.voice-recording-dot {
  width:8px;
  height:8px;
  border-radius:50%;
  background:#d24455;
}
.voice-recording-status time {
  font:10px "Cascadia Mono",monospace;
}
.voice-recording-status button {
  padding:4px 7px;
  border:0;
  background:transparent;
  color:#81313d;
  cursor:pointer;
  font-weight:700;
}

.attach-button:hover {
  border-color: rgba(200, 82, 114, 0.2);
  background: #fff0f5;
  color: var(--coral-deep);
  transform: translateY(-1px);
}

.attach-button:focus-visible {
  outline: 2px solid var(--coral-deep);
  outline-offset: 2px;
}

.attach-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
  transform: none;
}

.attach-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.composer textarea {
  display: block;
  width: 100%;
  max-height: 150px;
  padding: 7px 0;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  line-height: 1.5;
}

.composer textarea::placeholder {
  color: #939aad;
}

.guest-composer-signup {
  display:grid;
  width:100%;
  gap:3px;
  padding:13px 18px;
  border:0;
  border-radius:12px;
  background:var(--coral);
  color:var(--navy);
  cursor:pointer;
  text-align:center;
}
.guest-composer-signup[hidden] { display:none; }
.guest-composer-signup span {
  font:9px "Cascadia Mono",monospace;
  letter-spacing:.08em;
  text-transform:uppercase;
  opacity:.72;
}
.guest-composer-signup strong { font-size:14px; }
.composer.guest-limit { padding:7px; }
.composer.guest-limit .attach-button,
.composer.guest-limit .voice-button,
.composer.guest-limit textarea,
.composer.guest-limit .send-button,
.composer.guest-limit .stop-button { display:none; }

.send-button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: var(--coral);
  color: var(--navy);
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.stop-button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 13px;
  background: var(--navy);
  cursor: pointer;
}

.stop-button span {
  display: block;
  width: 10px;
  height: 10px;
  margin: auto;
  border-radius: 2px;
  background: var(--white);
}

.send-button:hover {
  background: #ff8d85;
  transform: translateY(-1px);
}

.send-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.send-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(255, 119, 109, 0.46);
  outline-offset: 3px;
}

.scrim {
  display: none;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  padding: 11px 15px;
  transform: translateY(12px);
  border-radius: 9px;
  background: var(--navy);
  color: var(--white);
  box-shadow: var(--shadow);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.with-action {
  display:flex;
  align-items:center;
  gap:14px;
  pointer-events:auto;
}
.toast.with-action button {
  padding:4px 0;
  border:0;
  border-bottom:1px solid currentColor;
  background:transparent;
  color:var(--white);
  font:700 10px "Cascadia Mono",monospace;
  cursor:pointer;
}
.toast.with-action button:disabled {
  opacity:.55;
}

.delete-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 3px 20px 20px 20px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(9, 14, 28, 0.3);
}

.new-thread-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: min(760px, calc(100dvh - 28px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  background: #f7f8fc;
  box-shadow: 0 30px 90px rgba(9, 14, 28, 0.3);
}

.new-thread-dialog::backdrop {
  background: rgba(10, 15, 28, 0.6);
  backdrop-filter: blur(3px);
}

.new-thread-dialog form {
  padding: 30px;
}

.new-thread-dialog h2 {
  margin: 6px 0 8px;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.new-thread-intro {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.new-thread-options {
  display: grid;
  gap: 8px;
  max-height: min(430px, 52dvh);
  overflow-y: auto;
}

.new-thread-option {
  display: grid;
  grid-template-columns: auto 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  cursor: pointer;
}

.new-thread-option:has(input:checked) {
  border-color: rgba(255, 119, 109, 0.7);
  background: #fff5f3;
  box-shadow: 0 0 0 2px rgba(255, 119, 109, 0.1);
}

.new-thread-option input {
  accent-color: var(--coral-deep);
}

.new-thread-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 46% 54% 49% 51%;
  background: var(--sky);
  object-fit: cover;
  font: 500 25px "Iowan Old Style", serif;
}

.new-thread-option > span:last-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.new-thread-option strong {
  font-size: 14px;
}

.new-thread-option small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.new-thread-secret {
  display: grid;
  grid-template-columns: auto 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed rgba(99, 77, 128, 0.3);
  border-radius: 12px;
  background: rgba(99, 77, 128, 0.055);
  cursor: pointer;
}

.new-thread-secret:has(input:checked) {
  border-color: rgba(255, 119, 109, 0.65);
  background: #fff1ee;
}

.new-thread-secret input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--coral-deep);
}

.new-thread-secret-lock {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: rgba(99, 77, 128, 0.1);
  color: var(--ink-soft);
}

.new-thread-secret-lock svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.new-thread-secret > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.new-thread-secret strong {
  font-size: 13px;
}

.new-thread-secret small {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.35;
}

.new-thread-dialog .primary-action {
  width: auto;
  margin: 0;
}

@media (max-width: 520px) {
  .new-thread-dialog form { padding: 23px 18px 18px; }
  .new-thread-dialog h2 { font-size: 26px; }
  .new-thread-option { grid-template-columns: auto 46px minmax(0, 1fr); }
  .new-thread-avatar { width: 46px;height: 46px; }
}

.delete-dialog::backdrop {
  background: rgba(10, 15, 28, 0.56);
  backdrop-filter: blur(3px);
}

.delete-dialog form {
  position: relative;
  padding: 34px;
}

.delete-dialog .dialog-mark {
  position: absolute;
  top: 25px;
  right: 27px;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50% 47% 53% 46%;
  background: #fff0ef;
  color: var(--coral-deep);
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 23px;
}

.delete-dialog .eyebrow {
  margin: 0 0 11px;
  color: var(--coral-deep);
  font-size: 8px;
}

.delete-dialog h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.delete-dialog form > p:not(.eyebrow) {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 27px;
}

.dialog-actions button {
  padding: 10px 14px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.dialog-cancel {
  border: 1px solid var(--line);
  background: var(--white);
}

.dialog-delete {
  border: 1px solid var(--coral-deep);
  background: var(--coral-deep);
  color: var(--white);
}

.dialog-delete:hover {
  background: #cf4942;
}

.dialog-delete:disabled {
  cursor: wait;
  opacity: 0.55;
}

/* Memory and relationship */

.continuity-body {
  min-height: 100%;
  height: auto;
  overflow: auto;
  background: #e9ecf4;
}

.continuity-page {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 70px;
}

.continuity-header {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  align-items: start;
  gap: 25px;
  padding: 20px 0 46px;
}

.continuity-header > div .eyebrow,
.memory-heading .eyebrow,
.relationship-panel > header .eyebrow {
  margin: 4px 0 13px;
  color: var(--coral-deep);
  font-size: 8px;
}

.continuity-header h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 67px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1;
}

.continuity-header > div > p:last-child {
  max-width: 540px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.add-memory-button {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 12px 15px;
  border: 0;
  border-radius: 11px;
  background: var(--coral);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.add-memory-button span {
  font-size: 17px;
}

.relationship-panel {
  overflow: hidden;
  border-radius: 3px 22px 22px 22px;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 20px 50px rgba(16, 24, 45, 0.17);
}

.relationship-panel > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 29px 35px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.relationship-panel > header h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 35px;
  font-weight: 500;
}

.relationship-panel > header > p {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.relationship-panel > header > p span {
  color: var(--coral);
}

.relationship-content {
  display: grid;
  grid-template-columns: 0.85fr 1.2fr 1fr;
  gap: 35px;
  padding: 31px 35px 35px;
}

.relationship-meters {
  display: grid;
  gap: 18px;
}

.relationship-meter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 10px;
}

.relationship-meter > div {
  grid-column: 1 / -1;
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.relationship-meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transition: width 500ms ease;
}

.relationship-meter output {
  color: rgba(255, 255, 255, 0.38);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
}

.open-threads label {
  display: block;
  margin-bottom: 9px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 10px;
}

.open-threads textarea {
  width: 100%;
  padding: 11px 12px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  outline: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  font-size: 11px;
  line-height: 1.5;
}

.open-threads textarea::placeholder {
  color: rgba(255, 255, 255, 0.27);
}

.open-threads button {
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 9px;
}

.milestone-list {
  position: relative;
  display: grid;
  gap: 14px;
}

.milestone-list::before {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 4px;
  width: 1px;
  background: rgba(255, 255, 255, 0.13);
  content: "";
}

.milestone-list article {
  position: relative;
  display: flex;
  gap: 12px;
}

.milestone-list article i {
  z-index: 1;
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 3px;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--coral);
}

.milestone-list h3 {
  margin: 0 0 3px;
  font-size: 10px;
  font-weight: 600;
}

.milestone-list p {
  margin: 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 9px;
  line-height: 1.45;
}

.empty-copy {
  color: rgba(255, 255, 255, 0.35);
  font-size: 10px;
}

.memory-section {
  margin-top: 55px;
}

.memory-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
}

.memory-heading h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.memory-heading > p {
  margin: 0 0 5px;
  color: var(--ink-soft);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.memory-card,
.memory-empty {
  min-height: 165px;
  padding: 21px;
  border: 1px solid #dfe2ea;
  border-radius: 3px 16px 16px 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(23, 31, 54, 0.06);
}

.memory-card.pinned {
  border-color: rgba(255, 119, 109, 0.45);
}

.memory-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.memory-card header > span {
  color: var(--coral-deep);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.memory-card header div {
  display: flex;
  gap: 2px;
}

.memory-card header button {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8a91a2;
  cursor: pointer;
  font-size: 14px;
}

.memory-card header button:hover {
  background: #f0f2f7;
  color: var(--coral-deep);
}

.memory-card > p {
  margin: 22px 0 0;
  color: #3f485e;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.42;
}

.memory-empty {
  grid-column: 1 / -1;
  display: grid;
  min-height: 210px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.memory-empty > span {
  color: var(--coral);
  font-size: 27px;
}

.memory-empty h3 {
  margin: 8px 0 6px;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 23px;
  font-weight: 500;
}

.memory-empty p {
  max-width: 430px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.memory-dialog {
  width: min(500px, calc(100% - 30px));
  padding: 0;
  border: 0;
  border-radius: 3px 20px 20px 20px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(9, 14, 28, 0.3);
}

.memory-dialog::backdrop {
  background: rgba(10, 15, 28, 0.56);
  backdrop-filter: blur(3px);
}

.memory-dialog form {
  padding: 34px;
}

.memory-dialog .eyebrow {
  margin: 0 0 9px;
  color: var(--coral-deep);
  font-size: 8px;
}

.memory-dialog h2 {
  margin: 0 0 24px;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 29px;
  font-weight: 500;
}

.memory-dialog label > span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 10px;
}

.memory-dialog textarea,
.memory-dialog select {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
}

.memory-form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 20px;
  margin-top: 16px;
}

.memory-form-row select {
  height: 40px;
}

.memory-form-row .pin-check {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
}

.memory-form-row .pin-check span {
  margin: 0;
}

.memory-error {
  min-height: 16px;
  margin: 10px 0 0;
  color: var(--coral-deep);
  font-size: 10px;
}

.memory-save {
  color: var(--white);
}

/* Guided companion setup */

.wizard-body {
  overflow: auto;
  background: var(--paper);
}

.wizard-shell {
  display: grid;
  grid-template-columns: minmax(300px, 38%) minmax(0, 1fr);
  min-height: 100dvh;
}

.wizard-aside {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: clamp(28px, 5vw, 58px);
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 119, 109, 0.13), transparent 36%),
    var(--navy);
  color: var(--white);
}

.wizard-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--white);
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 18px;
  text-decoration: none;
}

.wizard-brand span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50% 47% 53% 46%;
  background: var(--coral);
  color: var(--navy);
}

.wizard-portrait {
  position: relative;
  display: grid;
  width: clamp(145px, 18vw, 230px);
  aspect-ratio: 1;
  margin: auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 48% 52% 46% 54%;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: clamp(60px, 10vw, 105px);
}

.wizard-portrait::before {
  position: absolute;
  inset: 15%;
  border: 1px solid rgba(255, 119, 109, 0.5);
  border-radius: 53% 47% 52% 48%;
  content: "";
  transform: rotate(8deg);
}

.wizard-portrait span {
  position: relative;
  z-index: 1;
}

.wizard-portrait i {
  position: absolute;
  top: 13%;
  right: 12%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--coral);
}

.wizard-aside blockquote {
  max-width: 380px;
  margin: 0 auto 35px;
  color: rgba(255, 255, 255, 0.75);
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: clamp(18px, 2vw, 25px);
  line-height: 1.35;
  text-align: center;
}

.wizard-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

.wizard-progress li {
  position: relative;
  padding-top: 13px;
  color: rgba(255, 255, 255, 0.3);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 7px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.wizard-progress li::before {
  position: absolute;
  top: 0;
  right: 4px;
  left: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  content: "";
}

.wizard-progress li.active,
.wizard-progress li.complete {
  color: rgba(255, 255, 255, 0.8);
}

.wizard-progress li.active::before,
.wizard-progress li.complete::before {
  background: var(--coral);
}

.wizard-main {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 50px clamp(28px, 7vw, 100px);
}

.wizard-main form {
  width: min(670px, 100%);
}

.wizard-step {
  display: none;
  animation: message-in 240ms ease-out;
}

.wizard-step.active {
  display: block;
}

.wizard-step > .eyebrow {
  margin: 0 0 13px;
  color: var(--coral-deep);
  font-size: 8px;
}

.wizard-step h1 {
  max-width: 650px;
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: clamp(39px, 5vw, 60px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.02;
}

.step-intro {
  max-width: 530px;
  margin: 17px 0 34px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.wizard-fields {
  display: grid;
  gap: 19px;
}

.wizard-fields.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wizard-fields label:first-child:last-child,
.wizard-fields.two-column label:nth-child(3) {
  grid-column: 1 / -1;
}

.wizard-fields label > span,
.wizard-textarea > span,
.wizard-traits label > span {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #4e566c;
  font-size: 10px;
  font-weight: 600;
}

.wizard-fields input,
.wizard-fields textarea,
.wizard-fields select,
.wizard-textarea textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d6dae4;
  border-radius: 10px;
  outline: 0;
  background: var(--white);
}

.wizard-fields input,
.wizard-fields select {
  height: 44px;
}

.wizard-fields textarea,
.wizard-textarea textarea {
  resize: vertical;
  line-height: 1.5;
}

.wizard-fields input:focus,
.wizard-fields textarea:focus,
.wizard-fields select:focus,
.wizard-textarea textarea:focus {
  border-color: #9ca8bf;
  box-shadow: 0 0 0 3px rgba(115, 143, 195, 0.13);
}

.wizard-fields small {
  display: block;
  margin-top: 6px;
  color: #969cac;
  font-size: 8px;
}

.relationship-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 25px;
}

.relationship-choices label {
  cursor: pointer;
}

.relationship-choices input {
  position: absolute;
  opacity: 0;
}

.relationship-choices label > span {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid #dfe2ea;
  border-radius: 3px 12px 12px 12px;
  background: var(--white);
  transition: border-color 150ms ease, background 150ms ease;
}

.relationship-choices input:checked + span {
  border-color: var(--coral);
  background: #fff7f6;
}

.relationship-choices b {
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 17px;
  font-weight: 500;
}

.relationship-choices small {
  color: var(--ink-soft);
  font-size: 9px;
}

.wizard-textarea {
  display: block;
}

.preset-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 31px;
}

.preset-choices button {
  padding: 9px 13px;
  border: 1px solid #d9dce5;
  border-radius: 99px;
  background: var(--white);
  cursor: pointer;
  font-size: 10px;
}

.preset-choices button.active {
  border-color: var(--coral);
  background: #fff4f3;
  color: var(--coral-deep);
}

.wizard-traits {
  display: grid;
  gap: 22px;
  margin-bottom: 30px;
}

.wizard-traits input {
  width: 100%;
  height: 3px;
  appearance: none;
  background:
    linear-gradient(
      90deg,
      var(--coral) var(--range-progress),
      #dfe2ea var(--range-progress)
    );
}

.wizard-traits input::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  appearance: none;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 1px 5px rgba(16, 24, 45, 0.25);
}

.wizard-traits output {
  color: var(--coral-deep);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
}

.wizard-fields.compact label:nth-child(3) {
  grid-column: auto;
}

.wizard-error {
  min-height: 19px;
  margin: 20px 0 0;
  color: var(--coral-deep);
  font-size: 10px;
}

.wizard-actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-top: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.wizard-actions > span {
  color: #9299aa;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.wizard-back,
.wizard-next {
  width: fit-content;
  padding: 11px 14px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 11px;
}

.wizard-back {
  border: 1px solid var(--line);
  background: transparent;
}

.wizard-next {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 24px;
  border: 0;
  background: var(--coral);
  font-weight: 600;
}

.wizard-next svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

@media (max-width: 760px) {
  .shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(310px, 86vw);
    transform: translateX(-101%);
    transition: transform 220ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .scrim {
    position: fixed;
    z-index: 10;
    inset: 0;
    display: block;
    visibility: hidden;
    background: rgba(10, 15, 28, 0.42);
    opacity: 0;
    transition: opacity 220ms ease, visibility 220ms ease;
  }

  .scrim.open {
    visibility: visible;
    opacity: 1;
  }

  .chat {
    height: 100dvh;
  }

  .chat::before {
    left: 22px;
  }

  .chat-header {
    min-height: 76px;
    padding: 14px 18px;
  }

  .menu-button {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-right: 13px;
    padding: 8px 5px;
    border: 0;
    background: transparent;
  }

  .menu-button span {
    width: 20px;
    height: 1px;
    background: var(--ink);
  }

  .companion p {
    display: none;
  }

  .model-tag {
    display: none;
  }

  .secret-chat-button {
    width: 40px;
    height: 40px;
    padding: 0;
  }

  .secret-chat-button svg {
    display: block;
  }

  .messages {
    padding: 28px 18px 22px 34px;
  }

  .message-bubble {
    max-width: 88%;
  }

  .message-stack {
    max-width: 88%;
  }

  .message-actions {
    opacity: 0.72;
  }

  .composer {
    margin: 0 14px 14px 28px;
  }

  .error-banner {
    margin: 0 14px 10px 28px;
  }

  .settings-page {
    width: min(100% - 28px, 620px);
    padding-top: 20px;
  }

  .settings-header {
    display: block;
    min-height: 0;
    padding-bottom: 30px;
  }

  .settings-title {
    margin-top: 34px;
  }

  .settings-title h1 {
    font-size: 45px;
  }

  .folio-mark {
    position: absolute;
    top: 8px;
    right: 0;
  }

  .folio-mark span {
    width: 37px;
    height: 37px;
    font-size: 21px;
  }

  .settings-form {
    display: block;
  }

  .profile-sheet {
    padding: 27px 24px 28px 32px;
  }

  .user-sheet {
    margin: 14px 0 0;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .compact-field {
    max-width: none;
  }

  .settings-actions {
    margin-top: 14px;
    padding: 18px;
  }

  .settings-actions span {
    display: none;
  }

  .continuity-page {
    width: calc(100% - 28px);
    padding-top: 20px;
  }

  .continuity-header {
    display: block;
  }

  .continuity-header > div {
    margin-top: 32px;
  }

  .add-memory-button {
    margin-top: 22px;
  }

  .relationship-panel > header {
    padding: 24px;
  }

  .relationship-content {
    grid-template-columns: 1fr;
    padding: 25px;
  }

  .memory-grid {
    grid-template-columns: 1fr;
  }

  .wizard-shell {
    display: block;
  }

  .wizard-aside {
    position: relative;
    height: auto;
    min-height: 230px;
    padding: 24px;
  }

  .wizard-portrait {
    width: 88px;
    margin: 24px auto 18px;
    font-size: 43px;
  }

  .wizard-aside blockquote {
    display: none;
  }

  .wizard-progress {
    margin-top: auto;
  }

  .wizard-main {
    padding: 38px 22px;
  }

  .wizard-fields.two-column,
  .relationship-choices {
    grid-template-columns: 1fr;
  }

  .wizard-fields.two-column label:nth-child(3) {
    grid-column: auto;
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f3edf7;
  --ink-soft: #ad9fb8;
  --paper: #100918;
  --sky: #3a294c;
  --line: #3a2b45;
  --shadow: 0 22px 54px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] body {
  background: #0d0813;
}

html[data-theme="dark"] .shell {
  background: #100918;
}

html[data-theme="dark"] .chat {
  background:
    linear-gradient(rgba(16, 9, 24, 0.93), rgba(16, 9, 24, 0.93)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 79px,
      rgba(240, 137, 163, 0.075) 80px
    );
}

html[data-theme="dark"] .chat::before {
  background: rgba(240, 137, 163, 0.24);
}

html[data-theme="dark"] .chat-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: rgba(19, 11, 29, 0.86);
}

html[data-theme="dark"] .presence {
  border-color: #100918;
}

html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .secret-chat-button,
html[data-theme="dark"] .chat-options-button {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.055);
  color: #bdaec7;
}

html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .secret-chat-button:hover,
html[data-theme="dark"] .chat-options-button:hover {
  border-color: rgba(240, 137, 163, 0.42);
  color: #f3a0b5;
}

html[data-theme="dark"] .theme-moon { display: none; }
html[data-theme="dark"] .theme-sun { display: block; }

html[data-theme="dark"] .secret-chat-button.active {
  border-color: rgba(240, 137, 163, 0.42);
  background: rgba(117, 48, 73, 0.42);
  color: #ffc0d0;
}

html[data-theme="dark"] .secret-chat-coachmark {
  border-color: rgba(240, 137, 163, 0.3);
  background: rgba(39, 21, 33, 0.98);
  color: #ffe8ef;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .secret-chat-coachmark::before {
  border-color: rgba(240, 137, 163, 0.3);
  background: rgba(39, 21, 33, 0.98);
}

html[data-theme="dark"] .secret-chat-coachmark span {
  color: #dbbac4;
}

html[data-theme="dark"] .secret-chat-coachmark-close {
  color: #d7aeba;
}

html[data-theme="dark"] .secret-mode-notice,
html[data-theme="dark"] .guest-banner {
  border-color: rgba(240, 137, 163, 0.25);
  background: #271521;
  color: #f2cad4;
}
html[data-theme="dark"] .guest-account-nudge {
  border-color:rgba(240,137,163,.26);
  background:rgba(35,20,32,.97);
  box-shadow:0 20px 55px rgba(0,0,0,.38);
}
html[data-theme="dark"] .guest-nudge-mark {
  border-color:rgba(240,137,163,.35);
  background:#321b2a;
  color:#f3a0b6;
}
html[data-theme="dark"] .guest-account-nudge strong { color:#fff4f7; }
html[data-theme="dark"] .guest-account-nudge span,
html[data-theme="dark"] .guest-nudge-dismiss { color:#c6aeb8; }
html[data-theme="dark"] .guest-nudge-action {
  background:var(--coral);
  color:var(--navy);
}
html[data-theme="dark"] .install-nudge {
  border-color:rgba(240,137,163,.24);
  background:
    linear-gradient(105deg,rgba(57,27,43,.96),rgba(29,24,38,.98) 58%);
  box-shadow:0 10px 30px rgba(0,0,0,.28);
}
html[data-theme="dark"] .install-nudge-mark {
  background:var(--coral);
  color:var(--navy);
}
html[data-theme="dark"] .install-nudge-copy strong { color:#fff4f7; }
html[data-theme="dark"] .install-nudge-copy span,
html[data-theme="dark"] #install-nudge-dismiss { color:#c6aeb8; }
html[data-theme="dark"] #install-nudge-dismiss:hover {
  background:rgba(255,255,255,.07);
}
html[data-theme="dark"] #install-nudge-action {
  background:#fff4f7;
  color:var(--navy);
}
html[data-theme="dark"] #notification-nudge-action {
  background:#fff4f7;
  color:var(--navy);
}
html[data-theme="dark"] #notification-nudge-dismiss {
  color:#c6aeb8;
}

@media(max-width:650px) {
  .guest-account-nudge {
    right:10px;
    bottom:92px;
    grid-template-columns:46px minmax(0,1fr);
    width:calc(100% - 20px);
    gap:11px;
    padding:14px 36px 14px 14px;
    border-radius:15px;
  }
  .guest-nudge-mark { min-height:45px;padding:5px; }
  .guest-account-nudge strong { font-size:14px; }
  .guest-account-nudge span { font-size:11px; }
  .guest-nudge-action {
    grid-column:1/-1;
    width:100%;
    min-height:40px;
  }
  .install-nudge {
    grid-template-columns:39px minmax(0,1fr);
    gap:10px;
    margin:0 14px 8px;
    padding:10px;
    border-radius:14px;
  }
  .install-nudge-mark {
    width:39px;
    height:39px;
    border-radius:11px 11px 11px 4px;
  }
  .install-nudge-copy strong { font-size:12px; }
  .install-nudge-copy span { font-size:10px; }
  .install-nudge-actions {
    grid-column:1/-1;
    display:grid;
    grid-template-columns:1fr 1.35fr;
  }
  .install-nudge-actions button { min-height:38px; }
}

@media(prefers-reduced-motion:reduce) {
  .guest-account-nudge,
  .install-nudge { animation:none; }
}

html[data-theme="dark"] .chat.secret-mode .chat-header {
  background: linear-gradient(
    90deg,
    rgba(46, 22, 34, 0.94),
    rgba(20, 12, 29, 0.96)
  );
}

html[data-theme="dark"] .thread-orbit {
  border-color: rgba(255, 255, 255, 0.16);
}

html[data-theme="dark"] .message-bubble {
  background: #24172f;
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .message-row.user .message-bubble {
  background: linear-gradient(145deg, #593049, #41263f);
  color: #fff9fc;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}
html[data-theme="dark"] .assistant-voice-toggle {
  border-color: rgba(240, 149, 173, 0.2);
  background: rgba(36, 23, 47, 0.88);
}
html[data-theme="dark"] .assistant-voice-toggle:hover {
  border-color: rgba(240, 149, 173, 0.42);
  background: #2d1c39;
}
html[data-theme="dark"] .assistant-voice-icon {
  background: #6e3857;
}
html[data-theme="dark"] .email-continuation-offer {
  border-color:rgba(240,149,173,.2);
  background:linear-gradient(135deg,#25172d,#1b1225);
  box-shadow:0 16px 42px rgba(0,0,0,.24);
}
html[data-theme="dark"] .email-continuation-offer input {
  border-color:rgba(255,255,255,.13);
  background:#140d1b;
}
html[data-theme="dark"] .email-continuation-offer button {
  color:#170f28;
  background:var(--blush);
}
html[data-theme="dark"] .email-continuation-offer .email-offer-dismiss {
  color:var(--ink-soft);
  background:transparent;
}

html[data-theme="dark"] .message-action {
  color: #8f809a;
}

html[data-theme="dark"] .message-action:hover,
html[data-theme="dark"] .message-action.active {
  background: rgba(255, 255, 255, 0.07);
  color: #f3a0b5;
}

html[data-theme="dark"] .message-bubble.markdown code {
  background: #16101f;
  color: #ffc0d0;
}

html[data-theme="dark"] .message-bubble.markdown a {
  color: #b7c9ff;
}

html[data-theme="dark"] .jump-latest {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(36, 23, 47, 0.96);
  color: #f5edf8;
}

html[data-theme="dark"] .composer {
  border-color: #46354f;
  background: #20142b;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .composer:focus-within {
  border-color: #8d657f;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.3),
    0 0 0 3px rgba(240, 137, 163, 0.08);
}

html[data-theme="dark"] .composer textarea {
  color: #f3edf7;
}

html[data-theme="dark"] .composer textarea::placeholder {
  color: #887a91;
}

html[data-theme="dark"] .attach-button {
  color: #a495ae;
}

html[data-theme="dark"] .voice-button {
  color:#b7adc3;
}
html[data-theme="dark"] .voice-button:hover,
html[data-theme="dark"] .voice-button.recording {
  background:#30203b;
  color:#ff9ba5;
}
html[data-theme="dark"] .voice-recording-status {
  background:#321e2b;
  color:#ffb3ba;
}
html[data-theme="dark"] .voice-recording-status button {
  color:#ffb3ba;
}

html[data-theme="dark"] .attach-button:hover {
  border-color: rgba(240, 137, 163, 0.2);
  background: rgba(240, 137, 163, 0.08);
  color: #f3a0b5;
}

html[data-theme="dark"] .composer-attachment {
  border-color: #403247;
  background: #191020;
}

html[data-theme="dark"] .composer-attachment button:hover {
  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .error-banner {
  border-color: rgba(240, 137, 163, 0.26);
  background: #351924;
  color: #ffc0d0;
}

/* Global user-media desk */
.admin-media-body {
  min-width: 0;
  overflow-x: hidden;
}

.admin-media-page {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 30px clamp(18px, 4vw, 56px) 56px;
  box-sizing: border-box;
}

.admin-media-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: end;
  margin-bottom: 24px;
}

.admin-media-header h1 {
  margin: 5px 0 8px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: .92;
  letter-spacing: -.055em;
}

.admin-media-header > div:first-child > p:last-child {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
}

.admin-media-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  margin-bottom: 24px;
}

.admin-media-nav a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.admin-media-nav a:hover { color: var(--ink); }

.admin-media-total {
  min-width: 146px;
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.admin-media-total strong,
.admin-media-total span,
.admin-media-total small {
  display: block;
}

.admin-media-total strong {
  font-size: 34px;
  line-height: 1;
}

.admin-media-total span {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.admin-media-total small {
  margin-top: 8px;
  color: var(--muted);
}

.admin-media-toolbar {
  position: sticky;
  top: 10px;
  z-index: 5;
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 22px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--white) 92%, transparent);
  box-shadow: 0 12px 36px rgba(18, 12, 34, .09);
  backdrop-filter: blur(14px);
}

.admin-media-types {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.admin-media-types::-webkit-scrollbar { display: none; }

.admin-media-types button {
  flex: 0 0 auto;
  padding: 10px 15px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.admin-media-types button.active {
  background: var(--ink);
  color: var(--white);
}

.admin-media-search {
  display: grid;
  gap: 5px;
  min-width: min(330px, 42vw);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.admin-media-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.admin-media-status {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.admin-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 285px), 1fr));
  gap: 18px;
}

.admin-media-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 12px 32px rgba(18, 12, 34, .08);
}

.admin-media-image {
  position: relative;
  display: block;
  width: 100%;
  height: 248px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #171124;
  cursor: zoom-in;
}

.admin-media-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 220ms ease;
}

.admin-media-image:hover img { transform: scale(1.025); }

.admin-media-image span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(15, 9, 26, .76);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.admin-media-voice {
  display: grid;
  align-content: center;
  min-height: 138px;
  padding: 22px;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 90% 0%, rgba(212, 109, 169, .26), transparent 42%),
    linear-gradient(145deg, #20132e, #111b34);
}

.admin-media-voice audio {
  width: 100%;
  height: 38px;
}

.admin-media-wave {
  display: flex;
  height: 38px;
  gap: 4px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.admin-media-wave i {
  width: 4px;
  height: calc(var(--wave) * 2px);
  max-height: 34px;
  border-radius: 999px;
  background: linear-gradient(#f9b9db, #9daefa);
  opacity: .88;
}

.admin-media-card-body { padding: 16px; }

.admin-media-card-heading {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.admin-media-kind {
  color: #a23f79;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.admin-media-card-heading time {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.admin-media-card h2 {
  margin: 10px 0 3px;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.admin-media-context {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-media-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.admin-media-badges span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.admin-media-caption {
  display: -webkit-box;
  min-height: 36px;
  margin: 13px 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.admin-media-caption.empty {
  color: var(--muted);
  font-style: italic;
}

.admin-media-chat-link {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}

.admin-media-chat-link:hover { color: #a23f79; }

.admin-media-empty {
  grid-column: 1 / -1;
  padding: 60px 20px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  text-align: center;
}

.admin-media-empty strong {
  display: block;
  font-size: 22px;
}

.admin-media-empty p { color: var(--muted); }

.admin-media-pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 26px;
}

.admin-media-pagination button,
.admin-media-pagination select {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
}

.admin-media-pagination label,
.admin-media-pagination span {
  color: var(--muted);
  font-size: 11px;
}

.admin-media-preview-dialog {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  color: var(--ink);
}

.admin-media-preview-dialog::backdrop {
  background: rgba(9, 6, 17, .76);
  backdrop-filter: blur(4px);
}

.admin-media-preview-dialog header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.admin-media-preview-dialog h2 { margin: 2px 0 0; }

.admin-media-preview-dialog header button {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
}

.admin-media-preview-dialog img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 110px);
  object-fit: contain;
  background: #0c0911;
}

html[data-theme="dark"] .admin-media-total,
html[data-theme="dark"] .admin-media-toolbar,
html[data-theme="dark"] .admin-media-card,
html[data-theme="dark"] .admin-media-preview-dialog,
html[data-theme="dark"] .admin-media-preview-dialog header {
  border-color:var(--line);
  background:#1b1225;
  color:var(--ink);
}
html[data-theme="dark"] .admin-media-toolbar {
  background:rgba(27,18,37,.94);
  box-shadow:0 12px 36px rgba(0,0,0,.3);
}
html[data-theme="dark"] .admin-media-search input,
html[data-theme="dark"] .admin-media-pagination button,
html[data-theme="dark"] .admin-media-pagination select {
  border-color:#463650;
  background:#21172d;
  color:var(--ink);
}
html[data-theme="dark"] .admin-media-search input::placeholder {
  color:#8f8199;
}
html[data-theme="dark"] .admin-media-types button:hover {
  background:#2a1d35;
  color:var(--ink);
}
html[data-theme="dark"] .admin-media-types button.active {
  background:var(--coral);
  color:var(--navy);
}
html[data-theme="dark"] .admin-media-kind {
  color:#f3a0c8;
}
html[data-theme="dark"] .admin-media-badges span {
  border-color:#463650;
  background:#21172d;
  color:#c9bdcf;
}
html[data-theme="dark"] .admin-media-chat-link {
  color:#f3b1c2;
}
html[data-theme="dark"] .admin-media-chat-link:hover {
  color:#ffd0dc;
}
html[data-theme="dark"] .admin-media-empty {
  border-color:#4b3a54;
  background:rgba(27,18,37,.62);
}
html[data-theme="dark"] .admin-media-preview-dialog header {
  border-bottom-color:var(--line);
  background:rgba(27,18,37,.96);
}
html[data-theme="dark"] .admin-media-preview-dialog header button {
  border-color:#463650;
  background:#21172d;
  color:var(--ink);
}
html[data-theme="dark"] .admin-media-preview-dialog header button:hover,
html[data-theme="dark"] .admin-media-pagination button:hover:not(:disabled) {
  border-color:rgba(240,137,163,.48);
  background:#2a1d35;
}
html[data-theme="dark"] .admin-media-pagination button:disabled {
  opacity:.42;
}
html[data-theme="dark"] .admin-media-search input:focus,
html[data-theme="dark"] .admin-media-pagination select:focus,
html[data-theme="dark"] .admin-media-types button:focus-visible,
html[data-theme="dark"] .admin-media-preview-dialog header button:focus-visible {
  outline:2px solid var(--coral);
  outline-offset:2px;
}

@media (max-width: 680px) {
  .admin-media-page { padding: 18px 12px 38px; }
  .admin-media-header {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .admin-media-header h1 { font-size: 46px; }
  .admin-media-total {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 7px;
    align-items: baseline;
    min-width: 0;
  }
  .admin-media-total span { margin: 0; }
  .admin-media-total small {
    margin: 0;
    text-align: right;
  }
  .admin-media-toolbar {
    top: 6px;
    display: grid;
    gap: 10px;
  }
  .admin-media-search { min-width: 0; }
  .admin-media-grid { grid-template-columns: 1fr; }
  .admin-media-image { height: min(78vw, 340px); }
  .admin-media-pagination { gap: 7px; }
}

html[data-theme="dark"] .new-thread-dialog,
html[data-theme="dark"] .delete-dialog {
  background: #1b1124;
  color: var(--ink);
}

html[data-theme="dark"] .new-thread-option {
  border-color: var(--line);
  background: #24172f;
}

html[data-theme="dark"] .new-thread-option:has(input:checked) {
  border-color: rgba(240, 137, 163, 0.55);
  background: #351d30;
}

html[data-theme="dark"] .new-thread-secret {
  border-color: rgba(216, 196, 226, 0.26);
  background: rgba(216, 196, 226, 0.06);
}

html[data-theme="dark"] .new-thread-secret:has(input:checked) {
  border-color: rgba(240, 137, 163, 0.58);
  background: #351d30;
}

html[data-theme="dark"] .new-thread-secret-lock {
  background: rgba(216, 196, 226, 0.1);
  color: var(--ink-soft);
}

html[data-theme="dark"] .dialog-cancel {
  border-color: var(--line);
  background: #24172f;
  color: var(--ink);
}

html[data-theme="dark"] .delete-dialog .dialog-mark {
  background: #351924;
}

/* Shared theme control for every route outside the chat header. */
.page-theme-toggle {
  position:fixed;
  right:max(16px,env(safe-area-inset-right));
  bottom:max(16px,env(safe-area-inset-bottom));
  z-index:1100;
  display:grid;
  width:44px;
  height:44px;
  place-items:center;
  border:1px solid rgba(23,15,40,.14);
  border-radius:50%;
  background:rgba(255,255,255,.92);
  color:var(--navy);
  box-shadow:0 12px 34px rgba(18,10,29,.18);
  cursor:pointer;
  backdrop-filter:blur(12px);
}
.page-theme-toggle:hover {
  border-color:rgba(200,82,114,.42);
  color:var(--coral-deep);
  transform:translateY(-1px);
}
.page-theme-toggle:focus-visible {
  outline:3px solid rgba(239,137,163,.5);
  outline-offset:3px;
}
.page-theme-toggle svg {
  grid-area:1/1;
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-linecap:round;
  stroke-linejoin:round;
  stroke-width:1.7;
}
.page-theme-sun { display:none; }
html[data-theme="dark"] .page-theme-toggle {
  border-color:rgba(255,255,255,.13);
  background:rgba(36,23,47,.94);
  color:#f3a0b5;
  box-shadow:0 14px 38px rgba(0,0,0,.38);
}
html[data-theme="dark"] .page-theme-moon { display:none; }
html[data-theme="dark"] .page-theme-sun { display:block; }

.admin-header-tools{display:flex;flex-wrap:wrap;align-items:end;justify-content:flex-end;gap:10px}
.admin-load-status {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin:-17px 0 24px;
  padding:13px 15px;
  border:1px solid #e6b866;
  border-radius:12px;
  background:#fff8e8;
  color:#6d4b15;
  box-shadow:0 8px 24px rgba(78,52,16,.08);
}
.admin-load-status[hidden] { display:none; }
.admin-load-status span { display:grid;gap:3px; }
.admin-load-status strong { font-size:11px; }
.admin-load-status small { color:inherit;font-size:9px;opacity:.82; }
.admin-load-status button {
  flex:none;
  min-width:76px;
  padding:9px 13px;
  border:1px solid currentColor;
  border-radius:9px;
  background:transparent;
  color:inherit;
  font-weight:700;
  cursor:pointer;
}
.admin-load-status button:disabled { cursor:wait;opacity:.65; }
html[data-theme="dark"] .admin-load-status {
  border-color:#765c32;
  background:#2c2419;
  color:#f0cf94;
}
@media(max-width:650px) {
  .admin-load-status { align-items:stretch;margin:-8px 0 18px; }
  .admin-load-status button { align-self:center; }
}
.admin-tool-link{margin-bottom:1px;padding:11px 14px;border:1px solid var(--line);border-radius:8px;background:white;color:var(--navy);font-size:11px;font-weight:700;text-decoration:none;white-space:nowrap}
.admin-tool-link:hover{border-color:var(--coral);color:var(--coral-deep)}
html[data-theme="dark"] .admin-tool-link{border-color:var(--line);background:#1b1225;color:var(--ink)}
@media(max-width:760px){
  .admin-header-tools{display:grid;align-items:stretch;margin-top:18px}
  .admin-tool-link{text-align:center}
}

/* Dark treatment for account, authentication, casting, settings, continuity,
   onboarding, administration, and their dialogs. */
html[data-theme="dark"] .portal-body,
html[data-theme="dark"] .catalog-body,
html[data-theme="dark"] .utility-body,
html[data-theme="dark"] .admin-body,
html[data-theme="dark"] .continuity-body,
html[data-theme="dark"] .wizard-body {
  background:#100918;
  color:var(--ink);
}
html[data-theme="dark"] .settings-body {
  background:
    linear-gradient(rgba(16,9,24,.94),rgba(16,9,24,.94)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 95px,
      rgba(240,137,163,.08) 96px
    );
}
html[data-theme="dark"] .portal-form,
html[data-theme="dark"] .utility-card,
html[data-theme="dark"] .profile-sheet,
html[data-theme="dark"] .memory-card,
html[data-theme="dark"] .memory-empty,
html[data-theme="dark"] .wizard-main,
html[data-theme="dark"] .admin-layout,
html[data-theme="dark"] .admin-detail,
html[data-theme="dark"] .admin-users {
  border-color:var(--line);
  background:#1b1225;
  color:var(--ink);
  box-shadow:0 18px 48px rgba(0,0,0,.22);
}
html[data-theme="dark"] .portal-form input,
html[data-theme="dark"] .stack-form input,
html[data-theme="dark"] .stack-form textarea,
html[data-theme="dark"] .admin-search input,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .wizard-fields input,
html[data-theme="dark"] .wizard-fields textarea,
html[data-theme="dark"] .wizard-fields select,
html[data-theme="dark"] .wizard-textarea textarea,
html[data-theme="dark"] .memory-dialog textarea,
html[data-theme="dark"] .memory-dialog select,
html[data-theme="dark"] .admin-memory-dialog textarea,
html[data-theme="dark"] .admin-memory-dialog input,
html[data-theme="dark"] .admin-memory-dialog select,
html[data-theme="dark"] .admin-persona-dialog textarea,
html[data-theme="dark"] .admin-persona-dialog input,
html[data-theme="dark"] .admin-persona-dialog select,
html[data-theme="dark"] .admin-global-prompt-section textarea {
  border-color:#463650;
  background:#21172d;
  color:#f3edf7;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color:#83738e;
}
html[data-theme="dark"] select { color-scheme:dark; }
html[data-theme="dark"] .guest-entry {
  border-color:#573244;
  background:#2a1724;
}
html[data-theme="dark"] .guest-action,
html[data-theme="dark"] .auth-tabs button,
html[data-theme="dark"] .quiet-action {
  color:#e9bfcb;
}
html[data-theme="dark"] .adult-check {
  border-color:var(--line);
  background:#181020;
}
html[data-theme="dark"] .catalog-page { background:#100918; }
html[data-theme="dark"] .persona-grid {
  background:#34273e;
}
html[data-theme="dark"] .persona-card {
  border-color:var(--line);
  background:#1c1326;
  color:var(--ink);
}
html[data-theme="dark"] .persona-card:hover {
  background:#281a35;
  box-shadow:0 18px 50px rgba(0,0,0,.32);
}
html[data-theme="dark"] .persona-card small,
html[data-theme="dark"] .chemistry { color:#b4a4be; }
html[data-theme="dark"] .persona-dialog,
html[data-theme="dark"] .age-dialog,
html[data-theme="dark"] .install-dialog,
html[data-theme="dark"] .memory-dialog,
html[data-theme="dark"] .admin-memory-dialog,
html[data-theme="dark"] .admin-persona-dialog,
html[data-theme="dark"] .chat-review {
  border:1px solid var(--line);
  background:#1b1124;
  color:var(--ink);
}
html[data-theme="dark"] .chat-review>#close-chat {
  border-color:#584b63;
  background:rgba(36,23,47,.94);
  color:#f3edf7;
}
html[data-theme="dark"] .install-steps li,
html[data-theme="dark"] .admin-memory-card,
html[data-theme="dark"] .admin-global-prompt-toggle {
  border-color:var(--line);
  background:#24172f;
}
html[data-theme="dark"] .privacy-note {
  border-color:#3d3954;
  background:#191a2b;
  color:#aeb6d1;
}
html[data-theme="dark"] .folio-mark span {
  border-color:var(--line);
  background:#24172f;
}
html[data-theme="dark"] .trait input[type="range"],
html[data-theme="dark"] .wizard-traits input {
  background:
    linear-gradient(
      90deg,
      var(--coral) var(--range-progress),
      #4b3b54 var(--range-progress)
    );
}
html[data-theme="dark"] .memory-card > p { color:#e5dce9; }
html[data-theme="dark"] .memory-card header button:hover {
  background:#31243a;
}
html[data-theme="dark"] .relationship-choices label > span,
html[data-theme="dark"] .preset-choices button {
  border-color:var(--line);
  background:#21172d;
}
html[data-theme="dark"] .relationship-choices input:checked + span,
html[data-theme="dark"] .preset-choices button.active {
  border-color:rgba(239,137,163,.55);
  background:#351d30;
}
html[data-theme="dark"] .wizard-actions,
html[data-theme="dark"] .sheet-heading,
html[data-theme="dark"] .trait-group {
  border-color:var(--line);
}
html[data-theme="dark"] .wizard-back {
  border-color:var(--line);
  color:var(--ink);
}
html[data-theme="dark"] .admin-analytics-section,
html[data-theme="dark"] .admin-global-prompt-section,
html[data-theme="dark"] .admin-persona-section {
  border-color:var(--line);
  background:#1b1225;
  color:var(--ink);
  box-shadow:0 16px 46px rgba(0,0,0,.2);
}
html[data-theme="dark"] .analytics-controls select,
html[data-theme="dark"] .analytics-controls button,
html[data-theme="dark"] .analytics-summary article,
html[data-theme="dark"] .analytics-funnel-panel,
html[data-theme="dark"] .analytics-breakdowns>div,
html[data-theme="dark"] .admin-global-prompt-footer button,
html[data-theme="dark"] .admin-user,
html[data-theme="dark"] .admin-user-row,
html[data-theme="dark"] .admin-pagination,
html[data-theme="dark"] .admin-pagination button,
html[data-theme="dark"] .admin-pagination select,
html[data-theme="dark"] .admin-persona-card,
html[data-theme="dark"] .admin-actions button,
html[data-theme="dark"] .admin-conversations button,
html[data-theme="dark"] .admin-memory-card header button {
  border-color:var(--line);
  background:#21172d;
  color:var(--ink);
}
html[data-theme="dark"] .admin-nickname-form {
  border-color:var(--line);
  background:#21172d;
}
html[data-theme="dark"] .admin-nickname-form input {
  border-color:var(--line);
  background:#191021;
  color:var(--ink);
}
html[data-theme="dark"] .admin-nickname-form button {
  border-color:var(--line);
  background:#191021;
  color:var(--ink);
}
html[data-theme="dark"] .admin-nickname-form .admin-nickname-save {
  border-color:var(--coral);
  background:var(--coral);
  color:#1b1225;
}
html[data-theme="dark"] .admin-nickname-edit:hover {
  border-color:rgba(255,137,128,.5);
  background:rgba(255,137,128,.12);
  color:var(--coral);
}
html[data-theme="dark"] .admin-user:hover,
html[data-theme="dark"] .admin-persona-card:hover,
html[data-theme="dark"] .admin-conversations button:hover {
  background:#2a1d35;
}
html[data-theme="dark"] .admin-conversations .user-deleted-chat {
  background:#211820;
  color:#ad9da7;
}
html[data-theme="dark"] .analytics-details>summary {
  border-color:var(--line);
  background:#21172d;
  color:var(--ink);
}
html[data-theme="dark"] .admin-nudge-panel {
  border-color:#503b5b;
  background:linear-gradient(135deg,#24182f,#21152b);
}
html[data-theme="dark"] .admin-direct-message-panel {
  border-color:#70423f;
  background:linear-gradient(135deg,#2b1b2c,#311d29);
}
html[data-theme="dark"] .admin-direct-message-panel textarea {
  border-color:var(--line);
  background:#191021;
  color:var(--ink);
}
html[data-theme="dark"] .admin-direct-message-panel .admin-direct-message-preview {
  border-color:#70423f;
  background:rgba(25,16,33,.74);
}
html[data-theme="dark"] .admin-direct-message-preview button,
html[data-theme="dark"] .admin-direct-message-actions #admin-direct-message-attach {
  border-color:var(--line)!important;
  background:#191021!important;
  color:#ffd0cc!important;
}
html[data-theme="dark"] .admin-direct-message-panel>header>span {
  color:#ffd0cc;
  background:#583431;
}
html[data-theme="dark"] .admin-direct-message-panel .admin-collapsible-badge {
  color:#ffd0cc;
  background:#583431;
}
html[data-theme="dark"] .admin-nudge-panel textarea,
html[data-theme="dark"] .admin-nudge-item button {
  border-color:var(--line);
  background:#191021;
  color:var(--ink);
}
html[data-theme="dark"] .admin-nudge-panel form {
  border-color:#503b5b;
  background:rgba(33,21,43,.97);
}
html[data-theme="dark"] .admin-nudge-panel>header>span {
  color:#e3bed2;
  background:#49334f;
}
html[data-theme="dark"] .admin-nudge-panel .admin-collapsible-badge {
  color:#e3bed2;
  background:#49334f;
}
html[data-theme="dark"] .analytics-funnel-panel .funnel-index {
  background:#21172d;
}
html[data-theme="dark"] .funnel-track {
  background:#3c3045;
}
html[data-theme="dark"] .chat-review article {
  background:#281d34;
}
html[data-theme="dark"] .admin-chat-mode-control {
  border-color:var(--line);
  background:#21172d;
}
html[data-theme="dark"] .admin-chat-mode-control button {
  border-color:var(--line);
  background:#191021;
  color:var(--ink);
}
html[data-theme="dark"] .admin-chat-mode-control button.active {
  border-color:var(--coral);
  background:var(--coral-deep);
  color:white;
}
html[data-theme="dark"] .chat-review article.user {
  background:#3a2032;
}
html[data-theme="dark"] .admin-message-markdown code {
  background:#160f1e;
  color:#ffc0d0;
}
html[data-theme="dark"] .admin-image-dialog {
  background:#120c1a;
  color:var(--ink);
}
html[data-theme="dark"] .admin-image-dialog>header {
  border-color:var(--line);
  background:rgba(27,17,36,.96);
}
html[data-theme="dark"] .admin-image-dialog>header button,
html[data-theme="dark"] .admin-image-gallery article {
  border-color:var(--line);
  background:#21172d;
  color:var(--ink);
}
html[data-theme="dark"] .admin-image-gallery article>a {
  background:#17101f;
}
html[data-theme="dark"] .admin-image-gallery p { color:var(--ink); }
html[data-theme="dark"] #temp-password {
  background:#0e0915;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Conversation style control: one warm accent, local to the active chat. */
.chat-style-control {
  display:inline-grid;
  grid-template-columns:repeat(var(--mode-count,3),minmax(0,1fr));
  gap:2px;
  margin-left:auto;
  padding:3px;
  border:1px solid rgba(24,32,57,.13);
  border-radius:20px;
  background:rgba(255,255,255,.72);
}
.chat-style-control[hidden] { display:none; }
.chat-style-control button {
  min-height:30px;
  padding:0 10px;
  border:0;
  border-radius:16px;
  background:transparent;
  color:var(--ink-soft);
  font-size:9px;
  font-weight:700;
  letter-spacing:.01em;
  cursor:pointer;
  transition:background .16s ease,color .16s ease,box-shadow .16s ease;
}
.chat-style-control button.active {
  background:#fff;
  color:var(--navy);
  box-shadow:0 2px 9px rgba(24,32,57,.1);
}
.chat-style-control button:focus-visible {
  outline:2px solid var(--coral);
  outline-offset:2px;
}
.chat-style-control button:disabled {
  cursor:wait;
  opacity:.55;
}
.chat.spicy-mode .chat-style-control {
  border-color:rgba(151,55,86,.38);
  background:rgba(151,55,86,.08);
  box-shadow:0 0 0 3px rgba(151,55,86,.05);
}
.chat.spicy-mode .chat-style-control #spicy-mode-button.active {
  background:#8f3456;
  color:#fff;
  box-shadow:0 4px 13px rgba(110,35,67,.22);
}

.spicy-consent-dialog {
  width:min(470px,calc(100% - 28px));
  padding:0;
  border:0;
  border-radius:22px 22px 22px 5px;
  background:var(--white);
  color:var(--ink);
  box-shadow:0 32px 100px rgba(20,11,28,.34);
}
.spicy-consent-dialog::backdrop {
  background:rgba(15,8,21,.64);
  backdrop-filter:blur(5px);
}
.spicy-consent-dialog form { padding:32px; }
.spicy-consent-mark {
  display:grid;
  width:45px;
  height:45px;
  margin-bottom:18px;
  place-items:center;
  border:1px solid rgba(151,55,86,.22);
  border-radius:50% 50% 50% 12px;
  background:#fff0f4;
  font-size:19px;
}
.spicy-consent-mark.verification {
  position:relative;
  border-color:rgba(143,52,86,.28);
  border-radius:50% 50% 14px 50%;
  color:#8f3456;
  transform:rotate(-4deg);
}
.spicy-consent-mark.verification::after {
  content:"♥";
  position:absolute;
  right:-5px;
  bottom:-5px;
  display:grid;
  width:18px;
  height:18px;
  place-items:center;
  border:2px solid var(--white);
  border-radius:50%;
  background:#8f3456;
  color:#fff;
  font-size:8px;
  transform:rotate(4deg);
}
.spicy-consent-dialog h2 {
  margin:5px 0 12px;
  font:500 30px "Iowan Old Style","Baskerville","Times New Roman",serif;
}
.spicy-consent-dialog form>p:not(.eyebrow) {
  margin:0 0 20px;
  color:var(--ink-soft);
  font-size:13px;
  line-height:1.65;
}
.spicy-consent-dialog .spicy-email-address {
  margin:-6px 0 17px;
  padding:10px 12px;
  border:1px solid rgba(151,55,86,.16);
  border-radius:10px;
  background:#fff8fa;
  color:#6e2d4a;
  font:600 11px "Cascadia Mono","SFMono-Regular",monospace;
  overflow-wrap:anywhere;
}
.spicy-adult-check {
  display:flex;
  align-items:flex-start;
  gap:11px;
  padding:14px;
  border:1px solid rgba(151,55,86,.2);
  border-radius:12px;
  background:#fff7f9;
  font-size:12px;
  font-weight:650;
  line-height:1.45;
}
.spicy-adult-check input { margin-top:2px;accent-color:#8f3456; }
.spicy-consent-dialog form>small {
  display:block;
  margin:11px 2px 22px;
  color:var(--ink-soft);
  font-size:9px;
  line-height:1.5;
}
.spicy-dialog-status {
  min-height:18px;
  margin:-11px 2px 8px !important;
  color:#8f3456 !important;
  font-size:10px !important;
  font-weight:650;
}
.spicy-confirm-action {
  padding:11px 15px;
  border:1px solid #8f3456;
  border-radius:9px;
  background:#8f3456;
  color:#fff;
  font-weight:750;
  cursor:pointer;
}
.spicy-confirm-action:disabled { cursor:wait;opacity:.58; }
.spicy-change-email {
  display:block;
  margin:15px auto -5px;
  padding:6px;
  border:0;
  background:transparent;
  color:var(--coral-deep);
  font-size:10px;
  font-weight:650;
  cursor:pointer;
}
.spicy-change-email:hover { text-decoration:underline; }

.admin-mode-prompt-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin-bottom:17px;
}
.admin-mode-prompt-grid>label {
  display:grid;
  gap:8px;
  padding:15px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fafbfe;
}
.admin-mode-prompt-grid label>span { display:grid;gap:3px; }
.admin-mode-prompt-grid label>span small,
.admin-mode-prompt-grid label>small {
  color:var(--ink-soft);
  font-size:10px;
  font-weight:400;
}
.admin-mode-prompt-grid .spicy-prompt-editor {
  border-color:rgba(143,52,86,.24);
  background:#fff8fa;
}

html[data-theme="dark"] .chat-style-control {
  border-color:rgba(255,255,255,.11);
  background:rgba(255,255,255,.05);
}
html[data-theme="dark"] .chat-style-control button.active {
  background:#30223a;
  color:#fff;
}
html[data-theme="dark"] .chat.spicy-mode .chat-style-control {
  border-color:rgba(240,137,163,.34);
  background:rgba(117,48,73,.24);
}
html[data-theme="dark"] .spicy-consent-dialog,
html[data-theme="dark"] .admin-mode-prompt-grid>label {
  border-color:var(--line);
  background:#21172d;
  color:var(--ink);
}
html[data-theme="dark"] .spicy-adult-check,
html[data-theme="dark"] .admin-mode-prompt-grid .spicy-prompt-editor {
  border-color:rgba(240,137,163,.24);
  background:#2a1826;
}
html[data-theme="dark"] .spicy-consent-dialog .spicy-email-address {
  border-color:rgba(240,137,163,.2);
  background:#2a1826;
  color:#f0a3b8;
}
html[data-theme="dark"] .email-verification-badge {
  border-color:rgba(240,137,163,.24);
  background:#2a1826;
  color:#f0a3b8;
}
html[data-theme="dark"] .email-verification-badge.verified {
  border-color:rgba(104,194,148,.24);
  background:#172820;
  color:#8dd8ad;
}

@media(max-width:700px) {
  .chat-header {
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
  }
  .chat-header .menu-button {
    grid-column:1;
    grid-row:1;
  }
  .chat-header .companion {
    grid-column:2;
    grid-row:1;
    min-width:0;
  }
  .chat-header .companion>div:last-child {
    min-width:0;
  }
  .chat-header .companion h2 {
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .chat-header .chat-utility-controls {
    grid-column:3;
    grid-row:1;
    margin-left:8px;
  }
  .secret-chat-coachmark {
    right:12px;
  }
  .chat-style-control {
    grid-column:1 / -1;
    grid-row:2;
    width:100%;
    margin:9px 0 0;
  }
  .chat-style-control button { min-height:32px; }
  .admin-mode-prompt-grid { grid-template-columns:1fr; }
  .spicy-consent-dialog form { padding:25px; }
}

.admin-mode-change {
  display:grid;
  grid-template-columns:12px auto auto 1fr;
  align-items:center;
  gap:8px;
  margin:16px 4%;
  padding-top:12px;
  border-top:1px dashed rgba(143,52,86,.22);
  color:var(--ink-soft);
  font-size:9px;
}
.admin-mode-change::before,
.admin-mode-change::after {
  display:none;
  content:none;
}
.admin-mode-change>span {
  width:8px;
  height:8px;
  border:2px solid #fff;
  border-radius:50%;
  background:#8f3456;
  box-shadow:0 0 0 1px rgba(143,52,86,.3);
}
.admin-mode-change strong {
  color:var(--ink);
  font-size:9px;
}
.admin-mode-change b {
  padding:3px 7px;
  border-radius:10px;
  background:#fff0f4;
  color:#8f3456;
  font:700 8px "Cascadia Mono",monospace;
  white-space:nowrap;
}
.admin-mode-change time {
  justify-self:end;
  white-space:nowrap;
}
html[data-theme="dark"] .admin-mode-change>span { border-color:#17101f; }
html[data-theme="dark"] .admin-mode-change b {
  background:rgba(143,52,86,.25);
  color:#f3a0b5;
}
@media(max-width:600px) {
  .admin-mode-change {
    grid-template-columns:12px auto 1fr;
  }
  .admin-mode-change time {
    grid-column:2 / -1;
    justify-self:start;
  }
}

/* Admin user dossier */
.admin-dashboard-route .admin-layout {
  grid-template-columns:1fr;
}
.admin-dashboard-route .admin-users {
  border-right:0;
}
.admin-dashboard-route .admin-detail {
  display:none;
}
.admin-user-table-toolbar {
  display:flex;
  justify-content:flex-end;
  gap:9px;
  padding:13px 15px;
  border-bottom:1px solid var(--line);
  background:#f7f5f8;
}
.admin-user-table-toolbar label {
  display:grid;
  gap:5px;
  min-width:145px;
  color:var(--ink-soft);
  font:700 8px "Cascadia Mono",monospace;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.admin-user-table-toolbar select {
  min-height:37px;
  padding:0 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:white;
  color:var(--ink);
  font:600 10px system-ui,sans-serif;
}
.admin-user-table-wrap {
  width:100%;
  overflow-x:auto;
  scrollbar-width:thin;
}
.admin-user-table {
  width:100%;
  min-width:880px;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
  background:white;
}
.admin-user-table th {
  position:sticky;
  top:0;
  z-index:2;
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  background:var(--navy);
  color:white;
  font:700 8px "Cascadia Mono",monospace;
  letter-spacing:.08em;
  text-align:left;
  text-transform:uppercase;
}
.admin-user-table th:nth-child(1){width:24%}
.admin-user-table th:nth-child(2){width:17%}
.admin-user-table th:nth-child(3){width:15%}
.admin-user-table th:nth-child(4){width:auto}
.admin-user-table th:nth-child(5){width:62px}
.admin-user-table td {
  min-width:0;
  padding:14px;
  border-bottom:1px solid var(--line);
  background:white;
  color:var(--ink);
  vertical-align:middle;
}
.admin-user-table-row:hover td { background:#faf7fb; }
.admin-user-table-identity>a {
  display:grid;
  min-width:0;
  gap:3px;
  color:inherit;
  text-decoration:none;
}
.admin-user-table-identity>a:hover strong { color:var(--coral-deep); }
.admin-user-table-identity>a:focus-visible {
  outline:2px solid var(--coral);
  outline-offset:3px;
  border-radius:3px;
}
.admin-user-table-identity strong,
.admin-user-latest strong,
.admin-user-relationships strong {
  overflow:hidden;
  font-size:11px;
  line-height:1.35;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.admin-user-table-identity small,
.admin-user-relationships small,
.admin-user-latest time {
  overflow:hidden;
  color:var(--ink-soft);
  font-size:9px;
  line-height:1.4;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.admin-user-table-identity>span {
  display:block;
  margin-top:6px;
  color:var(--ink-soft);
  font:8px "Cascadia Mono",monospace;
}
.admin-user-badges { display:flex;flex-wrap:wrap;gap:5px; }
.admin-user-badge {
  display:inline-flex;
  max-width:100%;
  padding:5px 7px;
  border-radius:999px;
  background:#ece9ef;
  color:#655b6c;
  font:700 8px "Cascadia Mono",monospace;
  white-space:nowrap;
}
.admin-user-badge.registered { background:#e5e9f8;color:#4d5f93; }
.admin-user-badge.guest { background:#f1ecf5;color:#725b82; }
.admin-user-badge.expired { background:#ececef;color:#74727a; }
.admin-user-badge.admin { background:#eee2f5;color:#704488; }
.admin-user-badge.banned { background:#ffe2df;color:#a5413a; }
.admin-user-badge.verified { background:#dff6eb;color:#277a57; }
.admin-user-badge.unverified { background:#fff0d8;color:#8b6223; }
.admin-user-relationships,.admin-user-latest { line-height:1.35; }
.admin-user-relationships strong,.admin-user-relationships small,
.admin-user-latest strong,.admin-user-latest time { display:block; }
.admin-user-relationships small,.admin-user-latest time { margin-top:4px; }
.admin-user-table-action { text-align:center; }
.admin-user-table .admin-view-latest {
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  margin:0 auto;
  padding:0;
  border:1px solid var(--line);
  border-radius:50%;
  background:white;
  color:var(--coral-deep);
}
.admin-user-table .admin-view-latest svg {
  width:17px;
  height:17px;
  fill:none;
  stroke:currentColor;
  stroke-linecap:round;
  stroke-linejoin:round;
  stroke-width:1.7;
}
.admin-user-table .admin-view-latest:hover:not(:disabled) {
  border-color:var(--coral);
  background:#fff6f8;
  color:var(--coral-deep);
}
.admin-user-table .admin-view-latest:focus-visible,
.admin-user-table-toolbar select:focus {
  outline:2px solid var(--coral);
  outline-offset:2px;
}
.admin-user-table .admin-view-latest.loading svg {
  animation:admin-chat-button-pulse .75s ease-in-out infinite alternate;
}
@keyframes admin-chat-button-pulse { to { transform:scale(.78);opacity:.48 } }
html[data-theme="dark"] .admin-user-table-toolbar {
  border-color:var(--line);
  background:#170f20;
}
html[data-theme="dark"] .admin-user-table-toolbar select,
html[data-theme="dark"] .admin-user-table,
html[data-theme="dark"] .admin-user-table td,
html[data-theme="dark"] .admin-user-table .admin-view-latest {
  border-color:var(--line);
  background:#21172d;
  color:var(--ink);
}
html[data-theme="dark"] .admin-user-table-row:hover td { background:#2a1d35; }
html[data-theme="dark"] .admin-user-table .admin-view-latest {
  color:var(--coral);
}
@media(max-width:700px) {
  .admin-user-table-toolbar {
    display:grid;
    grid-template-columns:1fr 1fr;
    padding:10px;
  }
  .admin-user-table-toolbar label { min-width:0; }
  .admin-user-table { min-width:780px; }
  .admin-user-table th:first-child,
  .admin-user-table td:first-child {
    position:sticky;
    left:0;
    z-index:1;
    box-shadow:7px 0 12px -12px rgba(23,15,40,.7);
  }
  .admin-user-table th:first-child { z-index:3; }
  .admin-user-table th:nth-child(1){width:190px}
  .admin-user-table th:nth-child(2){width:145px}
  .admin-user-table th:nth-child(3){width:125px}
  .admin-user-table th:nth-child(4){width:250px}
}
@media(prefers-reduced-motion:reduce) {
  .admin-user-table .admin-view-latest.loading svg { animation:none; }
}
.admin-user-route .admin-page {
  max-width:1180px;
  margin-inline:auto;
}
.admin-user-route .admin-header-tools,
.admin-user-route .admin-analytics-section,
.admin-user-route .admin-global-prompt-section,
.admin-user-route .admin-mode-prompts-section,
.admin-user-route .admin-persona-section,
.admin-user-route .admin-users {
  display:none;
}
.admin-user-route .admin-layout {
  display:block;
  min-height:0;
  border:0;
  background:transparent;
}
.admin-user-route .admin-detail {
  display:block;
  padding:0;
  overflow:visible;
}
.admin-user-section {
  margin:22px 0;
  padding:22px;
  border:1px solid var(--line);
  border-radius:14px;
  background:white;
}
.admin-user-section>header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
}
.admin-user-section>header h3,
.admin-user-section>header p {
  margin:0;
}
.admin-user-section>header h3 {
  margin-top:3px;
  font:500 25px "Iowan Old Style",serif;
}
.admin-user-section>header>span {
  color:var(--ink-soft);
  font:10px "Cascadia Mono",monospace;
}
.admin-user-facts {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:1px;
  margin:0;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--line);
}
.admin-user-facts>div {
  min-width:0;
  padding:12px;
  background:#fafbfe;
}
.admin-user-facts dt {
  margin-bottom:5px;
  color:var(--ink-soft);
  font:8px "Cascadia Mono",monospace;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.admin-user-facts dd {
  margin:0;
  overflow-wrap:anywhere;
  font-size:12px;
  line-height:1.45;
}
.admin-user-companions,
.admin-operation-grid {
  display:grid;
  gap:10px;
}
.admin-user-companion,
.admin-operation-grid>details,
#admin-memory-details {
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fafbfe;
}
.admin-user-companion>summary,
.admin-operation-grid>details>summary,
#admin-memory-details>summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 16px;
  cursor:pointer;
  list-style:none;
}
.admin-user-companion>summary::-webkit-details-marker,
.admin-operation-grid>details>summary::-webkit-details-marker,
#admin-memory-details>summary::-webkit-details-marker {
  display:none;
}
.admin-user-companion>summary>span {
  display:flex;
  align-items:center;
  min-width:0;
  gap:11px;
}
.admin-user-companion>summary img,
.admin-user-companion>summary i {
  width:42px;
  height:42px;
  flex:0 0 42px;
  border-radius:50%;
  object-fit:cover;
}
.admin-user-companion>summary i {
  display:grid;
  place-items:center;
  background:var(--navy);
  color:white;
  font:20px "Iowan Old Style",serif;
}
.admin-user-companion>summary b {
  display:grid;
  min-width:0;
  gap:3px;
}
.admin-user-companion>summary small,
.admin-user-companion>summary em,
.admin-operation-grid summary span,
#admin-memory-details>summary span {
  color:var(--ink-soft);
  font-size:10px;
  font-style:normal;
}
.admin-user-companion-body {
  display:grid;
  gap:18px;
  padding:0 16px 16px;
}
.admin-user-narrative {
  display:grid;
  grid-template-columns:auto 1fr;
  gap:6px 14px;
}
.admin-user-narrative p {
  margin:0;
  white-space:pre-wrap;
  line-height:1.55;
}
.admin-user-traits {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px 18px;
}
.admin-user-traits>span {
  display:grid;
  grid-template-columns:130px 1fr 28px;
  align-items:center;
  gap:8px;
  font-size:10px;
}
.admin-user-traits i {
  height:6px;
  overflow:hidden;
  border-radius:6px;
  background:linear-gradient(90deg,var(--coral) var(--trait),#e5e7ed var(--trait));
}
.admin-user-traits em {
  color:var(--ink-soft);
  font-style:normal;
  text-align:right;
}
.admin-user-relationship h4 {
  margin:0 0 10px;
}
.admin-user-milestones {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}
.admin-user-milestones article {
  padding:12px;
  border:1px solid var(--line);
  border-radius:8px;
  background:white;
}
.admin-user-milestones p {
  margin:5px 0;
  line-height:1.45;
}
.admin-user-milestones time {
  color:var(--ink-soft);
  font-size:9px;
}
.admin-user-memory-section .primary-action {
  padding:9px 13px;
  border:0;
  border-radius:7px;
  background:var(--navy);
  color:white;
  cursor:pointer;
}
#admin-memory-details>.admin-memory-list {
  margin:0;
  padding:0 14px 14px;
}
.admin-user-media-summary {
  margin:-19px 0 24px;
  color:var(--ink-soft);
  font-size:10px;
}
.admin-user-section .admin-conversations button {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  align-items:center;
  gap:14px;
}
.admin-conversations time {
  color:var(--ink-soft);
  font:9px "Cascadia Mono",monospace;
  white-space:nowrap;
}
.admin-operation-grid>details>summary {
  background:#fafbfe;
}
.admin-operation-rows {
  display:grid;
  gap:8px;
  padding:0 12px 12px;
}
.admin-operation-rows>dl {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin:0;
  padding:11px;
  border:1px solid var(--line);
  border-radius:8px;
  background:white;
}
.admin-operation-rows>dl>div {
  min-width:0;
}
.admin-operation-rows dt {
  color:var(--ink-soft);
  font:8px "Cascadia Mono",monospace;
  text-transform:capitalize;
}
.admin-operation-rows dd {
  margin:3px 0 0;
  overflow-wrap:anywhere;
  font-size:10px;
}
.admin-operation-note {
  margin:0;
  padding:0 12px 12px;
  color:var(--ink-soft);
  font-size:9px;
}
.admin-chat-jump-latest {
  position:sticky;
  z-index:4;
  bottom:14px;
  left:50%;
  float:none!important;
  display:block;
  margin:-4px auto 18px;
  padding:9px 13px;
  transform:translateX(-50%);
  border:1px solid rgba(22,31,54,.18);
  border-radius:999px;
  background:var(--navy);
  box-shadow:0 8px 24px rgba(22,31,54,.2);
  color:white;
  cursor:pointer;
}
.admin-chat-jump-latest[hidden] {
  display:none;
}

html[data-theme="dark"] .admin-user-section,
html[data-theme="dark"] .admin-user-milestones article,
html[data-theme="dark"] .admin-operation-rows>dl {
  background:#211a2a;
}
html[data-theme="dark"] .admin-user-facts,
html[data-theme="dark"] .admin-user-companion,
html[data-theme="dark"] .admin-operation-grid>details,
html[data-theme="dark"] #admin-memory-details {
  background:#39303f;
}
html[data-theme="dark"] .admin-user-facts>div,
html[data-theme="dark"] .admin-operation-grid>details>summary {
  background:#292230;
}
html[data-theme="dark"] .admin-user-traits i {
  background:linear-gradient(90deg,var(--coral) var(--trait),#4a4050 var(--trait));
}
html[data-theme="dark"] .admin-chat-jump-latest {
  border-color:#665b6d;
  background:#f1d9df;
  color:#241923;
}

@media(max-width:760px) {
  .admin-user-section {
    padding:16px;
  }
  .admin-user-facts,
  .admin-operation-rows>dl {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .admin-user-traits,
  .admin-user-milestones {
    grid-template-columns:1fr;
  }
  .admin-user-section .admin-conversations button {
    grid-template-columns:1fr;
  }
  .admin-conversations time {
    white-space:normal;
  }
}
@media(max-width:480px) {
  .admin-user-facts,
  .admin-operation-rows>dl {
    grid-template-columns:1fr;
  }
  .admin-user-section>header {
    align-items:flex-start;
    flex-direction:column;
  }
  .admin-user-traits>span {
    grid-template-columns:110px 1fr 24px;
  }
}

/* Installed-PWA boyfriend check-ins */
.check-in-sheet {
  position:relative;
  overflow:hidden;
}
.check-in-sheet::after {
  content:"";
  position:absolute;
  width:180px;
  height:180px;
  right:-92px;
  bottom:-118px;
  border:1px solid rgba(151,55,86,.15);
  border-radius:50% 50% 42% 58%;
  pointer-events:none;
}
.check-in-setting {
  display:grid;
  grid-template-columns:48px minmax(0,1fr) auto;
  align-items:center;
  gap:16px;
  padding:18px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#faf9fc;
}
.check-in-mark {
  display:grid;
  width:48px;
  height:48px;
  place-items:center;
  border-radius:50% 50% 14px 50%;
  background:var(--navy);
  color:var(--coral);
  font:24px "Iowan Old Style",serif;
  transform:rotate(-4deg);
}
.check-in-setting>div:nth-child(2) {
  min-width:0;
}
.check-in-setting strong {
  display:block;
  margin-bottom:5px;
  color:var(--ink);
  font-size:14px;
}
.check-in-setting p {
  max-width:650px;
  margin:0 0 7px;
  color:var(--ink-soft);
  font-size:11px;
  line-height:1.55;
}
.check-in-setting small {
  color:var(--coral-deep);
  font-size:9px;
  font-weight:650;
}
.check-in-toggle {
  display:grid;
  grid-template-columns:42px;
  justify-items:center;
  gap:5px;
  color:var(--ink-soft);
  font-size:8px;
  cursor:pointer;
}
.check-in-toggle input {
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.check-in-toggle span {
  position:relative;
  width:42px;
  height:24px;
  border-radius:999px;
  background:#c9cbd3;
  transition:background .18s ease;
}
.check-in-toggle span::after {
  content:"";
  position:absolute;
  width:18px;
  height:18px;
  left:3px;
  top:3px;
  border-radius:50%;
  background:white;
  box-shadow:0 2px 6px rgba(22,31,54,.22);
  transition:transform .18s ease;
}
.check-in-toggle input:checked+span {
  background:var(--coral-deep);
}
.check-in-toggle input:checked+span::after {
  transform:translateX(18px);
}
.check-in-toggle input:focus-visible+span {
  outline:2px solid var(--coral-deep);
  outline-offset:3px;
}
.check-in-toggle input:disabled+span {
  opacity:.45;
}
.check-in-status {
  min-height:18px;
  margin:10px 2px 0;
  color:var(--coral-deep);
  font-size:10px;
}
html[data-theme="dark"] .check-in-setting {
  border-color:var(--line);
  background:#211a2a;
}

/* Settings, account, and per-installation Privacy Lock */
.sidebar-tools .install-app {
  min-height:54px;
  margin-bottom:7px;
  padding:10px 12px;
  border:1px solid rgba(255,119,109,.34);
  border-radius:12px;
  background:linear-gradient(135deg,rgba(255,119,109,.2),rgba(255,255,255,.05));
  color:white;
  font-size:12px;
  font-weight:700;
}
.sidebar-tools .install-app .install-seal {
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border-radius:50%;
  background:var(--coral);
  color:var(--navy);
  font:600 17px "Iowan Old Style","Baskerville",serif;
}
.utility-intro {
  max-width:500px;
  margin:-10px 0 28px;
  color:var(--ink-soft);
  line-height:1.55;
}
.preference-body { min-height:100%;height:auto;overflow:auto; }
.preference-page {
  width:min(780px,calc(100% - 32px));
  margin:auto;
  padding:42px 0 90px;
}
.preference-header { padding:10px 0 28px; }
.preference-header>.eyebrow { margin-top:42px; }
.preference-header h1 {
  margin:8px 0 14px;
  font:500 clamp(46px,8vw,74px)/.95 "Iowan Old Style","Baskerville",serif;
  letter-spacing:-.05em;
}
.preference-header>p:last-child {
  max-width:570px;
  color:var(--ink-soft);
  line-height:1.6;
}
.preference-card {
  margin-top:16px;
  padding:28px;
  border:1px solid var(--line);
  border-radius:17px;
  background:white;
  box-shadow:0 13px 38px rgba(20,29,52,.055);
}
.preference-card>header {
  display:flex;
  align-items:center;
  gap:15px;
  margin-bottom:24px;
}
.preference-card h2 {
  margin:3px 0 0;
  font:500 28px "Iowan Old Style","Baskerville",serif;
}
.preference-icon {
  display:grid;
  flex:0 0 45px;
  place-items:center;
  width:45px;
  height:45px;
  border-radius:15px;
  background:#f4eaf0;
  color:var(--coral-deep);
  font-size:20px;
}
.appearance-choice {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin:0;
  padding:0;
  border:0;
}
.appearance-choice legend {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
}
.appearance-choice label { cursor:pointer; }
.appearance-choice input { position:absolute;opacity:0; }
.appearance-choice span {
  display:grid;
  place-items:center;
  min-height:48px;
  border:1px solid var(--line);
  border-radius:10px;
  color:var(--ink-soft);
  font-size:12px;
  font-weight:700;
}
.appearance-choice input:checked+span {
  border-color:var(--coral);
  background:#fff2f1;
  color:var(--navy);
  box-shadow:inset 0 0 0 1px var(--coral);
}
.appearance-choice input:focus-visible+span {
  outline:2px solid var(--coral);
  outline-offset:2px;
}
.compact-check-in {
  grid-template-columns:minmax(0,1fr) auto;
  padding:0;
  border:0;
  background:transparent;
}
.compact-check-in>div:first-child {
  min-width:0;
  padding-right:18px;
}
.privacy-preference-card { overflow:hidden; }
.privacy-preference-card>header {
  position:relative;
  padding-bottom:22px;
  border-bottom:1px solid var(--line);
}
.privacy-status-seal {
  display:grid;
  flex:0 0 62px;
  place-items:center;
  width:62px;
  height:62px;
  border:1px solid rgba(143,52,86,.18);
  border-radius:50%;
  background:
    radial-gradient(circle at 35% 28%,#fff 0 10%,transparent 11%),
    linear-gradient(145deg,#f9e7ee,#e8d9f2);
  color:#7c3f65;
  box-shadow:0 0 0 7px rgba(143,52,86,.055);
}
.privacy-status-seal.small { width:49px;height:49px;margin-bottom:18px; }
.privacy-status-seal svg,.privacy-lock-seal svg {
  width:30px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.privacy-lock-badge {
  display:inline-flex;
  margin-top:7px;
  padding:5px 8px;
  border-radius:999px;
  background:#f1eef3;
  color:var(--ink-soft);
  font:700 9px "Cascadia Mono",monospace;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.privacy-lock-badge.enabled { background:#e6f6ed;color:#28744f; }
.privacy-install-required,.privacy-unverified {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:22px;
}
.privacy-install-required[hidden],.privacy-unverified[hidden],
.privacy-lock-controls[hidden] { display:none; }
.privacy-install-required p,.privacy-unverified p {
  max-width:470px;
  margin:0;
  color:var(--ink-soft);
  line-height:1.55;
}
.privacy-install-required .install-app { width:auto;white-space:nowrap; }
.privacy-unverified .primary-action { text-decoration:none;white-space:nowrap; }
.privacy-mode-grid { display:grid;grid-template-columns:1fr 1fr;gap:10px; }
.privacy-mode-grid article {
  display:grid;
  align-content:space-between;
  gap:20px;
  min-height:145px;
  padding:18px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fafbfe;
}
.privacy-mode-grid article>div { display:grid;gap:7px; }
.privacy-mode-grid strong { font-size:13px; }
.privacy-mode-grid span { color:var(--ink-soft);font-size:11px;line-height:1.45; }
.privacy-mode-grid button,.quiet-bordered-action {
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:8px;
  background:white;
  color:var(--navy);
  font-weight:700;
  cursor:pointer;
}
.privacy-mode-grid button:hover,.privacy-mode-grid button.active {
  border-color:var(--coral);
  color:var(--coral-deep);
}
.privacy-timing-form {
  display:grid;
  grid-template-columns:1fr 1fr auto;
  align-items:end;
  gap:10px;
  margin-top:14px;
  padding-top:18px;
  border-top:1px solid var(--line);
}
.privacy-timing-form[hidden] { display:none; }
.privacy-timing-form label,.privacy-setup-dialog label {
  display:grid;
  gap:7px;
  color:var(--ink-soft);
  font-size:10px;
  font-weight:650;
}
.privacy-timing-form input,.privacy-timing-form select,
.privacy-setup-dialog input,.privacy-setup-dialog select {
  width:100%;
  min-height:43px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:8px;
  background:white;
  color:var(--ink);
}
.danger-text-action {
  margin-top:17px;
  padding:7px 0;
  border:0;
  background:transparent;
  color:#a5413a;
  cursor:pointer;
}
.privacy-settings-status {
  min-height:18px;
  margin:10px 0 0;
  color:#357e5d;
  font-size:11px;
}
.privacy-settings-status.error { color:#a5413a; }
.boyfriend-settings-card {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:25px;
  margin-top:16px;
  padding:22px 25px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--navy);
  color:white;
  text-decoration:none;
}
.boyfriend-settings-card>span:first-child { display:grid;gap:4px; }
.boyfriend-settings-card small {
  color:var(--coral);
  font:9px "Cascadia Mono",monospace;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.boyfriend-settings-card>span:last-child {
  max-width:330px;
  color:rgba(255,255,255,.62);
  font-size:11px;
  text-align:right;
}
.account-context-link { margin:20px 0; }
.privacy-setup-dialog {
  width:min(470px,calc(100vw - 28px));
  padding:0;
  border:0;
  border-radius:19px;
  background:white;
  color:var(--ink);
  box-shadow:0 25px 90px rgba(14,18,34,.28);
}
.privacy-setup-dialog::backdrop { background:rgba(10,8,18,.72);backdrop-filter:blur(4px); }
.privacy-setup-dialog form { position:relative;display:grid;gap:16px;padding:32px; }
.privacy-setup-dialog h2 {
  margin:0;
  font:500 34px "Iowan Old Style","Baskerville",serif;
}
.privacy-setup-dialog form>p:not(.eyebrow):not(.form-error) {
  margin:-6px 0 2px;
  color:var(--ink-soft);
  line-height:1.5;
}
.privacy-pin-setup { display:grid;grid-template-columns:1fr 1fr;gap:10px; }
.privacy-pin-setup[hidden] { display:none; }
.dialog-close {
  position:absolute;
  top:18px;
  right:18px;
  width:32px;
  height:32px;
  border:1px solid var(--line);
  border-radius:50%;
  background:white;
  color:var(--ink);
  cursor:pointer;
}
.danger-action {
  padding:13px 18px;
  border:0;
  border-radius:9px;
  background:#a5413a;
  color:white;
  font-weight:700;
  cursor:pointer;
}
.privacy-lock-overlay {
  position:fixed;
  z-index:2147483647;
  inset:0;
  display:grid;
  place-items:center;
  padding:20px;
  background:
    radial-gradient(circle at 50% 25%,rgba(180,92,139,.18),transparent 35%),
    #100918;
  color:#fff8fb;
}
.privacy-lock-overlay[hidden] { display:none; }
html.privacy-lock-active,
html.privacy-screen-covered { overflow:hidden; }
.privacy-lock-card { width:min(420px,100%);text-align:center; }
.privacy-lock-seal {
  display:grid;
  place-items:center;
  width:82px;
  height:82px;
  margin:0 auto 26px;
  border:1px solid rgba(255,157,166,.3);
  border-radius:50%;
  background:rgba(255,255,255,.055);
  color:#ff9da6;
  box-shadow:0 0 0 10px rgba(255,157,166,.035);
}
.privacy-lock-seal svg { width:39px; }
.privacy-lock-card h1 {
  margin:7px 0 13px;
  font:500 clamp(41px,9vw,58px)/.95 "Iowan Old Style","Baskerville",serif;
  letter-spacing:-.045em;
}
.privacy-lock-copy { margin:0 auto 28px;color:#bfaebe;line-height:1.55; }
.privacy-pin-form { display:grid;gap:14px; }
.privacy-pin-form[hidden] { display:none; }
.privacy-pin-form>label {
  color:#cbbbc9;
  font-size:11px;
}
.privacy-pin-shell { position:relative;height:58px; }
.privacy-pin-shell input {
  position:absolute;
  z-index:2;
  inset:0;
  width:100%;
  padding:0 11px 0 27px;
  border:1px solid rgba(255,255,255,.2);
  border-radius:12px;
  outline:0;
  background:transparent;
  color:white;
  font:29px "Cascadia Mono",monospace;
  letter-spacing:28px;
}
.privacy-pin-shell input:focus { border-color:#ff9da6;box-shadow:0 0 0 3px rgba(255,157,166,.12); }
.privacy-pin-cells { position:absolute;inset:0;display:grid;grid-template-columns:repeat(6,1fr);pointer-events:none; }
.privacy-pin-cells i { border-right:1px solid rgba(255,255,255,.08); }
.privacy-pin-cells i:last-child { border:0; }
.privacy-lock-card .primary-action { width:100%; }
.privacy-device-unlock[hidden] { display:none; }
.privacy-lock-status { min-height:20px;margin:14px 0;color:#ffb2b8;font-size:11px; }
.privacy-lock-secondary { display:flex;justify-content:center;gap:8px;margin-top:20px; }
.privacy-lock-secondary button {
  padding:9px;
  border:0;
  background:transparent;
  color:#aa98aa;
  font-size:10px;
  cursor:pointer;
}
.privacy-lock-secondary button:hover { color:white; }
html.privacy-screen-covered body::after {
  content:"Himora";
  position:fixed;
  z-index:2147483646;
  inset:0;
  display:grid;
  place-items:center;
  background:#100918;
  color:rgba(255,255,255,.36);
  font:500 27px "Iowan Old Style","Baskerville",serif;
  letter-spacing:.06em;
}
.privacy-reset-body { min-height:100dvh; }
.privacy-reset-page {
  min-height:100dvh;
  display:grid;
  place-items:center;
  padding:22px;
}
.privacy-reset-card {
  width:min(500px,100%);
  padding:38px;
  border:1px solid var(--line);
  border-radius:20px;
  background:white;
  box-shadow:0 22px 70px rgba(20,29,52,.12);
}
.privacy-reset-card h1 {
  margin:15px 0;
  font:500 46px/.98 "Iowan Old Style","Baskerville",serif;
  letter-spacing:-.04em;
}
.privacy-reset-card>p:not(.eyebrow) { color:var(--ink-soft);line-height:1.55; }
.privacy-reset-card .form-error.success { color:#277a57; }
.privacy-reset-return { margin-top:22px; }

html[data-theme="dark"] .preference-card,
html[data-theme="dark"] .privacy-mode-grid article,
html[data-theme="dark"] .privacy-setup-dialog,
html[data-theme="dark"] .privacy-reset-card {
  border-color:#44344b;
  background:#1b1225;
}
html[data-theme="dark"] .preference-icon { background:#2b1b35;color:#ff9da6; }
html[data-theme="dark"] .appearance-choice span,
html[data-theme="dark"] .privacy-mode-grid button,
html[data-theme="dark"] .quiet-bordered-action,
html[data-theme="dark"] .privacy-timing-form input,
html[data-theme="dark"] .privacy-timing-form select,
html[data-theme="dark"] .privacy-setup-dialog input,
html[data-theme="dark"] .privacy-setup-dialog select,
html[data-theme="dark"] .dialog-close {
  border-color:#493852;
  background:#160e20;
  color:#f5edf8;
}
html[data-theme="dark"] .appearance-choice input:checked+span {
  border-color:#ff7b83;
  background:#2b1727;
  color:#fff;
}
html[data-theme="dark"] .privacy-preference-card>header { border-color:#44344b; }
html[data-theme="dark"] .privacy-lock-badge { background:#2b2330;color:#c7b9c9; }
html[data-theme="dark"] .privacy-lock-badge.enabled { background:#163527;color:#7cdaa7; }

@media(max-width:650px) {
  .preference-page { width:min(100% - 24px,580px);padding-top:22px; }
  .preference-header h1 { font-size:46px; }
  .preference-card { padding:22px 18px; }
  .preference-card h2 { font-size:24px; }
  .privacy-install-required,.privacy-unverified,
  .boyfriend-settings-card { align-items:stretch;flex-direction:column; }
  .boyfriend-settings-card>span:last-child { text-align:left; }
  .privacy-mode-grid { grid-template-columns:1fr; }
  .privacy-mode-grid article { min-height:0; }
  .privacy-timing-form { grid-template-columns:1fr; }
  .privacy-pin-setup { grid-template-columns:1fr; }
  .privacy-setup-dialog form { padding:28px 22px; }
  .privacy-lock-secondary { flex-direction:column; }
}
html[data-theme="dark"] .check-in-mark {
  background:var(--coral);
  color:var(--navy);
}
html[data-theme="dark"] .check-in-setting strong {
  color:#fff4f7;
}

/* Personal profile, private library, albums, and per-thread atmosphere. */
.sidebar-profile-card {
  display:grid;
  grid-template-columns:42px minmax(0,1fr) 18px;
  align-items:center;
  gap:11px;
  flex:none;
  margin-top:20px;
  padding:11px;
  border:1px solid rgba(255,255,255,.1);
  border-radius:14px;
  background:rgba(255,255,255,.045);
  color:inherit;
  text-decoration:none;
}
.sidebar-profile-card[hidden] { display:none; }
.sidebar-profile-card:hover { border-color:rgba(255,157,166,.4);background:rgba(255,255,255,.075); }
.sidebar-profile-avatar {
  display:grid;
  place-items:center;
  width:42px;
  min-width:42px;
  max-width:42px;
  height:42px;
  min-height:42px;
  max-height:42px;
  flex:0 0 42px;
  aspect-ratio:1;
  overflow:hidden;
  border-radius:50%;
  background:linear-gradient(145deg,#ff9da6,#7e4f77);
  color:#160d20;
}
.sidebar-profile-avatar img { width:100%;height:100%;object-fit:cover; }
.sidebar-profile-avatar b { font:600 18px "Iowan Old Style","Baskerville",serif; }
.sidebar-profile-card small { display:block;color:var(--sidebar-soft,#a99bad);font-size:9px;text-transform:uppercase;letter-spacing:.12em; }
.sidebar-profile-card strong { display:block;overflow:hidden;margin-top:2px;text-overflow:ellipsis;white-space:nowrap;font-size:12px; }
.sidebar-profile-card>svg { width:17px;fill:none;stroke:currentColor;stroke-width:1.6;opacity:.55; }
.chat-options-button {
  display:grid;
  flex:0 0 auto;
  place-items:center;
  width:38px;
  height:38px;
  padding:0;
  border:1px solid rgba(24,32,57,.14);
  border-radius:50%;
  background:rgba(255,255,255,.74);
  color:var(--ink-soft);
  cursor:pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}
.chat-options-button:hover {
  border-color:rgba(200,82,114,.4);
  color:var(--coral-deep);
  transform:rotate(12deg);
}
.chat-options-button svg {
  width:17px;
  height:17px;
  fill:none;
  stroke:currentColor;
  stroke-linecap:round;
  stroke-linejoin:round;
  stroke-width:1.45;
}
html[data-theme="dark"] .chat-options-button {
  border-color:rgba(255,255,255,.11);
  background:rgba(255,255,255,.055);
  color:#bdaec7;
}
html[data-theme="dark"] .chat-options-button:hover {
  border-color:rgba(240,137,163,.42);
  color:#f3a0b5;
}
.attachment-action-icon.library {
  background:linear-gradient(145deg,#2f2351,#956286);
  color:#fff3f5;
}

.profile-page-body,.photos-page-body {
  height:auto;
  min-height:100dvh;
  overflow-x:hidden;
  overflow-y:auto;
  background:
    radial-gradient(circle at 85% 4%,rgba(190,103,145,.14),transparent 30%),
    var(--page,#f5f3f7);
  color:var(--ink);
}
.self-profile-page,.photos-page {
  width:min(1120px,calc(100% - 36px));
  margin:0 auto;
  padding:28px 0 70px;
}
.profile-topbar,.photos-page-header nav {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:34px;
}
.profile-topbar>div,.photos-page-header nav {
  display:flex;
  gap:18px;
}
.profile-topbar a:not(.back-link),.photos-page-header nav>a:not(.back-link) {
  color:var(--ink-soft);
  font-size:11px;
  font-weight:700;
  text-decoration:none;
}
.self-profile-hero {
  display:grid;
  grid-template-columns:clamp(110px,17vw,170px) minmax(0,1fr);
  align-items:end;
  gap:clamp(24px,5vw,58px);
  margin:0 0 38px;
}
.self-profile-avatar {
  position:relative;
  display:grid;
  place-items:center;
  aspect-ratio:1;
  overflow:hidden;
  border:6px solid rgba(255,255,255,.75);
  border-radius:50%;
  background:linear-gradient(145deg,#e8a7b5,#6e446e);
  box-shadow:0 24px 60px rgba(42,25,52,.2);
  color:#fff;
  cursor:pointer;
}
.self-profile-avatar img { width:100%;height:100%;object-fit:cover; }
.self-profile-avatar>span { font:500 clamp(48px,8vw,82px) "Iowan Old Style","Baskerville",serif; }
.self-profile-avatar>i {
  position:absolute;
  right:8px;
  bottom:8px;
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border:3px solid white;
  border-radius:50%;
  background:#171020;
  color:white;
  font:normal 22px/1 sans-serif;
}
.self-profile-hero h1,.photos-title-row h1 {
  margin:4px 0 10px;
  font:500 clamp(43px,7vw,74px)/.92 "Iowan Old Style","Baskerville",serif;
  letter-spacing:-.05em;
}
.self-profile-hero>div>p:last-child,.photos-title-row p {
  max-width:620px;
  margin:0;
  color:var(--ink-soft);
  line-height:1.55;
}
.self-profile-layout { display:grid;grid-template-columns:minmax(0,1.25fr) minmax(310px,.75fr);gap:24px;align-items:start; }
.self-profile-form { display:grid;gap:16px; }
.self-profile-form label { display:grid;gap:7px;color:var(--ink-soft);font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em; }
.self-profile-form input,.self-profile-form textarea {
  width:100%;
  border:1px solid var(--line);
  border-radius:11px;
  background:var(--surface,#fff);
  color:var(--ink);
  padding:12px 13px;
  font:400 14px/1.45 inherit;
  text-transform:none;
  letter-spacing:0;
  resize:vertical;
}
.profile-section-heading { display:flex;justify-content:space-between;align-items:start;gap:14px; }
.profile-section-heading h2 { margin:3px 0 0;font:500 28px "Iowan Old Style","Baskerville",serif; }
.profile-section-heading>span { padding:5px 8px;border-radius:999px;background:var(--surface-soft);color:var(--ink-soft);font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.08em; }
.profile-gallery-card>p { margin:8px 0 19px;color:var(--ink-soft);font-size:12px;line-height:1.55; }
.profile-gallery-actions { display:grid;grid-template-columns:1fr 1fr;gap:9px; }
.profile-gallery-actions .quiet-bordered-action {
  display:flex;
  min-height:42px;
  align-items:center;
  justify-content:center;
  text-align:center;
  text-decoration:none;
}
.profile-account-card {
  display:grid;
  grid-template-columns:52px minmax(0,1fr) auto;
  align-items:center;
  gap:16px;
  margin-top:24px;
  padding:22px 24px;
  color:var(--ink);
  text-decoration:none;
  transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease;
}
.profile-account-card:hover {
  border-color:color-mix(in srgb,var(--coral) 52%,var(--line));
  box-shadow:0 16px 42px rgba(81,43,75,.11);
  transform:translateY(-1px);
}
.profile-account-card:focus-visible {
  outline:3px solid color-mix(in srgb,var(--coral) 65%,transparent);
  outline-offset:3px;
}
.profile-account-seal {
  display:grid;
  width:52px;
  height:52px;
  place-items:center;
  border:1px solid color-mix(in srgb,var(--coral) 38%,var(--line));
  border-radius:50%;
  background:color-mix(in srgb,var(--coral) 10%,var(--surface));
  color:var(--coral-deep);
}
.profile-account-seal svg {
  width:25px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.6;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.profile-account-copy { display:grid;min-width:0;gap:3px; }
.profile-account-copy .eyebrow { margin:0;color:var(--ink-soft); }
.profile-account-copy strong {
  font:500 24px "Iowan Old Style","Baskerville",serif;
}
.profile-account-copy small { color:var(--ink-soft);font-size:11px;line-height:1.4; }
.profile-account-arrow {
  display:grid;
  width:34px;
  height:34px;
  place-items:center;
  border-radius:50%;
  background:var(--surface-soft);
  color:var(--ink-soft);
  font-size:18px;
  transition:background .18s ease,color .18s ease,transform .18s ease;
}
.profile-account-card:hover .profile-account-arrow {
  background:var(--coral);
  color:#2a1521;
  transform:translateX(2px);
}
.self-profile-gallery { display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-bottom:16px; }
.self-profile-gallery button {
  aspect-ratio:4/5;
  overflow:hidden;
  padding:0;
  border:0;
  border-radius:9px;
  background:var(--surface-soft);
  cursor:pointer;
}
.self-profile-gallery img { width:100%;height:100%;object-fit:cover; }
.self-profile-gallery>p { grid-column:1/-1;padding:35px 15px;border:1px dashed var(--line);border-radius:12px;text-align:center; }

.photos-title-row { display:flex;align-items:end;justify-content:space-between;gap:30px; }
.photo-upload-button {
  flex:none;
  display:flex;
  align-items:center;
  gap:9px;
  padding:13px 18px;
  border-radius:12px;
  background:var(--coral);
  color:#26121d;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 12px 28px rgba(164,71,101,.2);
}
.photo-upload-button span { font-size:22px;font-weight:400;line-height:.7; }
.photo-usage { display:flex;gap:20px;margin-top:22px;color:var(--ink-soft);font-size:10px; }
.photo-usage b { color:var(--ink);font-variant-numeric:tabular-nums; }
.photo-upload-status { min-height:20px;margin:12px 0 0;color:var(--ink-soft);font-size:11px; }
.saved-photo-grid {
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:8px;
  margin-top:22px;
}
.saved-photo-tile {
  position:relative;
  aspect-ratio:1;
  overflow:hidden;
  padding:0;
  border:0;
  border-radius:10px;
  background:var(--surface-soft);
  cursor:pointer;
}
.saved-photo-tile img { width:100%;height:100%;object-fit:cover;transition:transform .25s ease; }
.saved-photo-tile:hover img { transform:scale(1.035); }
.saved-photo-tile span { position:absolute;right:6px;bottom:6px;padding:4px 6px;border-radius:999px;background:rgba(14,10,19,.68);color:white;font-size:8px;backdrop-filter:blur(6px); }
.photos-empty { padding:90px 20px;text-align:center;color:var(--ink-soft); }
.photos-empty span { display:block;color:var(--coral);font-size:34px; }
.photos-empty h2 { margin:12px 0 8px;color:var(--ink);font:500 32px "Iowan Old Style","Baskerville",serif; }
.photos-empty p { margin:0; }
.photos-load-more { display:block;margin:24px auto 0; }
.photos-load-more[hidden] { display:none; }

.photo-picker-dialog,.wallpaper-dialog,.profile-photo-viewer {
  width:min(760px,calc(100% - 24px));
  max-height:min(820px,calc(100dvh - 24px));
  padding:0;
  border:1px solid var(--line);
  border-radius:20px;
  background:var(--surface,#fff);
  color:var(--ink);
  box-shadow:0 30px 100px rgba(17,9,27,.35);
}
.photo-picker-dialog::backdrop,.wallpaper-dialog::backdrop,.profile-photo-viewer::backdrop { background:rgba(12,7,18,.72);backdrop-filter:blur(8px); }
.photo-picker-sheet,.wallpaper-sheet { display:grid;max-height:inherit;padding:24px; }
.photo-picker-sheet>header,.wallpaper-sheet>header { display:flex;align-items:start;justify-content:space-between;gap:20px;margin-bottom:18px; }
.photo-picker-sheet h2,.wallpaper-sheet h2 { margin:3px 0 0;font:500 32px "Iowan Old Style","Baskerville",serif; }
.photo-picker-grid {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:7px;
  overflow:auto;
  min-height:150px;
  max-height:52dvh;
  padding:2px;
}
.photo-picker-grid button { position:relative;aspect-ratio:1;overflow:hidden;padding:0;border:2px solid transparent;border-radius:9px;background:var(--surface-soft);cursor:pointer; }
.photo-picker-grid button.selected { border-color:var(--coral);box-shadow:0 0 0 2px color-mix(in srgb,var(--coral) 25%,transparent); }
.photo-picker-grid button.selected::after { content:"✓";position:absolute;right:6px;top:6px;display:grid;place-items:center;width:21px;height:21px;border-radius:50%;background:var(--coral);color:#25131d;font-size:11px;font-weight:900; }
.photo-picker-grid img { width:100%;height:100%;object-fit:cover; }
.photo-picker-empty { grid-column:1/-1;margin:auto;text-align:center;color:var(--ink-soft); }
.photo-picker-sheet>footer,.wallpaper-sheet>footer { display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:18px; }
.photo-picker-sheet>footer>span { margin-right:auto;color:var(--ink-soft);font-size:10px; }
.chat-photo-picker-mode { margin:-8px 0 14px;color:var(--ink-soft);font-size:11px; }
.photo-picker-send-options {
  display:flex;
  align-items:center;
  gap:14px;
  margin:0 0 16px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:color-mix(in srgb,var(--surface-soft) 72%,transparent);
}
.photo-picker-send-options[hidden] { display:none; }
.photo-picker-send-options legend { position:absolute;clip:rect(0 0 0 0);clip-path:inset(50%);width:1px;height:1px;overflow:hidden;white-space:nowrap; }
.photo-picker-send-kind { display:flex;gap:3px;padding:3px;border-radius:9px;background:color-mix(in srgb,var(--ink) 7%,transparent); }
.photo-picker-send-kind button,
.photo-picker-timer button {
  min-height:31px;
  padding:6px 10px;
  border:0;
  border-radius:7px;
  background:transparent;
  color:var(--ink-soft);
  font-size:10px;
  font-weight:750;
  cursor:pointer;
}
.photo-picker-send-kind button.selected {
  background:var(--surface,#fff);
  color:var(--ink);
  box-shadow:0 2px 8px rgba(22,12,30,.12);
}
.photo-picker-timer { display:flex;align-items:center;gap:8px;margin-left:auto; }
.photo-picker-timer[hidden] { display:none; }
.photo-picker-timer>span { color:var(--ink-soft);font-size:9px; }
.photo-picker-timer>div { display:flex;gap:3px; }
.photo-picker-timer button { min-width:32px;padding-inline:7px;border:1px solid transparent; }
.photo-picker-timer button.selected { border-color:var(--coral);background:color-mix(in srgb,var(--coral) 16%,transparent);color:var(--ink); }
.photo-picker-send-kind button:focus-visible,
.photo-picker-timer button:focus-visible { outline:2px solid var(--coral);outline-offset:2px; }
.photo-picker-more { margin:12px auto 0; }
.photo-picker-upload { cursor:pointer; }

.profile-photo-viewer { width:min(860px,calc(100% - 20px));height:min(88dvh,850px);background:#100a17;color:#fff; }
.profile-photo-viewer>button { position:absolute;z-index:2;right:16px;top:16px;width:40px;height:40px;border:1px solid rgba(255,255,255,.2);border-radius:50%;background:rgba(0,0,0,.35);color:white;font-size:24px;cursor:pointer; }
.profile-photo-viewer>img { display:block;width:100%;height:calc(100% - 50px);object-fit:contain; }
.profile-photo-viewer>p,.profile-photo-viewer>div { display:flex;align-items:center;justify-content:center;gap:20px;height:50px;margin:0;color:#c8b9c8;font-size:10px; }
.danger-text-action { border:0;background:transparent;color:#ff9da6;font:700 10px inherit;cursor:pointer; }
.saved-photo-delete-button {
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:34px;
  padding:7px 12px;
  border:1px solid rgba(255,157,166,.48);
  border-radius:999px;
  background:rgba(255,157,166,.09);
  color:#ffb0b7;
  font-size:10px;
  font-weight:750;
  letter-spacing:.01em;
  cursor:pointer;
  transition:background .16s ease,border-color .16s ease,transform .16s ease;
}
.saved-photo-delete-button svg {
  width:14px;
  height:14px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.saved-photo-delete-button:hover:not(:disabled) {
  border-color:#ff9da6;
  background:rgba(255,157,166,.18);
  transform:translateY(-1px);
}
.saved-photo-delete-button:focus-visible {
  outline:2px solid #ffd0d4;
  outline-offset:3px;
}
.saved-photo-delete-button:disabled { opacity:.48;cursor:wait;transform:none; }

.chat-wallpaper {
  grid-area:messages;
  position:relative;
  z-index:0;
  min-width:0;
  min-height:0;
  overflow:hidden;
  pointer-events:none;
  --wallpaper-image:none;
  --wallpaper-dim:.22;
  --wallpaper-blur:0px;
  --wallpaper-size:cover;
}
.messages { z-index:1; }
.chat-wallpaper:not([data-wallpaper-kind="default"])::before {
  content:"";
  position:absolute;
  z-index:0;
  inset:-12px;
  background-image:var(--wallpaper-image);
  background-position:center;
  background-repeat:no-repeat;
  background-size:var(--wallpaper-size);
  filter:blur(var(--wallpaper-blur));
  pointer-events:none;
}
.chat-wallpaper:not([data-wallpaper-kind="default"])::after {
  content:"";
  position:absolute;
  z-index:0;
  inset:0;
  background:rgba(13,8,18,var(--wallpaper-dim));
  pointer-events:none;
}
.message-photo-album { display:grid;gap:3px;overflow:hidden;margin:-8px -8px 8px;border-radius:13px; }
.message-photo-album button { min-height:110px;padding:0;border:0;background:#231728;cursor:pointer; }
.message-photo-album img { width:100%;height:100%;max-height:310px;object-fit:cover;display:block; }
.message-photo-album.count-1 { grid-template-columns:1fr; }
.message-photo-album.count-2 { grid-template-columns:repeat(2,1fr); }
.message-photo-album.count-3,.message-photo-album.count-5 { grid-template-columns:repeat(2,1fr); }
.message-photo-album.count-3 button:first-child,.message-photo-album.count-5 button:first-child { grid-row:span 2; }
.message-photo-album.count-4 { grid-template-columns:repeat(2,1fr); }

.wallpaper-sheet { overflow:auto; }
.wallpaper-preview {
  position:relative;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:190px;
  overflow:hidden;
  padding:34px 24px;
  border-radius:15px;
  background-image:
    linear-gradient(rgba(13,8,18,var(--wallpaper-dim)),rgba(13,8,18,var(--wallpaper-dim))),
    var(--wallpaper-image);
  background-position:center;
  background-repeat:no-repeat;
  background-size:var(--wallpaper-size);
  color:white;
}
.wallpaper-preview span { position:relative;z-index:1;width:max-content;max-width:75%;padding:10px 13px;border-radius:14px;font-size:11px;box-shadow:0 5px 16px rgba(0,0,0,.14); }
.wallpaper-preview-incoming { align-self:start;background:#fff;color:#2b2430; }
.wallpaper-preview-outgoing { align-self:end;background:#ff9da6;color:#2a1420; }
.wallpaper-choices { margin:18px 0 0;padding:0;border:0; }
.wallpaper-choices legend { margin-bottom:10px;color:var(--ink-soft);font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.1em; }
#wallpaper-preset-grid { display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:12px; }
#wallpaper-preset-grid input { position:absolute;opacity:0; }
.wallpaper-swatch { display:flex;align-items:end;aspect-ratio:1.25;padding:9px;border:2px solid transparent;border-radius:10px;background:#eee;color:white;font-size:9px;font-weight:800;text-shadow:0 1px 5px #000;cursor:pointer; }
#wallpaper-preset-grid input:checked+.wallpaper-swatch { border-color:var(--coral);box-shadow:0 0 0 2px color-mix(in srgb,var(--coral) 20%,transparent); }
.wallpaper-swatch.default { background:linear-gradient(145deg,#f6f3f8,#ded8e3);color:#443b49;text-shadow:none; }
.wallpaper-swatch.afterglow { background:radial-gradient(circle at 20% 15%,#f4a38d,transparent 40%),#42213d; }
.wallpaper-swatch.blue-hour { background:radial-gradient(circle at 75% 20%,#6488af,transparent 43%),#172a46; }
.wallpaper-swatch.moonlit-rose { background:radial-gradient(circle at 25% 80%,#8c486a,transparent 46%),#25162c; }
.wallpaper-swatch.soft-orbit { background:radial-gradient(circle at 70% 22%,#d1a6c5 0 10%,transparent 11%),#4c3658; }
.wallpaper-swatch.violet-rain { background:repeating-linear-gradient(118deg,rgba(255,255,255,.14) 0 1px,transparent 1px 11px),#4a346b; }
.wallpaper-swatch.warm-static { background:radial-gradient(circle at 20% 10%,#b98775,transparent 40%),#482b3e; }
.wallpaper-controls { display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:17px; }
.wallpaper-controls label { display:grid;gap:7px;color:var(--ink-soft);font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.08em; }
.wallpaper-controls select { width:100%;padding:10px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--ink); }
.wallpaper-controls output { float:right;color:var(--ink); }

html[data-theme="dark"] .profile-page-body,
html[data-theme="dark"] .photos-page-body { --page:#100918;--surface:#1b1225;--surface-soft:#281b30; }
html[data-theme="dark"] .self-profile-avatar { border-color:#2a1a32; }
html[data-theme="dark"] .profile-account-seal {
  border-color:#56394e;
  background:#2a1b30;
  color:#f2a1b6;
}
html[data-theme="dark"] .profile-account-card:hover {
  border-color:#70475f;
  box-shadow:0 18px 46px rgba(0,0,0,.28);
}
html[data-theme="dark"] .photo-picker-dialog,
html[data-theme="dark"] .wallpaper-dialog,
html[data-theme="dark"] .self-profile-form input,
html[data-theme="dark"] .self-profile-form textarea,
html[data-theme="dark"] .wallpaper-controls select { border-color:#44344b;background:#1b1225;color:#f7eff8; }
html[data-theme="dark"] .photo-picker-send-options {
  border-color:#4a3655;
  background:#21152b;
}
html[data-theme="dark"] .photo-picker-send-kind {
  background:#130c1b;
}
html[data-theme="dark"] .photo-picker-send-kind button {
  color:#d9cce1;
}
html[data-theme="dark"] .photo-picker-send-kind button:hover:not(.selected) {
  background:#30203c;
  color:#fff8ff;
}
html[data-theme="dark"] .photo-picker-send-kind button.selected {
  background:#f2a1b6;
  color:#241320;
  box-shadow:0 3px 12px rgba(0,0,0,.3);
}
html[data-theme="dark"] .photo-picker-timer>span {
  color:#c9b9d1;
}
html[data-theme="dark"] .photo-picker-timer button {
  color:#d9cce1;
}
html[data-theme="dark"] .photo-picker-timer button:hover:not(.selected) {
  border-color:#6a4c77;
  background:#30203c;
  color:#fff8ff;
}
html[data-theme="dark"] .photo-picker-timer button.selected {
  border-color:#f2a1b6;
  background:rgba(242,161,182,.2);
  color:#fff4f7;
}

@media(max-width:820px) {
  .self-profile-layout { grid-template-columns:1fr; }
  .saved-photo-grid { grid-template-columns:repeat(4,1fr); }
}
@media(max-width:650px) {
  .self-profile-page,.photos-page { width:min(100% - 24px,1120px);padding-top:18px; }
  .self-profile-hero { grid-template-columns:92px minmax(0,1fr);align-items:center;gap:18px;margin-bottom:25px; }
  .self-profile-avatar { border-width:4px; }
  .self-profile-avatar>i { right:1px;bottom:1px;width:27px;height:27px;border-width:2px;font-size:18px; }
  .self-profile-hero h1,.photos-title-row h1 { font-size:43px; }
  .photos-title-row { align-items:flex-start;flex-direction:column; }
  .photo-upload-button { width:100%;justify-content:center; }
  .photo-usage { justify-content:space-between;gap:10px; }
  .saved-photo-grid { grid-template-columns:repeat(3,1fr);gap:5px; }
  .photo-picker-sheet,.wallpaper-sheet { padding:19px 15px; }
  .profile-gallery-actions { grid-template-columns:1fr; }
  .profile-account-card {
    grid-template-columns:44px minmax(0,1fr) 30px;
    gap:12px;
    padding:17px;
  }
  .profile-account-seal { width:44px;height:44px; }
  .profile-account-copy strong { font-size:21px; }
  .profile-account-copy small { font-size:10px; }
  .profile-account-arrow { width:30px;height:30px; }
  .photo-picker-send-options { align-items:stretch;flex-direction:column;gap:9px; }
  .photo-picker-send-kind { display:grid;grid-template-columns:1fr 1fr; }
  .photo-picker-timer { align-items:flex-start;flex-direction:column;margin-left:0; }
  .photo-picker-timer>div { width:100%; }
  .photo-picker-timer button { flex:1; }
  .photo-picker-grid { grid-template-columns:repeat(3,1fr);max-height:55dvh; }
  .photo-picker-sheet>footer { flex-wrap:wrap; }
  .photo-picker-sheet>footer .primary-action { flex:1; }
  #wallpaper-preset-grid { grid-template-columns:repeat(3,1fr); }
  .wallpaper-controls { grid-template-columns:1fr; }
  .message-photo-album button { min-height:90px; }
}
@media(max-width:650px) {
  .check-in-setting {
    grid-template-columns:42px minmax(0,1fr);
    align-items:start;
    padding:15px;
  }
  .check-in-mark {
    width:42px;
    height:42px;
  }
  .check-in-toggle {
    grid-column:1/-1;
    grid-template-columns:42px auto;
    align-items:center;
    justify-items:start;
  }
  .compact-check-in {
    grid-template-columns:minmax(0,1fr);
    gap:14px;
    padding:0;
  }
  .compact-check-in>div:first-child {
    width:100%;
    padding-right:0;
  }
  .compact-check-in .check-in-toggle {
    grid-column:1;
  }
}

/* Conversation-first inbox */
.shell {
  grid-template-columns: 96px 360px minmax(0, 1fr);
}

.shell:not(.chat-open) {
  grid-template-columns: 104px minmax(0, 1fr);
}

.shell:not(.chat-open) .chat {
  display: none;
}

.app-navigation {
  z-index: 25;
  align-items: center;
  padding: 25px 12px 18px;
}

.app-navigation .brand {
  justify-content: center;
}

.app-navigation .brand > div:last-child {
  display: none;
}

.app-navigation .brand-mark {
  width: 45px;
  height: 45px;
}

.app-navigation .sidebar-tools {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  gap: 7px;
  margin-top: 26px;
  padding-top: 0;
  border: 0;
}

.app-navigation .settings-link {
  order: 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-height: 61px;
  padding: 8px 4px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: rgba(255,255,255,.56);
  font-size: 9px;
  cursor: pointer;
}

.app-navigation #chats-tab { order: 1; }
.app-navigation #personas-link { order: 2; }
.app-navigation #photos-link { order: 3; }
.app-navigation #settings-link { order: 4; }
.app-navigation #admin-link { order: 5; margin-top: auto; }

.app-navigation .settings-link svg {
  width: 20px;
  height: 20px;
}

.app-navigation .settings-link:hover,
.app-navigation .settings-link.active {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.conversation-pane {
  position: relative;
  z-index: 5;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid #ded9e2;
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,246,249,.96)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 79px,
      rgba(24,32,57,.035) 80px
    );
  color: #221b29;
}

.inbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 30px 24px 18px;
}

.inbox-header .eyebrow {
  margin: 0 0 4px;
  color: #9a8799;
  font-size: 8px;
}

.inbox-header h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -.035em;
}

.conversation-pane .sidebar-profile-card {
  width: auto;
  max-width: 138px;
  margin: 0;
  padding: 3px 9px 3px 3px;
  border: 1px solid #e3dce5;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  color: #332738;
}

.conversation-pane .sidebar-profile-card {
  grid-template-columns:34px minmax(0,1fr);
  gap:7px;
}

.conversation-pane .sidebar-profile-avatar {
  width:34px;
  min-width:34px;
  max-width:34px;
  height:34px;
  min-height:34px;
  max-height:34px;
  flex:0 0 34px;
  aspect-ratio:1 / 1;
}

.conversation-pane .sidebar-profile-card strong {
  margin:0;
  font-size:12px;
}

.conversation-pane .sidebar-profile-card:hover {
  border-color: rgba(226,112,143,.48);
  background: #fff;
}

.conversation-pane .inbox-install {
  display: grid;
  grid-template-columns:30px minmax(0,1fr) auto;
  align-items:center;
  align-self:stretch;
  width:auto;
  min-width:0;
  max-width:none;
  box-sizing:border-box;
  overflow:hidden;
  gap: 9px;
  min-height: 44px;
  margin: 0 20px 12px;
  padding: 6px 8px;
  border: 1px solid rgba(226,112,143,.25);
  border-radius: 12px;
  background: rgba(243,160,181,.1);
  color: #3d2c3d;
}

.conversation-pane .inbox-install[hidden] { display: none; }
.conversation-pane .inbox-install .install-seal {
  width:28px;
  height:28px;
  font-size:16px;
}
.conversation-pane .inbox-install-copy {
  display:grid;
  min-width:0;
  gap:1px;
  text-align:left;
}
.conversation-pane .inbox-install strong { font-size: 11px; }
.conversation-pane .inbox-install small { color: #887685; font-size: 9px; }
.conversation-pane .inbox-install strong,
.conversation-pane .inbox-install small {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.conversation-pane .inbox-install-action {
  padding:5px 8px;
  border-radius:999px;
  background:#2b1a38;
  color:#fff;
  font-size:9px;
  font-weight:700;
}

.conversation-history-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 20px 7px;
}

.conversation-pane .conversation-history-heading .new-chat {
  width:36px;
  min-width:36px;
  min-height:36px;
  height:36px;
  flex:none;
  align-self:auto;
  justify-content:center;
  gap:0;
  margin:0;
  padding:0;
  border-color: rgba(28,21,40,.1);
  border-radius:999px;
  background: #20162f;
  color: #fff;
  box-shadow:none;
  font-size:11px;
  font-weight:700;
}

.conversation-pane .conversation-history-heading .new-chat span:first-child {
  color:inherit;
  font-size:16px;
  line-height:1;
}

.conversation-pane .conversation-history-heading .new-chat:hover {
  border-color: rgba(255,255,255,.2);
  background: #2b1c3e;
}

.conversation-history {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.conversation-history .nav-label {
  margin: 0;
  color: #a08f9e;
}

.conversation-pane .conversation-list {
  display: block;
  min-height: 0;
  padding: 0 10px 24px;
  overflow-y: auto;
  scrollbar-color: rgba(63,43,72,.2) transparent;
}

.conversation-entry {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  align-items: center;
  border-bottom: 1px solid rgba(49,35,57,.075);
}

.conversation-item {
  display: grid;
  grid-template-columns: 48px minmax(0,1fr);
  align-items: center;
  gap: 12px;
  padding: 13px 5px 13px 10px;
  border: 0;
  border-radius: 13px;
  color: #3b2e40;
  white-space: normal;
}

.conversation-item:hover { background: rgba(45,31,55,.045); color: #271d2c; }
.conversation-item.active { background: rgba(239,142,168,.13); color: #271d2c; }

.conversation-avatar {
  display: grid;
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  flex: 0 0 48px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #2a1c38;
  color: #f3a0b5;
  box-shadow: 0 3px 11px rgba(37,24,44,.16);
  font-family: "Iowan Old Style", "Baskerville", serif;
  font-size: 21px;
}

.conversation-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.conversation-copy,
.conversation-topline,
.conversation-preview-line {
  display: flex;
  min-width: 0;
}

.conversation-copy {
  flex-direction: column;
  gap: 3px;
}

.conversation-topline,
.conversation-preview-line {
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.conversation-topline strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-topline time {
  flex: none;
  color: #a08f9e;
  font-size: 8px;
}

.conversation-topic,
.conversation-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-topic {
  color: #776477;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .055em;
}

.conversation-preview {
  color: #8a7b89;
  font-size: 10px;
}

.conversation-unread {
  display: grid;
  min-width: 19px;
  height: 19px;
  flex: none;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #e2708f;
  color: #fff;
  font-size: 8px;
  font-weight: 800;
}

.conversation-list-empty {
  display: grid;
  flex: 1;
  place-content: center;
  justify-items: center;
  gap: 5px;
  padding: 30px;
  color: #857383;
  text-align: center;
}

.conversation-list-empty[hidden] { display: none; }
.conversation-list-empty > span { color: #e2708f; font-size: 30px; }
.conversation-list-empty strong { color: #3e3041; font: 500 17px "Iowan Old Style","Baskerville",serif; }
.conversation-list-empty small { max-width: 190px; font-size: 10px; line-height: 1.5; }

.menu-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

@media (min-width: 761px) {
  .menu-button { display: none; }
}

html[data-theme="dark"] .conversation-pane {
  border-right-color: #34273c;
  background:
    linear-gradient(180deg, rgba(28,18,38,.97), rgba(20,13,29,.98)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 79px,
      rgba(255,255,255,.03) 80px
    );
  color: #f5eef7;
}

html[data-theme="dark"] .conversation-pane .sidebar-profile-card {
  border-color: #44344b;
  background: rgba(255,255,255,.045);
  color: #f5eef7;
}

html[data-theme="dark"] .conversation-pane .sidebar-profile-card:hover {
  border-color: rgba(243,160,181,.45);
  background: rgba(255,255,255,.075);
}

html[data-theme="dark"] .conversation-pane .new-chat {
  border-color: rgba(255,255,255,.08);
  background: #f0a0b5;
  color: #241321;
}

html[data-theme="dark"] .conversation-history .nav-label,
html[data-theme="dark"] .inbox-header .eyebrow,
html[data-theme="dark"] .conversation-topline time,
html[data-theme="dark"] .conversation-topic,
html[data-theme="dark"] .conversation-preview {
  color: #aa98ac;
}

html[data-theme="dark"] .conversation-entry { border-bottom-color: rgba(255,255,255,.055); }
html[data-theme="dark"] .conversation-item { color: #eee5f1; }
html[data-theme="dark"] .conversation-item:hover { background: rgba(255,255,255,.045); color: #fff; }
html[data-theme="dark"] .conversation-item.active { background: rgba(243,160,181,.13); color: #fff; }
html[data-theme="dark"] .conversation-avatar { border-color: #271a31; }
html[data-theme="dark"] .conversation-list-empty strong { color: #f5eef7; }
html[data-theme="dark"] .conversation-pane .inbox-install {
  border-color: rgba(243,160,181,.22);
  background: rgba(243,160,181,.09);
  color: #f7eff8;
}

@media (max-width: 760px) {
  body { overflow: hidden; }

  .shell {
    position: relative;
    display: block;
    width: 100%;
    height: 100dvh;
  }

  .conversation-pane {
    position: fixed;
    z-index: 6;
    inset: 0 0 70px;
    width: 100%;
    border: 0;
  }

  .inbox-header {
    padding: max(22px, env(safe-area-inset-top)) 18px 15px;
  }

  .inbox-header h1 { font-size: 36px; }
  .conversation-pane .new-chat { margin-inline: 14px; }
  .conversation-pane .inbox-install { margin-inline: 14px; }
  .conversation-pane .conversation-list { padding-inline: 5px; }
  .conversation-item { grid-template-columns: 52px minmax(0,1fr); padding-block: 12px; }
  .conversation-avatar { width: 52px; height: 52px; }
  .app-navigation {
    position: fixed;
    z-index: 30;
    inset: auto 0 0;
    display: block;
    width: 100%;
    height: calc(70px + env(safe-area-inset-bottom));
    padding: 4px 7px env(safe-area-inset-bottom);
    transform: none;
    border-top: 1px solid rgba(255,255,255,.1);
    background: #170f28;
  }

  .app-navigation .brand { display: none; }

  .app-navigation .sidebar-tools {
    display: grid;
    height: 100%;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 2px;
    margin: 0;
  }

  .app-navigation .settings-link {
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 5px 2px;
    font-size: 8px;
  }

  .app-navigation #admin-link { display: none; }
  .guest-mode .app-navigation .sidebar-tools { grid-template-columns: 1fr; }

  .chat {
    position: fixed;
    z-index: 40;
    inset: 0;
    display: none;
    width: 100%;
    height: 100dvh;
  }

  .shell.chat-open .chat { display: grid; }
  .shell.chat-open .conversation-pane,
  .shell.chat-open .app-navigation { display: none; }

  .menu-button {
    display: grid;
    place-items: center;
    margin-right: 7px;
    padding: 8px;
  }

  .scrim { display: none !important; }
}

@media (max-width: 390px) {
  .conversation-pane .sidebar-profile-card span:last-child { display: none; }
  .conversation-pane .sidebar-profile-card { padding: 4px; }
  .conversation-topline strong { font-size: 12px; }
}

.admin-diagnostics-section .analytics-controls input {
  height:38px;
  min-width:210px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:8px;
  background:white;
  color:var(--ink);
}
.admin-diagnostics-summary {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto 12px;
  align-items:center;
  gap:14px;
  cursor:pointer;
  list-style:none;
}
.admin-diagnostics-summary::-webkit-details-marker { display:none; }
.admin-diagnostics-summary>span:first-child { display:grid;gap:4px; }
.admin-diagnostics-summary strong {
  font:500 32px "Iowan Old Style",serif;
}
.admin-diagnostics-toggle-label {
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--ink-soft);
  background:rgba(255,255,255,.72);
  font-size:9px;
  font-weight:700;
  letter-spacing:.05em;
  text-transform:uppercase;
}
.admin-diagnostics-summary>i {
  width:8px;
  height:8px;
  border-right:2px solid var(--ink-soft);
  border-bottom:2px solid var(--ink-soft);
  transform:rotate(225deg);
  transition:transform .18s ease;
}
.admin-diagnostics-section:not([open]) .admin-diagnostics-summary>i {
  transform:rotate(45deg);
}
.admin-diagnostics-summary:focus-visible {
  outline:2px solid var(--coral);
  outline-offset:7px;
  border-radius:5px;
}
.admin-diagnostics-body { padding-top:20px; }
.admin-diagnostics-body>header {
  display:flex;
  justify-content:flex-end;
}
.chat-diagnostics-list { display:grid;gap:9px; }
.chat-diagnostic {
  padding:14px 16px;
  border:1px solid var(--line);
  border-left:3px solid #91a0ad;
  border-radius:10px;
  background:white;
}
.chat-diagnostic.failed { border-left-color:#d65d6e; }
.chat-diagnostic.succeeded { border-left-color:#5d9f80; }
.chat-diagnostic>header {
  display:flex;
  align-items:start;
  justify-content:space-between;
  gap:15px;
}
.chat-diagnostic>header span { display:grid;gap:3px; }
.chat-diagnostic>header strong { color:var(--ink);font-size:12px; }
.chat-diagnostic>header small,
.chat-diagnostic>header time,
.chat-diagnostic>p { color:var(--ink-soft);font-size:9px; }
.chat-diagnostic>p a { color:var(--coral-deep);font-weight:700;text-decoration:none; }
.chat-diagnostic dl {
  display:grid;
  grid-template-columns:2fr repeat(3,1fr);
  gap:8px;
  margin:10px 0 0;
}
.chat-diagnostic dl div { min-width:0; }
.chat-diagnostic dt {
  color:var(--ink-soft);
  font-size:8px;
  text-transform:uppercase;
  letter-spacing:.07em;
}
.chat-diagnostic dd {
  overflow:hidden;
  margin:3px 0 0;
  font:9px "Cascadia Mono",monospace;
  text-overflow:ellipsis;
  white-space:nowrap;
}
html[data-theme="dark"] .admin-diagnostics-section .analytics-controls input,
html[data-theme="dark"] .chat-diagnostic {
  border-color:#403348;
  background:#1b1225;
  color:#f4edf6;
}
html[data-theme="dark"] .admin-diagnostics-toggle-label {
  border-color:var(--line);
  background:#21172d;
  color:var(--ink-soft);
}
@media(max-width:760px) {
  .admin-diagnostics-summary {
    grid-template-columns:minmax(0,1fr) 12px;
  }
  .admin-diagnostics-summary strong { font-size:27px; }
  .admin-diagnostics-toggle-label { display:none; }
  .admin-diagnostics-body>header { display:block; }
  .admin-diagnostics-section .analytics-controls { grid-template-columns:1fr 1fr; }
  .admin-diagnostics-section .analytics-controls label:nth-child(3) { grid-column:1/-1; }
  .admin-diagnostics-section .analytics-controls input { width:100%;min-width:0; }
  .chat-diagnostic dl { grid-template-columns:1fr 1fr; }
}

/* Unified user experience
   The warm "private letter" character is reserved for the active conversation;
   navigation and utility surfaces stay quiet, familiar, and highly readable. */
body.user-facing {
  --user-midnight:#170f28;
  --user-plum:#2c1d3b;
  --user-rose:#e8789a;
  --user-rose-deep:#b94d70;
  --user-blush:#fff3f7;
  --user-paper:#fcf9fc;
  --user-ink:#2b2030;
  --user-muted:#746475;
  --user-line:#e5dbe6;
  --user-radius:18px;
  --user-shadow:0 18px 52px rgba(39,22,48,.1);
  color:var(--user-ink);
  font-family:"Aptos","SF Pro Text","Segoe UI",system-ui,-apple-system,sans-serif;
  font-size:16px;
  line-height:1.55;
}

body.user-facing button,
body.user-facing input,
body.user-facing select,
body.user-facing textarea {
  font-family:inherit;
  font-size:16px;
}

body.user-facing [hidden] {
  display:none !important;
}

body.user-facing small { font-size:12px;line-height:1.45; }
body.user-facing .eyebrow,
body.user-facing .nav-label,
body.user-facing .model-tag {
  font-size:12px;
  letter-spacing:.065em;
}

body.user-facing h1,
body.user-facing h2,
body.user-facing h3,
body.user-facing .brand-mark,
body.user-facing .brand h1 {
  font-family:"Iowan Old Style","Palatino Linotype","Book Antiqua",Georgia,serif;
}

body.user-facing :where(a,button,input,select,textarea,summary):focus-visible {
  outline:3px solid rgba(232,120,154,.72);
  outline-offset:3px;
}

body.signed-user-page {
  width:100%;
  height:100dvh;
  min-height:0;
  overflow:hidden;
  background:
    radial-gradient(circle at 86% 8%,rgba(232,120,154,.11),transparent 28%),
    #f3edf4;
}

.user-shell-frame {
  display:grid;
  grid-template-columns:104px minmax(0,1fr);
  width:min(1600px,100%);
  height:100dvh;
  margin:0 auto;
  overflow:hidden;
  background:var(--user-paper);
  box-shadow:var(--user-shadow);
}

.user-page-stage {
  min-width:0;
  min-height:0;
  overflow:auto;
  overscroll-behavior:contain;
  background:
    linear-gradient(180deg,rgba(255,255,255,.62),rgba(250,246,251,.94)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 95px,
      rgba(63,39,70,.025) 96px
    );
}

body.user-facing .app-navigation {
  width:auto;
  min-width:0;
  background:
    radial-gradient(circle at 40% 92%,rgba(232,120,154,.17),transparent 32%),
    linear-gradient(180deg,#1b1029,#140c20);
}

body.user-facing .app-navigation .brand-mark {
  color:#24142d;
  text-decoration:none;
  box-shadow:0 8px 24px rgba(232,120,154,.2);
}

body.user-facing .app-navigation .settings-link {
  min-height:68px;
  gap:7px;
  border:1px solid transparent;
  color:rgba(255,255,255,.67);
  font-size:12px;
  line-height:1.1;
}

body.user-facing .app-navigation .settings-link:hover,
body.user-facing .app-navigation .settings-link.active {
  border-color:rgba(255,255,255,.08);
  background:rgba(255,255,255,.09);
  color:#fff;
}

body.user-facing .app-navigation .settings-link.active {
  box-shadow:inset 3px 0 0 var(--user-rose);
}

body.user-facing .app-navigation .settings-link svg {
  width:22px;
  height:22px;
}

.app-navigation .user-shell-profile-link {
  order:5;
  margin-top:auto;
}

.app-navigation .user-shell-admin-link { order:6; }
.user-shell-profile-mark {
  display:grid;
  width:25px;
  height:25px;
  place-items:center;
  border:1px solid rgba(255,255,255,.2);
  border-radius:50%;
  background:linear-gradient(145deg,#f39ab4,#83567f);
  color:#1c1026;
  font:700 13px "Iowan Old Style","Palatino Linotype",serif;
}

/* The shared frame turns formerly unrelated signed-in pages into one app. */
.signed-user-page .user-page-stage > main {
  width:min(1180px,calc(100% - 56px));
  min-height:100%;
  margin:0 auto;
  padding-top:40px;
  padding-bottom:80px;
}

.signed-user-page :where(
  .utility-card,.preference-card,.profile-sheet,.relationship-panel,
  .memory-panel,.profile-gallery-card,.self-profile-form
) {
  border:1px solid var(--user-line);
  border-radius:var(--user-radius);
  background:rgba(255,255,255,.9);
  box-shadow:0 12px 38px rgba(48,27,57,.065);
}

.signed-user-page :where(
  .photos-page-header,.profile-topbar,.settings-header,.preference-header,
  .continuity-header,.utility-page>header
) {
  color:var(--user-ink);
}

.signed-user-page :where(
  .photos-page-header,.profile-topbar,.settings-header,.preference-header,
  .continuity-header
) .back-link,
.signed-user-page .catalog-brand-lockup,
.signed-user-page .catalog-header>.back-link {
  display:none;
}

.signed-user-page :where(
  .photos-page-header,.settings-header,.preference-header,.continuity-header,
  .utility-page>header
) h1,
.signed-user-page .self-profile-hero h1 {
  color:var(--user-ink);
  font-size:clamp(38px,5vw,62px);
  letter-spacing:-.045em;
  line-height:1;
}

.signed-user-page :where(
  .photos-page-header,.settings-header,.preference-header,.continuity-header,
  .utility-page>header
) p,
.signed-user-page .self-profile-hero p {
  font-size:16px;
  line-height:1.65;
}

.signed-user-page :where(label,.field>span,legend) {
  color:var(--user-muted);
  font-size:14px;
  font-weight:650;
}

.signed-user-page :where(input,select,textarea) {
  min-height:48px;
  padding:13px 15px;
  border-color:var(--user-line);
  border-radius:12px;
  background:#fff;
  color:var(--user-ink);
}

.signed-user-page textarea { line-height:1.55; }

.signed-user-page :where(
  .primary-action,.quiet-action,.quiet-bordered-action,.photo-upload-button,
  .add-memory-button
) {
  min-height:46px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:11px 17px;
  border-radius:12px;
  font-size:15px;
}

/* Boyfriend catalog retains its portraits but now lives inside the app frame. */
.signed-user-page .catalog-page {
  display:block;
  width:100%;
  min-height:100%;
  padding:0;
}

.signed-user-page .catalog-header {
  position:relative;
  height:auto;
  padding:4px 8px 34px;
  overflow:visible;
  background:transparent;
  color:var(--user-ink);
}

.signed-user-page .catalog-header h1 {
  max-width:760px;
  margin:10px 0 18px;
  font-size:clamp(42px,6vw,68px);
  line-height:.98;
}

.signed-user-page .catalog-header>p:not(.eyebrow):not(.catalog-count) {
  max-width:680px;
  color:var(--user-muted);
  font-size:16px;
}

.signed-user-page .catalog-count {
  color:var(--user-muted);
  font-size:12px;
}

.signed-user-page .active-companions {
  max-width:760px;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.signed-user-page .active-companions>small {
  grid-column:1/-1;
  color:var(--user-muted);
  font-size:10px;
  font-weight:700;
  letter-spacing:.1em;
}

.signed-user-page .active-companions>div {
  grid-template-columns:40px minmax(0,1fr) 40px;
  min-width:0;
  padding:4px;
  border:1px solid var(--user-line);
  border-radius:14px;
  background:rgba(255,255,255,.82);
  box-shadow:0 8px 24px rgba(45,25,54,.045);
}

.signed-user-page .active-companion-avatar {
  width:36px;
  height:36px;
  border:1px solid var(--user-line);
}

.signed-user-page .active-companions button {
  min-width:0;
  min-height:40px;
  padding:7px 9px;
  overflow:hidden;
  border:0;
  border-radius:10px;
  background:transparent;
  color:var(--user-ink);
  font-size:14px;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.signed-user-page .active-companions button:hover {
  background:rgba(232,120,154,.1);
}

.signed-user-page .active-companions button[data-archive] {
  color:var(--user-rose);
  font-size:18px;
}

.signed-user-page .persona-grid {
  grid-template-columns:repeat(3,minmax(230px,1fr));
  gap:14px;
  padding:0 8px;
  background:transparent;
}

.signed-user-page .persona-card {
  min-height:350px;
  padding:28px;
  border:1px solid var(--user-line);
  border-radius:18px;
  background:rgba(255,255,255,.88);
  box-shadow:0 10px 30px rgba(45,25,54,.055);
}

.signed-user-page .persona-card p {
  color:var(--user-muted);
  font-size:15px;
}

/* Chat and inbox: familiar messaging proportions with the private-letter line. */
body.user-facing .shell {
  grid-template-columns:104px 380px minmax(0,1fr);
  width:min(1600px,100%);
}

body.user-facing .conversation-pane {
  border-right-color:var(--user-line);
  background:
    linear-gradient(180deg,rgba(255,255,255,.97),rgba(251,247,251,.98)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 79px,
      rgba(71,43,76,.025) 80px
    );
}

body.user-facing .inbox-header { padding:31px 24px 20px; }
body.user-facing .inbox-header .eyebrow { font-size:12px; }
body.user-facing .inbox-header h1 { font-size:38px; }

body.user-facing .conversation-pane .conversation-history-heading .new-chat {
  width:36px;
  min-width:36px;
  min-height:36px;
  height:36px;
  flex:none;
  align-self:auto;
  justify-content:center;
  gap:0;
  margin:0;
  padding:0;
  border:1px solid rgba(232,120,154,.52);
  border-radius:999px;
  background:linear-gradient(135deg,#271735,#1d122a);
  box-shadow:none;
  font-size:11px;
  font-weight:700;
}

body.user-facing .conversation-pane .conversation-history-heading .new-chat:hover {
  border-color:rgba(255,255,255,.38);
  background:linear-gradient(135deg,#342044,#251532);
}

body.user-facing .conversation-history-heading .nav-label {
  margin:0;
  color:#887589;
}

body.user-facing .conversation-entry { min-height:76px; }
body.user-facing .conversation-item {
  grid-template-columns:56px minmax(0,1fr);
  gap:13px;
  min-height:75px;
  padding:10px 6px 10px 12px;
}

body.user-facing .conversation-avatar {
  width:54px;
  height:54px;
  font-size:23px;
}

body.user-facing .conversation-copy { gap:4px; }
body.user-facing .conversation-topline strong { font-size:16px; }
body.user-facing .conversation-preview { font-size:14px; }
body.user-facing .conversation-topic,
body.user-facing .conversation-topline time { font-size:12px; }
body.user-facing .conversation-unread {
  min-width:22px;
  height:22px;
  font-size:12px;
}
body.user-facing .chat::before {
  left:clamp(28px,6vw,94px);
  background:rgba(232,120,154,.3);
}

body.user-facing .chat-header {
  min-height:94px;
  padding:17px clamp(20px,4vw,56px);
  background:rgba(252,249,252,.88);
}

body.user-facing .avatar {
  width:52px;
  min-width:52px;
  max-width:52px;
  height:52px;
  min-height:52px;
  max-height:52px;
  flex:0 0 52px;
  aspect-ratio:1;
  overflow:hidden;
  font-size:25px;
}
body.user-facing .avatar img {
  display:block;
  width:100%;
  height:100%;
  aspect-ratio:1;
  object-fit:cover;
}
body.user-facing .companion h2 { font-size:22px; }
body.user-facing .companion p { font-size:14px; }

body.user-facing .chat-style-control button {
  min-height:40px;
  padding:0 13px;
  font-size:13px;
}

body.user-facing .theme-toggle,
body.user-facing .chat-options-button,
body.user-facing .secret-chat-button,
body.user-facing .menu-button {
  min-width:44px;
  min-height:44px;
}

body.user-facing .empty-state .eyebrow { font-size:12px; }
body.user-facing .empty-state>p:last-child { font-size:16px; }

body.user-facing .message-row { margin-bottom:24px; }
body.user-facing .message-bubble {
  padding:15px 18px;
  border-radius:9px 20px 20px 20px;
  font-size:16px;
  line-height:1.58;
}

body.user-facing .message-row.user .message-bubble {
  border-radius:20px 9px 20px 20px;
}

body.user-facing .message-action {
  width:40px;
  height:40px;
  border-radius:10px;
}

body.user-facing .message-action svg { width:17px; }
body.user-facing .chat-session-divider { font-size:12px; }

body.user-facing .composer {
  min-height:66px;
  margin-bottom:max(24px,env(safe-area-inset-bottom));
  padding:10px 158px 10px 18px;
  border-color:#d9cfdc;
  border-radius:22px;
  box-shadow:0 16px 42px rgba(47,27,57,.12);
}

body.user-facing .composer textarea {
  min-height:44px;
  padding:10px 0;
  font-size:16px;
}

body.user-facing .attach-button,
body.user-facing .voice-button,
body.user-facing .send-button,
body.user-facing .stop-button {
  width:44px;
  height:44px;
}

body.user-facing .attach-button { right:62px;bottom:11px; }
body.user-facing .voice-button { right:108px;bottom:11px; }
body.user-facing .send-button,
body.user-facing .stop-button { right:9px;bottom:10px; }

body.user-facing .composer-attachment strong { font-size:14px; }
body.user-facing .composer-attachment span,
body.user-facing .voice-recording-status { font-size:12px; }
body.user-facing .composer-attachment button { width:44px;height:44px; }

/* Dark mode uses the same hierarchy instead of isolated white page styles. */
html[data-theme="dark"] body.user-facing {
  --user-paper:#17101f;
  --user-ink:#f7eff8;
  --user-muted:#b8a8ba;
  --user-line:#423247;
  background:#100a18;
  color:var(--user-ink);
}

html[data-theme="dark"] .user-page-stage {
  background:
    linear-gradient(180deg,rgba(29,19,38,.98),rgba(19,12,27,.99)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 95px,
      rgba(255,255,255,.025) 96px
    );
}

html[data-theme="dark"] .signed-user-page :where(
  .utility-card,.preference-card,.profile-sheet,.relationship-panel,
  .memory-panel,.profile-gallery-card,.self-profile-form,.persona-card
) {
  border-color:var(--user-line);
  background:rgba(34,23,43,.9);
  color:var(--user-ink);
}

html[data-theme="dark"] .signed-user-page .active-companions>div {
  border-color:var(--user-line);
  background:rgba(34,23,43,.9);
  box-shadow:0 10px 28px rgba(0,0,0,.2);
}

html[data-theme="dark"] .signed-user-page .active-companions button {
  background:transparent;
  color:var(--user-ink);
}

html[data-theme="dark"] .signed-user-page .active-companions button:hover {
  background:rgba(232,120,154,.13);
}

html[data-theme="dark"] .signed-user-page .active-companions button[data-archive] {
  color:#f3a9bd;
}

html[data-theme="dark"] .signed-user-page :where(input,select,textarea) {
  border-color:var(--user-line);
  background:#1d1426;
  color:var(--user-ink);
}

html[data-theme="dark"] .signed-user-page .photo-upload-button {
  background:var(--user-rose);
  color:#241321;
}

html[data-theme="dark"] .signed-user-page .field > span,
html[data-theme="dark"] .signed-user-page .trait label,
html[data-theme="dark"] .signed-user-page .field small {
  color:var(--user-muted);
}

html[data-theme="dark"] body.user-facing .guest-action {
  border-color:#6c465c;
  background:#24172f;
  color:#f3b3c4;
}

html[data-theme="dark"] .signed-user-page .catalog-header,
html[data-theme="dark"] .signed-user-page .catalog-header h1,
html[data-theme="dark"] .signed-user-page :where(
  .photos-page-header,.settings-header,.preference-header,.continuity-header,
  .utility-page>header
),
html[data-theme="dark"] .signed-user-page :where(
  .photos-page-header,.settings-header,.preference-header,.continuity-header,
  .utility-page>header
) h1,
html[data-theme="dark"] .signed-user-page .self-profile-hero h1 {
  color:var(--user-ink);
}

html[data-theme="dark"] body.user-facing .chat-header {
  border-bottom-color:var(--user-line);
  background:rgba(28,18,37,.89);
}

html[data-theme="dark"] body.user-facing .conversation-pane {
  border-right-color:var(--user-line);
  background:
    linear-gradient(180deg,rgba(28,18,38,.98),rgba(18,11,27,.99)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 79px,
      rgba(255,255,255,.028) 80px
    );
  color:var(--user-ink);
  color-scheme:dark;
}

html[data-theme="dark"] body.user-facing .conversation-pane :where(
  .inbox-header .eyebrow,
  .conversation-history .nav-label,
  .sidebar-profile-card small,
  .inbox-install small,
  .conversation-topline time,
  .conversation-topic,
  .conversation-preview,
  .conversation-list-empty,
  .conversation-list-empty small
) {
  color:#c2b1c4;
}

html[data-theme="dark"] body.user-facing .conversation-pane .conversation-entry {
  border-bottom-color:rgba(255,255,255,.075);
}

html[data-theme="dark"] body.user-facing .conversation-pane .conversation-item {
  color:#f2eaf4;
}

html[data-theme="dark"] body.user-facing .conversation-pane .conversation-item:hover {
  background:rgba(255,255,255,.055);
  color:#fff;
}

html[data-theme="dark"] body.user-facing .conversation-pane .conversation-item.active {
  background:rgba(243,160,181,.14);
  color:#fff;
}

html[data-theme="dark"] body.user-facing .conversation-pane .conversation-list-empty strong {
  color:var(--user-ink);
}

html[data-theme="dark"] body.user-facing .conversation-pane .new-chat {
  border-color:rgba(255,255,255,.3);
  background:linear-gradient(135deg,#ef9bb4,#dc7698);
  color:#241321;
}

@media(max-width:1120px) and (min-width:761px) {
  body.user-facing .shell { grid-template-columns:88px 340px minmax(0,1fr); }
  .user-shell-frame { grid-template-columns:88px minmax(0,1fr); }
  body.user-facing .app-navigation { padding-inline:8px; }
  body.user-facing .app-navigation .settings-link { font-size:11px; }
  .signed-user-page .persona-grid { grid-template-columns:repeat(2,minmax(230px,1fr)); }
}

@media(max-width:760px) {
  body.signed-user-page { overflow:hidden; }
  .user-shell-frame { display:block;width:100%;height:100dvh; }
  .user-page-stage {
    width:100%;
    height:100dvh;
    padding-bottom:calc(62px + env(safe-area-inset-bottom));
  }

  .signed-user-page .user-page-stage>main {
    width:min(100% - 28px,760px);
    min-height:auto;
    padding-top:max(24px,env(safe-area-inset-top));
    padding-bottom:48px;
  }

  body.user-facing .app-navigation {
    height:calc(62px + env(safe-area-inset-bottom));
    padding:3px 6px env(safe-area-inset-bottom);
  }

  body.user-facing .app-navigation .sidebar-tools {
    grid-template-columns:repeat(4,minmax(0,1fr));
  }

  body.user-facing .app-navigation .settings-link {
    min-height:0;
    height:100%;
    gap:2px;
    padding:3px 2px;
    border:0;
    border-radius:10px;
    font-size:10px;
    line-height:1;
  }

  body.user-facing .app-navigation .settings-link svg {
    width:19px;
    height:19px;
  }

  body.user-facing .app-navigation .settings-link.active {
    box-shadow:inset 0 2px 0 var(--user-rose);
  }

  body.signed-user-page .page-theme-toggle {
    right:14px;
    bottom:calc(72px + env(safe-area-inset-bottom));
  }

  .app-navigation .user-shell-profile-link,
  .app-navigation .user-shell-admin-link { display:none!important; }

  body.user-facing .conversation-pane {
    inset:0 0 calc(62px + env(safe-area-inset-bottom));
  }

  body.user-facing .inbox-header {
    padding:max(18px,env(safe-area-inset-top)) 14px 12px;
  }

  body.user-facing .conversation-history-heading { margin-inline:14px; }
  body.user-facing .conversation-pane .inbox-install { margin-inline:14px; }

  body.user-facing .conversation-entry { min-height:78px; }
  body.user-facing .conversation-item {
    grid-template-columns:58px minmax(0,1fr);
    min-height:77px;
    padding-block:10px;
  }
  body.user-facing .conversation-avatar { width:56px;height:56px; }

  body.user-facing .chat-header {
    min-height:82px;
    padding:max(12px,env(safe-area-inset-top)) 12px 10px;
  }

  body.user-facing .avatar {
    width:48px;
    min-width:48px;
    max-width:48px;
    height:48px;
    min-height:48px;
    max-height:48px;
    flex-basis:48px;
  }
  body.user-facing .companion h2 { font-size:20px; }
  body.user-facing .companion p { font-size:13px; }
  body.user-facing .chat-style-control button {
    min-height:36px;
    padding:0 8px;
    font-size:12px;
  }

  body.user-facing .message-bubble,
  body.user-facing .message-stack {
    max-width:88%;
  }

  body.user-facing .message-action { width:44px;height:44px; }

  body.user-facing .composer {
    margin:0 10px max(10px,env(safe-area-inset-bottom));
    padding-right:151px;
  }

  .signed-user-page .catalog-header { padding:0 2px 26px; }
  .signed-user-page .catalog-header h1 { font-size:44px; }
  .signed-user-page .persona-grid {
    grid-template-columns:1fr;
    padding:0;
  }
  .signed-user-page .persona-card {
    min-height:0;
    grid-template-columns:92px minmax(0,1fr);
  }
  .signed-user-page .active-companions { grid-template-columns:1fr; }
}

@media(max-width:390px) {
  body.user-facing .conversation-topline strong { font-size:15px; }
  body.user-facing .conversation-preview { font-size:13px; }
  body.user-facing .chat-style-control button { padding-inline:6px; }
  .signed-user-page .user-page-stage>main { width:calc(100% - 20px); }
}

@media(max-width:760px) and (hover:none) and (pointer:coarse) {
  body.user-facing .message-row {
    margin-bottom:14px;
  }

  body.user-facing .message-bubble {
    max-width:90%;
    padding:8px 12px;
    font-size:15px;
    line-height:1.44;
    touch-action:manipulation;
  }

  body.user-facing .message-stack {
    max-width:90%;
    gap:4px;
    touch-action:manipulation;
  }

  body.user-facing .message-actions {
    display:none;
  }

  body.user-facing .message-options-trigger {
    position:absolute;
    display:block;
    width:1px;
    height:1px;
    padding:0;
    overflow:hidden;
    clip:rect(0,0,0,0);
    border:0;
    white-space:nowrap;
  }

  body.user-facing .message-options-trigger:focus-visible {
    z-index:3;
    top:50%;
    left:0;
    display:grid;
    width:38px;
    height:38px;
    clip:auto;
    place-items:center;
    overflow:visible;
    border:1px solid rgba(232,120,154,.38);
    border-radius:12px;
    background:var(--white);
    color:var(--ink);
    box-shadow:0 8px 24px rgba(27,16,35,.16);
    font-size:22px;
    transform:translateY(-50%);
  }

  body.user-facing .message-row.user .message-options-trigger:focus-visible {
    right:0;
    left:auto;
  }

  .message-action-dialog.message-action-dialog-anchored {
    position:fixed;
    inset:auto;
    width:min(252px,calc(100vw - 24px));
    max-height:calc(100dvh - 24px);
    margin:0;
    overflow:visible;
    border-radius:18px;
    box-shadow:0 18px 52px rgba(15,9,23,.3);
    --message-action-surface:#fff;
  }

  .message-action-dialog.message-action-dialog-anchored::backdrop {
    background:rgba(13,8,20,.28);
    backdrop-filter:blur(1px);
  }

  .message-action-dialog-anchored .message-action-sheet {
    position:relative;
    padding:7px;
    overflow:visible;
    border-radius:18px;
    background:var(--message-action-surface);
  }

  .message-action-dialog-anchored .message-action-sheet::after {
    position:absolute;
    width:12px;
    height:12px;
    border:1px solid var(--line);
    background:var(--message-action-surface);
    content:"";
    transform:rotate(45deg);
  }

  .message-action-dialog-anchored[data-placement="below"] .message-action-sheet::after {
    top:-7px;
    border-right:0;
    border-bottom:0;
  }

  .message-action-dialog-anchored[data-placement="above"] .message-action-sheet::after {
    bottom:-7px;
    border-top:0;
    border-left:0;
  }

  .message-action-dialog-anchored[data-side="assistant"] .message-action-sheet::after {
    left:22px;
  }

  .message-action-dialog-anchored[data-side="user"] .message-action-sheet::after {
    right:22px;
  }

  .message-action-dialog-anchored .message-action-sheet>header,
  .message-action-dialog-anchored .message-action-cancel {
    display:none;
  }

  .message-action-dialog-anchored .message-action-list {
    max-height:calc(100dvh - 52px);
    gap:2px;
    overflow-y:auto;
  }

  .message-action-dialog-anchored .message-sheet-action {
    min-height:44px;
    grid-template-columns:34px minmax(0,1fr);
    gap:8px;
    padding:5px 9px;
    border:0;
    border-radius:12px;
    background:transparent;
  }

  .message-action-dialog-anchored .message-sheet-action>span {
    width:32px;
    height:32px;
    border-radius:10px;
  }

  .message-action-dialog-anchored .message-sheet-action svg {
    width:18px;
    height:18px;
  }

  .message-action-dialog-anchored .message-sheet-action strong {
    font-size:14px;
  }

  html[data-theme="dark"] .message-action-dialog.message-action-dialog-anchored {
    --message-action-surface:#20142b;
  }

  html[data-theme="dark"] body.user-facing .message-options-trigger:focus-visible {
    border-color:#62445f;
    background:#21152b;
    color:#f7eff8;
  }
}

@media(prefers-reduced-motion:reduce) {
  body.user-facing *,
  body.user-facing *::before,
  body.user-facing *::after {
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
  }
}
