
:root {
  --bg: #FCF8F4;
  --bg-2: #FFFDFB;
  --surface: rgba(255,255,255,.78);
  --surface-solid: #FFFDFC;
  --surface-soft: #FFF6F3;
  --text: #3B2927;
  --heading: #4E3936;
  --brand-word: #BE5B72;
  --brand-word-deep: #A94C63;
  --muted: #786D68;
  --muted-2: #A79B95;
  --line: #F0DDD7;
  --line-strong: #EBCAC5;
  --primary: #C95D73;
  --primary-2: #B95268;
  --primary-light: #FBE7EA;
  --primary-soft: #FFF1F3;
  --green: #70B46C;
  --green-soft: #EFF9EF;
  --warning: #D39168;
  --shadow: 0 14px 34px rgba(116, 75, 64, .075);
  --shadow-light: 0 9px 22px rgba(116, 75, 64, .05);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 18px;
  --sidebar-w: 286px;
  --ui-scale: 1;
  --viewport-pad: 0px;
  --ease: cubic-bezier(.22,.72,.22,1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 12%, rgba(246, 207, 199, .32), transparent 32%),
    radial-gradient(circle at 90% 6%, rgba(255, 225, 217, .38), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  overflow-x: hidden;
}

a, a:visited, a:hover, a:active {
  color: inherit;
  text-decoration: none !important;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
svg { flex-shrink: 0; }

.browser-frame {
  width: 100vw;
  min-height: 100dvh;
  height: 100dvh;
  margin: 0;
  padding: var(--viewport-pad);
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(252,248,244,.97));
  overflow-x: hidden;
  overflow-y: auto;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  width: calc(100% / var(--ui-scale));
  min-height: calc((100dvh - var(--viewport-pad) * 2) / var(--ui-scale));
  height: calc((100dvh - var(--viewport-pad) * 2) / var(--ui-scale));
  margin: 0;
  overflow: hidden;
  border-radius: 0;
  background:
    radial-gradient(circle at 66% 16%, rgba(255,232,226,.42), transparent 28%),
    linear-gradient(120deg, #FFFCFA 0%, #FFFDFB 48%, #FFF8F5 100%);
  transform: scale(var(--ui-scale));
  transform-origin: top left;
}

.sidebar {
  border-right: 1px solid rgba(90,60,52,.08);
  background:
    linear-gradient(180deg, rgba(255,252,250,.94), rgba(255,248,245,.87)),
    radial-gradient(circle at 50% 18%, rgba(250,220,215,.5), transparent 34%);
  padding: 34px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100%;
  height: 100%;
  position: sticky;
  top: 0;
  align-self: start;
}
.brand-area { text-align: center; }
.brand-word {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 52px;
  letter-spacing: 0;
  line-height: 1;
  color: var(--brand-word);
  background: linear-gradient(180deg, var(--brand-word) 0%, var(--brand-word-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}
.brand-mark {
  width: 138px; height: 138px;
  object-fit: contain;
  margin: 34px auto 48px;
  border-radius: 50%;
  filter: drop-shadow(0 18px 26px rgba(197, 93, 115, .12));
  mix-blend-mode: multiply;
}
.nav {
  display: grid;
  gap: 13px;
}
.nav-link {
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  color: #615854;
  font-weight: 620;
  transition: background .2s var(--ease), transform .2s var(--ease), color .2s var(--ease);
}
.nav-link:hover {
  background: rgba(255,255,255,.74);
  transform: translateX(2px);
}
.nav-link.active {
  color: var(--text);
  background: linear-gradient(90deg, #FCE2E7, #FFF0F2);
  box-shadow: inset 0 0 0 1px rgba(218, 157, 167, .36);
}
.nav-icon {
  width: 25px; height: 25px;
  color: currentColor;
  display: inline-grid;
  place-items: center;
}
.nav-icon svg { width: 25px; height: 25px; }
.nav-link.active .nav-icon { color: var(--primary); }

.account-card {
  margin-top: auto;
  min-height: 58px;
  padding: 8px 14px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(90,60,52,.08);
  box-shadow: var(--shadow-light);
}
.logout-card {
  width: 100%;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.logout-card:hover {
  transform: translateY(-1px);
  border-color: rgba(201,93,115,.28);
  box-shadow: var(--shadow);
}
.logout-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--primary);
  background: var(--primary-light);
}
.logout-icon svg {
  width: 20px;
  height: 20px;
}
.account-card img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 42%;
  transform: scale(1.06);
  transform-origin: center;
}
.account-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}
.account-main strong { font-size: 17px; line-height: 1.08; font-weight: 760; white-space: nowrap; }
.account-main small { color: var(--muted-2); font-size: 15px; line-height: 1.2; white-space: nowrap; }
.account-arrow { margin-left: auto; color: #746B67; font-size: 26px; line-height: 1; }

.main {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 32px clamp(24px, 2.8vw, 40px) 30px;
  outline: none;
  overflow: auto;
  scrollbar-gutter: stable;
}
.page-fit {
  --fit-scale: 1;
  width: 100%;
  min-height: 0;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
  margin-bottom: 26px;
}
.h1 {
  margin: 0;
  color: var(--heading);
  font-size: clamp(28px, 3vw, 36px);
  letter-spacing: 0;
  line-height: 1.18;
  font-weight: 500;
}
.page-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.48;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(255,255,255,.74);
  border: 1px solid var(--line);
  color: var(--muted);
  box-shadow: var(--shadow-light);
  white-space: nowrap;
  font-weight: 620;
}
.green-dot { width: 10px; height: 10px; background: var(--green); border-radius: 50%; }

.card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-light);
  overflow: hidden;
}
.card.pad { padding: clamp(20px, 2vw, 28px); }
.card-title {
  margin: 0;
  font-size: 21px;
  letter-spacing: -.025em;
  font-weight: 760;
  color: var(--text);
}
.small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.muted { color: var(--muted); }
.btn {
  min-height: 42px;
  padding: 0 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  font-weight: 760;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
  text-decoration: none !important;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled {
  cursor: default;
  opacity: .72;
  transform: none;
}
.btn.primary {
  color: #fff;
  background: linear-gradient(180deg, #D86B86, #C95470);
  box-shadow: 0 14px 26px rgba(199,84,112,.22);
}
.btn.ghost {
  color: var(--primary);
  background: rgba(255,255,255,.7);
  border-color: rgba(201,93,115,.48);
}
.btn.soft {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: rgba(201,93,115,.18);
}
.inline-icon { width: 22px; height: 22px; stroke: currentColor; fill: none; }
.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(201,93,115,.2);
  background: rgba(255,243,245,.72);
  color: var(--primary);
  display: inline-grid;
  place-items: center;
  transition: transform .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.icon-button:hover {
  transform: translateY(-1px);
  background: rgba(255,232,238,.92);
  box-shadow: 0 8px 18px rgba(199,84,112,.11);
}
.icon-button:disabled {
  cursor: default;
  opacity: .72;
  transform: none;
  box-shadow: none;
}
.icon-button svg {
  width: 20px;
  height: 20px;
}
.preview-refresh {
  flex: 0 0 auto;
}
.preview-refresh.is-loading svg {
  animation: previewSpin .9s linear infinite;
}
@keyframes previewSpin {
  to { transform: rotate(360deg); }
}
.icon-circle {
  width: 58px; height: 58px; border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #FFF1F3, #FBE4E8);
  color: var(--primary);
  flex: 0 0 auto;
}
.icon-circle svg { width: 28px; height: 28px; stroke: currentColor; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr);
  gap: 18px;
}
.hero-card {
  min-height: 374px;
  padding: clamp(26px, 2.8vw, 36px);
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(0,1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px 28px;
  align-items: center;
  background:
    linear-gradient(rgba(255,255,255,.08), rgba(255,255,255,.08)),
    url("./assets/images/wave-bg.jpg") center/cover no-repeat;
  position: relative;
}
.hero-card::before {
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(90deg, rgba(255,255,255,.36), rgba(255,255,255,.05));
  pointer-events:none;
}
.hero-card > * { position: relative; z-index: 1; }
.hero-card-title {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 21px;
  font-weight: 760;
  color: var(--text);
}
.hero-content { min-width: 0; }
.avatar-large {
  width: min(100%, 214px); aspect-ratio: 1;
  object-fit: contain;
  border-radius: 50%;
  mix-blend-mode: multiply;
}
.hero-name {
  font-family: Georgia, "Times New Roman", serif;
  margin: 0 0 4px;
  font-size: clamp(46px, 4.8vw, 58px);
  line-height: 1;
  letter-spacing: .015em;
  font-weight: 400;
}
.hero-subtitle {
  margin: 0 0 12px;
  color: var(--primary);
  font-weight: 800;
  font-size: 21px;
}
.hero-copy {
  color: #5F5651;
  font-size: 16px;
  line-height: 1.78;
  max-width: 440px;
  margin: 0 0 18px;
}
.side-stack { display: grid; gap: 18px; }
.status-card {
  min-height: 165px;
  padding: 24px 28px;
  position: relative;
}
.card-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
}
.status-row {
  margin-top: 14px;
  display:flex;
  align-items:center;
  gap: 12px;
}
.status-row strong { font-size: 24px; }
.connected-mark {
  width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid var(--green);
  color: var(--green);
  display:grid;
  place-items:center;
}
.connected-mark svg { width: 23px; height: 23px; }
.kebab { position:absolute; top:18px; right:18px; color: #706662; }
.toggle {
  width: 58px; height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, #D86B86, #C95470);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(145,45,65,.08);
  flex: 0 0 auto;
}
.toggle::after {
  content:"";
  width: 28px; height: 28px;
  border-radius: 50%;
  background: white;
  position:absolute;
  right:3px; top:3px;
  box-shadow: 0 2px 8px rgba(80, 40, 38, .16);
}
.toggle.off { background: #E6DCD8; }
.toggle.off::after { right: auto; left: 3px; }
.metric-row {
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 10px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.metric-row:last-of-type { border-bottom: 0; }
.metric-row svg { color: var(--muted); width: 23px; height: 23px; }
.metric-row b { color: var(--primary); }

.quick-grid {
  grid-column: 1 / -1;
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
}
.action-card {
  min-height: 118px;
  padding: 20px 22px;
  display:flex;
  align-items:center;
  gap: 18px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.action-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.action-card h3 { margin:0 0 7px; font-size: 18px; }
.action-card p { margin:0; color:var(--muted); line-height:1.55; font-size:14px; }
.action-main { min-width:0; }
.chev { margin-left:auto; color:#675C58; font-size: 25px; }
.activity-card {
  grid-column: 1 / -1;
  min-height: 236px;
  padding: 28px 32px 24px;
  display:block;
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.96) 54%, rgba(255,248,245,.82) 78%, rgba(255,240,236,.42) 100%),
    var(--surface);
}
.activity-card::after {
  content:"";
  position:absolute;
  inset: 0 0 0 auto;
  width: min(520px, 38%);
  background: url("./assets/images/still-life.jpg") calc(100% + 2px) bottom / auto 110% no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.08) 16%, rgba(0,0,0,.72) 38%, #000 58%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.08) 16%, rgba(0,0,0,.72) 38%, #000 58%);
  pointer-events:none;
  z-index:0;
}
.activity-card > div {
  position: relative;
  z-index: 2;
  width: min(100%, 760px);
}
.activity-message {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: 98px;
  padding: 16px 20px;
  display:grid;
  grid-template-columns: 46px minmax(0,1fr) auto;
  gap: 14px;
  align-items:center;
  background: rgba(255,255,255,.68);
}
.activity-message img { width: 46px; height:46px; border-radius:50%; mix-blend-mode:multiply; }
.badge {
  display:inline-flex;
  align-items:center;
  height:26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 760;
  margin-left: 8px;
}
.memory-text { margin: 6px 0 0; color:#5F5651; line-height:1.55; }
.text-link {
  display:inline-flex;
  align-items:center;
  gap: 8px;
  color: var(--primary);
  font-weight: 760;
  margin-top: 16px;
}
.still-life {
  width:100%;
  height: 198px;
  object-fit:cover;
  object-position:center right;
  border-radius: 22px 22px 0 0;
  align-self:end;
}
.activity-card .still-life {
  display: none;
}

.layout-two {
  display:grid;
  grid-template-columns: minmax(0,1.05fr) minmax(360px,.95fr);
  gap: 24px;
  align-items:start;
}

body[data-route="create"] .layout-two {
  grid-template-columns: minmax(0, 1fr) minmax(0, .95fr);
  align-items: stretch;
}
body[data-route="create"] .layout-two > .side-stack {
  height: 100%;
  grid-template-rows: 250px minmax(0, 1fr);
}
body[data-route="create"] .form-card,
body[data-route="create"] .chat-card {
  min-height: 0;
}
.form-card { padding: 26px; }
.form-group { margin-bottom: 20px; }
.form-label {
  display:flex;
  align-items:center;
  gap: 7px;
  margin-bottom: 10px;
  font-weight: 760;
  color:#483431;
}
input, textarea, .fake-select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.78);
  border-radius: 14px;
  color: var(--text);
  outline: 0;
}
input, .fake-select { min-height: 50px; padding: 0 16px; display:flex; align-items:center; }
textarea {
  padding: 15px 16px;
  min-height: 126px;
  resize: vertical;
  line-height: 1.75;
}
input:focus, textarea:focus { border-color: rgba(201,93,115,.58); box-shadow: 0 0 0 4px rgba(201,93,115,.1); }
.textarea-wrap { position:relative; }
.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.form-label-row .form-label {
  margin-bottom: 0;
}
.advanced-link {
  min-height: 21px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(201,93,115,.26);
  background: rgba(255,243,245,.72);
  color: var(--primary);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}
.advanced-link:hover {
  background: rgba(255,232,238,.92);
}
.chips { display:flex; flex-wrap:wrap; gap: 10px; }
.chip {
  min-height: 38px;
  padding: 0 16px;
  display:inline-flex;
  align-items:center;
  border-radius: 999px;
  border: 1px solid rgba(201,93,115,.34);
  background: rgba(255,243,245,.86);
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
}
.switch-row {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255,255,255,.65);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 18px;
  margin: 18px 0 20px;
}
.segment {
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.62);
  border-radius: 14px;
  overflow:hidden;
}
.segment button {
  min-height: 46px;
  border:0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}
