/* =====================================================================
   샤이닝로드 (Shining Road) — Mobile Web App
   Design system: warm light pastel gradients
   ===================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand & accent */
  --primary: #d97868;
  --on-primary: #ffffff;
  --primary-hover: #e99a86;
  --primary-focus: #c9685b;
  --brand-secure: #b88395;

  /* Surfaces */
  --canvas: #fff9f5;
  --surface-1: rgba(255, 255, 255, 0.78);
  --surface-2: #fff1eb;
  --surface-3: #f9e2dc;
  --surface-4: #f3d4d0;
  --hairline: rgba(171, 114, 101, 0.18);
  --hairline-strong: rgba(171, 114, 101, 0.28);
  --hairline-tertiary: rgba(171, 114, 101, 0.38);

  /* Text */
  --ink: #423536;
  --ink-muted: #746365;
  --ink-subtle: #9b8581;
  --ink-tertiary: #b7a5a0;

  /* Semantic */
  --success: #4f9d7a;
  --overlay: rgba(66, 53, 54, 0.22);

  /* Emotion accents (used sparingly, only inside content surfaces) */
  --emo-confusion: #9f92bb;
  --emo-sadness: #7d9fd0;
  --emo-anger: #d97868;
  --emo-calm: #76b7a7;
  --emo-hope: #d8a957;

  /* Radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-xxl: 24px;
  --r-pill: 9999px;

  /* Spacing */
  --s-xxs: 4px;
  --s-xs: 8px;
  --s-sm: 12px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 32px;
  --s-xxl: 48px;

  /* Type */
  --font-sans: "Pretendard Variable", Pretendard, "Inter", -apple-system, system-ui, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --app-w: 412px;
  --nav-h: 64px;
  --nav-safe-h: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: #fff4ed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  /* warm atmospheric backdrop for desktop framing only */
  background:
    radial-gradient(900px 520px at 25% -10%, rgba(255, 196, 175, 0.58), transparent 62%),
    radial-gradient(780px 520px at 86% 8%, rgba(211, 190, 244, 0.42), transparent 58%),
    linear-gradient(180deg, #fff7f1 0%, #f8ece8 100%);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
}

ul {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* =====================================================================
   App shell — phone frame on desktop, fullscreen on mobile
   ===================================================================== */
.app {
  position: relative;
  width: var(--app-w);
  height: 880px;
  max-height: 100vh;
  background: var(--canvas);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xxl);
  box-shadow: 0 32px 90px rgba(161, 103, 91, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.72);
}

/* =====================================================================
   404
   ===================================================================== */
.error-app {
  overflow: hidden;
}

.not-found-screen {
  position: relative;
  display: flex;
  min-height: 100%;
  padding: max(28px, env(safe-area-inset-top)) 22px max(26px, env(safe-area-inset-bottom));
  overflow: hidden;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 38%),
    var(--canvas);
}

.not-found-screen__glow {
  position: absolute;
  border-radius: var(--r-pill);
  filter: blur(2px);
  pointer-events: none;
}

.not-found-screen__glow--one {
  width: 230px;
  height: 230px;
  top: -82px;
  right: -92px;
  background: rgba(217, 120, 104, 0.13);
}

.not-found-screen__glow--two {
  width: 190px;
  height: 190px;
  bottom: -70px;
  left: -86px;
  background: rgba(159, 146, 187, 0.12);
}

.not-found-card {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 32px 24px 26px;
  text-align: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xxl);
  box-shadow: 0 20px 54px rgba(96, 68, 67, 0.12);
  backdrop-filter: blur(14px);
}

.not-found-visual {
  position: relative;
  display: grid;
  width: 144px;
  height: 132px;
  margin: 0 auto 18px;
  place-items: center;
}

