:root {
  --rose: #e11d48;
  --rose-dark: #9f1239;
  --rose-soft: #fb7185;
  --blush: #fdf0ec;
  --blush-2: #fbe7e0;
  --pink: #f9a8d4;
  --ink: #33241f;
  --muted: #8a5a52;
  --card: #ffffff;
  --line: #ecd9d2;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, #fdf6f2 0%, #fbeee9 55%, #f9e2db 100%);
  color: var(--ink);
  min-height: 100vh;
}
#app { max-width: 560px; margin: 0 auto; padding: 0 14px 40px; }
.view { padding-top: 18px; }

/* login */
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 5px solid var(--rose);
  border-radius: 28px;
  padding: 26px 20px 20px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(60, 40, 30, 0.14);
  margin-top: 24px;
}
.login-card h1 { margin: 6px 0 2px; font-size: 30px; color: var(--rose-dark); letter-spacing: 0.3px; }
.tagline { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.who-label { font-weight: 700; font-size: 14px; margin: 10px 0 8px; }
.who-row { display: flex; gap: 10px; justify-content: center; margin-bottom: 12px; }
.who-btn {
  flex: 1; max-width: 150px; padding: 12px; border-radius: 999px;
  border: 2px solid var(--rose); background: #fff; color: var(--rose-dark);
  font-size: 17px; font-weight: 800; cursor: pointer;
}
.who-btn.selected { background: var(--rose); color: #fff; }
input[type="password"], input[type="text"] {
  width: 100%; padding: 13px 14px; border-radius: 14px;
  border: 2px solid var(--line); font-size: 16px; background: #fff;
  color: var(--ink); outline: none; margin-bottom: 10px;
}
input:focus { border-color: var(--rose); }
.btn-primary {
  background: var(--rose); color: #fff; border: none; border-radius: 999px;
  padding: 13px 22px; font-size: 16px; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.28);
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary.small { padding: 9px 16px; font-size: 14px; }
.btn-primary.big { padding: 15px 30px; font-size: 18px; width: 100%; }
.btn-primary:disabled { opacity: 0.55; }
.btn-ghost {
  background: transparent; border: 2px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 8px 14px; font-weight: 700; cursor: pointer;
}
.btn-ghost.small { padding: 9px 14px; font-size: 14px; }
.btn-danger {
  background: #991b1b; color: #fff; border: none; border-radius: 999px;
  padding: 15px 30px; font-size: 18px; font-weight: 800; cursor: pointer; width: 100%;
}
.error { color: #b91c1c; font-weight: 700; font-size: 14px; }
.fineprint { color: var(--muted); opacity: 0.75; font-size: 12.5px; margin-top: 14px; }
.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }

/* header + tabs */
.app-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 6px 4px 10px; }
.app-header h2 { margin: 0; color: var(--rose-dark); font-size: 24px; }
.app-header p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab {
  flex: 1; padding: 10px 2px; border-radius: 999px; border: 2px solid var(--line);
  background: rgba(255,255,255,0.85); color: var(--muted); font-weight: 800;
  font-size: 12.5px; cursor: pointer;
}
.tab.active { background: var(--rose); border-color: var(--rose); color: #fff; }
.tabpane { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.incoming {
  background: #fff; border: 2px solid var(--rose); border-radius: 18px;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; box-shadow: 0 8px 24px rgba(60, 40, 30, 0.18);
}
.incoming span { flex: 1; font-weight: 800; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 16px; margin-bottom: 12px; box-shadow: 0 6px 20px rgba(60, 40, 30, 0.07);
}
.section-title { font-size: 17px; margin: 18px 4px 8px; color: var(--rose-dark); }

/* streaks */
.streak-row { display: flex; gap: 10px; margin-bottom: 4px; }
.streak-chip {
  flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 10px 12px; text-align: center;
}
.streak-chip .num { font-size: 22px; font-weight: 900; color: var(--rose); }
.streak-chip .lbl { font-size: 12px; color: var(--muted); font-weight: 700; }

/* ladder */
.track { margin-bottom: 14px; }
.track-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 8px; }
.track-head h3 { margin: 0; font-size: 17px; }
.track-head .rung-label { font-size: 13px; color: var(--muted); font-weight: 700; }
.rungs { display: flex; flex-direction: column; gap: 6px; }
.rung {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 9px 12px;
}
.rung .dot { width: 12px; height: 12px; border-radius: 50%; background: #e6ddd6; flex: none; }
.rung.done .dot { background: var(--rose); }
.rung.current { border-color: var(--rose); background: #fdeef0; }
.rung.current .dot { background: var(--rose); box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.3); }
.rung .name { flex: 1; font-weight: 700; font-size: 14.5px; }
.rung .who { font-size: 12px; font-weight: 800; }
.rung .who.me { color: var(--rose); }
.rung .who.partner { color: #db2777; }
.rung.locked { opacity: 0.55; }
.log-box { padding: 12px; }
.log-box h4 { margin: 0 0 4px; font-size: 15px; }
.log-box p { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.set-dots { font-size: 14px; font-weight: 800; margin: 0 0 10px; color: var(--ink); }
.set-dots .dots { letter-spacing: 4px; color: var(--rose); font-size: 17px; }
.rep-chips { display: flex; gap: 8px; margin-bottom: 12px; }
.rep-chips .chip {
  flex: 1; padding: 12px 0; border-radius: 14px; border: 2px solid var(--line);
  background: #fff; color: var(--ink); font-size: 15px; font-weight: 800; cursor: pointer;
}
.rep-chips .chip.sel { background: var(--rose); border-color: var(--rose); color: #fff; }
.log-box .btn-primary.big { margin-bottom: 8px; }
.btn-ghost.wide { width: 100%; padding: 13px; font-size: 15px; }
.activity { list-style: none; padding: 0; margin: 0; }
.activity li {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 12px; margin-bottom: 6px; font-size: 14px;
}
.activity li .when { color: var(--muted); font-size: 12px; display: block; }

/* home screen — three obvious actions */
.home-rosie { text-align: center; margin: 2px 0 2px; }
.home-rosie-cap { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--rose-dark); }
.home-prompt { font-size: 19px; font-weight: 900; margin: 6px 4px 14px; }
.home-action {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: #fff; border: 2px solid var(--line); border-radius: 22px;
  padding: 18px 16px; margin-bottom: 12px; cursor: pointer; text-align: left;
  box-shadow: 0 6px 20px rgba(60, 40, 30, 0.07);
}
.home-action .ha-emoji { font-size: 30px; flex: none; }
.home-action .ha-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.home-action .ha-text b { font-size: 18px; color: var(--ink); }
.home-action .ha-text i { font-style: normal; font-size: 13.5px; color: var(--muted); }
.home-action .ha-arrow { font-size: 28px; color: var(--rose); font-weight: 900; flex: none; }
.home-action.secondary { background: var(--blush); }

/* chat quick replies */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chips .chip {
  padding: 10px 14px; border-radius: 999px; border: 2px solid var(--line);
  background: #fff; color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer;
}
.chips .chip:active { background: var(--blush-2); }

/* photos */
.photo-upload { text-align: center; }
.upload-label {
  display: inline-block; background: var(--rose); color: #fff; border-radius: 999px;
  padding: 11px 20px; font-weight: 800; cursor: pointer; margin-bottom: 10px;
}
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-item { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.photo-item img { width: 100%; display: block; aspect-ratio: 1; object-fit: cover; }
.photo-item .cap { padding: 8px 10px; font-size: 13px; }
.photo-item .cap b { display: block; font-size: 12px; color: var(--rose-dark); }

/* chat */
.chat-log {
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  padding: 14px; min-height: 320px; max-height: 55vh; overflow-y: auto; margin-bottom: 10px;
}
.msg { max-width: 82%; padding: 10px 13px; border-radius: 18px; margin-bottom: 8px; font-size: 15px; line-height: 1.35; }
.msg.me { margin-left: auto; background: var(--rose); color: #fff; border-bottom-right-radius: 6px; }
.msg.them { background: var(--blush-2); border-bottom-left-radius: 6px; }
.msg .who { display: block; font-size: 11px; opacity: 0.8; font-weight: 800; margin-bottom: 2px; }
.chat-compose { display: flex; gap: 8px; }
.chat-compose input { flex: 1; margin: 0; }

/* call */
.call-card { text-align: center; }
.call-status { font-weight: 800; font-size: 16px; margin: 4px 0 12px; }
.videos { position: relative; margin-bottom: 12px; }
.videos video { width: 100%; border-radius: 18px; background: #33241f; min-height: 180px; }
#local-video {
  position: absolute; right: 10px; bottom: 10px; width: 96px !important;
  min-height: 0; border: 3px solid #fff; border-radius: 14px;
}

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--rose-dark); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-weight: 800; box-shadow: 0 10px 30px rgba(0,0,0,.3); z-index: 50; max-width: 90vw;
  text-align: center;
}
