/* ============================================================
   Мост • Bridge — design system
   Два цвета — два человека. Градиент — «мы».
   ============================================================ */

:root {
  --him: #5B6CF0;
  --her: #EE5D83;
  --us: linear-gradient(135deg, #5B6CF0 0%, #A664BF 55%, #EE5D83 100%);
  --him-soft: rgba(91, 108, 240, .12);
  --her-soft: rgba(238, 93, 131, .12);

  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface-2: #F2EEE6;
  --text: #23222E;
  --muted: #7d7a89;
  --border: #E9E3D8;
  --shadow: 0 6px 24px rgba(35, 34, 46, .07);
  --shadow-lift: 0 12px 40px rgba(35, 34, 46, .16);

  --ok: #3EC58A;
  --danger: #E25555;

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  --tab-h: 62px;
  --header-h: 54px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
  --bg: #14151F;
  --surface: #1D1E2C;
  --surface-2: #262838;
  --text: #EDEDF4;
  --muted: #9c9aae;
  --border: #2D2F42;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --shadow-lift: 0 12px 40px rgba(0, 0, 0, .5);
  --him-soft: rgba(91, 108, 240, .2);
  --her-soft: rgba(238, 93, 131, .2);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior: none;
}

#app { height: 100dvh; display: flex; flex-direction: column; }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--him); text-decoration: none; }

/* ---------- shell ---------- */
.header {
  height: var(--header-h);
  flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 5;
}
.header h1 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.header .sub { font-size: 12px; color: var(--muted); margin-top: -2px; }
.header .spacer { flex: 1; }

.main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; }
.page { padding: 16px 16px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; }

/* ---------- tab bar ---------- */
.tabbar {
  flex: none;
  display: flex; align-items: stretch;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  z-index: 5;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 600;
  transition: color .15s;
}
.tab svg { width: 23px; height: 23px; }
.tab.active { color: var(--text); }
.tab.active .ico-stroke { stroke: url(#usGrad); }
.tab-wheel .disc {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--us);
  display: flex; align-items: center; justify-content: center;
  margin-top: -18px;
  box-shadow: 0 6px 18px rgba(166, 100, 191, .45);
  border: 3px solid var(--bg);
}
.tab-wheel .disc svg { width: 24px; height: 24px; }
.tab-wheel span { margin-top: 1px; }

/* ---------- primitives ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.hint { color: var(--muted); font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-md);
  padding: 12px 18px;
  font-weight: 700; font-size: 14.5px;
  background: var(--surface-2);
  transition: transform .08s, opacity .15s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--us); color: #fff; box-shadow: 0 6px 18px rgba(166, 100, 191, .35); }
.btn-ghost { background: transparent; border: 1px solid var(--border); }
.btn-danger { color: var(--danger); background: transparent; border: 1px solid var(--border); }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--muted);
  transition: all .15s;
  white-space: nowrap;
}
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-row.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chip-row.scroll::-webkit-scrollbar { display: none; }

.seg { display: flex; background: var(--surface-2); border-radius: var(--r-md); padding: 4px; gap: 4px; }
.seg button {
  flex: 1; padding: 9px 8px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: var(--muted);
  transition: all .15s;
}
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.input, .textarea, select.input {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
}
.input:focus, .textarea:focus { border-color: var(--him); background: var(--surface); }
.textarea { resize: none; min-height: 90px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.field { display: flex; flex-direction: column; }
.form { display: flex; flex-direction: column; gap: 14px; }

/* person identity */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 16px;
  flex: none;
}
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 3px;
  background: var(--surface-2); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--thumb, var(--him));
  border: 3px solid var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
}

/* ---------- sheet & overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(15, 14, 22, .45);
  backdrop-filter: blur(2px);
  animation: fadeIn .18s ease;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 10px 18px calc(22px + var(--safe-b));
  max-height: 88dvh; overflow-y: auto;
  box-shadow: var(--shadow-lift);
  animation: slideUp .24s cubic-bezier(.3, 1.1, .4, 1);
}
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 2px auto 14px; }
.sheet h2 { font-size: 18px; font-weight: 800; margin-bottom: 12px; letter-spacing: -.01em; }
@keyframes slideUp { from { transform: translateY(60%); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 18px);
  transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 11px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600;
  z-index: 60; box-shadow: var(--shadow-lift);
  animation: fadeIn .2s ease;
  max-width: 86vw; text-align: center;
}

.fab {
  position: fixed; right: 18px; bottom: calc(var(--tab-h) + var(--safe-b) + 18px);
  width: 54px; height: 54px; border-radius: 18px;
  background: var(--us); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(166, 100, 191, .45);
  z-index: 10; font-size: 26px; font-weight: 400;
  transition: transform .1s;
}
.fab:active { transform: scale(.92); }

.empty {
  text-align: center; padding: 36px 24px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty .big { font-size: 40px; }
.empty p { font-size: 14px; max-width: 300px; }

/* ============================================================
   Login / setup
   ============================================================ */