.not-found-visual::before {
  position: absolute;
  width: 118px;
  height: 118px;
  content: "";
  background: linear-gradient(145deg, #fff0e9, #f4e8f4);
  border: 1px solid rgba(217, 120, 104, 0.12);
  border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%;
  transform: rotate(-7deg);
}

.not-found-visual__icon {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  color: var(--primary);
}

.not-found-visual__icon svg {
  width: 100%;
  height: 100%;
}

.server-error-screen .not-found-visual::before {
  background: linear-gradient(145deg, #fff0e9, #eeeaf7);
}

.server-error-visual__icon {
  color: var(--emo-confusion);
}

.not-found-card__eyebrow {
  margin-bottom: 8px;
  color: var(--primary-focus);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.not-found-card h1 {
  color: var(--ink);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.6px;
}

.not-found-card__description {
  margin-top: 12px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.7;
}

.not-found-card__actions {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.not-found-card__actions .btn {
  gap: 8px;
}

.not-found-card__actions .btn svg {
  width: 18px;
  height: 18px;
}

.not-found-screen__foot {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  color: var(--ink-subtle);
  font-size: 12px;
}

@media (max-height: 620px) {
  .not-found-card {
    padding-block: 22px 18px;
  }

  .not-found-visual {
    height: 96px;
    margin-bottom: 10px;
    transform: scale(0.82);
  }

  .not-found-card__actions {
    margin-top: 18px;
  }

  .not-found-screen__foot {
    margin-top: 12px;
  }
}

@media (max-width: 460px) {
  body {
    background: var(--canvas);
    min-height: 100vh;
    min-height: 100dvh;
    align-items: flex-start;
    overflow: hidden;
    overscroll-behavior: none;
  }
  .app {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ---------- Screen system ---------- */
.screens {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
  pointer-events: none;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

.screen__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.screen__scroll::-webkit-scrollbar {
  width: 0;
}

/* =====================================================================
   App bar
   ===================================================================== */
.appbar {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  padding: 0 var(--s-md);
  background: rgba(255, 249, 245, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hairline);
}

.appbar__title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.4px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.appbar__back {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  color: var(--ink-muted);
  margin-left: -8px;
}

.appbar__back:active {
  background: var(--surface-2);
}

.appbar__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  color: var(--ink-muted);
  position: relative;
  transition: background 0.15s, color 0.15s;
}

.icon-btn:active {
  background: var(--surface-2);
  color: var(--ink);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.badge-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--primary);
  border: 2px solid var(--canvas);
}

/* ---------- Brand mark ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.brand__mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(150deg, #f19a83, #c9a8f2);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(217, 120, 104, 0.24);
}

.brand__mark svg {
  width: 16px;
  height: 16px;
  color: #fff;
}

.brand__name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

/* =====================================================================
   Typography helpers
   ===================================================================== */
.eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--primary-hover);
  text-transform: uppercase;
}

.display-lg {
  font-size: 34px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -1.4px;
}

.display-md {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.9px;
}

.headline {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.subhead {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-muted);
}

.body {
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.05px;
}

.body-sm {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-muted);
}

.caption {
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-subtle);
}

.muted {
  color: var(--ink-subtle);
}

/* =====================================================================
   Buttons
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  border-radius: var(--r-md);
  padding: 10px 16px;
  min-height: 40px;
  transition: background 0.15s, transform 0.05s, border-color 0.15s;
  user-select: none;
}

.btn:active {
  transform: scale(0.985);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn--primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn--primary:hover {
  background: var(--primary-hover);
}

.btn--primary:active {
  background: var(--primary-focus);
}

.btn--secondary {
  background: var(--surface-1);
  color: var(--ink);
  border: 1px solid var(--hairline);
}

.btn--secondary:active {
  background: var(--surface-2);
}

.btn--ghost {
  background: transparent;
  color: var(--ink-muted);
}

.btn--ghost:active {
  background: var(--surface-2);
}

.btn--block {
  width: 100%;
}

.btn--lg {
  min-height: 48px;
  font-size: 15px;
  border-radius: var(--r-md);
}

.btn--danger {
  color: var(--emo-anger);
  border: 1px solid var(--hairline);
}

/* =====================================================================
   Cards
   ===================================================================== */
.card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--s-lg);
  position: relative;
}

.card::before {
  /* soft top highlight for translucent pastel surfaces */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.82), transparent);
  pointer-events: none;
}

/* =====================================================================
   Pills / chips / badges
   ===================================================================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-subtle);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 7px 14px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.chip.is-active {
  background: linear-gradient(135deg, #ffe7dc, #f0e4ff);
  color: var(--ink);
  border-color: var(--hairline-strong);
}

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  color: var(--ink-muted);
  background: #fff1eb;
  border-radius: var(--r-sm);
  padding: 3px 9px;
}

.tag::before {
  content: "#";
  color: var(--ink-subtle);
  margin-right: 1px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--ink-muted);
  background: #fff1eb;
  border-radius: var(--r-pill);
  padding: 3px 9px;
}

.status-badge--success {
  color: var(--success);
}

.status-badge--success .dot {
  background: var(--success);
}

.status-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--ink-subtle);
}

/* Visibility indicator */
.visibility-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-subtle);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.visibility-indicator__dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
}

.visibility-indicator--public .visibility-indicator__dot {
  background: #f5c94f;
}

.visibility-indicator--friends .visibility-indicator__dot {
  background: #4187f1;
}

.visibility-indicator--private .visibility-indicator__dot {
  background: #12cfd7;
}

.visibility-indicator--badge {
  padding: 4px 10px;
  background: #fff1eb;
  border-radius: var(--r-pill);
  color: var(--ink-muted);
}

/* ---------- Emotion pill ---------- */
.emotion {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: var(--r-pill);
  padding: 4px 10px 4px 8px;
  border: 1px solid var(--hairline);
  background: linear-gradient(135deg, #fff1eb, #f7efff);
  color: var(--ink-muted);
}

.emotion .emoji {
  font-size: 13px;
}

/* =====================================================================
   Section layout
   ===================================================================== */
.section {
  padding: var(--s-lg) var(--s-md);
}

.section + .section {
  padding-top: 0;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--s-md);
}

.section__head h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.section__more {
  font-size: 13px;
  color: var(--ink-subtle);
}

.stack {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: center;
}

.spread {
  justify-content: space-between;
}

.gap-xs { gap: var(--s-xs); }
.gap-sm { gap: var(--s-sm); }
.gap-md { gap: var(--s-md); }

/* Horizontal scroll chip rail */
.rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 var(--s-md) 2px;
  scrollbar-width: none;
}

.rail::-webkit-scrollbar { display: none; }

.rail[data-drag-scroll] {
  cursor: grab;
}

.rail[data-drag-scroll].is-pointer-dragging {
  cursor: grabbing;
  user-select: none;
}