.segment button.active { background: linear-gradient(180deg,#D86B86,#C95470); color:white; }
.time-row { display:grid; grid-template-columns: 1fr auto 1fr; align-items:center; gap: 12px; }
.presence-preview {
  min-height: 50px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.62);
  padding: 0 16px;
}
.presence-preview span {
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.4;
}
.form-actions { display:flex; justify-content:space-between; gap: 16px; padding-top: 4px; }
.save-note {
  min-height: 20px;
  margin-top: 10px;
  color: var(--primary);
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
}
.profile-preview {
  padding: 24px 28px 30px;
  min-height: 238px;
  display:grid;
  grid-template-columns: 154px minmax(0,1fr);
  grid-template-rows: auto 1fr;
  gap: 20px 28px;
  align-items:center;
  background:
    linear-gradient(rgba(255,255,255,.28), rgba(255,255,255,.28)),
    url("./assets/images/wave-bg.jpg") center/cover no-repeat;
}
.profile-preview .card-title { grid-column: 1 / -1; }
.profile-preview img { width: 154px; height:154px; border-radius: 50%; mix-blend-mode:multiply; }
.chat-card { padding: 24px; }
body[data-route="create"] .chat-card {
  display: flex;
  flex-direction: column;
}
.chat-list { display:grid; gap: 15px; }
body[data-route="create"] .chat-list {
  flex: 1;
  align-content: space-between;
  gap: 12px;
}
.message-bubble {
  display:grid;
  grid-template-columns: 42px minmax(0, auto);
  gap: 6px 12px;
  width: fit-content;
  max-width: 88%;
  align-items:start;
}
.message-bubble::before {
  content:"";
  width: 42px;
  height: 42px;
  border-radius: 50%;
  grid-column: 1;
  grid-row: 1 / span 2;
  background: url("./assets/images/logo-mark.png") center/cover no-repeat;
  mix-blend-mode: multiply;
}
.message-bubble.user { justify-self: end; }
.message-bubble.user {
  grid-template-columns: minmax(0, auto) 42px;
}
.message-bubble.user::before {
  grid-column: 2;
  background-image: url("./assets/images/user-avatar.png");
  mix-blend-mode: normal;
}
.message-bubble.solea .bubble-meta,
.message-bubble.solea .bubble {
  grid-column: 2;
  justify-self: start;
}
.message-bubble.user .bubble-meta,
.message-bubble.user .bubble {
  grid-column: 1;
  justify-self: end;
}
.bubble-meta { color: var(--primary); font-size: 13px; font-weight: 760; }
.message-bubble.user .bubble-meta { text-align: right; }
.bubble {
  border-radius: 18px;
  padding: 13px 16px;
  line-height: 1.65;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(120,75,66,.045);
  width: fit-content;
  max-width: min(100%, 640px);
  overflow-wrap: break-word;
}
.solea .bubble { background:#fff; border: 1px solid var(--line); }
.user .bubble { background:#F8DDE2; border: 1px solid #F3C8D1; }
.chat-note {
  margin-top: 18px;
  color: var(--muted-2);
  font-size: 13px;
}
.advanced-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(59,41,39,.28);
  backdrop-filter: blur(10px);
}
.advanced-modal {
  width: min(860px, 94vw);
  max-height: min(760px, 88vh);
  overflow: auto;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(112,71,64,.22);
  padding: 24px;
}
.advanced-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.modal-close {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.76);
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}
.advanced-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.advanced-modal-grid .form-group {
  margin-bottom: 0;
}
.advanced-modal-grid textarea {
  min-height: 92px;
  line-height: 1.62;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  padding-top: 20px;
}

.qr-layout {
  display:grid;
  grid-template-columns: minmax(0,1.25fr) minmax(330px,.75fr);
  gap: 24px;
}
body[data-route="wechat"] .qr-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr);
  gap: 18px 24px;
}
.qr-card {
  padding: clamp(24px, 3vw, 36px);
  display:grid;
  justify-items:center;
  text-align:center;
  background:
    linear-gradient(rgba(255,255,255,.38), rgba(255,255,255,.38)),
    url("./assets/images/wave-bg.jpg") center/cover no-repeat;
}
body[data-route="wechat"] .qr-card {
  padding: 30px 30px 26px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.qr-title { font-size: 21px; font-weight: 780; margin-bottom: 20px; }
body[data-route="wechat"] .qr-title {
  margin-bottom: 18px;
  font-size: 21px;
}
.qr-box {
  width: min(320px, 76vw);
  aspect-ratio: 1;
  border-radius: 24px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(100,60,52,.08);
  position: relative;
  overflow: hidden;
}
body[data-route="wechat"] .qr-box {
  width: clamp(292px, 25vw, 324px);
}
.qr-box img { width:100%; height:100%; }
.qr-expired-mask {
  position: absolute;
  inset: 10px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255, 253, 252, .9);
  color: var(--primary);
  font-weight: 760;
  font-size: 20px;
  box-shadow: inset 0 0 0 1px rgba(201,93,115,.2);
  backdrop-filter: blur(2px);
}
.qr-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  background: rgba(250, 244, 241, .65);
  border-radius: 16px;
}
.countdown { margin: 18px 0 14px; color: var(--muted); }
body[data-route="wechat"] .countdown { margin: 16px 0 12px; }
.countdown b { color: var(--primary); font-size: 20px; }
.stepper {
  width: 100%;
  margin-top: 28px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
  display:grid;
  grid-template-columns: repeat(4,1fr);
  gap: 6px;
}
body[data-route="wechat"] .stepper {
  margin-top: clamp(24px, 3vh, 34px);
  padding: 18px 24px;
}
.step {
  position:relative;
  display:grid;
  justify-items:center;
  gap: 8px;
  color: var(--muted-2);
  font-size: 14px;
  font-weight: 700;
}
body[data-route="wechat"] .step { gap: 7px; }
.step:not(:last-child)::after {
  content:"";
  position:absolute;
  width: calc(100% - 38px);
  height: 2px;
  background: #E9DCD8;
  left: calc(50% + 23px);
  top: 17px;
}
.step.done:not(:last-child)::after { background: var(--primary); }
.step-dot {
  width: 34px; height: 34px; border-radius:50%;
  display:grid;
  place-items:center;
  border: 2px solid #E5D8D4;
  color: var(--muted-2);
  background: #F7F0EE;
  z-index:1;
}
.step.done .step-dot, .step.current .step-dot {
  background: linear-gradient(180deg,#D86B86,#C95470);
  color:white; border-color: transparent;
}
.step.done, .step.current { color: var(--text); }
.info-stack { display:grid; gap: 18px; }
body[data-route="wechat"] .info-stack { gap: 14px; }
body[data-route="wechat"] .info-stack .card.pad { padding: 22px 24px; }
.numbered { list-style:none; padding:0; margin:18px 0 0; display:grid; gap:18px; }
body[data-route="wechat"] .numbered { margin-top: 14px; gap: 14px; }
.numbered li { display:grid; grid-template-columns: 34px minmax(0,1fr); gap:14px; align-items:start; }
.number {
  width:34px; height:34px; border-radius:50%;
  background: var(--primary-light);
  color: var(--primary);
  display:grid; place-items:center;
  font-weight: 800;
}
.bullets { margin:14px 0 0; padding-left: 20px; color:var(--muted); line-height:1.9; }
body[data-route="wechat"] .bullets { margin-top: 10px; line-height: 1.72; }
body[data-route="wechat"] .failure-card .bullets {
  line-height: 1.7;
}
.banner {
  grid-column: 1 / -1;
  margin-top: 0;
  min-height: 180px;
  padding: 26px 28px;
  display:grid;
  grid-template-columns: auto minmax(0,1fr) minmax(220px, 400px);
  align-items:center;
  gap: 22px;
  background: linear-gradient(90deg, #FFF8F5, #FFECE9);
}
body[data-route="wechat"] .banner {
  position: relative;
  isolation: isolate;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 178px;
  padding: 30px min(360px, 30vw) 30px 34px;
  gap: 20px;
  background:
    linear-gradient(90deg, rgba(255,250,248,.92), rgba(255,241,237,.68)),
    url("./assets/images/wave-bg.jpg") center/cover no-repeat,
    linear-gradient(90deg, #FFF8F5, #FFECE9);
}
body[data-route="wechat"] .banner::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: min(430px, 36%);
  background: url("./assets/images/still-life.jpg") right bottom / auto 120% no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.25) 18%, #000 42%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.25) 18%, #000 42%);
  pointer-events: none;
  z-index: 0;
}
body[data-route="wechat"] .banner > * {
  position: relative;
  z-index: 1;
}
.banner .still-life {
  height: 160px;
  border-radius: 20px;
  object-fit: cover;
}
body[data-route="wechat"] .banner .still-life { display: none; }
body[data-route="wechat"] .banner .icon-circle {
  width: 68px;
  height: 68px;
}
body[data-route="wechat"] .banner .icon-circle svg {
  width: 34px;
  height: 34px;
}
body[data-route="wechat"] .banner .card-title {
  max-width: 760px;
  font-size: 22px;
  line-height: 1.35;
}
body[data-route="wechat"] .banner .page-subtitle {
  margin-top: 8px;
  font-size: 16px;
}

.tabs {
  display:inline-grid;
  grid-template-columns: repeat(3, 1fr);
  border-radius: 15px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
  overflow:hidden;
  margin-bottom: 22px;
}
.tab {
  min-width: 130px;
  height: 46px;
  border:0;
  background: transparent;
  color: var(--muted);
  font-weight: 760;
}
.tab.active { color: var(--primary); background: var(--primary-light); }
body[data-route="memory"] .page-header {
  margin-bottom: 18px;
}
body[data-route="memory"] .tabs {
  margin-bottom: 16px;
}
body[data-route="memory"] .tab {
  height: 42px;
}
.memory-grid {
  display:grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, .86fr);
  gap: 22px;
}
body[data-route="memory"] .memory-grid {
  grid-template-columns: minmax(0, 1fr) minmax(330px, .9fr);
  gap: 16px 18px;
}
.memory-list { padding: 24px; }
.memory-list .card-title { margin-bottom: 16px; }
body[data-route="memory"] .memory-list { padding: 20px 22px; }
body[data-route="memory"] .memory-list .card-title { margin-bottom: 12px; }
.memory-item {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  display:grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 16px;
  align-items:center;
}
.memory-item:first-of-type {
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255,246,247,.7);
  margin-bottom: 2px;
}
.memory-item:last-child { border-bottom:0; }
body[data-route="memory"] .memory-item {
  padding: 10px 0;
}
body[data-route="memory"] .memory-item:first-of-type {
  padding: 12px 14px;
  margin-bottom: 0;
}
.tag {
  display:inline-flex;
  align-items:center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 760;
  color: var(--primary);
  background: var(--primary-light);
}
.tag.alt { color:#C77956; background:#FFF0E4; }
.tag.purple { color:#9C6AA6; background:#F4E7F5; }
.memory-date { display:block; color:var(--muted-2); font-size: 13px; margin-top: 5px; }
.item-actions { display:flex; align-items:center; gap:14px; color:var(--muted); font-size: 13px; white-space:nowrap; }
.detail-card { padding: 24px; margin-bottom: 18px; }
body[data-route="memory"] .detail-card {
  padding: 20px 22px;
  margin-bottom: 14px;
}
body[data-route="memory"] .detail-card .form-group {
  margin-bottom: 14px;
}
body[data-route="memory"] .detail-card textarea {
  min-height: 64px !important;
  line-height: 1.55;
}
body[data-route="memory"] .detail-card .form-actions {
  margin-top: 10px;
}
.add-memory {
  min-height: 116px;
  padding: 22px 24px;
  display:flex;
  align-items:center;
  gap: 18px;
}
body[data-route="memory"] .add-memory {
  min-height: 98px;
  padding: 18px 22px;
}
body[data-route="memory"] .add-memory .icon-circle {
  width: 52px;
  height: 52px;
}
body[data-route="memory"] .add-memory .icon-circle svg {
  width: 26px;
  height: 26px;
}
.conversation-preview {
  grid-column: 1 / -1;
  padding: 24px;
}
body[data-route="memory"] .conversation-preview {
  padding: 20px 22px 18px;
}
.conversation-row {
  margin-top: 16px;
  display:grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 16px;
}
body[data-route="memory"] .conversation-row {
  margin-top: 12px;
  gap: 14px;
}
.conversation-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  display:grid;
  grid-template-columns: 54px minmax(0,1fr);
  gap: 14px;
  background: rgba(255,255,255,.66);
}
body[data-route="memory"] .conversation-card {
  padding: 14px 16px;
  grid-template-columns: 48px minmax(0,1fr);
}
body[data-route="memory"] .conversation-card .icon-circle {
  width: 48px;
  height: 48px;
}
body[data-route="memory"] .conversation-card .icon-circle svg {
  width: 24px;
  height: 24px;
}
.card-actions {
  margin-top:8px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  color: var(--primary);
  font-weight: 720;
  font-size: 13px;
}
.memory-all-link {
  justify-content: center;
  margin-top: 14px;
}

.settings-grid {
  display:grid;
  grid-template-columns: minmax(0,1.25fr) minmax(330px,.75fr);
  gap: 18px 22px;
  align-items: stretch;
}
body[data-route="settings"] .page-header {
  margin-bottom: 18px;
}
body[data-route="settings"] .h1 {
  font-size: 42px;
  line-height: 1.1;
  color: var(--heading);
  letter-spacing: 0;
  font-weight: 500;
}
body[data-route="settings"] .page-subtitle {
  font-size: 18px;
  line-height: 1.48;
}
body[data-route="settings"] .card-title {
  font-size: 24px;
}
.settings-stack {
  display:grid;
  gap: 18px;
}
body[data-route="settings"] .settings-stack {
  gap: 13px;
}
body[data-route="settings"] .settings-grid {
  gap: 16px 22px;
}
body[data-route="settings"] .card.pad {
  padding: 20px 26px;
}
.settings-row {
  display:grid;
  grid-template-columns: 26px minmax(0,1fr) auto;
  gap: 14px;
  align-items:center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
body[data-route="settings"] .settings-row {
  padding: 10px 0;
  grid-template-columns: 30px minmax(0,1fr) auto;
}
.settings-row:last-child { border-bottom:0; }
.settings-row svg { color: #6C625F; width: 24px; height: 24px; }
body[data-route="settings"] .settings-row strong {
  font-size: 18px;
}
body[data-route="settings"] .settings-row .small {
  font-size: 14px;
  line-height: 1.42;
}
.green-badge {
  color:#5A9F58;
  background:var(--green-soft);
  border-radius:999px;
  padding: 5px 10px;
  margin-left: 8px;
  font-size: 13px;
  vertical-align: middle;
}
.connection-card {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 18px;
  flex-wrap: wrap;
}
body[data-route="settings"] .connection-card .small {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.3;
}
body[data-route="settings"] .connection-card .small svg {
  width: 22px;
  height: 22px;
  color: var(--muted);
}
.info-illustration {
  min-height: 0;
  padding: 28px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,253,251,.92), rgba(255,246,243,.86)),
    url("./assets/images/wave-bg.jpg") center/cover no-repeat;
}
.info-illustration::before {
  content:"";
  position:absolute;
  inset: 24px 12px 132px;
  background: url("./assets/images/security-illustration.jpg") center / contain no-repeat;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 22%, rgba(0,0,0,.62) 52%, transparent 74%);
  mask-image: radial-gradient(ellipse at center, #000 22%, rgba(0,0,0,.62) 52%, transparent 74%);
  mix-blend-mode: multiply;
  opacity: .92;
  pointer-events:none;
  z-index:0;
}
.info-illustration > * {
  position: relative;
  z-index: 1;
}
.info-illustration img {
  display: none;
}
body[data-route="settings"] .info-illustration .card-title {
  font-size: 28px;
  line-height: 1.35;
}
body[data-route="settings"] .info-illustration .page-subtitle {
  font-size: 17px;
  line-height: 1.58;
  max-width: 390px;
}
.danger-zone {
  grid-column: 1 / -1;
  padding: 18px 22px;
  background: rgba(255,250,247,.86);
}
body[data-route="settings"] .danger-zone {
  padding: 16px 20px;
}
.danger-actions {
  margin-top: 12px;
  display:grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 16px;
}
.danger-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255,255,255,.68);
  display: block;
}
body[data-route="settings"] .danger-card {
  padding: 14px 18px;
}
.danger-card .icon-circle { width: 52px; height: 52px; }
.danger-card .icon-circle svg { width: 25px; height: 25px; }
.danger-card h4 { margin: 8px 0 5px; font-size: 18px; }
.danger-card p { margin:0 0 8px; color: var(--muted); line-height:1.42; font-size:14px; }
.danger-card .btn {
  min-height: 36px;
  padding: 0 16px;
  font-size: 13px;
}

