:root {
  --bg: #0c0c0e;
  --surface: #141417;
  --surface-2: #1a1a1e;
  --surface-3: #222228;
  --line: rgba(255,255,255,.085);
  --line-strong: rgba(255,255,255,.16);
  --text: #f3f0e9;
  --muted: #aaa7a1;
  --dim: #6c6a69;
  --accent: #d9b78f;
  --accent-2: #a76f54;
  --green: #92b79d;
  --red: #cb7d73;
  --blue: #829bb6;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --sidebar: 224px;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--sans); overflow-x: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

.login-screen { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-columns: 1.08fr .92fr; min-height: 100svh; background: #0a0a0c; }
.login-portrait { background: url('/assets/aya-hoshino.jpg') center 30% / cover no-repeat; filter: saturate(.78) contrast(1.05); }
.login-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent 20%, rgba(10,10,12,.12) 50%, #0a0a0c 67%), linear-gradient(0deg, rgba(0,0,0,.45), transparent 55%); }
.login-panel { position: relative; align-self: center; z-index: 1; max-width: 520px; padding: 7vw; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }
.login-panel h1 { margin: 0; font-family: var(--serif); font-size: clamp(82px, 10vw, 148px); line-height: .82; font-weight: 400; letter-spacing: -.045em; }
.login-copy { max-width: 390px; margin: 30px 0 46px; color: #b4b1ab; font-size: 15px; line-height: 1.8; }
.login-form label { display: block; margin-bottom: 12px; color: #c7c3bd; font-size: 12px; }
.credential-fields { display: grid; gap: 5px; }
.credential-fields > input { width: 100%; padding: 15px 4px; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--line-strong); outline: 0; }
.credential-fields input::placeholder { color: #5f5d5c; }
.credential-fields input:focus { border-color: rgba(217,183,143,.55); }
.password-row { display: flex; border-bottom: 1px solid var(--line-strong); }
.password-row:focus-within { border-color: rgba(217,183,143,.55); }
.password-row input { flex: 1; width: 100%; padding: 15px 4px; color: var(--text); background: transparent; border: 0; outline: 0; }
.password-row input::placeholder { color: #5f5d5c; }
.password-row button { padding: 0 18px; color: var(--accent); background: transparent; border: 0; cursor: pointer; }
.form-error { min-height: 20px; color: #da827b; font-size: 12px; }

.loading-screen { position: fixed; inset: 0; z-index: 90; display: grid; place-content: center; gap: 24px; background: var(--bg); text-align: center; }
.loading-screen p { color: var(--muted); font-size: 13px; letter-spacing: .05em; }
.loading-orbit { position: relative; width: 54px; height: 54px; margin: auto; border: 1px solid var(--line-strong); border-radius: 50%; }
.loading-orbit::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--line); border-radius: 50%; }
.loading-orbit span { position: absolute; top: -3px; left: 23px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); transform-origin: 4px 30px; animation: orbit 1.8s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }

.app { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; padding: 26px 18px 20px; background: #101012; border-right: 1px solid var(--line); }
.brand-row { display: flex; align-items: center; gap: 11px; padding: 0 8px 32px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; font-family: var(--serif); font-size: 24px; color: #171719; background: var(--text); border-radius: 50%; }
.brand-row div { display: flex; flex-direction: column; }
.brand-row strong { font-size: 13px; letter-spacing: .2em; }
.brand-row small { margin-top: 2px; color: var(--dim); font-size: 10px; letter-spacing: .12em; }
.nav-list { display: flex; flex-direction: column; gap: 4px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 13px; width: 100%; min-height: 43px; padding: 0 12px; color: #797775; background: transparent; border: 0; border-radius: 10px; cursor: pointer; transition: .2s ease; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.035); }
.nav-item.active { color: var(--text); background: rgba(255,255,255,.065); }
.nav-item.active::before { content: ""; position: absolute; left: 0; width: 2px; height: 18px; border-radius: 4px; background: var(--accent); }
.nav-item span { width: 19px; text-align: center; font-size: 17px; font-weight: 400; }
.nav-item b { font-size: 12px; font-weight: 500; }
.unread-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; color: #121214; background: var(--accent); border-radius: 99px; font-size: 10px; line-height: 18px; font-style: normal; text-align: center; }
.sidebar-bottom { margin-top: auto; }
.connection-line { display: flex; align-items: center; gap: 7px; padding: 18px 12px 0; color: var(--dim); }
.connection-dot { width: 6px; height: 6px; border-radius: 50%; background: #7a7a7a; }
.connection-dot.online { background: var(--green); box-shadow: 0 0 8px rgba(146,183,157,.5); }
.connection-dot.warn { background: var(--accent); }
.session-badge { margin-left: auto; padding: 3px 6px; color: #d9cda3; background: rgba(196,169,88,.11); border: 1px solid rgba(196,169,88,.24); border-radius: 5px; font-size: 7px; font-weight: 600; letter-spacing: .12em; }

.main { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 4vw, 58px); background: rgba(12,12,14,.86); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.menu-button { display: none; background: none; border: 0; font-size: 20px; }
.time-pair { display: flex; align-items: center; gap: 18px; }
.time-pair div { display: flex; align-items: baseline; gap: 8px; }
.time-pair small { color: var(--dim); font-size: 8px; font-weight: 600; letter-spacing: .13em; }
.time-pair strong { font-family: var(--serif); font-size: 21px; font-weight: 400; letter-spacing: .02em; }
.time-bridge { width: 26px; height: 1px; background: var(--line-strong); }
.top-actions { display: flex; align-items: center; gap: 12px; }
.account-chip { padding: 6px 9px; color: var(--dim); border: 1px solid var(--line); border-radius: 99px; font-size: 8px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
.account-chip.test { color: #d9cda3; background: rgba(196,169,88,.08); border-color: rgba(196,169,88,.23); }
.icon-button { width: 36px; height: 36px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; transition: .2s; }
.icon-button:hover { color: var(--text); border-color: var(--line-strong); transform: rotate(30deg); }
.icon-button.syncing { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.profile-button { width: 38px; height: 38px; padding: 0; overflow: hidden; background: transparent; border: 1px solid var(--line-strong); border-radius: 50%; cursor: pointer; }
.profile-button img { width: 100%; height: 100%; object-fit: cover; }
.test-world-banner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 62px; padding: 11px clamp(22px, 4vw, 58px); color: #d9cda3; background: linear-gradient(90deg, rgba(196,169,88,.13), rgba(196,169,88,.045)); border-bottom: 1px solid rgba(196,169,88,.2); }
.test-world-banner div { display: flex; flex-direction: column; gap: 3px; }
.test-world-banner strong { font-size: 9px; letter-spacing: .14em; }
.test-world-banner span { color: #aaa486; font-size: 9px; line-height: 1.55; }
.test-world-banner button { flex: 0 0 auto; padding: 7px 10px; color: #d9cda3; background: transparent; border: 1px solid rgba(196,169,88,.27); border-radius: 7px; font-size: 8px; cursor: pointer; }
.test-world .chat-view { height: calc(100vh - 140px); }

.view { display: none; padding: 34px clamp(22px, 4vw, 58px) 70px; max-width: 1540px; margin: auto; animation: fadeUp .35s ease both; }
.active-view { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(5px); } }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .72fr); gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.moment-card { position: relative; min-height: 400px; overflow: hidden; border-radius: var(--radius); background: var(--surface); }
.moment-photo { position: absolute; inset: 0; }
.moment-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 32%; filter: saturate(.68) brightness(.72); transform: scale(1.01); }
.moment-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,8,10,.82), rgba(8,8,10,.2) 65%), linear-gradient(0deg, rgba(8,8,10,.9), transparent 62%); }
.moment-content { position: absolute; inset: auto 0 0 0; padding: 42px; }
.live-label { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: #c7c3bd; font-size: 9px; letter-spacing: .16em; }
.live-label span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(146,183,157,.7); }
.moment-content h2 { max-width: 620px; margin: 0; font-family: var(--serif); font-size: clamp(36px, 4vw, 58px); line-height: 1.02; font-weight: 400; }
.moment-content > p { margin: 12px 0 24px; color: #b7b4ae; font-size: 12px; }
.moment-content blockquote { max-width: 520px; margin: 0; color: #d1cdc5; font-family: var(--serif); font-size: 18px; font-style: italic; line-height: 1.45; }
.telemetry-panel { padding: 25px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-heading h3 { margin: 0; font-family: var(--serif); font-size: 25px; font-weight: 400; }
.pill { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; color: var(--green); background: rgba(146,183,157,.1); border: 1px solid rgba(146,183,157,.15); border-radius: 99px; font-size: 9px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.primary-mood { display: flex; align-items: center; gap: 14px; margin: 34px 0 36px; padding: 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; }
.mood-orb { width: 42px; height: 42px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #f0d5b5, #9c694c 58%, #3a2921); box-shadow: 0 0 28px rgba(217,183,143,.18); }
.primary-mood div { display: flex; flex-direction: column; }
.primary-mood small { color: var(--dim); font-size: 10px; }
.primary-mood strong { margin-top: 3px; font-family: var(--serif); font-size: 24px; font-weight: 400; text-transform: capitalize; }
.meter-list { display: flex; flex-direction: column; gap: 23px; }
.meter-row > div:first-child { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.meter-row b { color: var(--text); font-weight: 500; }
.meter { height: 3px; overflow: hidden; background: var(--surface-3); border-radius: 4px; }
.meter i { display: block; width: 0; height: 100%; background: var(--accent); border-radius: 4px; transition: width .7s ease; }

.today-grid { display: grid; grid-template-columns: 1.35fr .75fr .9fr; gap: 18px; margin-top: 18px; }
.map-panel, .relationship-panel, .recent-panel { min-height: 290px; padding: 23px; }
.coordinate { color: var(--dim); font-family: ui-monospace, monospace; font-size: 9px; }
.map { height: 205px; margin-top: 18px; overflow: hidden; border-radius: 12px; background: #17181a; }
.leaflet-container { background: #17181a; font-family: var(--sans); }
.leaflet-control-attribution { color: #777 !important; background: rgba(10,10,12,.7) !important; font-size: 8px !important; }
.leaflet-control-zoom a { color: #ddd !important; background: #18181b !important; border-color: #2c2c31 !important; }
.aya-map-marker { position: relative; width: 18px; height: 18px; border: 2px solid #f1e8dc; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 7px rgba(167,111,84,.2), 0 0 22px rgba(217,183,143,.38); }
.aya-map-marker::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: white; }
.relationship-spark { color: var(--accent); font-family: var(--serif); font-size: 32px; }
.relationship-meters { display: flex; flex-direction: column; gap: 15px; margin-top: 26px; }
.relationship-metric { display: grid; grid-template-columns: 54px 1fr 29px; align-items: center; gap: 9px; color: var(--muted); font-size: 10px; }
.relationship-metric .meter { height: 2px; }
.relationship-metric b { color: var(--text); font-size: 10px; text-align: right; }
.relationship-note { margin: 23px 0 0; padding-top: 18px; color: var(--dim); border-top: 1px solid var(--line); font-size: 10px; line-height: 1.6; }
.text-button { padding: 0; color: var(--accent); background: transparent; border: 0; font-size: 10px; cursor: pointer; }
.latest-event { margin-top: 24px; }
.latest-event .event-kicker { color: var(--accent); font-size: 9px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.latest-event h4 { margin: 10px 0 8px; font-family: var(--serif); font-size: 23px; font-weight: 400; }
.latest-event p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.latest-event blockquote { margin: 15px 0 0; color: #cac5bd; font-family: var(--serif); font-style: italic; font-size: 14px; }
.skeleton-block { min-height: 100px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.03), transparent); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.chat-view { height: calc(100vh - 78px); padding-top: 0; padding-bottom: 0; }
.chat-view.active-view { display: grid; grid-template-rows: 80px minmax(0,1fr) auto auto; }
.chat-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.chat-person { position: relative; display: flex; align-items: center; gap: 12px; }
.chat-person img { width: 42px; height: 42px; object-fit: cover; border-radius: 50%; }
.presence { position: absolute; left: 31px; top: 31px; width: 9px; height: 9px; border: 2px solid var(--bg); border-radius: 50%; background: var(--green); }
.chat-person h2 { margin: 0; font-family: var(--serif); font-size: 23px; font-weight: 400; }
.chat-person p { margin: 3px 0 0; color: var(--dim); font-size: 10px; }
.urgent-button { padding: 8px 12px; color: #b9847c; background: transparent; border: 1px solid rgba(203,125,115,.25); border-radius: 99px; font-size: 9px; cursor: pointer; }
.messages { overflow-y: auto; padding: 34px max(2vw, 8px); scrollbar-width: thin; scrollbar-color: #39393d transparent; }
.message { display: flex; margin: 0 0 22px; }
.message.in { justify-content: flex-end; }
.message-inner { max-width: min(68%, 670px); }
.message-bubble { padding: 13px 16px; border-radius: 15px; font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.message.out .message-bubble { color: #e9e5de; background: var(--surface-2); border-top-left-radius: 4px; }
.message.in .message-bubble { color: #171719; background: #ded6ca; border-top-right-radius: 4px; }
.message-meta { margin-top: 5px; color: var(--dim); font-size: 8px; }
.message.in .message-meta { text-align: right; }
.pending-reply { display: flex; align-items: center; gap: 9px; padding: 10px 13px; color: var(--muted); background: rgba(255,255,255,.025); border-top: 1px solid var(--line); font-size: 10px; }
.pending-reply > span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s infinite; }
.pending-reply p { margin: 0; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.composer { display: grid; grid-template-columns: 1fr 44px; align-items: end; gap: 12px; padding: 18px 0 24px; border-top: 1px solid var(--line); }
.composer textarea { width: 100%; max-height: 160px; padding: 12px 14px; resize: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 13px; outline: none; line-height: 1.5; }
.composer textarea:focus { border-color: rgba(217,183,143,.35); }
.composer button { width: 44px; height: 44px; color: #171719; background: var(--text); border: 0; border-radius: 50%; font-size: 18px; cursor: pointer; }
.composer button:disabled { opacity: .35; cursor: wait; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin: 12px 0 42px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.page-heading h2 { margin: 0; font-family: var(--serif); font-size: clamp(35px, 4vw, 54px); font-weight: 400; }
.page-heading > p { max-width: 430px; margin: 0; color: var(--dim); font-size: 11px; line-height: 1.7; text-align: right; }
.timeline { position: relative; max-width: 980px; margin: auto; }
.timeline::before { content: ""; position: absolute; top: 8px; bottom: 0; left: 121px; width: 1px; background: var(--line); }
.timeline-item { position: relative; display: grid; grid-template-columns: 97px 1fr; gap: 48px; padding-bottom: 35px; }
.timeline-time { color: var(--dim); font-size: 9px; line-height: 1.55; text-align: right; }
.timeline-time strong { display: block; color: #b5b1aa; font-size: 10px; font-weight: 500; }
.timeline-dot { position: absolute; left: 117px; top: 5px; width: 9px; height: 9px; border: 2px solid var(--bg); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px rgba(217,183,143,.3); }
.timeline-card { padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.timeline-card header { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.event-type { color: var(--accent); font-size: 8px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
.event-place { color: var(--dim); font-size: 9px; }
.timeline-card h3 { margin: 11px 0 9px; font-family: var(--serif); font-size: 24px; font-weight: 400; }
.timeline-card > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.private-thought { margin: 16px 0 0 !important; padding: 14px 16px; color: #d1cbc2 !important; background: rgba(217,183,143,.055); border-left: 2px solid rgba(217,183,143,.45); font-family: var(--serif); font-size: 15px !important; font-style: italic; }
.effects { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.effect-chip { padding: 4px 7px; color: var(--dim); background: var(--surface-2); border-radius: 6px; font-size: 8px; }
.effect-chip.positive { color: var(--green); }
.effect-chip.negative { color: var(--red); }

.diary-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.diary-card { min-height: 280px; padding: 30px; background: #ebe4d8; color: #282522; border-radius: 5px 16px 16px 5px; box-shadow: inset 5px 0 rgba(56,45,35,.08); }
.diary-card time { color: #8d8175; font-size: 9px; letter-spacing: .1em; }
.diary-card h3 { margin: 35px 0 15px; font-family: var(--serif); font-size: 29px; font-weight: 400; }
.diary-card p { margin: 0; color: #534d46; font-family: var(--serif); font-size: 17px; line-height: 1.75; }
.diary-card footer { margin-top: 28px; color: #9b7b5e; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filter-button { padding: 7px 11px; color: var(--dim); background: transparent; border: 1px solid var(--line); border-radius: 99px; font-size: 9px; cursor: pointer; }
.filter-button.active { color: #161618; background: var(--text); border-color: var(--text); }
.memory-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.memory-card { min-height: 180px; display: flex; flex-direction: column; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.memory-card header { display: flex; justify-content: space-between; color: var(--dim); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.memory-card p { margin: 24px 0; color: #d3cfc7; font-family: var(--serif); font-size: 17px; line-height: 1.5; }
.memory-card footer { margin-top: auto; }
.confidence-bar { height: 2px; background: var(--surface-3); }
.confidence-bar i { display: block; height: 100%; background: var(--accent); }
.memory-meta { display: flex; justify-content: space-between; margin-top: 7px; color: var(--dim); font-size: 8px; }
.finance-summary { display: flex; align-items: baseline; gap: 12px; padding: 26px 0 40px; }
.finance-summary small { color: var(--dim); font-size: 11px; }
.finance-summary strong { font-family: var(--serif); font-size: 55px; font-weight: 400; }
.finance-summary span { color: var(--accent); font-size: 10px; }
.finance-list { border-top: 1px solid var(--line); }
.finance-row { display: grid; grid-template-columns: 100px 1fr auto; align-items: center; gap: 20px; padding: 17px 4px; border-bottom: 1px solid var(--line); }
.finance-row time { color: var(--dim); font-size: 9px; }
.finance-row h4 { margin: 0; color: #ccc8c1; font-size: 11px; font-weight: 500; }
.finance-row p { margin: 3px 0 0; color: var(--dim); font-size: 9px; }
.finance-amount { font-family: var(--serif); font-size: 18px; }
.finance-amount.income { color: var(--green); }
.finance-amount.expense { color: #c69389; }

.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.settings-card { min-height: 210px; padding: 25px; }
.settings-card h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 24px; font-weight: 400; }
.settings-card > p { margin: 0 0 25px; color: var(--dim); font-size: 10px; line-height: 1.7; }
.segmented { display: grid; grid-template-columns: repeat(3,1fr); padding: 3px; background: var(--surface-2); border-radius: 10px; }
.segmented button { padding: 9px 6px; color: var(--dim); background: transparent; border: 0; border-radius: 8px; font-size: 10px; cursor: pointer; }
.segmented button.active { color: var(--text); background: var(--surface-3); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; }
.toggle-row span { display: flex; flex-direction: column; }
.toggle-row b { font-size: 11px; font-weight: 500; }
.toggle-row small { margin-top: 4px; color: var(--dim); font-size: 9px; }
.toggle-row input { display: none; }
.toggle-row i { position: relative; flex: 0 0 39px; height: 21px; background: var(--surface-3); border-radius: 99px; transition: .2s; }
.toggle-row i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; background: #8a8885; border-radius: 50%; transition: .2s; }
.toggle-row input:checked + i { background: rgba(203,125,115,.3); }
.toggle-row input:checked + i::after { left: 21px; background: var(--red); }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; padding: 9px 12px; color: var(--muted); background: transparent; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 9px; text-decoration: none; cursor: pointer; }
.secondary-button:hover { color: var(--text); border-color: rgba(255,255,255,.28); }
.danger-button { display: inline-flex; align-items: center; justify-content: center; padding: 10px 13px; color: #e6a99f; background: rgba(203,125,115,.06); border: 1px solid rgba(203,125,115,.32); border-radius: 8px; font-size: 9px; cursor: pointer; }
.danger-button:hover { background: rgba(203,125,115,.12); }
.danger-button:disabled { opacity: .45; cursor: wait; }
.test-control-card { background: linear-gradient(135deg, rgba(196,169,88,.08), var(--surface) 58%); border-color: rgba(196,169,88,.22); }
.test-control-card .eyebrow { margin-bottom: 7px; color: #d9cda3; }
.danger-card { border-color: rgba(203,125,115,.14); }

.profile-drawer { position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; width: min(470px, 92vw); overflow-y: auto; background: #111113; border-left: 1px solid var(--line); transform: translateX(101%); transition: transform .32s ease; }
.profile-drawer.open { transform: translateX(0); }
.drawer-close { position: absolute; z-index: 2; top: 16px; right: 16px; width: 34px; height: 34px; color: white; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.16); border-radius: 50%; font-size: 20px; cursor: pointer; backdrop-filter: blur(8px); }
.drawer-image { height: 310px; }
.drawer-image img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; filter: saturate(.75); }
.drawer-content { padding: 30px; }
.drawer-content h2 { margin: 0; font-family: var(--serif); font-size: 42px; font-weight: 400; }
.chinese-name { margin: 4px 0 28px; color: var(--dim); font-size: 11px; }
.profile-facts { display: grid; grid-template-columns: repeat(2,1fr); gap: 1px; margin-bottom: 26px; background: var(--line); border: 1px solid var(--line); }
.profile-fact { min-height: 80px; padding: 14px; background: var(--surface); }
.profile-fact small { display: block; margin-bottom: 7px; color: var(--dim); font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.profile-fact p { margin: 0; color: #d3cfc7; font-size: 10px; line-height: 1.5; }
.drawer-content details { border-top: 1px solid var(--line); }
.drawer-content details:last-child { border-bottom: 1px solid var(--line); }
.drawer-content summary { padding: 17px 0; color: #cbc7bf; font-size: 11px; cursor: pointer; }
.drawer-content details > div { padding: 0 0 19px; color: var(--muted); font-size: 10px; line-height: 1.75; }
.drawer-content details p { margin: 0 0 10px; }
.drawer-backdrop { position: fixed; z-index: 65; inset: 0; visibility: hidden; opacity: 0; background: rgba(0,0,0,.58); transition: .3s; }
.drawer-backdrop.open { visibility: visible; opacity: 1; }
.toast-stack { position: fixed; z-index: 85; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; }
.toast { max-width: 340px; padding: 13px 15px; color: #e5e1da; background: #25252a; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 12px 28px rgba(0,0,0,.3); font-size: 10px; line-height: 1.5; animation: toastIn .25s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(5px); } }
.empty-state { padding: 50px; color: var(--dim); border: 1px dashed var(--line-strong); border-radius: 14px; font-family: var(--serif); font-size: 19px; text-align: center; }

@media (max-width: 1120px) {
  .today-grid { grid-template-columns: 1fr 1fr; }
  .map-panel { grid-column: 1 / -1; }
  .memory-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 820px) {
  :root { --sidebar: 0px; }
  .sidebar { width: 238px; transform: translateX(-102%); transition: transform .25s; box-shadow: 20px 0 45px rgba(0,0,0,.35); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-button { display: block; }
  .topbar { height: 68px; padding: 0 17px; }
  .time-pair { gap: 7px; }
  .time-pair div { flex-direction: column; gap: 1px; }
  .time-pair small { font-size: 6px; }
  .time-pair strong { font-size: 16px; }
  .time-bridge { width: 12px; }
  .view { padding: 22px 16px 60px; }
  .hero-grid { grid-template-columns: 1fr; }
  .moment-card { min-height: 390px; }
  .telemetry-panel { min-height: 320px; }
  .today-grid { grid-template-columns: 1fr; }
  .map-panel { grid-column: auto; }
  .chat-view { height: calc(100vh - 68px); padding: 0 16px; }
  .test-world .chat-view { height: calc(100vh - 148px); }
  .test-world-banner { min-height: 80px; padding: 11px 16px; gap: 12px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-top: 0; }
  .page-heading > p { text-align: left; }
  .diary-grid, .settings-grid, .memory-grid { grid-template-columns: 1fr; }
  .login-screen { grid-template-columns: 1fr; }
  .login-portrait { position: absolute; inset: 0; opacity: .48; }
  .login-shade { background: linear-gradient(0deg, #0a0a0c 2%, rgba(10,10,12,.58) 68%, rgba(10,10,12,.26)); }
  .login-panel { align-self: end; padding: 35px 25px 9vh; }
  .login-panel h1 { font-size: 86px; }
  .login-copy { margin: 20px 0 30px; }
}

@media (max-width: 560px) {
  .moment-content { padding: 27px; }
  .moment-content h2 { font-size: 39px; }
  .top-actions { gap: 6px; }
  .account-chip { max-width: 84px; overflow: hidden; text-overflow: ellipsis; }
  .test-world-banner span { font-size: 8px; }
  .test-world-banner button { display: none; }
  .icon-button { display: none; }
  .timeline::before { left: 5px; }
  .timeline-item { grid-template-columns: 1fr; gap: 9px; padding-left: 25px; }
  .timeline-time { text-align: left; }
  .timeline-dot { left: 1px; }
  .message-inner { max-width: 86%; }
  .profile-button { width: 34px; height: 34px; }
  .finance-row { grid-template-columns: 68px 1fr auto; gap: 10px; }
  .finance-summary { flex-wrap: wrap; }
  .finance-summary strong { font-size: 43px; }
}