.home-filter-rail,
.search-tag-rail {
  margin-bottom: var(--s-md);
}

/* =====================================================================
   Event card (feed)
   ===================================================================== */
.event-card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--s-md);
  transition: background 0.15s, border-color 0.15s, transform 0.06s;
  box-shadow: 0 10px 26px rgba(155, 116, 104, 0.08);
}

.event-card:active {
  background: var(--surface-2);
  transform: scale(0.992);
}

.feed-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.feed-author--detail {
  margin-bottom: 14px;
}

.feed-author__text {
  flex: 1;
  min-width: 0;
}

.feed-author__name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

.feed-author__me {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--primary-focus);
  background: #fff1eb;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 2px 6px;
}

.feed-author__meta {
  font-size: 12px;
  color: var(--ink-subtle);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-btn {
  min-width: 64px;
  height: 30px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 0 12px;
  flex-shrink: 0;
}

.friend-btn.is-friend,
.friend-btn.is-incoming,
.friend-btn.is-requested {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-muted);
  border: 1px solid var(--hairline);
}

.friend-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.friend-mini-btn {
  height: 28px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 10px;
}

.friend-mini-btn.is-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}

.companion-filter-bar {
  display: flex;
  gap: var(--s-xs);
  margin-bottom: var(--s-sm);
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.companion-filter-bar::-webkit-scrollbar {
  display: none;
}

.companion-filter-bar .chip {
  padding-inline: 12px;
}

.list-row.companion-row {
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
}

.companion-row .list-row__title {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.companion-row .list-row__sub {
  margin-top: 4px;
  line-height: 1.45;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.companion-row .friend-actions {
  display: grid;
  flex: 0 0 64px;
  gap: 6px;
  width: 64px;
}

.companion-row .friend-actions .status-badge,
.companion-row .friend-mini-btn {
  justify-content: center;
  min-height: 28px;
  width: 100%;
}

.companion-row > .friend-btn {
  min-width: 64px;
  padding-inline: 8px;
}

.event-card__top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.event-card__date {
  font-size: 12px;
  color: var(--ink-subtle);
  font-family: var(--font-mono);
}

.event-card__body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.event-card__reflections {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--primary-hover);
}

.event-card__reflections svg {
  width: 14px;
  height: 14px;
}

.feed-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}

.feed-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  color: var(--ink-subtle);
  font-size: 12.5px;
  font-weight: 600;
}

.feed-actions svg {
  width: 17px;
  height: 17px;
}

/* Home feed follows the story-first card layout used in the visual reference. */
.home-feed-card {
  padding: 18px 16px 16px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(155, 116, 104, 0.07);
}

.home-feed-card__author {
  gap: 11px;
  margin-bottom: 18px;
}

.home-feed-card__avatar {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.home-feed-card__identity {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.home-feed-card__identity .feed-author__name {
  flex-shrink: 0;
  font-size: 15px;
}

.home-feed-card__handle {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-subtle);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-feed-card .feed-author__meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-family: var(--font-sans);
}

.home-feed-card__journey {
  color: var(--primary-hover);
  font-weight: 600;
}

.home-feed-card .friend-btn {
  min-width: 70px;
  height: 34px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--hairline);
  color: var(--ink-muted);
  font-size: 12.5px;
}

.home-feed-card__body {
  display: block;
  overflow: visible;
  color: var(--ink-muted);
  font-size: 14.5px;
  line-height: 1.65;
}

.home-feed-card__thumbnail {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 12px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  object-fit: contain;
}

.home-feed-card__tags {
  color: #5968d7;
  white-space: normal;
}

.home-feed-card__tags button {
  color: inherit;
  font: inherit;
  white-space: nowrap;
}

.home-feed-card__tags button:active {
  opacity: 0.68;
}

.home-feed-card__tag-link {
  color: #5968d7;
  font-weight: 500;
  text-decoration: none;
}

.home-feed-card__tag-link:hover {
  text-decoration: underline;
}

.home-feed-card__reflection {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  color: var(--primary-hover);
  font-size: 12.5px;
  font-weight: 500;
}

.home-feed-card__reflection svg {
  width: 16px;
  height: 16px;
}

.home-feed-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}

.home-feed-card__emotions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.home-feed-card__emotion-arrow {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--primary-hover);
}

.home-feed-card__emotions .emotion {
  padding: 4px 9px 4px 7px;
  font-size: 12px;
}

.home-feed-card__actions {
  gap: 11px;
  margin: 0 0 0 auto;
  padding: 0;
  border-top: 0;
  flex-shrink: 0;
}

.home-feed-card__actions button {
  gap: 4px;
  min-height: 28px;
  font-size: 12px;
}

.home-feed-card__actions svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 370px) {
  .home-feed-card__footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-feed-card__actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* =====================================================================
   Journey timeline (event detail)
   ===================================================================== */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 14px;
  width: 2px;
  background: linear-gradient(rgba(201, 168, 242, 0.38), #eeb6a6);
}

.tl-node {
  position: relative;
  padding-bottom: var(--s-lg);
}

.tl-node::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 2px solid var(--hairline-strong);
}

.tl-node--origin::before {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(217, 120, 104, 0.18);
}

.tl-node.is-active-feed::before {
  background: var(--primary-focus);
  border-color: var(--primary-focus);
  box-shadow: none;
}