.hero {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 22px calc(32px + var(--safe-b));
  gap: 20px; text-align: center;
}
.hero .logo {
  width: 84px; height: 84px; border-radius: 28px;
  background: var(--us);
  display: flex; align-items: center; justify-content: center;
  font-size: 42px;
  box-shadow: 0 14px 40px rgba(166, 100, 191, .4);
}
.hero h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.hero .tagline { color: var(--muted); font-size: 15px; max-width: 320px; }
.hero .cards { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; }

.person-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform .1s;
}
.person-card:active { transform: scale(.98); }
.person-card .avatar { width: 52px; height: 52px; font-size: 21px; }
.person-card .name { font-weight: 800; font-size: 17px; }
.person-card .lang { color: var(--muted); font-size: 13px; }
.person-card .arrow { margin-left: auto; color: var(--muted); font-size: 20px; }

.pin-input {
  max-width: 220px; text-align: center;
  font-size: 26px; letter-spacing: .35em; font-weight: 800;
  padding: 14px 10px 14px calc(10px + .35em);
}

.setup-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.setup-person {
  border-radius: var(--r-lg); padding: 14px 16px 16px;
  border: 1.5px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; gap: 10px;
}
.setup-person .who { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; }

/* ============================================================
   Chat
   ============================================================ */
.chat-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.msgs { flex: 1; overflow-y: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 10px; }

.day-sep { align-self: center; font-size: 11.5px; font-weight: 700; color: var(--muted);
  background: var(--surface-2); padding: 4px 12px; border-radius: 999px; margin: 8px 0 2px; }

.msg { display: flex; flex-direction: column; max-width: 86%; animation: msgIn .18s ease; }
.msg.own { align-self: flex-end; align-items: flex-end; }
.msg.other { align-self: flex-start; align-items: flex-start; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.bubble {
  border-radius: 18px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}
.msg.own .bubble { background: var(--bubble-own, var(--him)); border: none; color: #fff; border-bottom-right-radius: 6px; }
.msg.other .bubble { border-bottom-left-radius: 6px; }

.bubble .primary { font-size: 15px; white-space: pre-wrap; }
.bubble .secondary {
  margin-top: 7px; padding-top: 7px;
  border-top: 1px solid rgba(128, 128, 128, .25);
  font-size: 13px; opacity: .78; white-space: pre-wrap;
  display: flex; gap: 6px; align-items: baseline;
}
.msg.own .bubble .secondary { border-top-color: rgba(255, 255, 255, .35); }
.lang-tag {
  font-size: 9.5px; font-weight: 800; letter-spacing: .06em;
  border: 1px solid currentColor; border-radius: 5px; padding: 0 4px;
  opacity: .8; flex: none; transform: translateY(-1px);
}
.bubble .pending { font-size: 12.5px; opacity: .7; font-style: italic; margin-top: 6px; }

.nuance {
  margin-top: 8px; padding: 8px 10px; border-radius: 10px;
  background: rgba(232, 162, 61, .13);
  border: 1px solid rgba(232, 162, 61, .35);
  font-size: 12.5px; line-height: 1.4;
}
.msg.own .nuance { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); }

.msg-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 0 4px; }
.msg-meta time { font-size: 11px; color: var(--muted); }
.msg-meta .act { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.msg-meta .act:active { opacity: .6; }

.explain-box {
  margin-top: 6px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px dashed var(--border);
  font-size: 13px; line-height: 1.5; max-width: 100%;
}
.explain-box b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }

.voice-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.play-btn {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: rgba(255,255,255,.22); color: inherit;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.msg.other .play-btn { background: var(--surface-2); }
.voice-bar { flex: 1; height: 4px; border-radius: 2px; background: rgba(128,128,128,.3); position: relative; min-width: 90px; }
.voice-bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 2px; background: currentColor; opacity: .9; }
.voice-len { font-size: 11.5px; opacity: .8; }

