/* ============================================================
   MIMA demo — styles
   ============================================================ */

:root {
  /* brand */
  --plum:        #4A235A;
  --purple:      #8E4EC6;
  --purple-deep: #7B3F98;
  --lavender:    #C9A0DC;
  --lavender-lt: #EADCF5;
  --pink:        #EC6FA9;
  --pink-lt:     #FBD9E8;
  --mint:        #6FCF97;
  --amber:       #F2C14E;
  --coral:       #F2795B;

  /* light theme surfaces */
  --bg:          #FBF4FA;
  --bg-2:        #F4E9F5;
  --card:        #FFFFFF;
  --card-2:      #FBF4FA;
  --line:        #ECD9EC;
  --text:        #2E1D38;
  --text-soft:   #6E5A7B;
  --text-faint:  #9C8BA8;
  --accent:      var(--purple);
  --accent-ink:  #FFFFFF;
  --shadow:      0 6px 24px rgba(74, 35, 90, 0.10);
  --shadow-sm:   0 2px 10px rgba(74, 35, 90, 0.08);
  --danger:      #E5484D;
  --danger-bg:   #FDE7E8;

  --radius:      20px;
  --radius-sm:   14px;
  --frame-w:     430px;
}

:root[data-theme="dark"] {
  --bg:          #17101E;
  --bg-2:        #1F1629;
  --card:        #241830;
  --card-2:      #2C1E3A;
  --line:        #3A2A4A;
  --text:        #F3E9F7;
  --text-soft:   #C4B2D2;
  --text-faint:  #8B7A9C;
  --accent:      #B98BE0;
  --accent-ink:  #1A121F;
  --shadow:      0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-sm:   0 2px 12px rgba(0, 0, 0, 0.35);
  --lavender-lt: #33244300;
  --danger:      #FF6369;
  --danger-bg:   #3A1F26;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

h1, h2, h3, h4, .wordmark, .serif {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--accent); }

/* ============================================================
   Phone frame
   ============================================================ */
#app-frame {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(142,78,198,.20), transparent 60%),
    radial-gradient(900px 500px at 110% 20%, rgba(236,111,169,.16), transparent 55%),
    var(--bg-2);
  padding: 0;
}

#phone {
  position: relative;
  width: 100%;
  max-width: var(--frame-w);
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 480px) {
  #app-frame { padding: 24px; }
  #phone {
    height: min(920px, calc(100vh - 48px));
    border-radius: 44px;
    box-shadow: 0 40px 100px rgba(46, 29, 56, .35), 0 0 0 10px #1c1420, 0 0 0 12px #2c2233;
  }
}

/* ============================================================
   Top bar
   ============================================================ */
#topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}
.topbar-logo { width: 30px; height: 30px; border-radius: 9px; }
.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  color: var(--text-soft);
}
.icon-btn:active { background: var(--bg-2); }
.topbar-title { flex: 1; display: flex; flex-direction: column; line-height: 1.05; }
.wordmark { font-size: 20px; font-weight: 700; letter-spacing: .06em; color: var(--text); }
.topbar-sub { font-size: 11px; color: var(--text-faint); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.ico-moon { display: none; }
:root[data-theme="dark"] .ico-sun { display: none; }
:root[data-theme="dark"] .ico-moon { display: block; }

/* ============================================================
   Screen area
   ============================================================ */
#screen {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 18px 16px 120px;
  scroll-behavior: smooth;
}
#screen::-webkit-scrollbar { width: 0; }