.tl-node__when {
  font-size: 12px;
  color: var(--ink-subtle);
  font-family: var(--font-mono);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tl-node__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--primary-hover);
}

.tl-node__active {
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-pill);
  background: #fff;
  border: 1px solid rgba(232, 125, 93, 0.32);
  color: var(--primary-focus);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  box-shadow: 0 6px 14px rgba(232, 125, 93, 0.14);
}

.tl-node__edit,
.tl-node__delete {
  margin-left: auto;
  padding: 5px 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--primary-focus);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
}

.tl-node__delete {
  margin-left: 0;
  color: var(--emo-anger);
  border-color: rgba(217, 120, 104, 0.45);
  background: rgba(217, 120, 104, 0.1);
}

.tl-node__edit:active,
.tl-node__delete:active {
  background: var(--surface-2);
}

.tl-node__delete:active {
  background: rgba(217, 120, 104, 0.18);
}

.tl-card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--s-md);
}

.tl-node.is-active-feed .tl-card {
  background: var(--surface-1);
  border: 2px solid var(--primary-focus);
  box-shadow: none;
}

.tl-card p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
}

.tl-card--restricted {
  background: rgba(255, 255, 255, 0.48);
  border-style: dashed;
}

.tl-card--restricted p {
  color: var(--ink-subtle);
  font-weight: 500;
}

.tl-card .tl-card__restricted-message {
  display: flex;
  padding: 18px 0;
  font-size: 12px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

.tl-card__thumbnail {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 14px;
  border-radius: var(--r-lg);
  object-fit: cover;
}

.reflect-emotion-compare {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
}

.reflect-emotion-compare__item {
  flex: 0 0 auto;
}

.reflect-emotion-compare__arrow {
  flex: 0 0 auto;
}

.tl-card__inline-tag {
  display: inline;
  margin-left: 5px;
  color: #2878d7;
  font: inherit;
  font-weight: 500;
}

.tl-card__foot {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tl-card__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}

.tl-card__actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  color: var(--ink-subtle);
  font-size: 12.5px;
  font-weight: 600;
}

.tl-card__actions button.is-liked {
  color: var(--primary);
}

.tl-card__actions button.is-liked svg {
  fill: var(--primary);
  stroke: var(--primary);
}

.tl-card__actions svg {
  width: 17px;
  height: 17px;
}

/* =====================================================================
   Forms
   ===================================================================== */
.field {
  margin-bottom: var(--s-md);
}

.field__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.profile-handle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s-xs);
}

.field-error {
  margin-top: var(--s-xs);
  color: var(--emo-anger);
  font-size: 13px;
  line-height: 1.45;
}

.profile-handle-copy {
  min-width: 92px;
  padding-inline: 12px;
  white-space: nowrap;
}

[data-screen="edit-profile"] .edit-profile-handle-caption {
  margin-top: 4px;
  line-height: 1.4;
}

#edit-avatar {
  margin-inline: auto;
  overflow: hidden;
  text-align: center;
}

[data-screen="edit-profile"] .section.center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.input,
.textarea,
.select {
  width: 100%;
  background: var(--surface-1);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--ink-tertiary);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--primary-focus);
  box-shadow: 0 0 0 3px rgba(217, 120, 104, 0.18);
}

.textarea {
  resize: none;
  min-height: 120px;
}

.compose-editor {
  position: relative;
  min-height: 160px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.compose-editor:focus-within {
  border-color: var(--primary-focus);
  box-shadow: 0 0 0 3px rgba(217, 120, 104, 0.18);
}

.compose-editor__highlight,
.textarea--lg {
  width: 100%;
  min-height: 160px;
  padding: 14px;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.05px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.compose-editor__highlight {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: var(--ink);
  pointer-events: none;
}

.compose-editor__tag {
  color: #2878d7;
  font-weight: 500;
}

.compose-editor__placeholder {
  color: var(--ink-tertiary);
  font-weight: 400;
}

.textarea--lg {
  position: relative;
  z-index: 1;
  display: block;
  height: 160px;
  border: none;
  background: transparent;
  color: transparent;
  caret-color: var(--ink);
  -webkit-text-fill-color: transparent;
  resize: none;
  overflow: auto;
}

.textarea--lg::placeholder {
  color: var(--ink-tertiary);
  -webkit-text-fill-color: var(--ink-tertiary);
}

.textarea--lg:focus {
  outline: none;
  box-shadow: none;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239b8581' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.counter {
  font-size: 12px;
  color: var(--ink-tertiary);
  font-family: var(--font-mono);
}

/* Emotion picker grid */
.emo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.emo-opt {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  font-size: 12.5px;
  color: var(--ink-muted);
  transition: border-color 0.15s, background 0.15s;
}

.emo-opt .emoji {
  font-size: 19px;
}

.emo-opt.is-selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, #ffe4d8, #f1e5ff);
  color: var(--ink);
}

.attach-row {
  display: flex;
  gap: 10px;
}

.attach-btn {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px dashed var(--hairline-strong);
  color: var(--ink-subtle);
  font-size: 12.5px;
  cursor: pointer;
}

.compose-file-input {
  display: none;
}

.attach-btn svg {
  width: 22px;
  height: 22px;
}

.compose-attachment {
  margin-top: var(--s-md);
}

.compose-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: var(--s-sm);
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--surface-1);
}