.composer {
  flex: none;
  display: flex; align-items: flex-end; gap: 9px;
  padding: 10px 12px calc(10px + var(--safe-b));
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.composer textarea {
  flex: 1;
  background: var(--surface-2); border: 1.5px solid transparent; border-radius: 20px;
  padding: 11px 15px; max-height: 120px; resize: none; outline: none;
  font-size: 15px; line-height: 1.4;
}
.composer textarea:focus { border-color: var(--him); }
.round-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--muted); font-size: 18px;
  transition: all .15s;
}
.round-btn.send { background: var(--us); color: #fff; box-shadow: 0 4px 14px rgba(166,100,191,.4); }
.round-btn:active { transform: scale(.92); }

.rec-panel {
  flex: 1; display: flex; align-items: center; gap: 12px;
  background: var(--surface-2); border-radius: 20px; padding: 10px 16px;
}
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.rec-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.rec-hint { font-size: 12px; color: var(--muted); flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.presence { display: flex; align-items: center; gap: 5px; }
.presence .dot { background: var(--muted); }
.presence.on .dot { background: var(--ok); }

/* ============================================================
   Wheel
   ============================================================ */
.wheel-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 16px; }
.wheel-svg { width: 100%; max-width: 360px; height: auto; }
.wheel-svg .ring { fill: none; stroke: var(--border); stroke-width: 1; }
.wheel-svg .axis { stroke: var(--border); stroke-width: 1; }
.wheel-svg .poly { stroke-width: 2.5; stroke-linejoin: round; fill-opacity: .28; }
.wheel-svg .vertex { stroke: var(--surface); stroke-width: 1.5; }
.wheel-svg .lbl { cursor: pointer; }
.wheel-svg .lbl text { fill: var(--muted); font-size: 10.5px; font-weight: 700; }
.wheel-svg .lbl .em { font-size: 15px; }
.legend { display: flex; gap: 16px; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }

.area-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 14px;
  box-shadow: var(--shadow);
}
.area-row .em { font-size: 21px; width: 30px; text-align: center; }
.area-row .nm { flex: 1; font-weight: 700; font-size: 14.5px; }
.area-row .vals { display: flex; gap: 10px; align-items: center; }
.area-row .val { display: flex; align-items: center; gap: 5px; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.area-row .val.zero { opacity: .35; }

.rate-row { display: flex; align-items: center; gap: 14px; margin: 6px 0 2px; }
.rate-row .num { font-size: 26px; font-weight: 800; width: 44px; text-align: center; font-variant-numeric: tabular-nums; }

/* ============================================================
   Goals
   ============================================================ */
.goal-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px 16px 14px 20px;
  box-shadow: var(--shadow); overflow: hidden;
}
.goal-card:active { transform: scale(.99); }
.goal-card .stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.goal-card .ttl { font-weight: 700; font-size: 15px; }
.goal-card .ttl-tr { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.goal-card.done .ttl { text-decoration: line-through; opacity: .55; }
.goal-card .meta { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.goal-card .area-tag { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.owner-dots { display: flex; align-items: center; }
.owner-dots .dot { width: 15px; height: 15px; border: 2px solid var(--surface); }
.owner-dots .dot + .dot { margin-left: -5px; }

.progress { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; flex: 1; min-width: 60px; }
.progress i { display: block; height: 100%; border-radius: 3px; background: var(--us); transition: width .3s; }
.progress-lbl { font-size: 11.5px; color: var(--muted); font-weight: 700; }

.event-badge {
  width: 48px; flex: none; text-align: center;
  border-radius: var(--r-sm); padding: 6px 2px;
  background: var(--surface-2);
}
.event-badge .d { font-size: 19px; font-weight: 800; line-height: 1.1; }
.event-badge .m { font-size: 10.5px; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.event-card { display: flex; align-items: center; gap: 13px; }
.countdown { font-size: 12px; font-weight: 700; }

.step-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.step-row:last-child { border-bottom: none; }
.step-check {
  width: 22px; height: 22px; border-radius: 7px; flex: none; margin-top: 1px;
  border: 2px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; transition: all .15s;
}
.step-row.done .step-check { background: var(--ok); border-color: var(--ok); }
.step-row .tx { flex: 1; font-size: 14px; }
.step-row.done .tx { opacity: .5; text-decoration: line-through; }
.step-row .tx small { display: block; color: var(--muted); font-size: 12px; }
.step-row .del { color: var(--muted); font-size: 15px; padding: 2px 6px; }

.ai-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700;
  background: linear-gradient(135deg, var(--him-soft), var(--her-soft));
  border: 1px solid var(--border);
  padding: 9px 14px; border-radius: var(--r-md);
}
.ai-btn .spark { font-size: 14px; }

/* ============================================================
   Journal
   ============================================================ */
.j-card { display: flex; flex-direction: column; gap: 8px; }
.j-head { display: flex; align-items: center; gap: 9px; }
.j-head .avatar { width: 30px; height: 30px; font-size: 12px; }
.j-head .who { font-weight: 800; font-size: 13.5px; }
.j-head time { color: var(--muted); font-size: 11.5px; }
.j-head .mood { margin-left: auto; font-size: 20px; }
.j-text { font-size: 14.5px; white-space: pre-wrap; }
.j-orig { color: var(--muted); font-size: 13px; white-space: pre-wrap; border-left: 2.5px solid var(--border); padding-left: 10px; }
.j-toggle { font-size: 12px; font-weight: 700; color: var(--muted); align-self: flex-start; }
.priv-tag { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; color: var(--muted);
  border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; }
.mood-row { display: flex; gap: 6px; flex-wrap: wrap; }
.mood-row button { font-size: 24px; padding: 6px; border-radius: 10px; transition: all .12s; opacity: .55; }
.mood-row button.active { background: var(--surface-2); opacity: 1; transform: scale(1.15); }
.prompt-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.prompt-chips::-webkit-scrollbar { display: none; }

.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; cursor: pointer; z-index: 1; }
.switch i {
  position: absolute; inset: 0; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--border); transition: background .18s;
}
.switch i::after {
  content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px; transition: transform .18s;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.switch input:checked + i { background: var(--us); border-color: transparent; }
.switch input:checked + i::after { transform: translateX(20px); }

/* ============================================================
   Today: week strip, routines, vocab, quick add
   ============================================================ */
.week-strip {
  display: flex; gap: 6px; justify-content: space-between;
}
.day-pill {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 9px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  transition: all .15s;
}
.day-pill .dw { font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--muted); }
.day-pill .dn { font-size: 15px; font-weight: 800; }
.day-pill.today .dn { color: var(--her); }
.day-pill.active { background: var(--text); border-color: var(--text); }
.day-pill.active .dw, .day-pill.active .dn { color: var(--bg); }

.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: -4px; }