.screen-head { margin-bottom: 16px; }
.screen-head h1 { font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.screen-head p { color: var(--text-soft); font-size: 13.5px; margin-top: 2px; }

.fade-in { animation: fade .28s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Generic components
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.card-title { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spacer { flex: 1; }
.muted { color: var(--text-soft); }
.faint { color: var(--text-faint); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  background: var(--lavender-lt); color: var(--purple-deep);
}
:root[data-theme="dark"] .pill { background: #33244a; color: var(--lavender); }
.pill.green { background: #E4F6EC; color: #1F7A46; }
.pill.amber { background: #FCF0D6; color: #9A6B10; }
.pill.pink  { background: var(--pink-lt); color: #B93B75; }
:root[data-theme="dark"] .pill.green { background: #1E3A2A; color: #7FDCA4; }
:root[data-theme="dark"] .pill.amber { background: #3A2F17; color: #F2C14E; }
:root[data-theme="dark"] .pill.pink  { background: #3A1F2E; color: #F5A6C9; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 18px; border-radius: 14px;
  font-weight: 800; font-size: 14.5px;
  background: var(--accent); color: var(--accent-ink);
  transition: transform .1s ease, filter .15s ease;
  width: 100%;
}
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--bg-2); color: var(--text); border: 1px solid var(--line); }
.btn.outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { padding: 9px 14px; font-size: 13px; width: auto; border-radius: 11px; }

/* toggle switch */
.switch { position: relative; width: 46px; height: 28px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--line); transition: background .2s ease;
}
.switch .thumb {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; transition: transform .2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.switch input:checked ~ .track { background: var(--accent); }
.switch input:checked ~ .thumb { transform: translateX(18px); }

/* segmented control */
.seg { display: flex; background: var(--bg-2); border-radius: 13px; padding: 4px; gap: 4px; }
.seg button {
  flex: 1; padding: 9px 8px; border-radius: 10px;
  font-weight: 700; font-size: 13px; color: var(--text-soft);
  transition: all .15s ease;
}
.seg button.active { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .seg button.active { background: #3a2a4a; color: #fff; }

.divider { height: 1px; background: var(--line); margin: 12px 0; }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: var(--bg-2); color: var(--text-soft); border: 1px solid transparent;
}
.chip.active { background: var(--accent); color: var(--accent-ink); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  color: #fff; background: var(--purple);
}
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.lg { width: 68px; height: 68px; font-size: 24px; }

/* ============================================================
   Bottom nav
   ============================================================ */
#bottomnav {
  flex: 0 0 auto;
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  z-index: 30;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 10px; border-radius: 12px;
  color: var(--text-faint); font-size: 10px; font-weight: 800;
  letter-spacing: .02em;
  flex: 1;
}
.nav-item svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active { color: var(--accent); }
.nav-item.active svg { filter: drop-shadow(0 3px 8px color-mix(in srgb, var(--accent) 45%, transparent)); }

/* ============================================================
   Emergency FAB + sheet
   ============================================================ */
#sos-fab {
  position: absolute; right: 16px; bottom: 84px;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(145deg, #F2795B, #E5484D);
  color: #fff; font-weight: 900; font-size: 13px; letter-spacing: .05em;
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(229, 72, 77, .5);
  z-index: 40;
}
.sos-label { position: relative; z-index: 2; }
.sos-pulse {
  position: absolute; inset: 0; border-radius: 50%;
  background: #E5484D; opacity: .55;
  animation: sospulse 2.2s ease-out infinite;
}
@keyframes sospulse {
  0% { transform: scale(1); opacity: .55; }
  70% { transform: scale(1.9); opacity: 0; }
  100% { opacity: 0; }
}

/* sheet / modal */
.sheet-backdrop {
  position: absolute; inset: 0; z-index: 100;
  background: rgba(30, 16, 40, .55);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end;
  animation: fade .2s ease both;
}
.sheet {
  width: 100%; max-height: 92%;
  background: var(--bg); border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  animation: sheetup .3s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes sheetup { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: 6px auto 14px; }
.sheet h2 { font-size: 21px; font-weight: 600; margin-bottom: 4px; }
.sheet-close { position: absolute; }

.modal-center {
  position: absolute; inset: 0; z-index: 110;
  background: rgba(30, 16, 40, .55);
  display: grid; place-items: center; padding: 24px;
  animation: fade .2s ease both;
}
.modal-center .box {
  background: var(--bg); border-radius: 22px; padding: 22px;
  width: 100%; max-width: 340px; text-align: center;
  animation: sheetup .28s ease both;
}

/* form fields */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 800; color: var(--text-faint); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  font-family: inherit; font-size: 14px; resize: vertical;
}
.field textarea { min-height: 84px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* ============================================================
   Device screen
   ============================================================ */
.conn-card {
  background: linear-gradient(145deg, var(--purple), var(--plum));
  color: #fff; border: none;
  position: relative; overflow: hidden;
}
.conn-card::after {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,.10);
}
.conn-card .card-title { color: rgba(255,255,255,.7); }
.conn-status { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; font-family: "Fraunces", serif; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(111,207,151,.3); }
.dot.off { background: #ff9d9d; box-shadow: 0 0 0 4px rgba(255,157,157,.25); }
.conn-meta { display: flex; gap: 18px; margin-top: 14px; }
.conn-meta div { font-size: 12px; color: rgba(255,255,255,.75); }
.conn-meta b { display: block; font-size: 15px; color: #fff; font-family: "Fraunces", serif; margin-top: 2px; }

/* temperature dial */
.dial-wrap { display: flex; flex-direction: column; align-items: center; padding: 6px 0 2px; }
.dial { position: relative; width: 210px; height: 210px; }
.dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dial-temp { font-family: "Fraunces", serif; font-size: 46px; font-weight: 600; line-height: 1; }
.dial-temp sup { font-size: 20px; top: -.7em; }
.dial-label { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-top: 4px; }
.dial-btns { display: flex; gap: 14px; margin-top: 6px; }
.dial-btns button {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line);
  font-size: 24px; font-weight: 700; color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.dial-btns button:active { transform: scale(.92); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.stat .k { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.stat .v { font-family: "Fraunces", serif; font-size: 22px; font-weight: 600; margin-top: 3px; }
.stat .v small { font-size: 12px; font-weight: 700; color: var(--text-faint); font-family: "Nunito"; }

/* EMG live bar */
.emg-bars { display: flex; align-items: flex-end; gap: 3px; height: 60px; margin-top: 6px; }
.emg-bars i { flex: 1; background: linear-gradient(var(--pink), var(--purple)); border-radius: 3px; animation: emg 1.1s ease-in-out infinite; }
@keyframes emg { 0%,100% { height: 20%; } 50% { height: 90%; } }

.timer-row { display: flex; gap: 8px; }
.timer-row .chip { flex: 1; text-align: center; }

/* ============================================================
   Analytics screen
   ============================================================ */
.insight {
  background: linear-gradient(135deg, var(--lavender-lt), transparent), var(--card);
  border-left: 4px solid var(--accent);
}
.insight h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.insight p { font-size: 13px; color: var(--text-soft); line-height: 1.5; }

.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 130px; margin: 10px 0 4px; }
.bar-chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-chart .bar span.b {
  width: 100%; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(var(--lavender), var(--purple));
  min-height: 4px;
}
.bar-chart .bar.hot span.b { background: linear-gradient(var(--pink), var(--coral)); }
.bar-chart .bar span.l { font-size: 9.5px; font-weight: 700; color: var(--text-faint); }

.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.legend i { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--text-soft); }
.legend i::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--sw, var(--purple)); }

/* cycle ring calendar */
.cycle-ring { display: flex; align-items: center; gap: 16px; }
.cycle-ring .ring { position: relative; width: 120px; height: 120px; flex: 0 0 auto; }
.cycle-ring .ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.cycle-ring .ring .c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cycle-ring .ring .c b { font-family: "Fraunces", serif; font-size: 28px; }
.cycle-ring .ring .c span { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.cycle-ring ul { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.cycle-ring li { display: flex; align-items: center; gap: 8px; color: var(--text-soft); }
.cycle-ring li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--d, var(--purple)); }

.spark { width: 100%; height: 70px; }
.spark path.line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.spark path.area { fill: color-mix(in srgb, var(--accent) 16%, transparent); stroke: none; }

.heat-grid { display: grid; grid-template-columns: auto repeat(6, 1fr); gap: 4px; font-size: 9px; }
.heat-grid .hc { aspect-ratio: 1; border-radius: 4px; background: var(--cell, var(--bg-2)); }
.heat-grid .hl { display: flex; align-items: center; font-weight: 700; color: var(--text-faint); font-size: 9px; }

/* ============================================================
   Community screen
   ============================================================ */
.composer {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 8px 8px 14px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.composer input { flex: 1; background: none; border: none; font-family: inherit; font-size: 13.5px; color: var(--text); }
.composer input:focus { outline: none; }
.composer .btn.sm { flex: 0 0 auto; }

.group-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.group-scroll::-webkit-scrollbar { display: none; }
.group-card {
  flex: 0 0 auto; width: 130px; padding: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.group-card .g-emoji { font-size: 22px; }
.group-card .g-name { font-weight: 800; font-size: 12.5px; margin-top: 6px; }
.group-card .g-count { font-size: 10.5px; color: var(--text-faint); font-weight: 700; margin-top: 2px; }

.post {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.post-head { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-faint); font-weight: 700; margin-bottom: 8px; }
.post-head .sub { color: var(--accent); }
.post h3 { font-size: 16px; font-weight: 600; line-height: 1.3; margin-bottom: 5px; }
.post p.body { font-size: 13.5px; color: var(--text-soft); line-height: 1.55; }
.post-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag { font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--bg-2); color: var(--text-soft); }
.post-actions { display: flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--text-faint); }
.vote { display: flex; align-items: center; gap: 4px; background: var(--bg-2); border-radius: 999px; padding: 5px 10px; font-weight: 800; font-size: 12.5px; }
.vote button { display: grid; place-items: center; color: var(--text-faint); }
.vote button.up.on { color: var(--pink); }
.vote button svg { width: 15px; height: 15px; }
.act-btn { display: flex; align-items: center; gap: 5px; background: var(--bg-2); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 12px; color: var(--text-soft); }

.comment { display: flex; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.comment .c-body { font-size: 12.5px; }
.comment .c-body .c-meta { font-weight: 800; font-size: 11px; color: var(--text-faint); margin-bottom: 2px; }

/* ============================================================
   Assistance screen
   ============================================================ */
.doc-card { display: flex; gap: 12px; }
.doc-card img, .doc-card .doc-ph {
  width: 58px; height: 58px; border-radius: 16px; flex: 0 0 auto;
  object-fit: cover; background: var(--lavender-lt);
  display: grid; place-items: center; font-size: 22px;
}
.doc-card .d-name { font-weight: 800; font-size: 14.5px; }
.doc-card .d-spec { font-size: 12px; color: var(--text-soft); }
.doc-card .d-meta { display: flex; gap: 10px; margin-top: 5px; font-size: 11px; color: var(--text-faint); font-weight: 700; }
.stars { color: var(--amber); letter-spacing: 1px; }

.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.slot { padding: 10px 6px; text-align: center; border-radius: 11px; background: var(--bg-2); font-size: 12px; font-weight: 700; border: 1.5px solid transparent; }
.slot.active { border-color: var(--accent); color: var(--accent); background: var(--card); }
.slot.gone { opacity: .35; text-decoration: line-through; }

.chat-thread { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.msg { max-width: 78%; padding: 10px 13px; border-radius: 16px; font-size: 13px; line-height: 1.45; }
.msg.them { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; }
.msg .t { display: block; font-size: 9.5px; opacity: .6; margin-top: 4px; font-weight: 700; }

.perm-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }
.perm-row svg { width: 18px; height: 18px; color: var(--accent); flex: 0 0 auto; margin-top: 1px; }

.video-stage {
  aspect-ratio: 3/4; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(160deg, var(--plum), #1b1020);
  position: relative; display: grid; place-items: center; color: #fff;
}
.video-stage .self {
  position: absolute; right: 12px; bottom: 12px; width: 84px; aspect-ratio: 3/4;
  border-radius: 12px; background: linear-gradient(160deg, var(--purple), var(--pink));
  border: 2px solid rgba(255,255,255,.3);
}
.video-ctrls { display: flex; justify-content: center; gap: 14px; margin-top: 14px; }
.video-ctrls button { width: 52px; height: 52px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; }
.video-ctrls button svg { width: 22px; height: 22px; }
.video-ctrls button.end { background: var(--danger); color: #fff; }

/* ============================================================
   Emergency sheet specifics
   ============================================================ */
.sos-preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sos-preset {
  padding: 14px 12px; border-radius: var(--radius-sm);
  background: var(--card); border: 1.5px solid var(--line); text-align: left;
}
.sos-preset.active { border-color: var(--coral); background: color-mix(in srgb, var(--coral) 10%, var(--card)); }
.sos-preset .e { font-size: 24px; }
.sos-preset .n { font-weight: 800; font-size: 13px; margin-top: 6px; }
.sos-preset .d { font-size: 11px; color: var(--text-faint); }

.radius-track { position: relative; padding: 8px 0; }
.radius-track input[type=range] { width: 100%; accent-color: var(--coral); }

.responder {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-top: 1px solid var(--line);
}
.responder .r-dist { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--mint); }

.incoming {
  background: var(--danger-bg); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px;
}
.incoming .i-t { font-weight: 800; font-size: 13px; color: var(--danger); }
.incoming .i-d { font-size: 12px; color: var(--text-soft); margin: 4px 0 8px; }

/* ============================================================
   Profile screen
   ============================================================ */
.profile-hero { text-align: center; padding: 8px 0 4px; }
.profile-hero .avatar { margin: 0 auto 10px; }
.profile-hero h2 { font-size: 22px; font-weight: 600; }
.profile-hero .u { color: var(--accent); font-weight: 700; font-size: 13px; }
.profile-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 14px 0; }
.profile-stats .ps { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 8px; text-align: center; }
.profile-stats .ps b { display: block; font-family: "Fraunces", serif; font-size: 20px; }
.profile-stats .ps span { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }

.settings-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.settings-list .item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.settings-list .item:last-child { border-bottom: none; }
.settings-list .item svg { width: 19px; height: 19px; color: var(--accent); flex: 0 0 auto; }
.settings-list .item .chev { margin-left: auto; color: var(--text-faint); }
.settings-list .item .val { margin-left: auto; color: var(--text-faint); font-weight: 700; font-size: 12.5px; }

.section-label { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin: 18px 4px 8px; }

/* toast */
#toast {
  position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%) translateY(20px);
  background: var(--plum); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 700; z-index: 200; opacity: 0;
  transition: all .3s ease; pointer-events: none; box-shadow: var(--shadow);
  max-width: 84%; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty { text-align: center; padding: 40px 20px; color: var(--text-faint); }
.empty svg { width: 44px; height: 44px; margin-bottom: 10px; opacity: .5; }