.compose-file-card__thumb {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid #d9e8f3;
  border-radius: 10px;
  background: #f2f9fd;
  cursor: zoom-in;
}

.compose-file-card__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
}

.compose-file-card__info {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.compose-file-card__name {
  width: fit-content;
  max-width: 100%;
  padding: 0;
  text-align: left;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: zoom-in;
}

.compose-file-card__size {
  color: var(--ink-tertiary);
  font-size: 12px;
}

.compose-image-remove {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-tertiary);
  transition: color 0.15s, background 0.15s;
}

.compose-image-remove:hover {
  background: var(--canvas);
  color: var(--emo-anger);
}

.compose-image-remove svg {
  width: 20px;
  height: 20px;
}

.compose-preview-layer {
  position: absolute;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.compose-preview-layer__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 24, 23, 0.68);
}

.compose-preview-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 760px);
  max-height: calc(100vh - 40px);
  overflow: hidden;
  flex-direction: column;
  border-radius: var(--r-xl);
  background: #fff;
  box-shadow: 0 24px 70px rgba(30, 24, 23, 0.28);
}

.compose-preview-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--hairline);
}

.compose-preview-dialog__header h2 {
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compose-preview-dialog__close {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-muted);
}

.compose-preview-dialog__close:hover {
  background: var(--canvas);
}

.compose-preview-dialog__close svg {
  width: 22px;
  height: 22px;
}

.compose-preview-dialog__body {
  display: grid;
  min-height: 180px;
  overflow: auto;
  place-items: center;
  background: #f6f3f2;
}

.compose-preview-dialog__body img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 136px);
  object-fit: contain;
}

.field-label-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 8px;
}

.field-label-row .field__label {
  flex-shrink: 0;
  margin-bottom: 0;
}

.field__hint {
  min-width: 0;
  color: var(--ink-tertiary);
  font-size: 10.5px;
  line-height: 1.3;
  letter-spacing: -0.15px;
}

.cycle-chips {
  display: flex;
  gap: 4px;
  width: 100%;
}

.cycle-chips .chip {
  flex: 1 1 0;
  justify-content: center;
  min-width: 0;
  padding: 7px 3px;
  font-size: 11.5px;
  letter-spacing: -0.2px;
}

.compose-reminder-field {
  margin-bottom: 0;
}

/* Segmented toggle */
.segmented {
  display: flex;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 3px;
  gap: 2px;
}

.segmented button {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-subtle);
  border-radius: var(--r-pill);
  padding: 8px 6px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.segmented button.is-active {
  background: var(--surface-2);
  color: var(--ink);
}

/* =====================================================================
   List rows (settings, companions, notifications)
   ===================================================================== */
.list {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.list-row {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  padding: 14px var(--s-md);
  border-bottom: 1px solid var(--hairline);
  transition: background 0.15s;
}

.list-row:last-child {
  border-bottom: none;
}

.list-row:active {
  background: var(--surface-2);
}

.list-row__icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #ffe9df, #f1e8ff);
  display: grid;
  place-items: center;
  color: var(--primary-focus);
  flex-shrink: 0;
}

.list-row__icon svg {
  width: 18px;
  height: 18px;
}

.list-row__text {
  flex: 1;
  min-width: 0;
}

.list-row__title {
  font-size: 14.5px;
  font-weight: 500;
}

