:root {
  color-scheme: light;
  --bg: #f5f6fb;
  --surface: rgba(255,255,255,.88);
  --surface-strong: #fff;
  --ink: #182032;
  --muted: #70798d;
  --line: #e5e8f1;
  --primary: #625ee7;
  --primary-dark: #4d49c8;
  --accent: #6fbfd7;
  --danger: #b4495a;
  --shadow: 0 18px 60px rgba(54, 57, 112, .10);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(145deg, #f8f9fd 0%, #f2f4fb 52%, #f6f3ff 100%);
  overflow-x: hidden;
}
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.bg-orb { position: fixed; border-radius: 999px; filter: blur(2px); pointer-events: none; opacity: .42; z-index: 0; }
.orb-one { width: 440px; height: 440px; background: radial-gradient(circle, #d5d4ff 0%, rgba(213,212,255,0) 72%); top: -180px; right: -90px; }
.orb-two { width: 420px; height: 420px; background: radial-gradient(circle, #c8eef3 0%, rgba(200,238,243,0) 72%); bottom: -180px; left: -120px; }
.shell { position: relative; z-index: 1; width: min(1420px, calc(100% - 32px)); margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; color: white; font-weight: 800; font-size: 22px; background: linear-gradient(145deg, #716cf0, #65bcd2); box-shadow: 0 10px 24px rgba(98,94,231,.26); }
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand-copy strong { letter-spacing: .08em; font-size: 16px; }
.brand-copy small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.status-pill { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 999px; background: #eef0f7; color: var(--muted); font-size: 12px; font-weight: 700; }
.status-pill.online { background: #e8f6ef; color: #39765b; }
.status-pill.offline { background: #faeeee; color: #9c4a54; }
.ghost-button, .refresh-button, .secondary-button { border: 1px solid var(--line); background: rgba(255,255,255,.8); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-weight: 700; }
.login-layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr); gap: 28px; align-items: stretch; padding: 44px 0 64px; }
.hero-card, .auth-card, .panel-card, .profile-card, .security-card { border: 1px solid rgba(229,232,241,.9); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.hero-card { min-height: 590px; padding: clamp(36px, 5vw, 70px); border-radius: var(--radius-xl); background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(246,246,255,.86)); display: flex; flex-direction: column; justify-content: center; }
.eyebrow { display: inline-block; color: var(--primary); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: 11px; margin-bottom: 14px; }
.hero-card h1 { margin: 0; font-size: clamp(44px, 6vw, 82px); line-height: .98; letter-spacing: -.055em; max-width: 800px; }
.hero-card h1 span { color: var(--primary); }
.hero-card > p { max-width: 650px; margin: 26px 0 0; color: var(--muted); font-size: 18px; line-height: 1.6; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 54px; }
.feature-grid div { background: rgba(255,255,255,.72); border: 1px solid var(--line); padding: 18px; border-radius: 18px; display: grid; gap: 5px; }
.feature-grid span { font-size: 22px; }
.feature-grid strong { margin-top: 4px; }
.feature-grid small { color: var(--muted); }
.auth-card { border-radius: var(--radius-xl); background: rgba(255,255,255,.92); padding: clamp(28px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; }
.auth-card h2 { font-size: 34px; margin: 0 0 14px; letter-spacing: -.035em; }
.auth-card p { color: var(--muted); line-height: 1.6; }
.primary-button { width: 100%; border: 0; padding: 15px 18px; border-radius: 15px; color: white; background: linear-gradient(135deg, var(--primary), #7771f4); box-shadow: 0 12px 30px rgba(98,94,231,.24); font-weight: 800; margin-top: 18px; }
.primary-button:hover { background: linear-gradient(135deg, var(--primary-dark), #6d67e8); }
.privacy-note { font-size: 12px; margin: 15px 0 0 !important; }
.code-box { width: 100%; border: 1px solid #dadcf0; background: #f7f7fd; border-radius: 16px; padding: 17px; display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--primary); }
.code-box code { font-size: 20px; font-weight: 850; letter-spacing: .025em; }
.code-box span { font-size: 11px; color: var(--muted); font-weight: 800; text-transform: uppercase; }
.auth-progress { display: flex; gap: 13px; align-items: center; padding: 18px 0 8px; }
.auth-progress div { display: grid; gap: 3px; }
.auth-progress small { color: var(--muted); line-height: 1.35; }
.spinner { width: 22px; height: 22px; border: 3px solid #e3e4f2; border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.text-button { border: 0; background: transparent; padding: 8px 0; color: var(--primary); font-weight: 750; }
.text-button.danger { color: var(--danger); }
.error-box { margin-top: 14px; padding: 13px 15px; border: 1px solid #efcfd4; background: #fff3f5; color: #8e3f4b; border-radius: 13px; font-size: 14px; }
.app-layout { flex: 1; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 22px; padding: 18px 0 44px; }
.sidebar { position: sticky; top: 18px; align-self: start; height: calc(100vh - 36px); border-radius: var(--radius-lg); border: 1px solid var(--line); background: rgba(255,255,255,.82); backdrop-filter: blur(20px); padding: 22px 16px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.welcome-block { padding: 6px 10px 20px; display: grid; gap: 3px; }
.welcome-block small { color: var(--muted); }
.nav-list { display: grid; gap: 5px; min-height: 0; }
.nav-item { border: 0; background: transparent; color: #596176; border-radius: 13px; padding: 12px 13px; display: flex; align-items: center; gap: 11px; font-weight: 700; text-align: left; }
.nav-item span { width: 22px; text-align: center; }
.nav-item.active { background: #efefff; color: var(--primary-dark); }
.sidebar-foot { margin-top: auto; padding: 10px 10px 4px; border-top: 1px solid var(--line); flex: 0 0 auto; }
.sidebar-foot .danger { width: 100%; text-align: left; }
.content { min-width: 0; }
.view-panel { min-height: 70vh; }
.page-head { padding: 14px 4px 24px; display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.page-head h1 { margin: 0; font-size: clamp(34px, 4vw, 54px); letter-spacing: -.045em; }
.page-head p { margin: 8px 0 0; color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat-card { border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.86); padding: 22px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 13px; box-shadow: 0 10px 30px rgba(54,57,112,.05); }
.stat-card span { grid-row: span 2; font-size: 26px; }
.stat-card strong { font-size: 28px; line-height: 1; }
.stat-card small { color: var(--muted); }
.dashboard-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; margin-top: 14px; }
.panel-card { background: rgba(255,255,255,.84); border-radius: var(--radius-lg); padding: 22px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-title small { color: var(--muted); }
.section-title h2 { margin: 2px 0 0; }
.compact-list, .cards-list { display: grid; gap: 10px; }
.compact-item, .memory-card, .reminder-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: rgba(255,255,255,.76); }
.compact-item strong, .memory-card strong, .reminder-card strong { display: block; line-height: 1.4; }
.compact-item small, .memory-card small, .reminder-card small { display: block; color: var(--muted); margin-top: 8px; }
.memory-card p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.people-preview { display: flex; flex-wrap: wrap; gap: 9px; }
.person-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); background: #fff; border-radius: 999px; font-weight: 700; }
.person-chip span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #efefff; color: var(--primary); }
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.person-card { border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.86); padding: 20px; }
.person-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.person-avatar { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; font-weight: 850; color: var(--primary-dark); background: #efefff; }
.person-head h3 { margin: 0; }
.person-head small { color: var(--muted); }
.fact-list { display: flex; flex-wrap: wrap; gap: 7px; }
.fact-pill { border-radius: 10px; padding: 8px 10px; background: #f6f7fb; color: #596176; font-size: 13px; line-height: 1.35; }
.empty-state { padding: 38px 20px; border: 1px dashed #cfd3df; border-radius: 18px; text-align: center; color: var(--muted); }
.profile-card { border-radius: var(--radius-lg); padding: 28px; background: rgba(255,255,255,.86); display: grid; grid-template-columns: auto 1fr; gap: 20px; }
.profile-avatar { width: 72px; height: 72px; border-radius: 24px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, #716cf0, #65bcd2); font-size: 28px; font-weight: 850; }
.profile-main h2 { margin: 7px 0 4px; }
.profile-main p { margin: 0; color: var(--muted); }
.profile-details { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 0; }
.profile-details div { background: #f7f8fb; border-radius: 14px; padding: 14px; }
.profile-details dt { font-size: 12px; color: var(--muted); }
.profile-details dd { margin: 5px 0 0; font-weight: 750; }
.security-card { margin-top: 14px; border-radius: var(--radius-lg); padding: 22px; background: rgba(255,255,255,.86); display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.security-card > div { display: flex; align-items: flex-start; gap: 13px; }
.security-card span { font-size: 24px; }
.security-card h3 { margin: 0 0 5px; }
.security-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.footer { padding: 16px 0 30px; color: #8b92a3; text-align: center; font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 10; padding: 12px 16px; border-radius: 999px; color: white; background: #282c3b; box-shadow: 0 14px 40px rgba(0,0,0,.15); font-size: 13px; }
@media (max-width: 980px) {
  .login-layout { grid-template-columns: 1fr; }
  .hero-card { min-height: auto; }
  .app-layout { grid-template-columns: 1fr; padding-bottom: 95px; }
  .sidebar { position: fixed; z-index: 8; left: 12px; right: 12px; bottom: 10px; top: auto; height: auto; padding: 8px; border-radius: 18px; }
  .welcome-block, .sidebar-foot { display: none; }
  .nav-list { grid-template-columns: repeat(5, 1fr); gap: 3px; }
  .nav-item { justify-content: center; flex-direction: column; gap: 4px; padding: 8px 4px; font-size: 10px; }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .shell { width: min(100% - 20px, 1420px); }
  .topbar { height: 76px; }
  .brand-copy small { display: none; }
  .status-pill { display: none; }
  .login-layout { padding-top: 18px; gap: 14px; }
  .hero-card, .auth-card { border-radius: 22px; }
  .hero-card { padding: 30px 24px; }
  .hero-card h1 { font-size: 44px; }
  .hero-card > p { font-size: 15px; }
  .feature-grid { grid-template-columns: 1fr; margin-top: 28px; }
  .feature-grid div { grid-template-columns: auto 1fr; align-items: center; }
  .feature-grid span { grid-row: span 2; }
  .auth-card { padding: 26px 22px; }
  .stats-grid { grid-template-columns: 1fr; }
  .people-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .refresh-button { padding: 9px 11px; font-size: 12px; }
  .profile-details { grid-template-columns: 1fr; }
  .security-card { align-items: stretch; flex-direction: column; }
  .nav-item span { font-size: 17px; }
}

/* v1.4.1: Web memory composer */
.memory-composer { margin: 14px 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(244,244,255,.88)); padding: 24px; box-shadow: 0 12px 34px rgba(54,57,112,.06); display: grid; grid-template-columns: minmax(220px,.75fr) minmax(320px,1.25fr); gap: 24px; align-items: center; }
.composer-copy h2 { margin: 0; font-size: 28px; letter-spacing: -.03em; }
.composer-copy p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.composer-form { display: grid; gap: 10px; }
.composer-form textarea { width: 100%; resize: vertical; min-height: 96px; max-height: 260px; box-sizing: border-box; border: 1px solid #d8dbea; border-radius: 16px; padding: 15px 16px; background: rgba(255,255,255,.9); color: var(--text); font: inherit; line-height: 1.5; outline: none; transition: border-color .18s ease, box-shadow .18s ease; }
.composer-form textarea:focus { border-color: #9995f4; box-shadow: 0 0 0 4px rgba(98,94,231,.09); }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.composer-actions small { color: var(--muted); line-height: 1.4; }
.composer-submit { width: auto; margin: 0; padding-inline: 24px; flex: 0 0 auto; }
.composer-submit:disabled { opacity: .65; cursor: wait; }
.composer-result { grid-column: 1 / -1; border-radius: 14px; padding: 14px 16px; white-space: pre-line; line-height: 1.5; font-size: 14px; }
.composer-result.success { background: #effaf4; border: 1px solid #cdebd9; color: #286044; }
.composer-result.warning { background: #fff8e9; border: 1px solid #f0dfb4; color: #71551d; }
@media (max-width: 900px) { .memory-composer { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .memory-composer { padding: 19px; gap: 16px; } .composer-actions { align-items: stretch; flex-direction: column; } .composer-submit { width: 100%; } }

/* v1.4.2: Recall in Web/PWA */
.memory-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 14px 0; }
.memory-action-grid .memory-composer { margin: 0; grid-template-columns: 1fr; align-items: start; }
.recall-composer { border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(239,245,255,.9)); padding: 24px; box-shadow: 0 12px 34px rgba(54,57,112,.06); display: grid; gap: 18px; align-content: start; }
.recall-form { display: grid; gap: 10px; }
.recall-form textarea { width: 100%; resize: vertical; min-height: 96px; max-height: 260px; box-sizing: border-box; border: 1px solid #d8dbea; border-radius: 16px; padding: 15px 16px; background: rgba(255,255,255,.92); color: var(--text); font: inherit; line-height: 1.5; outline: none; transition: border-color .18s ease, box-shadow .18s ease; }
.recall-form textarea:focus { border-color: #9995f4; box-shadow: 0 0 0 4px rgba(98,94,231,.09); }
.recall-result { border-radius: 14px; padding: 15px 16px; line-height: 1.5; background: #f5f4ff; border: 1px solid #dcd9ff; color: var(--text); }
.recall-result.success { background: #f4f7ff; border-color: #d9e1ff; }
.recall-result.warning { background: #fff8e9; border-color: #f0dfb4; color: #71551d; }
.recall-result.answering { color: var(--muted); }
.recall-result p { margin: 8px 0 0; white-space: pre-line; }
.recall-result small { display: block; margin-top: 10px; color: var(--muted); }
.recall-answer-head { display: flex; align-items: center; gap: 8px; }
.recall-answer-head span { width: 28px; height: 28px; border-radius: 9px; display: inline-grid; place-items: center; background: rgba(98,94,231,.11); color: #5753da; }
.person-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.person-choice { border: 1px solid #d9dbea; background: #fff; color: var(--text); border-radius: 999px; padding: 9px 13px; font: inherit; font-weight: 650; cursor: pointer; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.person-choice:hover { transform: translateY(-1px); border-color: #a9a5f4; background: #f7f6ff; }
@media (max-width: 1050px) { .memory-action-grid { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .recall-composer { padding: 19px; gap: 16px; } }

/* v1.5.0: Web Push */
.push-card { align-items: center; }
.push-actions { display: flex !important; align-items: center !important; justify-content: flex-end; gap: 9px !important; flex-wrap: wrap; }
.push-actions .text-button { padding: 10px 6px; }
.push-status-on { color: #39765b !important; }
.push-status-off { color: var(--muted) !important; }
.push-status-warn { color: #8a631d !important; }
@media (max-width: 680px) { .push-actions { width: 100%; justify-content: stretch; } .push-actions .secondary-button { flex: 1; } }

/* v1.5.1: Voice input */
.composer-buttons { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.voice-button { min-width: 118px; }
.voice-button.recording { background: #fff1f1; border-color: #efb4b4; color: #a53b3b; box-shadow: 0 0 0 4px rgba(184,64,64,.06); }
@media (max-width: 680px) {
  .composer-buttons { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .voice-button, .composer-buttons .composer-submit { width: 100%; }
}

/* v1.5.2: Photo input */
.photo-button { min-width: 96px; }
.photo-draft { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(160px, 240px) 1fr; gap: 18px; border: 1px solid #dcdff0; border-radius: 18px; padding: 14px; background: rgba(255,255,255,.9); align-items: stretch; }
.photo-draft img { width: 100%; height: 180px; object-fit: cover; border-radius: 14px; background: #f2f3f8; }
.photo-draft-body { display: grid; gap: 9px; align-content: center; }
.photo-draft-body > strong { font-size: 16px; }
.photo-draft-body p, .photo-draft-body small { margin: 0; color: var(--muted); line-height: 1.45; }
.photo-draft-body input { width: 100%; box-sizing: border-box; border: 1px solid #d8dbea; border-radius: 13px; padding: 12px 13px; background: #fff; color: var(--text); font: inherit; outline: none; }
.photo-draft-body input:focus { border-color: #9995f4; box-shadow: 0 0 0 4px rgba(98,94,231,.09); }
.photo-draft-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 3px; }
.memory-photo { width: min(100%, 560px); max-height: 360px; object-fit: cover; display: block; border-radius: 14px; margin: 0 0 14px; border: 1px solid var(--line); background: #f2f3f8; }
@media (max-width: 680px) {
  .photo-draft { grid-template-columns: 1fr; }
  .photo-draft img { height: 210px; }
  .photo-draft-actions { justify-content: stretch; }
  .photo-draft-actions .primary-button { flex: 1; }
  .composer-buttons { grid-template-columns: 1fr 1fr 1fr; }
  .photo-button, .voice-button, .composer-buttons .composer-submit { min-width: 0; padding-inline: 10px; }
}


.memory-card-actions { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.memory-card-actions button { font-size: 13px; }
.edited-badge { display: inline-flex; margin-left: 8px; color: var(--primary); font-weight: 700; }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(31, 34, 55, .42); backdrop-filter: blur(8px); }
.modal-card { width: min(620px, 100%); border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 30px 80px rgba(34, 37, 70, .24); padding: 22px; }
.modal-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.modal-head h2 { margin: 3px 0 0; }
.modal-close { border: 0; background: transparent; color: var(--muted); font-size: 30px; line-height: 1; padding: 0 5px; }
.modal-note { color: var(--muted); line-height: 1.5; margin: 14px 0; }
#editMemoryInput { width: 100%; resize: vertical; min-height: 150px; border: 1px solid var(--line); border-radius: 15px; padding: 14px; color: var(--ink); background: #fbfbff; font: inherit; line-height: 1.5; box-sizing: border-box; }
#editMemoryInput:focus { outline: 3px solid rgba(98,94,231,.10); border-color: var(--primary); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.modal-actions .primary-button { width: auto; margin-top: 0; padding: 11px 16px; }
@media (max-width: 680px) { .modal-actions { display: grid; grid-template-columns: 1fr; } .modal-actions .primary-button, .modal-actions .secondary-button { width: 100%; } }


/* v1.6.2: People Memory timeline */
.person-card-actions { display: flex; justify-content: flex-end; margin-top: 14px; padding-top: 10px; border-top: 1px solid #eef0f5; }
.person-timeline-modal { width: min(760px, calc(100vw - 28px)); max-height: min(82vh, 780px); overflow: auto; }
.timeline-current-block, .timeline-history-block { margin-top: 20px; }
.timeline-current-block h3, .timeline-history-block h3 { margin: 0 0 10px; font-size: 15px; }
.person-timeline-list { position: relative; display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 0 0 18px; }
.timeline-item:not(:last-child)::before { content: ''; position: absolute; left: 6px; top: 13px; bottom: -1px; width: 2px; background: #e5e7f1; }
.timeline-dot { position: relative; z-index: 1; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: #7772ef; box-shadow: 0 0 0 4px #f0efff; }
.timeline-item.change .timeline-dot { background: #56a6b9; box-shadow: 0 0 0 4px #eaf7fa; }
.timeline-body { min-width: 0; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fbfbfd; }
.timeline-body small { color: var(--muted); }
.timeline-body strong { line-height: 1.4; }
.timeline-arrow { color: var(--primary); font-weight: 800; }
.compact-empty { padding: 20px 14px; }

/* v1.7.4 — MEMORA Brand + Web/PWA UX Refresh */
:root {
  --bg: #f4f5fb;
  --surface: rgba(255,255,255,.90);
  --surface-strong: #ffffff;
  --ink: #171a2d;
  --text: #171a2d;
  --muted: #72788e;
  --line: #e4e6f0;
  --primary: #5b56e8;
  --primary-dark: #4540c4;
  --primary-soft: #eeedff;
  --accent: #69bed1;
  --accent-soft: #ebf8fb;
  --shadow: 0 20px 70px rgba(48, 47, 101, .10);
}
body {
  background:
    radial-gradient(circle at 82% 2%, rgba(105,190,209,.16), transparent 28%),
    radial-gradient(circle at 9% 20%, rgba(91,86,232,.10), transparent 28%),
    linear-gradient(180deg, #fafaff 0%, #f4f5fb 48%, #f7f8fc 100%);
}
.shell { width: min(1460px, calc(100% - 36px)); }
.topbar { height: 86px; }
.brand { gap: 13px; }
.brand-logo {
  width: 48px; height: 48px; border-radius: 15px; display: block;
  box-shadow: 0 11px 28px rgba(72, 69, 180, .20);
}
.brand-copy strong { font-size: 16px; letter-spacing: .12em; }
.brand-copy small { font-size: 11px; letter-spacing: .01em; }
.top-actions { gap: 9px; }
.beta-pill {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px;
  border: 1px solid #dedcfb; border-radius: 999px; background: #f3f2ff;
  color: var(--primary-dark); font-size: 10px; font-weight: 900; letter-spacing: .1em;
}
.ghost-button, .refresh-button, .secondary-button {
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.ghost-button:hover, .refresh-button:hover, .secondary-button:hover {
  transform: translateY(-1px); border-color: #cbc9ed; background: #fff;
  box-shadow: 0 8px 24px rgba(48,47,101,.07);
}
.primary-button { transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 15px 34px rgba(91,86,232,.28); }
button:focus-visible, textarea:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid rgba(91,86,232,.18); outline-offset: 2px;
}

/* Sign in / brand story */
.login-layout { gap: 22px; padding-top: 34px; }
.hero-card {
  position: relative; overflow: hidden; min-height: 610px;
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(242,242,255,.92));
}
.hero-card::after {
  content: ''; position: absolute; width: 310px; height: 310px; border-radius: 50%;
  right: -120px; top: -110px;
  background: radial-gradient(circle, rgba(105,190,209,.28), rgba(105,190,209,0) 70%);
  pointer-events: none;
}
.hero-brand-lockup { display: flex; align-items: center; gap: 14px; margin-bottom: 34px; }
.hero-brand-lockup img { width: 64px; height: 64px; border-radius: 19px; box-shadow: 0 15px 34px rgba(72,69,180,.18); }
.hero-brand-lockup div { display: grid; gap: 5px; }
.hero-brand-lockup strong { letter-spacing: .14em; font-size: 17px; }
.hero-brand-lockup small { color: var(--muted); font-size: 12px; }
.hero-card h1 { font-size: clamp(46px, 5.8vw, 78px); max-width: 940px; }
.hero-card > p { font-size: 17px; max-width: 720px; }
.hero-promise {
  display: inline-flex; align-self: flex-start; gap: 5px; margin-top: 24px; padding: 10px 14px;
  border: 1px solid #dfdef5; border-radius: 999px; background: rgba(255,255,255,.72);
  color: #5f6478; font-size: 13px;
}
.hero-promise strong { color: var(--primary-dark); }
.feature-grid { margin-top: 42px; }
.feature-grid div { min-height: 116px; align-content: start; }
.feature-grid span {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px;
  background: var(--primary-soft); color: var(--primary); font-size: 18px;
}
.feature-grid div:nth-child(2) span { background: var(--accent-soft); color: #3f94a7; }
.auth-card { position: relative; overflow: hidden; }
.auth-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.auth-trust { margin-top: 17px; padding: 13px 14px; border-radius: 14px; background: #f7f8fc; display: flex; align-items: flex-start; gap: 9px; }
.auth-trust p { margin: 0; font-size: 12px; line-height: 1.45; }

/* App shell */
.app-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 24px; }
.sidebar { background: rgba(255,255,255,.88); border-color: rgba(224,226,239,.95); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; }
.sidebar-brand img { border-radius: 11px; box-shadow: 0 7px 18px rgba(72,69,180,.15); }
.sidebar-brand span { display: grid; gap: 2px; min-width: 0; }
.sidebar-brand small { color: var(--primary); font-weight: 900; letter-spacing: .1em; font-size: 9px; }
.sidebar-brand strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item { transition: background .16s ease, transform .16s ease, color .16s ease; }
.nav-item:hover { transform: translateX(2px); background: #f6f6fd; }
.nav-item.active { background: linear-gradient(135deg, #efefff, #f1f8fb); color: var(--primary-dark); box-shadow: inset 0 0 0 1px rgba(91,86,232,.05); }
.page-head { padding-top: 8px; }
.home-head { padding-bottom: 18px; }
.home-head h1 { font-size: clamp(38px, 4.4vw, 58px); }
.page-head p { max-width: 680px; line-height: 1.5; }

/* Quick actions */
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.quick-action {
  border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.82);
  padding: 13px 14px; display: flex; align-items: center; gap: 10px; text-align: left; color: var(--ink);
  box-shadow: 0 8px 24px rgba(48,47,101,.04);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.quick-action > span:first-child { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: #f5f5fb; font-size: 18px; flex: 0 0 auto; }
.quick-action > span:last-child { display: grid; gap: 2px; min-width: 0; }
.quick-action strong { font-size: 13px; }
.quick-action small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-action:hover { transform: translateY(-2px); border-color: #d5d3f3; box-shadow: 0 12px 28px rgba(48,47,101,.08); }
.quick-action.primary-quick { background: linear-gradient(135deg, #f0efff, #f6f5ff); border-color: #dcdafa; }
.quick-action.primary-quick > span:first-child { background: #e5e3ff; }
.quick-action.recall-quick { background: linear-gradient(135deg, #eef9fb, #f7fbff); border-color: #d7edf2; }
.quick-action.recall-quick > span:first-child { background: #dff3f7; }

/* Main memory surfaces */
.memory-action-grid { grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr); gap: 14px; }
.memory-composer, .recall-composer { box-shadow: 0 14px 42px rgba(48,47,101,.06); }
.memory-composer.featured-composer {
  position: relative; overflow: hidden;
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(241,240,255,.92));
  border-color: #dedcf5;
}
.memory-composer.featured-composer::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, var(--primary), #837ff2);
}
.recall-composer { background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(239,249,252,.94)); border-color: #dcecf0; }
.composer-copy h2 { font-size: 27px; }
.composer-form textarea, .recall-form textarea {
  min-height: 112px; border-color: #dfe1ec; box-shadow: inset 0 1px 0 rgba(31,35,64,.02);
}
.composer-form textarea:focus, .recall-form textarea:focus { border-color: #a9a5f2; box-shadow: 0 0 0 4px rgba(91,86,232,.08); }
.memory-pulse { margin-top: 14px; }
.stat-card { padding: 18px 20px; border-radius: 17px; box-shadow: 0 8px 24px rgba(48,47,101,.04); }
.stat-card span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: #f2f2fb; font-size: 20px; }
.stat-card strong { font-size: 24px; }
.dashboard-three { grid-template-columns: 1fr 1fr 1fr; }
.panel-card { box-shadow: 0 12px 36px rgba(48,47,101,.05); }
.today-panel { background: linear-gradient(150deg, rgba(255,255,255,.96), rgba(245,244,255,.90)); }
.compact-item { transition: border-color .15s ease, background .15s ease; }
.compact-item:hover { border-color: #d8d8ea; background: #fff; }
.reminder-compact { display: flex; gap: 11px; align-items: flex-start; }
.reminder-compact .compact-icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: #f0efff; flex: 0 0 auto; }
.reminder-compact > div { min-width: 0; }
.people-preview { align-content: flex-start; }
.person-chip { box-shadow: 0 5px 14px rgba(48,47,101,.035); }
.person-card, .memory-card, .reminder-card { transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.person-card:hover, .memory-card:hover, .reminder-card:hover { transform: translateY(-1px); border-color: #d7d8e8; box-shadow: 0 10px 28px rgba(48,47,101,.06); }
.rich-empty { display: grid; gap: 5px; }
.rich-empty strong { color: #555c70; font-size: 14px; }
.rich-empty span { font-size: 12px; line-height: 1.45; }
.compact-empty { padding: 21px 14px; }

/* Profile polish */
.profile-card, .security-card { box-shadow: 0 12px 36px rgba(48,47,101,.05); }
.profile-avatar { background: linear-gradient(145deg, var(--primary), var(--accent)); color: #fff; }
.footer { opacity: .82; }

@media (max-width: 1180px) {
  .dashboard-three { grid-template-columns: 1fr 1fr; }
  .today-panel { grid-column: 1 / -1; }
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1050px) {
  .memory-action-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .app-layout { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .sidebar {
    left: 10px; right: 10px; bottom: max(8px, env(safe-area-inset-bottom));
    padding: 7px; border-radius: 20px; box-shadow: 0 18px 50px rgba(28,31,65,.16);
  }
  .nav-item:hover { transform: none; }
  .dashboard-three { grid-template-columns: 1fr; }
  .today-panel { grid-column: auto; }
}
@media (max-width: 680px) {
  .shell { width: min(100% - 18px, 1460px); }
  .topbar { height: 70px; }
  .brand-logo { width: 42px; height: 42px; border-radius: 13px; }
  .brand-copy strong { font-size: 14px; }
  .beta-pill { display: none; }
  #installButton { padding: 8px 10px; font-size: 11px; }
  .hero-brand-lockup { margin-bottom: 24px; }
  .hero-card h1 { font-size: clamp(40px, 12vw, 54px); }
  .hero-promise { border-radius: 15px; line-height: 1.35; }
  .feature-grid div { min-height: auto; }
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .quick-action { padding: 11px; }
  .quick-action > span:first-child { width: 32px; height: 32px; }
  .memory-composer, .recall-composer { border-radius: 20px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card { padding: 12px 9px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
  .stat-card span { width: 32px; height: 32px; font-size: 16px; }
  .stat-card strong { font-size: 21px; }
  .stat-card small { font-size: 10px; line-height: 1.2; }
  .panel-card { padding: 18px; }
  .sidebar .nav-list { grid-template-columns: repeat(5, 1fr); }
  .nav-item { min-width: 0; border-radius: 13px; }
  .nav-item.active { box-shadow: none; }
}
@media (max-width: 410px) {
  .brand-copy small { display: none; }
  .quick-action small { display: none; }
  .quick-action { justify-content: center; text-align: center; }
  .quick-action > span:last-child { display: block; }
  .stats-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}


/* v1.7.4.1 — supplied MEMORA brand concept + responsive layout fix */
:root {
  --bg: #f8f9fd;
  --surface: rgba(255,255,255,.90);
  --surface-strong: #ffffff;
  --ink: #2E2F3E;
  --text: #2E2F3E;
  --muted: #7c8197;
  --line: #e7e8f1;
  --primary: #7CA7F0;
  --primary-dark: #5f82ce;
  --primary-soft: #eef5ff;
  --accent: #C4B5FD;
  --accent-strong: #a58feb;
  --accent-soft: #f5f1ff;
  --shadow: 0 22px 68px rgba(69,76,121,.10);
}
body {
  background:
    radial-gradient(circle at 84% 0%, rgba(196,181,253,.28), transparent 29%),
    radial-gradient(circle at 5% 14%, rgba(124,167,240,.20), transparent 30%),
    linear-gradient(180deg, #fbfcff 0%, #f6f8fd 52%, #fbf9ff 100%);
}
.orb-one { background: radial-gradient(circle, rgba(196,181,253,.65) 0%, rgba(196,181,253,0) 72%); }
.orb-two { background: radial-gradient(circle, rgba(124,167,240,.48) 0%, rgba(124,167,240,0) 72%); }

/* Use the real supplied horizontal logo on desktop; app icon on narrow screens. */
.brand { min-width: 0; }
.brand-wordmark { width: 218px; height: 64px; object-fit: contain; display: block; border-radius: 15px; mix-blend-mode: multiply; }
.brand-app-icon { display: none; width: 46px; height: 46px; border-radius: 14px; box-shadow: 0 10px 26px rgba(124,167,240,.26); }
.brand-copy, .brand-logo { display: none !important; }
.beta-pill { border-color: #e3dcff; background: #f7f3ff; color: #7d6fc2; }
.status-pill.online { background: #edf7f4; }

/* Login / first impression uses the supplied welcome artwork. */
.brand-hero { padding: 18px; min-height: 0; display: grid; place-items: center; background: rgba(255,255,255,.82); }
.brand-hero::after { display: none; }
.welcome-art { display: block; width: min(100%, 760px); height: auto; border-radius: 25px; box-shadow: 0 20px 55px rgba(88,98,154,.11); }
.auth-card::before { background: linear-gradient(90deg, #7CA7F0, #C4B5FD); }
.eyebrow { color: #6f8fd4; }
.primary-button { background: linear-gradient(135deg, #7CA7F0, #aa98f2); box-shadow: 0 12px 30px rgba(124,167,240,.26); }
.primary-button:hover { background: linear-gradient(135deg, #6f99e6, #9e8ceb); box-shadow: 0 15px 34px rgba(124,167,240,.30); }
button:focus-visible, textarea:focus-visible, input:focus-visible, a:focus-visible { outline-color: rgba(124,167,240,.30); }

/* Brand icon system: rounded, light, blue/lilac, matching the supplied concept. */
.nav-icon, .quick-icon, .stat-icon { color: #789fe5; }
.nav-icon svg, .quick-icon svg, .stat-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.nav-icon { width: 23px !important; height: 23px; padding: 2px; flex: 0 0 auto; }
.nav-item.active { background: linear-gradient(135deg, #eef5ff, #f6f1ff); color: #667fc5; box-shadow: inset 0 0 0 1px rgba(124,167,240,.12); }
.nav-item:hover { background: #f5f8ff; }
.quick-action { border-color: #e5e8f2; background: rgba(255,255,255,.90); }
.quick-action > .quick-icon { width: 38px; height: 38px; padding: 9px; display: grid; place-items: center; border-radius: 13px; background: #eef5ff; flex: 0 0 auto; }
.quick-action:nth-child(2) > .quick-icon { color: #8f7fda; background: #f4f0ff; }
.quick-action:nth-child(3) > .quick-icon { color: #6f9ee8; background: #edf6ff; }
.quick-action:nth-child(4) > .quick-icon { color: #917bdc; background: #f5f1ff; }
.quick-action.primary-quick { background: linear-gradient(135deg, #f3f8ff, #f9f7ff); border-color: #dfe9fb; }
.quick-action.recall-quick { background: linear-gradient(135deg, #f7f4ff, #f8fbff); border-color: #e6dfff; }
.stat-card > .stat-icon { width: 42px; height: 42px; padding: 10px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #eef5ff, #f4f0ff); grid-row: span 2; }
.stat-card:nth-child(2) > .stat-icon { color: #907edb; }
.stat-card:nth-child(3) > .stat-icon { color: #718fd2; }
.sidebar-brand img { border-radius: 13px; box-shadow: 0 7px 20px rgba(124,167,240,.22); }
.sidebar-brand small { color: #7896d4; }
.person-avatar, .person-chip span { background: linear-gradient(145deg, #eef5ff, #f5f1ff); color: #718bd0; }
.profile-avatar { background: linear-gradient(145deg, #7CA7F0, #C4B5FD); }
.memory-composer.featured-composer::before { background: linear-gradient(180deg, #7CA7F0, #C4B5FD); }
.memory-composer.featured-composer { background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(243,247,255,.94)); border-color: #e0e9f8; }
.recall-composer { background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(248,245,255,.95)); border-color: #e9e2fb; }
.today-panel { background: linear-gradient(150deg, rgba(255,255,255,.97), rgba(244,247,255,.94)); }

/* Critical responsive fix: the late desktop .app-layout rule in v1.7.4 overrode
   the earlier mobile breakpoint, leaving content auto-placed in column 2 after
   the sidebar became fixed. Force a single explicit column below 980px. */
@media (max-width: 980px) {
  .app-layout { grid-template-columns: minmax(0, 1fr) !important; width: 100%; }
  .content { grid-column: 1 !important; grid-row: 1; width: 100%; min-width: 0; }
  .sidebar { grid-column: 1; }
  .view-panel { width: 100%; min-width: 0; }
}

@media (max-width: 760px) {
  .brand-wordmark { display: none; }
  .brand-app-icon { display: block; }
  .login-layout { grid-template-columns: minmax(0, 1fr); }
  .brand-hero { padding: 10px; }
  .welcome-art { border-radius: 20px; }
}

@media (max-width: 680px) {
  .quick-action > .quick-icon { width: 34px; height: 34px; padding: 8px; }
  .stat-card > .stat-icon { width: 34px; height: 34px; padding: 8px; }
  .nav-icon { width: 22px !important; height: 22px; }
}

/* v1.7.4.2 — header logo polish: native lockup, no raster white plaque */
.brand {
  gap: 10px;
  align-items: center;
  padding: 0;
  background: transparent;
  border-radius: 0;
}
.brand-header-icon {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 16px rgba(106, 123, 190, .14));
}
.brand-header-type {
  display: grid;
  gap: 1px;
  min-width: 0;
  line-height: 1;
}
.brand-header-type strong {
  color: #2E2F3E;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", Inter, system-ui, sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.035em;
}
.brand-header-type small {
  color: #9698ad;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .34em;
  padding-left: 2px;
  white-space: nowrap;
}
/* Old raster lockup stays in assets for brand/reference use but is not used in the header. */
.brand-wordmark, .brand-app-icon { display: none !important; }

@media (max-width: 760px) {
  .brand-header-icon { width: 46px; height: 46px; }
  .brand-header-type strong { font-size: 24px; }
  .brand-header-type small { font-size: 8px; letter-spacing: .27em; }
}

@media (max-width: 520px) {
  .brand-header-type small { display: none; }
  .brand-header-type strong { font-size: 22px; }
}

@media (max-width: 390px) {
  .brand-header-type { display: none; }
}

/* v1.8.1 — Commitments + Open Loops */
.stats-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dashboard-four { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.commitments-home-panel { background: linear-gradient(150deg, rgba(255,255,255,.97), rgba(241,247,255,.92)); }
.open-loops-home-panel { background: linear-gradient(150deg, rgba(255,255,255,.97), rgba(248,244,255,.94)); }
.open-loops-list { display: grid; gap: 12px; }
.open-loop-compact { display: flex; gap: 11px; align-items: flex-start; }
.open-loop-compact .compact-icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #f0f6ff, #f6f1ff); flex: 0 0 auto; }
.commitment-compact { display: flex; gap: 11px; align-items: flex-start; }
.commitment-compact .compact-icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #eef5ff, #f5f1ff); flex: 0 0 auto; }
.commitment-compact > div { min-width: 0; }
.commitments-list { display: grid; gap: 12px; }
.commitment-card { border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.90); padding: 18px; box-shadow: 0 10px 30px rgba(69,76,121,.05); }
.commitment-card-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.commitment-card-head > div { min-width: 0; }
.commitment-card-head strong { display: block; margin-top: 6px; font-size: 17px; line-height: 1.4; color: var(--ink); }
.commitment-direction { display: inline-flex; color: #68718a; font-size: 12px; font-weight: 800; letter-spacing: .01em; }
.commitment-status { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 9px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-open { color: #5576bb; background: #eef5ff; }
.status-done { color: #387158; background: #edf8f2; }
.status-cancelled { color: #7a6a75; background: #f4f1f3; }
.commitment-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 13px; color: var(--muted); font-size: 13px; }
.commitment-overdue { color: #a45954; background: #fff0ef; border-radius: 999px; padding: 4px 8px; font-weight: 750; }
.commitment-actions { display: flex; align-items: center; gap: 12px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.commitment-actions .secondary-button { width: auto; margin: 0; padding: 9px 13px; }
.commitment-closed { opacity: .76; }
.commitment-closed .commitment-card-head strong { text-decoration: none; }

@media (max-width: 1180px) {
  .dashboard-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .sidebar .nav-list, .nav-list { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .dashboard-four { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-item { font-size: 9px; }
}
@media (max-width: 520px) {
  .nav-item { font-size: 0; }
  .nav-item .nav-icon { width: 22px; height: 22px; }
  .commitment-card-head { flex-direction: column; gap: 10px; }
  .commitment-actions { align-items: stretch; flex-direction: column; }
  .commitment-actions .secondary-button, .commitment-actions .text-button { width: 100%; }
}


/* MEMORA v1.9 Daily Memory Brief */
.daily-brief-panel { margin: 18px 0; background: linear-gradient(145deg, rgba(244,248,255,.96), rgba(248,244,255,.96)); }
.brief-schedule { color: var(--muted); font-size: 12px; font-weight: 750; }
.daily-brief-content { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.brief-group { padding: 14px; border: 1px solid rgba(124,167,240,.22); border-radius: 16px; background: rgba(255,255,255,.78); }
.brief-group > strong { display: block; margin-bottom: 9px; color: var(--ink); }
.brief-item { display: grid; grid-template-columns: minmax(52px,auto) 1fr; gap: 9px; align-items: baseline; padding: 7px 0; border-top: 1px solid rgba(229,232,241,.72); }
.brief-item:first-of-type { border-top: 0; padding-top: 0; }
.brief-item span { color: var(--muted); font-size: 12px; font-weight: 750; }
.brief-item b { font-size: 13px; line-height: 1.4; font-weight: 700; }
.brief-settings-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.brief-toggle, .brief-time-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink); }
.brief-time-label input { border: 1px solid var(--line); border-radius: 10px; padding: 8px 9px; background: rgba(255,255,255,.92); color: var(--ink); font: inherit; }
.brief-settings-controls .secondary-button { width: auto; margin: 0; }
@media (max-width: 720px) {
  .daily-brief-content { grid-template-columns: 1fr; }
  .brief-settings-controls { width: 100%; justify-content: stretch; }
  .brief-settings-controls > * { width: 100%; }
  .brief-toggle, .brief-time-label { justify-content: space-between; }
  .brief-settings-controls .secondary-button { width: 100%; }
}


/* v1.9.0.5 — Web brand alignment with Telegram avatar */
.brand-telegram-avatar {
  display: block;
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 17px;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  box-shadow: 0 10px 28px rgba(108, 119, 214, .18);
}
.brand-header-type { gap: 4px; }
.brand-header-type small {
  color: #7a7f99;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .01em;
  padding-left: 0;
}
.telegram-brand-hero {
  min-height: 420px;
  padding: clamp(20px, 4vw, 44px);
  background: linear-gradient(145deg, rgba(238,247,255,.94), rgba(246,240,255,.94));
  border: 1px solid rgba(124,167,240,.16);
}
.telegram-brand-lockup {
  width: 100%;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 22px;
}
.telegram-brand-avatar {
  width: min(330px, 72vw);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 34px;
  border: 0;
  background: transparent;
  box-shadow: 0 28px 70px rgba(101, 112, 215, .20);
}
.telegram-brand-copy { display: grid; justify-items: center; gap: 8px; }
.telegram-brand-copy h1 {
  margin: 0;
  color: #2E2F3E;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", Inter, system-ui, sans-serif;
  font-size: clamp(34px, 5vw, 50px);
  letter-spacing: -.04em;
}
.telegram-brand-copy p {
  margin: 0;
  color: #60657d;
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 750;
}
@media (max-width: 760px) {
  .brand-telegram-avatar { width: 46px; height: 46px; border-radius: 14px; }
  .brand-header-type small { font-size: 9px; }
  .telegram-brand-hero { min-height: 0; }
  .telegram-brand-avatar { width: min(270px, 70vw); border-radius: 28px; }
}
@media (max-width: 520px) {
  .brand-header-type small { display: none; }
}
@media (max-width: 390px) {
  .brand-header-type { display: none; }
}


/* v1.9.1 Brief Controls */
.brief-controls-grid { align-items: flex-start; }
.brief-section-options { flex: 1 1 100%; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px 12px; padding: 12px; border: 1px solid rgba(124,167,240,.20); border-radius: 14px; background: rgba(255,255,255,.60); }
.brief-section-options > span { grid-column: 1 / -1; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.brief-section-options label { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink); }
@media (max-width: 720px) { .brief-section-options { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .brief-section-options { grid-template-columns: 1fr; } }

/* MEMORA v1.9.2 Weekly Review */
.weekly-review-card { align-items: flex-start; gap: 18px; }
.weekly-review-controls { flex: 1 1 540px; }
.brief-time-label select { border: 1px solid var(--line); border-radius: 10px; padding: 8px 9px; background: rgba(255,255,255,.92); color: var(--ink); font: inherit; }
.weekly-review-preview { flex: 1 1 100%; display: grid; gap: 10px; margin-top: 2px; }
.weekly-review-summary { padding: 12px 14px; border: 1px solid rgba(124,167,240,.20); border-radius: 14px; background: rgba(255,255,255,.60); }
.weekly-review-summary strong { display: block; margin-bottom: 6px; }
.weekly-review-summary p { margin: 4px 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
@media (max-width: 720px) { .weekly-review-controls, .weekly-review-controls > * { width: 100%; } }

/* MEMORA v1.10 Project Memory */
.stats-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.projects-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.project-card { display: grid; gap: 10px; padding: 18px; border: 1px solid rgba(124,167,240,.20); border-radius: 18px; background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(247,244,255,.92)); box-shadow: 0 12px 34px rgba(69,79,125,.06); }
.project-card.archived { opacity: .7; }
.project-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.project-card h3 { margin: 0; font-size: 17px; }
.project-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.project-card-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.project-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 8px; background: rgba(124,167,240,.10); color: #5778b9; font-size: 11px; font-weight: 800; }
.project-card .secondary-button { width: auto; margin: 0; justify-self: start; }
.project-create-card { margin-bottom: 16px; }
.project-create-form { display: grid; grid-template-columns: minmax(180px,.8fr) minmax(240px,1.4fr) auto; gap: 10px; align-items: center; }
.project-create-form input, .project-link-memory select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: rgba(255,255,255,.94); color: var(--ink); font: inherit; }
.project-create-form .primary-button { width: auto; margin: 0; }
.form-hint { display: block; margin-top: 10px; color: var(--muted); line-height: 1.45; }
.projects-preview { display: grid; gap: 9px; }
.project-preview-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 13px; background: rgba(124,167,240,.08); }
.project-preview-item strong { font-size: 13px; }
.project-preview-item small { color: var(--muted); font-size: 11px; }
.project-detail { margin-top: 18px; }
.project-detail-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.project-detail-head h2 { margin: 4px 0 6px; }
.project-detail-head p { margin: 0; color: var(--muted); }
.project-detail-actions { display: flex; gap: 10px; align-items: center; }
.project-detail-actions .secondary-button { width: auto; margin: 0; }
.project-detail-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.project-link-memory { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px; margin: 14px 0; border: 1px solid rgba(124,167,240,.18); border-radius: 14px; background: rgba(248,250,255,.8); }
.project-link-memory .secondary-button { width: auto; margin: 0; }
.project-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.project-detail-grid > section { padding: 14px; border: 1px solid rgba(124,167,240,.15); border-radius: 15px; background: rgba(255,255,255,.72); }
.project-detail-grid h3 { margin: 0 0 10px; font-size: 14px; }
.project-memory-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; padding: 9px 0; border-top: 1px solid rgba(229,232,241,.7); }
.project-memory-row:first-child { border-top: 0; padding-top: 0; }
.project-memory-row button { align-self: center; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 980px) {
  .sidebar .nav-list, .nav-list { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .projects-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .project-create-form { grid-template-columns: 1fr; }
  .project-create-form .primary-button { width: 100%; }
  .project-detail-head { flex-direction: column; }
  .project-detail-actions { width: 100%; }
  .project-detail-actions > * { flex: 1; }
  .project-detail-grid { grid-template-columns: 1fr; }
  .project-link-memory { grid-template-columns: 1fr; }
  .project-link-memory .secondary-button { width: 100%; }
}


/* MEMORA v1.11 Memory Connections */
.connections-list { display: grid; gap: 14px; }
.connections-info { margin-bottom: 16px; background: linear-gradient(145deg, rgba(245,249,255,.95), rgba(249,245,255,.95)); }
.connections-info strong { display: block; margin-bottom: 6px; }
.connections-info p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.connection-card { display: grid; gap: 12px; padding: 18px; border: 1px solid rgba(124,167,240,.20); border-radius: 18px; background: rgba(255,255,255,.88); box-shadow: 0 12px 34px rgba(69,79,125,.05); }
.connection-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.connection-card-head > small { color: var(--muted); font-weight: 750; }
.connection-badge { display: inline-flex; align-items: center; width: fit-content; padding: 6px 9px; border-radius: 999px; background: rgba(124,167,240,.11); color: #5778b9; font-size: 11px; font-weight: 850; }
.connection-reason { display: flex; flex-wrap: wrap; gap: 7px 10px; align-items: baseline; padding: 10px 12px; border-radius: 13px; background: rgba(196,181,253,.10); }
.connection-reason strong { font-size: 12px; }
.connection-reason span { color: var(--muted); font-size: 12px; }
.connection-pair { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 12px; align-items: stretch; }
.connection-pair > div { padding: 13px; border: 1px solid rgba(124,167,240,.14); border-radius: 14px; background: rgba(248,250,255,.72); }
.connection-pair small { color: var(--muted); font-size: 11px; font-weight: 800; }
.connection-pair p { margin: 7px 0 0; font-size: 13px; line-height: 1.48; }
.connection-arrow { display: grid; place-items: center; color: #7c8fc7; font-weight: 900; }
.connections-preview { display: grid; gap: 9px; }
.connection-preview-item { display: grid; width: 100%; gap: 4px; text-align: left; padding: 10px 11px; border-radius: 13px; background: rgba(124,167,240,.08); }
.connection-preview-item strong { font-size: 12px; color: var(--ink); }
.connection-preview-item small { color: var(--muted); font-size: 11px; line-height: 1.4; }
@media (max-width: 720px) {
  .connection-card-head { align-items: flex-start; flex-direction: column; }
  .connection-pair { grid-template-columns: 1fr; }
  .connection-arrow { transform: rotate(90deg); min-height: 18px; }
}

/* v1.13 Journal & Personal Timeline */
.journal-composer-card { margin-bottom: 18px; }
.journal-list, .personal-timeline-list { display: grid; gap: 14px; }
.journal-card {
  border: 1px solid var(--border, rgba(46,47,62,.1));
  border-radius: 20px;
  background: rgba(255,255,255,.78);
  padding: 18px;
  box-shadow: 0 10px 30px rgba(46,47,62,.05);
}
.journal-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.journal-card p { white-space: pre-wrap; margin: 0 0 10px; line-height: 1.6; }
.journal-card small { color: var(--muted, #6b6f80); }
.journal-date { font-weight: 700; color: #2E2F3E; }
.timeline-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.timeline-controls label { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.timeline-controls select { min-height: 42px; border-radius: 12px; border: 1px solid rgba(46,47,62,.14); padding: 0 12px; background: white; }
.personal-timeline-list { position: relative; }
.timeline-event { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 14px; padding: 0 0 18px; }
.timeline-event::before { content: ''; position: absolute; left: 8px; top: 18px; bottom: -4px; width: 1px; background: rgba(124,167,240,.35); }
.timeline-event:last-child::before { display: none; }
.timeline-dot { width: 17px; height: 17px; border-radius: 50%; background: linear-gradient(135deg, #7CA7F0, #C4B5FD); box-shadow: 0 0 0 4px rgba(124,167,240,.12); margin-top: 4px; z-index: 1; }
.timeline-event > div:last-child { border: 1px solid rgba(46,47,62,.09); border-radius: 18px; padding: 15px 17px; background: rgba(255,255,255,.75); }
.timeline-event h3 { margin: 4px 0 7px; font-size: 1rem; }
.timeline-event p { margin: 0; line-height: 1.55; white-space: pre-wrap; }
.timeline-event small { color: var(--muted, #6b6f80); }
@media (max-width: 720px) {
  .journal-card { padding: 15px; border-radius: 16px; }
  .timeline-controls { align-items: stretch; }
  .timeline-controls label, .timeline-controls select, .timeline-controls button { width: 100%; }
}

.settings-note { margin: 10px 0 0; color: var(--muted); line-height: 1.45; font-size: .92rem; }
.occasions-card { align-items: flex-start; flex-wrap: wrap; }
.occasions-card .occasions-controls { min-width: 280px; }
.occasions-card .weekly-review-preview { flex-basis: 100%; width: 100%; }

/* v1.15 Calendar Hub */
.calendar-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.calendar-controls label { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.calendar-controls select { min-height: 42px; border-radius: 12px; border: 1px solid rgba(46,47,62,.14); padding: 0 12px; background: white; }
.calendar-summary { margin: 14px 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.calendar-list { display: grid; gap: 18px; }
.calendar-day { display: grid; gap: 10px; }
.calendar-day > h3 { margin: 0; font-size: .95rem; color: var(--muted); letter-spacing: .02em; }
.calendar-day > div { display: grid; gap: 9px; }
.calendar-event { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; padding: 14px 15px; border: 1px solid rgba(124,167,240,.16); border-radius: 16px; background: rgba(255,255,255,.78); }
.calendar-event-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: rgba(124,167,240,.10); font-size: 1.1rem; }
.calendar-event-body { display: grid; gap: 4px; min-width: 0; }
.calendar-event-body small { color: var(--muted); font-size: .78rem; }
.calendar-event-body strong { color: var(--ink); line-height: 1.4; }
.calendar-event-body span { color: var(--muted); font-size: .8rem; }
.calendar-preview { display: grid; gap: 9px; }
.calendar-compact small { line-height: 1.35; }
@media (max-width: 720px) {
  .calendar-controls { align-items: stretch; }
  .calendar-controls label, .calendar-controls select, .calendar-controls button { width: 100%; }
  .calendar-event { grid-template-columns: 34px minmax(0, 1fr); padding: 12px; }
  .calendar-event-icon { width: 34px; height: 34px; }
}

/* v1.16 Email Inbox */
.email-import-card { margin-bottom: 14px; }
.email-import-form { display: grid; gap: 13px; }
.email-import-form label { display: grid; gap: 7px; color: var(--muted); font-size: .82rem; font-weight: 750; }
.email-import-form input, .email-import-form select, .email-import-form textarea {
  width: 100%; box-sizing: border-box; border: 1px solid rgba(46,47,62,.14); border-radius: 13px;
  background: rgba(255,255,255,.94); color: var(--ink); font: inherit; padding: 11px 12px; outline: none;
}
.email-import-form textarea { resize: vertical; min-height: 160px; line-height: 1.5; }
.email-import-form input:focus, .email-import-form select:focus, .email-import-form textarea:focus {
  border-color: #9995f4; box-shadow: 0 0 0 4px rgba(98,94,231,.08);
}
.email-form-row { display: grid; grid-template-columns: .8fr 1fr 1.2fr; gap: 10px; }
.email-list { display: grid; gap: 13px; margin-top: 16px; }
.email-card { border: 1px solid rgba(124,167,240,.17); border-radius: 18px; background: rgba(255,255,255,.82); padding: 17px; box-shadow: 0 10px 28px rgba(46,47,62,.04); }
.email-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.email-card-head > div { display: grid; gap: 3px; min-width: 0; }
.email-card-head strong { line-height: 1.4; }
.email-card-head small { color: var(--muted); }
.email-direction { width: fit-content; min-width: 28px; display: inline-grid; place-items: center; padding: 3px 7px; border-radius: 999px; background: rgba(124,167,240,.11); color: #5875ad; font-weight: 850; }
.email-summary { margin: 13px 0; line-height: 1.55; }
.email-card details { border-top: 1px solid rgba(46,47,62,.08); padding-top: 10px; }
.email-card summary { cursor: pointer; color: var(--muted); font-size: .85rem; font-weight: 750; }
.email-card pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: .87rem; line-height: 1.5; color: var(--ink); background: rgba(248,250,255,.7); padding: 12px; border-radius: 12px; }
.email-preview { display: grid; gap: 9px; }
.email-compact small { line-height: 1.35; }
@media (max-width: 760px) {
  .email-form-row { grid-template-columns: 1fr; }
  .email-card-head { flex-direction: column; }
}

/* v1.17 Universal Inbox */
.inbox-composer-card { margin-bottom: 16px; }
.inbox-list { display: grid; gap: 12px; margin-top: 14px; }
.inbox-preview { display: grid; gap: 9px; }
.inbox-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 15px 16px; border: 1px solid rgba(124,167,240,.17); border-radius: 18px; background: rgba(255,255,255,.82); box-shadow: 0 10px 28px rgba(46,47,62,.04); }
.inbox-card-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: rgba(124,167,240,.10); font-size: 1.15rem; }
.inbox-card-body { min-width: 0; display: grid; gap: 5px; }
.inbox-card-body small { color: var(--muted); font-size: .78rem; }
.inbox-card-body strong { color: var(--ink); line-height: 1.4; }
.inbox-card-body p { margin: 2px 0 0; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.inbox-action { width: fit-content; padding: 4px 8px; border-radius: 999px; background: rgba(255,183,77,.13); font-size: .76rem; font-weight: 800; }
.inbox-compact small { line-height: 1.35; }
@media (max-width: 720px) {
  .inbox-card { grid-template-columns: 36px minmax(0, 1fr); padding: 12px; }
  .inbox-card-icon { width: 36px; height: 36px; }
}

/* v1.19 — Private Health / Cycle Calendar */
.health-optin-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.health-optin-card h2 { margin-top: 0; }
.health-forecast-card { background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(246,243,255,.90)); }
.health-forecast-card #healthForecastText { font-size: 16px; line-height: 1.55; }
.health-settings-controls { min-width: min(100%, 480px); }
.health-settings-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.health-profile-card > div > span { background: var(--accent-soft); }
@media (max-width: 680px) {
  .health-optin-card { align-items: stretch; flex-direction: column; }
  .health-settings-actions { align-items: stretch; flex-direction: column; }
}


/* v1.19.1.1 — Web layout hotfix: sidebar footer + dashboard stat cards */
@media (min-width: 981px) {
  .sidebar { overflow: hidden; }
  .sidebar .nav-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(124,167,240,.34) transparent;
  }
  .sidebar .nav-list::-webkit-scrollbar { width: 5px; }
  .sidebar .nav-list::-webkit-scrollbar-thumb { background: rgba(124,167,240,.34); border-radius: 999px; }
}

.stats-grid .stat-card {
  grid-template-columns: 42px minmax(0, 1fr);
  min-width: 0;
  min-height: 96px;
}
.stats-grid .stat-card > strong,
.stats-grid .stat-card > small { min-width: 0; max-width: 100%; }
.stats-grid .stat-card > small {
  display: block;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  line-height: 1.25;
}
@media (max-width: 1100px) {
  .stats-grid .stat-card { min-height: 90px; }
}
@media (max-width: 680px) {
  .stats-grid .stat-card { min-height: 0; }
}

/* v1.19.1.2 — responsive dashboard stats + crisp PWA app icon */
.memory-pulse {
  gap: clamp(8px, .75vw, 14px);
}
.memory-pulse .stat-card {
  min-width: 0;
  min-height: 88px;
  padding: clamp(10px, .9vw, 16px);
  grid-template-columns: clamp(30px, 2.55vw, 38px) minmax(0, 1fr);
  column-gap: clamp(7px, .65vw, 10px);
  row-gap: 3px;
}
.memory-pulse .stat-card > .stat-icon {
  width: clamp(30px, 2.55vw, 38px);
  height: clamp(30px, 2.55vw, 38px);
  padding: clamp(7px, .65vw, 9px);
  border-radius: clamp(10px, .9vw, 13px);
}
.memory-pulse .stat-card > strong {
  font-size: clamp(19px, 1.55vw, 24px);
  line-height: 1;
}
.memory-pulse .stat-card > small {
  min-width: 0;
  max-width: 100%;
  font-size: clamp(9.5px, .78vw, 11.5px);
  line-height: 1.22;
  letter-spacing: -.012em;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: pretty;
}
@media (max-width: 1200px) {
  .stats-grid.memory-pulse { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .memory-pulse .stat-card {
    min-height: 82px;
    padding: 13px 15px;
    grid-template-columns: 36px minmax(0, 1fr);
    column-gap: 10px;
  }
  .memory-pulse .stat-card > .stat-icon { width: 36px; height: 36px; padding: 8px; }
  .memory-pulse .stat-card > strong { font-size: 22px; }
  .memory-pulse .stat-card > small { font-size: 11px; }
}
@media (max-width: 760px) {
  .stats-grid.memory-pulse { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .memory-pulse .stat-card { padding: 11px 12px; grid-template-columns: 32px minmax(0, 1fr); column-gap: 8px; }
  .memory-pulse .stat-card > .stat-icon { width: 32px; height: 32px; padding: 7px; }
  .memory-pulse .stat-card > strong { font-size: 20px; }
  .memory-pulse .stat-card > small { font-size: 10px; }
}



/* v1.19.1.3 — stat labels use the full card width; PWA icon transparency fixed */
.memory-pulse .stat-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  min-width: 0;
  min-height: 104px;
  padding: clamp(9px, .7vw, 13px);
  column-gap: clamp(7px, .55vw, 10px);
  row-gap: 7px;
}
.memory-pulse .stat-card > .stat-icon {
  grid-column: 1;
  grid-row: 1;
  width: clamp(28px, 2.25vw, 36px);
  height: clamp(28px, 2.25vw, 36px);
  padding: clamp(6px, .55vw, 8px);
  border-radius: clamp(9px, .75vw, 12px);
}
.memory-pulse .stat-card > strong {
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
  min-width: 0;
  font-size: clamp(18px, 1.35vw, 23px);
  line-height: 1;
}
.memory-pulse .stat-card > small {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  text-align: center;
  font-size: clamp(8.5px, .62vw, 11px);
  line-height: 1.22;
  letter-spacing: -.015em;
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-wrap: normal !important;
  word-break: keep-all !important;
  hyphens: none !important;
  text-wrap: balance;
}
@media (max-width: 1280px) {
  .memory-pulse .stat-card { min-height: 100px; padding: 9px 8px; }
  .memory-pulse .stat-card > small { font-size: 8.5px; }
}
@media (max-width: 1040px) {
  .stats-grid.memory-pulse { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .memory-pulse .stat-card { min-height: 88px; padding: 11px 13px; }
  .memory-pulse .stat-card > small { font-size: 10.5px; }
}
@media (max-width: 760px) {
  .stats-grid.memory-pulse { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .memory-pulse .stat-card > small { font-size: 10px; }
}

/* v1.19.2 — Private Health visual calendar & UX */
.health-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.health-stat {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 15px 16px;
  border: 1px solid rgba(124,167,240,.18);
  border-radius: 17px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 8px 24px rgba(46,47,62,.035);
}
.health-stat small { color: var(--muted); font-size: .76rem; font-weight: 800; }
.health-stat strong { color: var(--ink); font-size: clamp(1.15rem, 1.3vw, 1.45rem); line-height: 1.1; }
.health-stat span { color: var(--muted); font-size: .72rem; line-height: 1.35; }
.health-calendar-card { margin: 14px 0; overflow: hidden; }
.health-calendar-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.health-calendar-head small { color: var(--muted); font-size: .75rem; font-weight: 800; }
.health-calendar-head h2 { margin: 2px 0 0; text-transform: capitalize; }
.health-calendar-nav { display: flex; align-items: center; gap: 8px; }
.compact-button { min-width: 38px; padding: 8px 11px; }
.health-calendar-weekdays,
.health-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.health-calendar-weekdays { margin-bottom: 7px; }
.health-calendar-weekdays span { text-align: center; color: var(--muted); font-size: .72rem; font-weight: 850; }
.health-day {
  position: relative;
  min-width: 0;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid rgba(46,47,62,.075);
  border-radius: 14px;
  background: rgba(255,255,255,.80);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
}
.health-day:hover { transform: translateY(-1px); border-color: rgba(124,167,240,.42); box-shadow: 0 7px 18px rgba(46,47,62,.06); }
.health-day > span { font-weight: 850; font-size: .95rem; }
.health-day > small { max-width: 100%; color: var(--muted); font-size: .62rem; line-height: 1.15; white-space: normal; }
.health-day.outside { opacity: .38; background: rgba(248,249,253,.55); }
.health-day.actual {
  background: linear-gradient(145deg, rgba(196,181,253,.42), rgba(124,167,240,.20));
  border-color: rgba(139,127,232,.33);
}
.health-day.forecast {
  background: repeating-linear-gradient(135deg, rgba(124,167,240,.11), rgba(124,167,240,.11) 7px, rgba(196,181,253,.10) 7px, rgba(196,181,253,.10) 14px);
  border-color: rgba(124,167,240,.28);
}
.health-day.today::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  right: 8px;
  top: 8px;
  border-radius: 50%;
  background: #6f8fe4;
}
.health-day.selected { outline: 2px solid rgba(98,94,231,.52); outline-offset: 1px; }
.health-calendar-legend { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 13px; color: var(--muted); font-size: .74rem; }
.health-calendar-legend span { display: inline-flex; align-items: center; gap: 7px; }
.health-calendar-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; border: 1px solid rgba(46,47,62,.08); }
.health-calendar-legend i.actual { background: linear-gradient(145deg, rgba(196,181,253,.65), rgba(124,167,240,.35)); }
.health-calendar-legend i.forecast { background: repeating-linear-gradient(135deg, rgba(124,167,240,.19), rgba(124,167,240,.19) 4px, rgba(196,181,253,.18) 4px, rgba(196,181,253,.18) 8px); }
.health-calendar-legend i.today { border-radius: 50%; background: #6f8fe4; }
.health-calendar-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(124,167,240,.08);
  border: 1px solid rgba(124,167,240,.15);
}
.health-calendar-actions > div:first-child { min-width: 0; display: grid; gap: 3px; }
.health-calendar-actions small { color: var(--muted); font-size: .7rem; font-weight: 800; }
.health-calendar-actions strong { color: var(--ink); }
.health-calendar-actions span { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.health-calendar-action-buttons,
.health-entry-form-actions,
.health-history-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.health-history-actions { justify-content: flex-end; }
.health-entry-card { scroll-margin-top: 20px; }
@media (max-width: 1080px) {
  .health-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-day { min-height: 58px; padding: 8px; }
}
@media (max-width: 720px) {
  .health-calendar-head { align-items: flex-start; flex-direction: column; }
  .health-calendar-nav { width: 100%; justify-content: space-between; }
  .health-calendar-weekdays, .health-calendar-grid { gap: 4px; }
  .health-day { min-height: 48px; padding: 6px; border-radius: 10px; }
  .health-day > span { font-size: .84rem; }
  .health-day > small { display: none; }
  .health-calendar-actions { align-items: stretch; flex-direction: column; }
  .health-calendar-action-buttons { width: 100%; }
  .health-calendar-action-buttons .secondary-button { flex: 1 1 auto; }
  .health-history-actions { justify-content: flex-start; }
}
@media (max-width: 480px) {
  .health-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .health-stat { padding: 12px; }
  .health-calendar-card { padding-left: 10px; padding-right: 10px; }
  .health-day { min-height: 42px; padding: 5px; }
}

.health-reminder-settings {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 88%, var(--brand-soft));
}
.health-reminder-settings .settings-note { margin: 0; }

/* v1.20 Plans & Billing Foundation */
.billing-banner {
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid rgba(124,167,240,.28);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(124,167,240,.13), rgba(196,181,253,.14));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.billing-banner > div { display: grid; gap: 4px; }
.billing-banner strong { color: var(--text); }
.billing-banner span { color: var(--muted); line-height: 1.45; }
.billing-banner .secondary-button { width: auto; margin: 0; white-space: nowrap; }
.subscription-current-card {
  border: 1px solid rgba(124,167,240,.2);
  border-radius: 24px;
  padding: 26px;
  background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(244,247,255,.92));
  box-shadow: 0 16px 48px rgba(48,47,101,.07);
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(280px, 1.2fr);
  gap: 28px;
  margin-bottom: 18px;
}
.subscription-current-card h2 { margin: 8px 0 6px; }
.subscription-current-card p { margin: 0; color: var(--muted); }
.subscription-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef5ff;
  color: #667fc5;
  font-size: 12px;
  font-weight: 800;
}
.subscription-badge.plus { background: #f1edff; color: #7468c9; }
.subscription-usage { align-self: center; display: grid; gap: 10px; }
.subscription-usage-head { display: flex; justify-content: space-between; gap: 12px; }
.subscription-usage-head span, .subscription-usage small { color: var(--muted); }
.subscription-progress { height: 10px; background: #edf0f6; border-radius: 999px; overflow: hidden; }
.subscription-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7CA7F0, #C4B5FD); transition: width .25s ease; }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.plan-card { border: 1px solid rgba(229,232,241,.95); border-radius: 22px; padding: 24px; background: rgba(255,255,255,.9); }
.plan-card.featured { border-color: rgba(124,167,240,.35); background: linear-gradient(145deg, #fbfdff, #f7f3ff); }
.plan-card h3 { margin: 8px 0; }
.plan-price { display: block; font-size: 1.75rem; margin: 8px 0 12px; }
.plan-price small { font-size: .9rem; color: var(--muted); font-weight: 650; }
.plan-card p { color: var(--muted); line-height: 1.5; }
.plan-card ul { margin: 16px 0 20px; padding-left: 20px; color: var(--text); line-height: 1.8; }
.plan-card button[disabled] { opacity: .58; cursor: default; }
.billing-note-card { margin-top: 0; }
@media (max-width: 760px) {
  .billing-banner { align-items: stretch; flex-direction: column; }
  .billing-banner .secondary-button { width: 100%; }
  .subscription-current-card { grid-template-columns: 1fr; padding: 20px; }
  .plan-grid { grid-template-columns: 1fr; }
}