.routine-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 11px 14px;
  box-shadow: var(--shadow);
}
.routine-row.done { opacity: .72; }
.routine-row.done .r-title { text-decoration: line-through; }
.r-check {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  border: 2px solid var(--border); background: var(--surface);
  color: #fff; font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.r-check[disabled] { opacity: .3; }
.r-body { flex: 1; min-width: 0; }
.r-title { font-weight: 700; font-size: 14.5px; }
.r-sub { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 1px; }
.r-partner {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid var(--pc); background: transparent;
}
.r-partner.on { background: var(--pc); }

.days-row { display: flex; gap: 6px; }
.day-toggle {
  flex: 1; padding: 9px 0; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; font-weight: 800; color: var(--muted);
  transition: all .12s;
}
.day-toggle.on { background: var(--us); border-color: transparent; color: #fff; }

.mini-goal {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 14px;
  box-shadow: var(--shadow); width: 100%; text-align: left;
}
.mini-goal .ttl { flex: 1; font-weight: 700; font-size: 14px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.vocab-card { border: 1.5px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              var(--us) border-box; }
.vocab-word { padding: 10px 0; border-bottom: 1px solid var(--border); }
.vocab-word:last-child { border-bottom: none; }
.vocab-word .w { font-size: 14.5px; }
.vocab-word .ex { font-size: 12.5px; color: var(--muted); margin-top: 3px; font-style: italic; }
.vocab-word .ex span { font-style: normal; opacity: .8; }
.vocab-body { margin-top: 8px; }

.plan-preview {
  margin-top: 4px; padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface-2); border: 1px dashed var(--border);
}

.seg-mini { padding: 3px; gap: 3px; }
.seg-mini button { padding: 6px 9px; font-size: 11px; border-radius: 8px; white-space: nowrap; }

/* ============================================================
   Journal v2: reactions, comments, read receipts
   ============================================================ */
.j-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.react-row { display: flex; gap: 4px; flex: 1; }
.react {
  font-size: 15px; padding: 4px 8px; border-radius: 999px;
  border: 1px solid transparent; opacity: .55; transition: all .12s;
  display: inline-flex; align-items: center; gap: 3px;
}
.react i { font-style: normal; font-size: 11px; font-weight: 800; color: var(--muted); }
.react.on { opacity: 1; background: var(--surface-2); border-color: var(--border); }
.read-mark { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.read-mark.on { color: var(--ok); }

.j-comments { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.j-comment { display: flex; gap: 9px; }
.j-c-text { font-size: 13.5px; }
.j-c-orig { font-size: 12px; color: var(--muted); }
.j-c-input { display: flex; gap: 8px; }
.j-c-input .input { flex: 1; }

/* ============================================================
   Profile
   ============================================================ */
.set-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--border);
}
.set-row:last-child { border-bottom: none; }
.set-row .lbl { flex: 1; font-weight: 600; font-size: 14.5px; }
.set-row .lbl small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; margin-top: 1px; }
.section-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 6px 2px -6px; }
.kbd-ok { color: var(--ok); font-weight: 700; font-size: 13px; }

@media (min-width: 760px) {
  .page, .msgs, .composer { max-width: 680px; width: 100%; margin-left: auto; margin-right: auto; }
  .tabbar, .header { padding-left: calc(50vw - 340px); padding-right: calc(50vw - 340px); }
}