.list-row__sub {
  font-size: 12.5px;
  color: var(--ink-subtle);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row__chev {
  color: var(--ink-tertiary);
  flex-shrink: 0;
}

.list-row__chev svg {
  width: 18px;
  height: 18px;
}

/* Toggle switch */
.switch {
  width: 44px;
  height: 26px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  border: 1px solid var(--hairline-strong);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: var(--r-pill);
  background: var(--ink-subtle);
  transition: transform 0.2s, background 0.2s;
}

.switch.is-on {
  background: var(--primary);
  border-color: var(--primary);
}

.switch.is-on::after {
  transform: translateX(18px);
  background: #fff;
}

/* Avatar */
.avatar {
  border-radius: var(--r-pill);
  background: linear-gradient(150deg, #ffd2c1, #e5d5ff);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: #9d5f58;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar--32 { width: 32px; height: 32px; font-size: 13px; }
.avatar--40 { width: 40px; height: 40px; font-size: 15px; }
.avatar--72 { width: 72px; height: 72px; font-size: 26px; }
.avatar img {
  width: 100%;
  height: 100%;
  border: 1px solid rgb(228 234 241);
  border-radius: inherit;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(66, 53, 54, 0.08);
}

/* =====================================================================
   Notification rows
   ===================================================================== */
.notif {
  display: flex;
  width: 100%;
  gap: var(--s-sm);
  padding: var(--s-md);
  border: 0;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.notif:active {
  background: var(--surface-1);
}

.notif.is-unread {
  background: rgba(255, 229, 218, 0.58);
}

.notif[data-read="true"] {
  background: #fff9f6;
}

.notif__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, #ffe8de, #efe5ff);
  color: var(--primary-focus);
}

.notif__icon svg { width: 18px; height: 18px; }

.notif__body { flex: 1; min-width: 0; }

.notif__title {
  font-size: 14px;
  line-height: 1.45;
}

.notif__title b { font-weight: 600; }
.notif__actor { font-weight: 600; }
.notif__subject { font-weight: 600; }

.notif__time {
  font-size: 12px;
  color: var(--ink-subtle);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* =====================================================================
   Insight report
   ===================================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--s-md);
}

.stat__num {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -1px;
}

.stat__label {
  font-size: 12.5px;
  color: var(--ink-subtle);
  margin-top: 2px;
}

/* Emotion trend bars */
.bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 130px;
  padding-top: 8px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  max-width: 26px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(#f3b79f, #d97868);
  transition: height 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bar-col__label {
  font-size: 11px;
  color: var(--ink-subtle);
  white-space: nowrap;
}

.bars--year {
  gap: 4px;
}

.bars--year .bar-col {
  min-width: 0;
}

.bars--year .bar-col__label {
  font-size: 10px;
}

/* Tag frequency rows */
.freq-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.freq-row__name {
  width: 64px;
  font-size: 13px;
  color: var(--ink-muted);
}

.freq-track {
  position: relative;
  flex: 1;
  height: 8px;
  background: #fff0e9;
  border-radius: var(--r-pill);
  overflow: hidden;
}

.freq-fill {
  width: 0;
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, #df796d 0%, #c9a8f2 100%);
  transition: width 0.45s ease;
}

.freq-row__val {
  font-size: 12px;
  color: var(--ink-subtle);
  font-family: var(--font-mono);
  width: 22px;
  text-align: right;
}

/* =====================================================================
   FAB
   ===================================================================== */
.fab {
  position: absolute;
  right: 18px;
  bottom: calc(var(--nav-safe-h) + 18px);
  width: 56px;
  height: 56px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 16px 34px rgba(217, 120, 104, 0.32);
  z-index: 30;
  transition: background 0.15s, transform 0.08s;
}

.fab:active {
  transform: scale(0.94);
  background: var(--primary-focus);
}

.fab svg { width: 26px; height: 26px; }

/* =====================================================================
   Bottom nav
   ===================================================================== */
.bottom-nav {
  height: var(--nav-safe-h);
  flex-shrink: 0;
  display: flex;
  background: rgba(255, 249, 245, 0.9);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--hairline);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--ink-tertiary);
  font-size: 10.5px;
  font-weight: 500;
  transition: color 0.15s;
}

.nav-item svg {
  width: 23px;
  height: 23px;
  stroke-width: 1.8;
}

.nav-item.is-active {
  color: var(--ink);
}

.nav-item.is-active svg {
  color: var(--primary-hover);
}

/* =====================================================================
   Onboarding / Login
   ===================================================================== */
.onboard {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--s-xl) var(--s-lg) var(--s-xxl);
  position: relative;
  overflow: hidden;
}

.onboard__glow {
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 38%, rgba(255, 190, 166, 0.56), transparent 58%),
    radial-gradient(circle at 68% 62%, rgba(207, 185, 241, 0.48), transparent 64%);
  filter: blur(18px);
  opacity: 0.88;
  pointer-events: none;
}

.onboard__stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.44;
}

.onboard__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-bottom: var(--s-xxl);
  position: relative;
}

.onboard__logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(150deg, #f19a83, #c9a8f2);
  display: grid;
  place-items: center;
  box-shadow: 0 18px 42px rgba(217, 120, 104, 0.28);
}

.onboard__logo svg { width: 36px; height: 36px; color: #fff; }

.onboard__title {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -1.2px;
  text-align: center;
}

.onboard__slogan {
  font-size: 14px;
  color: var(--ink-subtle);
  text-align: center;
  letter-spacing: -0.1px;
}

.divider-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-tertiary);
  font-size: 12px;
  margin: var(--s-md) 0;
}

.divider-or::before,
.divider-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

.social-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 10px;
}

.social-btn:active { background: var(--surface-2); }

.social-btn svg { width: 18px; height: 18px; }

.social-btn--kakao {
  background: #fee500;
  border-color: #fee500;
  color: #191600;
  font-weight: 700;
}

.social-btn--kakao:active {
  background: #f3d900;
}

.onboard__foot {
  text-align: center;
  font-size: 13px;
  color: var(--ink-subtle);
  margin-top: var(--s-lg);
}

.onboard__foot a {
  color: var(--primary-hover);
  font-weight: 500;
}

/* =====================================================================
   Profile
   ===================================================================== */
.profile-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: var(--s-lg) var(--s-md) var(--s-md);
}

.profile-head__name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.profile-head__email {
  font-size: 13px;
  color: var(--ink-subtle);
}

.user-profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-xs);
  width: 100%;
  max-width: 320px;
}

.user-profile-actions .btn {
  min-width: 0;
  padding-inline: 12px;
}

.user-profile-status-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-xs);
  width: 100%;
}

.user-profile-request-response .friend-mini-btn {
  min-width: 70px;
  height: 34px;
  padding-inline: 13px;
}

.user-profile-request-sent .friend-btn,
.user-profile-request-sent .friend-mini-btn {
  min-width: 70px;
  height: 34px;
  padding-inline: 13px;
}

.user-profile-friend-request {
  min-width: 120px;
}