@media (max-width: 1180px) {
  :root { --sidebar-w: 246px; }
  .sidebar { padding-inline: 22px; }
  .brand-word { font-size: 40px; }
  .brand-mark { width: 98px; height: 98px; margin-bottom: 28px; }
  .nav-link { padding: 0 16px; height: 50px; }
}

@media (max-width: 960px) {
  .dashboard-grid, .qr-layout, .settings-grid, .memory-grid, .layout-two {
    grid-template-columns: 1fr;
  }
  .settings-stack, .danger-zone {
    grid-column: auto;
    grid-row: auto;
  }
  .side-stack { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .activity-card, .banner { grid-template-columns: 1fr; padding-bottom: 24px; }
  .still-life, .banner .still-life { height: 190px; border-radius: 20px; }
}

@media (max-width: 960px) {
  body { overflow-y: auto; }
  .browser-frame {
    min-height: 100dvh;
    height: auto;
    padding: 0;
    overflow: visible;
  }
  .app-shell {
    grid-template-columns: 1fr;
    min-height: 100dvh;
    height: auto;
    width: 100%;
    margin: 0;
    zoom: 1;
    overflow: visible;
    border-radius: 0;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 9;
    min-height: unset;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(90,60,52,.08);
    padding: 14px 14px 12px;
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items:center;
    gap: 12px;
  }
  .brand-area {
    display:flex;
    align-items:center;
    gap: 10px;
    text-align:left;
  }
  .brand-word { font-size: 34px; }
  .brand-mark { width: 44px; height:44px; margin:0; order:-1; }
  .nav {
    display:flex;
    overflow-x:auto;
    gap: 8px;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .nav::-webkit-scrollbar { display:none; }
  .nav-link {
    height: 42px;
    min-width:max-content;
    padding: 0 14px;
    border-radius: 999px;
    gap: 8px;
    font-size: 14px;
  }
  .nav-icon { width:20px; height:20px; }
  .nav-icon svg { width:20px; height:20px; }
  .account-card {
    margin:0;
    min-height:42px;
    padding: 6px 8px;
    border-radius: 999px;
    box-shadow: none;
  }
  .account-card img { width:32px; height:32px; }
  .logout-icon { width:32px; height:32px; }
  .logout-icon svg { width:18px; height:18px; }
  .account-main small { display:none; }
  .account-arrow { display:none; }
  .main {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 24px 16px 32px;
  }
  .page-fit {
    width: 100%;
    min-height: 0;
  }
  .page-header { flex-direction: column; }
  .side-stack { grid-template-columns: 1fr; }
  .hero-card, .profile-preview {
    grid-template-columns: 1fr;
    text-align:center;
    justify-items:center;
  }
  .hero-copy { margin-inline:auto; }
  .quick-grid, .conversation-row, .danger-actions {
    grid-template-columns: 1fr;
  }
  .activity-message { grid-template-columns: 42px 1fr; }
  .activity-message .small { grid-column: 2; }
  .settings-row { grid-template-columns: 24px minmax(0,1fr); }
  .settings-row .toggle, .settings-row .fake-select { grid-column: 2; justify-self:start; margin-top: 4px; }
  .connection-card { align-items: stretch; }
}

@media (max-width: 560px) {
  .account-card { display:none; }
  .sidebar { grid-template-columns: auto minmax(0,1fr); }
  .nav-link span:last-child { display:none; }
  .nav-link { width: 42px; min-width:42px; padding:0; justify-content:center; }
  .h1 { font-size: 28px; }
  .page-subtitle { font-size: 15px; }
  .hero-card { min-height: unset; padding: 24px; }
  .avatar-large { width: 156px; }
  .hero-name { font-size: 42px; }
  .form-actions, .time-row, .banner {
    grid-template-columns: 1fr;
  }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; }
  .stepper { grid-template-columns: 1fr 1fr; row-gap: 16px; }
  .step:not(:last-child)::after { display:none; }
  .tabs { width: 100%; }
  .tab { min-width: 0; }
  .add-memory { flex-direction: column; align-items:flex-start; }
  .add-memory .btn { width:100%; }
}

.settings-row > .fake-select { width: 180px; max-width: 100%; }
.btn svg { width: 20px; height: 20px; }