.user-profile-request {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.friendship-ended {
  color: var(--ink-subtle);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.invite-screen {
  background: var(--canvas);
}

.invite-profile-head .body-sm {
  max-width: 280px;
}

.invite-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  background: rgba(66, 53, 54, 0.26);
  backdrop-filter: blur(3px);
}

.invite-dialog {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 50%;
  z-index: 90;
  padding: 30px 20px 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  background: #fff;
  box-shadow: 0 24px 64px rgba(66, 53, 54, 0.24);
  text-align: center;
  transform: translateY(-50%);
}

.invite-brand {
  margin-bottom: 64px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.6px;
}

.invite-dialog h2 {
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: -0.8px;
}

.invite-dialog p {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.55;
}

.invite-dialog .btn,
.invite-dialog .social-btn {
  margin-top: 64px;
}

.invite-dialog .invite-slogan {
  margin-top: 0;
  font-size: 20px;
  line-height: 1.45;
}

.invite-dialog .invite-kakao {
  margin-bottom: 0;
}

.profile-withdraw-row {
  border-bottom: 0;
}

.profile-withdraw-row__title {
  color: var(--emo-anger);
  font-weight: 500;
}

.profile-account-list__form {
  width: 100%;
  border-bottom: 1px solid var(--hairline);
}

.profile-account-list .list-row {
  justify-content: flex-start;
  width: 100%;
  border-right: 0;
  border-left: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.user-profile-posts {
  padding-top: var(--s-lg);
}

.profile-stats {
  display: flex;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  margin: 0 var(--s-md);
}

.profile-stats__item {
  flex: 1;
  text-align: center;
  padding: var(--s-md) 8px;
  border-right: 1px solid var(--hairline);
}

.profile-stats__item:last-child { border-right: none; }

button.profile-stats__item {
  transition: background 0.15s;
}

button.profile-stats__item:active {
  background: var(--surface-2);
}

.profile-stats__num {
  display: block;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.profile-stats__label {
  display: block;
  font-size: 11.5px;
  color: var(--ink-subtle);
  margin-top: 2px;
}

/* =====================================================================
   Search
   ===================================================================== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 11px 14px;
  margin: var(--s-sm) var(--s-md);
}

.search-bar svg {
  width: 18px;
  height: 18px;
  color: var(--ink-subtle);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-size: 15px;
}

.search-bar input::placeholder { color: var(--ink-tertiary); }

.search-bar--inline {
  margin: 0 0 var(--s-sm);
}

.open-id-card {
  padding: var(--s-md);
}

.open-id-result {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-height: 38px;
  padding: 2px 6px 12px;
  color: var(--ink);
  font-size: 14px;
}

.open-id-result strong {
  font-weight: 600;
}

.open-id-result span {
  color: var(--ink-subtle);
  font-size: 12.5px;
}

.open-id-result.is-empty {
  color: var(--ink);
}

.empty {
  text-align: center;
  padding: var(--s-xxl) var(--s-lg);
  color: var(--ink-subtle);
}

.empty svg {
  width: 40px;
  height: 40px;
  color: var(--ink-tertiary);
  margin-bottom: 14px;
}

.empty p { font-size: 14px; }

.feed-login-required {
  display: flex;
  min-height: 180px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-md);
  text-align: center;
}

.feed-login-required p {
  color: var(--ink-muted);
  font-size: 14px;
}

.feed-login-required .btn {
  min-width: 112px;
}

/* =====================================================================
   Sheet / modal (toast)
   ===================================================================== */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--nav-safe-h) + 25px);
  transform: translate(-50%, 16px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--hairline-strong);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  padding: 11px 18px;
  border-radius: var(--r-pill);
  box-shadow: 0 16px 42px rgba(155, 116, 104, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast svg { width: 16px; height: 16px; color: var(--success); }

/* Helpers */
.hide { display: none !important; }
.pt-0 { padding-top: 0 !important; }
.center { text-align: center; }
.flex-1 { flex: 1; }
.mt-sm { margin-top: var(--s-sm); }
[data-screen="reflect"] .caption.mt-sm { margin-top: 4px; }
.mt-md { margin-top: var(--s-md); }
.mt-lg { margin-top: var(--s-lg); }
.mb-sm { margin-bottom: var(--s-sm); }
.mb-md { margin-bottom: var(--s-md); }
.w-full { width: 100%; }

/* Sticky bottom action bar (in forms) */
.action-bar {
  flex-shrink: 0;
  padding: var(--s-sm) var(--s-md);
  padding-bottom: calc(var(--s-sm) + env(safe-area-inset-bottom));
  background: rgba(255, 249, 245, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--hairline);
  display: flex;
  gap: 10px;
}

/* =====================================================================
   Emotion journey arc (feed card)
   ===================================================================== */
.emotion-arc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.emotion-arc svg {
  width: 14px;
  height: 14px;
  color: var(--primary-hover);
  flex-shrink: 0;
}

.journey-len {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary-hover);
}

/* Resurface reason line — why an old post is back on top of the feed */
.event-card__resurface {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary-hover);
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
}

.event-card__resurface svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Origin quote — the initial log demoted under the latest reflection,
   quote-retweet style. line-clamp sits on the inner <p>: clamping the
   padded box lets clipped lines bleed into the padding (webkit quirk). */
.event-card__origin {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
}

.event-card__origin-meta {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-subtle);
  margin-bottom: 4px;
}

.event-card__origin-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Liked state on feed actions */
.feed-actions button.is-liked {
  color: var(--primary);
}

.feed-actions button.is-liked svg {
  fill: var(--primary);
  stroke: var(--primary);
}

/* =====================================================================
   Comments (event detail)
   ===================================================================== */
.comment-thread {
  border-bottom: 1px solid var(--hairline);
}

.comment-thread:last-child {
  border-bottom: none;
}

.comment {
  display: flex;
  gap: 10px;
  padding: 12px 0;
}

.comment--reply {
  padding: 10px 0;
}

.comment__body {
  flex: 1;
  min-width: 0;
}

.comment__name {
  font-size: 13px;
  font-weight: 600;
}

.comment__name .caption {
  font-weight: 400;
  margin-left: 6px;
}

.comment__text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-muted);
  margin-top: 2px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.comment__actions button {
  color: var(--ink-subtle);
  font-size: 12px;
  font-weight: 600;
}

.comment__actions .comment__delete {
  color: var(--primary-focus);
}

.comment__replies {
  margin-left: 42px;
  padding-left: 12px;
  border-left: 2px solid var(--surface-3);
}

.comment--deleted {
  min-height: 48px;
  align-items: center;
}

.comment--deleted .comment__text {
  color: var(--ink-tertiary);
  font-size: 13px;
}

.comment-more {
  width: 100%;
  text-align: left;
  font-size: 13px;
  color: var(--ink-subtle);
  padding: 10px 0 2px;
}

.comment-input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 6px 6px 6px 10px;
}

.comment-input textarea {
  flex: 1;
  min-width: 0;
  height: 34px;
  max-height: 114px;
  border: none;
  padding: 7px 0;
  background: transparent;
  outline: none;
  resize: none;
  overflow-y: hidden;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink);
}

.comment-input textarea::placeholder {
  color: var(--ink-tertiary);
}

.comment-send {
  width: 34px;
  height: 34px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.comment-send:active {
  background: var(--primary-focus);
}

.comment-send svg {
  width: 15px;
  height: 15px;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: transparent;
}

.comment-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 90;
  width: min(100%, 430px);
  height: min(58vh, 560px);
  max-height: 620px;
  transform: translate(-50%, 110%);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  background: #fff;
  border: 1px solid var(--hairline);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -18px 48px rgba(55, 35, 28, 0.2);
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.comment-sheet.is-open {
  transform: translate(-50%, 0);
}

.comment-sheet.is-dragging {
  transition: none;
}

.comment-sheet__handle {
  width: 40px;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--hairline-strong);
  justify-self: center;
  margin-top: 10px;
}

.comment-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--s-md) 12px;
  border-bottom: 1px solid var(--hairline);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.comment-sheet.is-dragging .comment-sheet__head {
  cursor: grabbing;
}

.comment-sheet__head h2 {
  font-size: 16px;
  font-weight: 700;
}

.comment-sheet__head p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-subtle);
}

.comment-sheet__list {
  min-height: 170px;
  overflow-y: auto;
  padding: 4px var(--s-md);
  overscroll-behavior: contain;
  background: #fff;
}

.comment-sheet__composer {
  padding: 10px var(--s-md) calc(10px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--hairline);
}

.comment-sheet__input {
  background: #fff;
}

.comment-reply-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 8px 8px;
  color: var(--ink-subtle);
  font-size: 12px;
}

.comment-reply-context strong {
  color: var(--primary-focus);
  font-weight: 600;
}

.comment-reply-context button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--r-pill);
}

.comment-reply-context button:active {
  background: var(--surface-2);
}

.comment-reply-context svg {
  width: 14px;
  height: 14px;
}

/* Friend removal confirmation */
.confirm-backdrop {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(66, 53, 54, 0.28);
  opacity: 0;
  backdrop-filter: blur(3px);
  transition: opacity 0.18s ease;
}

.confirm-backdrop.is-open {
  opacity: 1;
}

.confirm-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 110;
  width: calc(100% - 40px);
  max-width: 340px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(66, 53, 54, 0.24);
  opacity: 0;
  transform: translate(-50%, calc(-50% + 10px)) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.confirm-dialog.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.confirm-dialog__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--primary-focus);
}

.confirm-dialog__icon svg {
  width: 22px;
  height: 22px;
}

.confirm-dialog__icon--danger {
  background: color-mix(in srgb, var(--emo-anger) 10%, #fff);
  color: var(--emo-anger);
}

.confirm-dialog h2 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.35px;
}

.confirm-dialog p {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.55;
}

.confirm-dialog__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.confirm-dialog__danger {
  background: var(--primary);
  color: #fff;
}

.confirm-dialog__danger:active {
  background: var(--primary-focus);
}

.edit-post-dialog {
  max-width: 380px;
}

.edit-post-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.edit-post-dialog__body {
  width: 100%;
  min-height: 180px;
}

.edit-post-dialog__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

/* Collapsible advanced options (compose) */
.collapse-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-subtle);
  padding: 4px 0;
}

.collapse-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.collapse-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Unread dot on bottom-nav item */
.nav-item {
  position: relative;
}

.nav-dot {
  position: absolute;
  top: 8px;
  left: calc(50% + 8px);
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--primary);
  border: 2px solid var(--canvas);
}

.scroll-pad {
  /*height: 24px;*/
}
.scroll-pad--nav {
  height: calc(var(--nav-h) + 5px);
}
