@font-face {
  font-family: Pretendard;
  src: url("../fonts/Pretendard-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Pretendard;
  src: url("../fonts/Pretendard-SemiBold.woff2") format("woff2");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Pretendard;
  src: url("../fonts/Pretendard-Bold.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

html {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar {
  display: none;
}
body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
body::-webkit-scrollbar {
  display: none;
}

:root {
  --primary: #3182f6;
  --primary-glow: rgba(49, 130, 246, 0.1);
  --primary-dark: #1b64da;
  --btn-primary-bg: #191f28;
  --btn-primary-bg-hover: #333d4b;
  --btn-primary-shadow: 0 8px 20px rgba(25, 31, 40, 0.18);
  --btn-primary-radius: 16px;
  --btn-primary-min-height: 52px;
  --bg: #ffffff; /* Clean white background */
  --bg-gradient: none;
  --surface: #ffffff; /* Card surface */
  --surface-solid: #ffffff;
  --text: #191f28; /* Dark text */
  --muted: #4e5968; /* Slate gray text */
  --line: #e5e8eb; /* Clean light border */
  --soft: #f2f4f6; /* Soft light gray background */
  --app-page-bg: #ffffff;
  --app-gutter: 24px;
  --bottom-nav-height: 56px;
  --danger: #f04452;
  --success: #00c7ae;
  --accent: var(--primary); /* Accent color matches primary */
  --accent-glow: rgba(49, 130, 246, 0.1);
}

.push-permission-card {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--bottom-nav-height, 56px) + 24px + env(safe-area-inset-bottom));
  z-index: 1600;
  width: min(520px, calc(100% - 32px));
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 14px;
  border: 1px solid #e5e8eb;
  border-radius: 18px;
  background: #fff;
  color: #191f28;
  box-shadow: 0 10px 30px rgba(25, 31, 40, .12);
  font: 14px/1.45 Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
.push-permission-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 13px; background: #f2f4f6; font-size: 20px; }
.push-permission-copy { flex: 1; min-width: 0; color: #4e5968; }
.push-permission-copy strong { display: block; margin-bottom: 2px; color: #191f28; font-size: 15px; }
.push-permission-action { flex: 0 0 auto; border: 0; border-radius: 12px; background: #3182f6; color: #fff; padding: 10px 13px; font-weight: 800; white-space: nowrap; }
.push-permission-close { align-self: flex-start; border: 0; background: transparent; color: #8b95a1; padding: 0 2px; font-size: 21px; line-height: 1; }
.push-permission-card.is-denied .push-permission-action { display: none; }
.push-foreground-toast { position:fixed; top:calc(14px + env(safe-area-inset-top)); left:14px; right:14px; z-index:2000; width:min(520px,calc(100% - 28px)); margin:auto; display:flex; align-items:center; gap:12px; padding:13px 12px; border:1px solid rgba(25,31,40,.08); border-radius:20px; background:rgba(255,255,255,.98); color:#191f28; box-shadow:0 16px 44px rgba(25,31,40,.18); font:14px/1.42 Pretendard,-apple-system,BlinkMacSystemFont,system-ui,sans-serif; backdrop-filter:blur(16px); }
.push-foreground-icon { width:42px; height:42px; flex:0 0 42px; display:grid; place-items:center; border-radius:15px; background:#e8f3ff; font-size:20px; }
.push-foreground-copy { min-width:0; flex:1; display:block; padding:2px 0; border:0; background:transparent; color:inherit; text-align:left; font:inherit; cursor:pointer; }
.push-foreground-copy strong,.push-foreground-copy span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.push-foreground-copy strong { margin-bottom:3px; font-size:15px; font-weight:850; }
.push-foreground-copy span { color:#6b7684; font-size:13px; }
.push-foreground-close { width:32px; height:32px; flex:0 0 32px; border:0; border-radius:11px; background:#f2f4f6; color:#8b95a1; font-size:20px; line-height:1; cursor:pointer; }
.app-payment-reminder { position:fixed; left:16px; right:16px; bottom:calc(var(--bottom-nav-height,56px) + 24px + env(safe-area-inset-bottom)); z-index:1500; width:min(520px,calc(100% - 32px)); margin:auto; display:flex; align-items:center; gap:11px; padding:14px; border:1px solid #dbeafe; border-radius:20px; background:rgba(255,255,255,.98); box-shadow:0 14px 36px rgba(25,31,40,.14); backdrop-filter:blur(16px); }
.app-payment-reminder-icon { width:40px; height:40px; flex:0 0 40px; display:grid; place-items:center; border-radius:14px; background:#e8f3ff; color:#1b64da; font-size:18px; font-weight:900; }
.app-payment-reminder-copy { min-width:0; flex:1; }
.app-payment-reminder-copy strong,.app-payment-reminder-copy small { display:block; }
.app-payment-reminder-copy strong { color:#191f28; font-size:14px; font-weight:850; }
.app-payment-reminder-copy small { margin-top:2px; color:#8b95a1; font-size:11px; }
.app-payment-reminder>button { flex:0 0 auto; padding:10px 12px; border:0; border-radius:12px; background:#3182f6; color:#fff; font-size:12px; font-weight:850; white-space:nowrap; cursor:pointer; }
.app-payment-reminder>button:disabled { background:#b0b8c1; }

/* Auth tutorial pages: keep ads above fixed bottom actions */
body:has(.auth-tutorial-page) {
  --auth-actions-height: 138px;
}
body:has(.auth-tutorial-page) .app-page-ad-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--auth-actions-height) + env(safe-area-inset-bottom));
  z-index: 28;
  width: min(430px, 100%);
  margin: 0;
  padding: 8px 16px 10px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, .98);
  border-top: 1px solid #f2f4f6;
  box-shadow: 0 -6px 24px rgba(25, 31, 40, .08);
  backdrop-filter: blur(12px);
}
body:has(.auth-tutorial-page):has(.app-page-ad-bar) .auth-tutorial-page {
  padding-bottom: calc(var(--auth-actions-height) + 24px + env(safe-area-inset-bottom));
}

/* iOS Safari home screen install guide */
.ios-home-guide {
  position: fixed;
  inset: 0;
  z-index: 1900;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, .42);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease;
}
.ios-home-guide.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.ios-home-guide-sheet {
  width: min(430px, 100%);
  padding: 20px 20px 16px;
  border-radius: 24px 24px 20px 20px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(25, 31, 40, .22);
}
.ios-home-guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.ios-home-guide-head h3 {
  margin: 0;
  color: #191f28;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: -0.03em;
}
.ios-home-guide-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 0;
  border-radius: 12px;
  background: #f2f4f6;
  color: #6b7684;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.ios-home-guide-copy {
  margin: 0 0 14px;
  color: #6b7684;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}
.ios-home-guide-steps {
  margin: 0 0 16px;
  padding: 14px 14px 14px 30px;
  border-radius: 16px;
  background: #f8fafc;
  color: #333d4b;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
}
.ios-home-guide-steps li + li {
  margin-top: 8px;
}
.ios-home-guide-share {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 8px;
  background: #e8f3ff;
  color: #1b64da;
  font-weight: 900;
}
.ios-home-guide-actions {
  display: grid;
  gap: 8px;
}
.ios-home-guide-actions .btn {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 900;
}
.ios-home-guide-actions .btn-ghost {
  border: 0;
  background: transparent;
  color: #8b95a1;
}
body:has(.ios-home-guide.is-visible) .app-page-ad-bar {
  z-index: 20;
}
.billing-plan-card.is-blocked { opacity:.58; cursor:not-allowed; }
.billing-plan-blocked-copy { display:block; margin-top:10px; color:#f04452; font-weight:750; text-align:left; }
.billing-plan-change-copy { display:block; margin-top:10px; color:#3182f6; font-weight:750; text-align:left; }
.app-pull-refresh { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; z-index: 2200; transform: translate(-50%, -150%); opacity: 0; padding: 8px 13px; border: 1px solid #e5e8eb; border-radius: 999px; background: rgba(255,255,255,.96); color: #6b7684; box-shadow: 0 8px 24px rgba(25,31,40,.12); font-size: 12px; font-weight: 800; transition: transform .18s ease, opacity .18s ease; pointer-events: none; }
.app-pull-refresh.is-visible { transform: translate(-50%, 0); opacity: 1; }
.app-pull-refresh.is-ready, .app-pull-refresh.is-loading { color: #1b64da; border-color: #cfe3ff; }
@media (max-width: 420px) {
  .push-permission-card { align-items: flex-start; }
  .push-permission-action { padding: 9px 10px; }
}

[hidden] {
  display: none !important;
}

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

.site-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  background: #fff;
  z-index: 1000;
  border-bottom: 1px solid #f2f4f6;
  padding: 0;
}

body {
  background: var(--app-page-bg);
  color: var(--text);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
}

html,
body {
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

.layout-container {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

/* Header Upgrades */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0;
}

.site-header-inner {
  width: min(1200px, calc(100% - 40px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-header.is-sub .site-header-inner {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  height: 56px;
  width: min(1200px, calc(100% - 24px));
}

.site-header.is-sub .site-header-back {
  display: inline-flex;
  grid-column: 1;
  justify-self: center;
}

.site-header-back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  color: #191f28;
}

.site-header.is-sub .brand {
  display: none;
}

.site-header.is-sub .site-nav {
  display: none;
}

.site-header-title {
  display: none;
  min-width: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: #191f28;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header.is-sub .site-header-title {
  display: block;
  grid-column: 2;
}

.site-header.is-sub .menu-button {
  grid-column: 3;
  justify-self: center;
  margin-right: 0;
}

.site-header.is-home .site-header-back,
.site-header.is-home .site-header-title {
  display: none;
}

body.app-chrome-hidden {
  padding-bottom: 0 !important;
}

body.app-chrome-hidden .ui-text-room {
  min-height: 100dvh;
}

.brand {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 12px;
  min-width: 0;
  height: 100%;
  margin-left: -10px;
}

.brand-logo {
  display: block;
  height: 100%;
  width: auto;
  max-width: min(360px, 78vw);
  object-fit: contain;
  object-position: left center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #1b64da);
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.brand strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #191f28;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 1px;
  font-weight: 500;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.site-nav a:hover {
  color: var(--text);
}

.nav-cta, .user-chip {
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 600;
  transition: all 0.25s ease;
}

.nav-cta:hover {
  background: #e5e8eb;
  border-color: #cbd5e1;
}

/* Hero section */
.hero {
  padding: 60px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.headline {
  margin: 0;
  font-size: 44px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -1px;
  color: #191f28;
}

.subcopy {
  margin: 20px 0 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 17px;
  font-weight: 400;
}

/* Glassmorphic panels */
.panel, .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel {
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.panel:hover {
  border-color: #cbd5e1;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.06);
}

.form-grid {
  display: grid;
  gap: 20px;
}

/* Modern Glass Inputs */
.field label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #e5e8eb;
  border-radius: 12px;
  background: #f9fafb;
  color: var(--text);
  font: inherit;
  padding: 14px 16px;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  background: #fff;
  border-color: #3182f6;
  box-shadow: 0 0 0 4px rgba(49, 130, 246, 0.12);
}

.field input.error {
  border-color: #f04452;
  background: #fff;
}
.field input.error:focus {
  box-shadow: 0 0 0 4px rgba(240, 68, 82, 0.12);
}

.field input.success {
  border-color: #00d084;
}

.onboarding-choice-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid #e5e8eb;
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.onboarding-choice-card input[type="radio"] {
  width: 20px;
  height: 20px;
  border: 2px solid #d1d6db;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.onboarding-choice-card input[type="radio"]:checked {
  border-color: #3182f6;
  background: #3182f6;
}

.onboarding-choice-card input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
}


/* Button glow styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--btn-primary-min-height);
  border: 0;
  border-radius: var(--btn-primary-radius);
  padding: 0 24px;
  background: var(--btn-primary-bg);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--btn-primary-shadow);
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
  background: var(--btn-primary-bg-hover);
  transform: none;
  box-shadow: var(--btn-primary-shadow);
  filter: none;
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn.secondary {
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn.secondary:hover {
  background: #e5e8eb;
  border-color: #cbd5e1;
  box-shadow: none;
}

.btn.danger {
  background: linear-gradient(135deg, var(--danger), #df2230);
  box-shadow: 0 4px 14px rgba(240, 68, 82, 0.3);
}
.btn.danger:hover {
  box-shadow: 0 6px 20px rgba(240, 68, 82, 0.5);
}

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  box-shadow: none !important;
}

/* Stat grid upgrades */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.stat {
  padding: 22px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}

.stat:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.notice {
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.08);
  color: #a5b4fc;
  padding: 18px;
  line-height: 1.6;
}

.notice.danger {
  border-color: rgba(244, 63, 94, 0.2);
  background: rgba(244, 63, 94, 0.08);
  color: #fca5a5;
}

.call-shell {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-rows: auto 1fr;
}

.call-topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.3);
  padding: 18px 0;
  backdrop-filter: blur(8px);
}

.call-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.call-meta h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.call-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  border-radius: 999px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.call-stage {
  padding: 36px 0;
}


/* --- AI Phone Call Layout --- */
.phone-card {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 28px;
  align-items: start;
}

/* Phone Face Frame */
.phone-face {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(25, 31, 40, 0.08);
  min-height: 640px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* In-call state styling */
.phone-card.in-call .phone-face {
  background: radial-gradient(circle at top, #1e293b, #0f172a);
  border-color: #1e293b;
  color: #ffffff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

/* Screens inside the phone */
.phone-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  height: 100%;
}

/* Lobby Screen */
.lobby-screen {
  justify-content: space-between;
}
.lobby-header {
  text-align: center;
  margin-top: 10px;
}
.call-badge-live {
  display: inline-block;
  background: rgba(49, 130, 246, 0.1);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.lobby-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}
.lobby-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.lobby-info-card {
  background: var(--soft);
  border-radius: 16px;
  padding: 20px;
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lobby-info-card .info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.lobby-info-card .info-row .label {
  color: var(--muted);
  font-weight: 600;
}
.lobby-info-card .info-row .value {
  color: var(--text);
  font-weight: 700;
}
.lobby-info-card .goal-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 4px;
}
.lobby-info-card .goal-row .value {
  color: var(--muted);
  font-style: italic;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
}

.lobby-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.btn-call-start {
  width: 100%;
  min-height: 60px;
  background: var(--success);
  color: #fff;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.25);
  border: none;
  cursor: pointer;
}
.btn-call-start:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-1px);
}
.btn-call-start:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.icon-phone {
  animation: shake 2s infinite ease-in-out;
}
@keyframes shake {
  0%, 100% { transform: rotate(0); }
  10%, 30%, 50%, 70%, 90% { transform: rotate(-10deg); }
  20%, 40%, 60%, 80% { transform: rotate(10deg); }
}

.lobby-tip {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

/* Call Screen */
.call-screen {
  justify-content: space-between;
  animation: fadeIn 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  height: 100%;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.call-screen-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}
.network-status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
  animation: blink 1.5s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.call-screen-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 30px 0;
}

/* Pulsating Avatar */
.avatar-ring-container {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.avatar-circle-main {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
  z-index: 2;
  transition: all 0.3s ease;
}

/* Pulse Rings */
.avatar-pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  z-index: 1;
  opacity: 0;
  pointer-events: none;
}

/* AI Speaking ripple animation */
.phone-card.ai-speaking .avatar-circle-main {
  transform: scale(1.05);
  box-shadow: 0 12px 35px rgba(99, 102, 241, 0.6);
}
.phone-card.ai-speaking .ring1 {
  animation: pulseRipple 2s infinite cubic-bezier(0.25, 0, 0, 1);
}
.phone-card.ai-speaking .ring2 {
  animation: pulseRipple 2s infinite cubic-bezier(0.25, 0, 0, 1) 0.8s;
}

@keyframes pulseRipple {
  0% {
    width: 110px;
    height: 110px;
    opacity: 0.8;
  }
  100% {
    width: 200px;
    height: 200px;
    opacity: 0;
  }
}

.caller-info {
  text-align: center;
  margin-bottom: 20px;
}
.caller-name {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
}
.call-timer-text {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}
.call-mic-status-text {
  display: inline-block;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 99px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 10px;
  font-weight: 700;
}

/* System Status Details box */
.call-status-box {
  width: 100%;
  max-width: 320px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px;
  text-align: center;
  backdrop-filter: blur(8px);
}
.call-status-box strong {
  display: block;
  font-size: 15px;
  color: #ffffff;
  margin-bottom: 4px;
  font-weight: 800;
}
.call-status-box p {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

/* Call Keypad Footer */
.call-screen-footer {
  margin-top: auto;
  width: 100%;
}
.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  justify-items: center;
  align-items: center;
}
.keypad-btn {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  font-family: inherit;
  width: 70px;
  transition: all 0.2s ease;
}
.keypad-btn .icon-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.keypad-btn:hover .icon-circle {
  background: rgba(255, 255, 255, 0.2);
}
.keypad-btn.active .icon-circle {
  background: var(--danger);
  color: #ffffff;
}
.keypad-btn span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
}

.keypad-info-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 70px;
}
.keypad-info-box .box-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  font-weight: 800;
}
.keypad-info-box .box-value {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 800;
  margin-top: 4px;
}

.hangup-row {
  display: flex;
  justify-content: center;
}
.btn-hangup {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--danger);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(240, 68, 82, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-hangup:hover:not(:disabled) {
  background: #d12d3b;
  transform: scale(1.05);
}
.btn-hangup:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Transcript Panel style upgrades */
.transcript-panel {
  min-height: 640px;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 20px 48px rgba(25, 31, 40, 0.06);
  overflow: hidden;
}
.transcript-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
}
.transcript-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}
.transcript-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-close-transcript {
  display: none;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.transcript-log {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fafafb;
}

.bubble {
  width: fit-content;
  max-width: min(640px, 86%);
  padding: 14px 18px;
  border-radius: 18px;
  line-height: 1.6;
  white-space: pre-wrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  font-size: 15px;
}

.bubble.ai {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top-left-radius: 4px;
}

.bubble.user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-top-right-radius: 4px;
}

.bubble small {
  display: block;
  margin-bottom: 4px;
  opacity: .72;
  font-weight: 800;
  font-size: 11px;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.result-section {
  padding: 22px;
}

.result-section h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.result-section p,
.result-section li {
  line-height: 1.7;
  color: var(--muted);
}

.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  background: var(--soft);
}

.footer-inner {
  padding: 30px 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
}

.footer-inner p { margin: 6px 0 0; }
.footer-links { display: flex; gap: 16px; font-weight: 800; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(420px, 100%);
  padding: 32px;
}

.admin-wrap {
  padding: 32px 0;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.admin-table th,
.responsive-admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.admin-table th {
  background: #f9fafb;
  color: var(--muted);
}

/* --- Touchable Selector Cards for Mobile --- */
.touch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.touch-card {
  background: #ffffff;
  border: 2px solid #e5e8eb;
  border-radius: 16px;
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.touch-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.touch-card.active {
  border-color: var(--primary);
  background: #f0f7ff;
  box-shadow: 0 6px 16px rgba(49, 130, 246, 0.1);
  transform: translateY(-2px);
}

.touch-card-icon {
  font-size: 32px;
  line-height: 1;
}

.touch-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

/* Topic Touch Card List */
.topic-touch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafafb;
}

.topic-touch-card {
  background: #ffffff;
  border: 1px solid #e5e8eb;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.topic-touch-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.topic-touch-card.active {
  border-color: var(--primary);
  background: #f0f7ff;
  box-shadow: 0 4px 10px rgba(49, 130, 246, 0.06);
}

.topic-touch-card .topic-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.topic-touch-card .topic-badge {
  font-size: 10px;
  background: #f2f4f6;
  color: #6b7684;
  padding: 3px 8px;
  border-radius: 99px;
  font-weight: 700;
}

.topic-touch-card.active .topic-badge {
  background: var(--primary);
  color: #ffffff;
}

/* Level Select Option Group */
.level-touch-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.level-touch-card {
  background: #ffffff;
  border: 1.5px solid #e5e8eb;
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.level-touch-card:hover {
  border-color: #cbd5e1;
}

.level-touch-card.active {
  border-color: var(--primary);
  background: #f0f7ff;
  box-shadow: 0 4px 12px rgba(49, 130, 246, 0.05);
}

.level-touch-card .level-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.level-touch-card .level-desc {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

@media (max-width: 860px) {
  .site-header-inner { 
    height: 60px; 
    padding: 0; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
  }
  .site-header.is-sub .site-header-inner {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
    height: 56px;
    width: min(1200px, calc(100% - 24px));
  }
  .site-nav { 
    display: none; 
  }
  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 8px;
  }
  .brand strong {
    font-size: 16px;
  }
  .menu-button {
    margin-right: -4px;
  }
  .hero-grid, .phone-card, .result-grid { grid-template-columns: 1fr; }
  .headline { font-size: 26px; }
  .stats-row { grid-template-columns: 1fr; }
  .phone-face, .transcript-panel { min-height: auto; }
  .transcript-panel { height: 520px; }
  .footer-inner { flex-direction: column; }

  /* When call is active on mobile, make the dialer full screen and hide headers/footers */
  body.in-active-call .site-header,
  body.in-active-call .site-footer,
  body.in-active-call .call-topbar,
  body:has(.phone-card.in-call) .site-header,
  body:has(.phone-card.in-call) .site-footer,
  body:has(.phone-card.in-call) .call-topbar {
    display: none !important;
  }

  body.in-active-call:not(:has(.ui-call-room-v3)),
  body:has(.phone-card.in-call):not(:has(.ui-call-room-v3)) {
    background: #0f172a;
    overflow: hidden;
  }

  .phone-card.in-call:not(.ui-call-room-v3) {
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
  }

  .phone-card.in-call .phone-face {
    height: 100vh;
    min-height: 100vh;
    border-radius: 0;
    border: none;
  }

  /* Conversation log bottom sheet layout on mobile */
  .phone-card.in-call .transcript-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60vh;
    background: #ffffff;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35);
    z-index: 10000;
    transform: translateY(110%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: auto;
  }

  .phone-card.in-call.transcript-open .transcript-panel {
    transform: translateY(0);
  }

  .phone-card.in-call .btn-close-transcript {
    display: block;
  }
}

/* --- Deureojuneun Diary mobile app layer --- */
:root {
  --diary-blue: var(--primary);
  --diary-blue-soft: #eef6ff;
  --diary-lavender: #f5f9ff;
  --diary-ink: #172033;
  --diary-muted: #6b7280;
  --diary-line: rgba(119, 139, 180, 0.18);
  --diary-card: rgba(255, 255, 255, 0.82);
}

body {
  background: #ffffff;
}

.site-header {
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.72);
}

.brand-mark,
.auth-logo {
  background: linear-gradient(135deg, var(--primary), #5ba2ff);
  color: #fff;
}

.notice {
  color: var(--primary-dark);
  background: #eef6ff;
  border-color: #dcecff;
}

.notice.danger {
  color: #be123c;
  background: #fff1f2;
  border-color: #fecdd3;
}

.app-shell {
  width: min(760px, calc(100% - var(--app-gutter) * 2));
  margin: 0 auto;
  padding: 18px var(--app-gutter) 100px;
}

/* Fix Admin dropdown hover issue */
.admin-nav-group {
  position: relative;
}
.admin-nav-group::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 10px;
  display: block;
}

.admin-nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  min-width: 180px;
  display: none;
  padding: 8px 0;
  margin-top: 0;
  border: 1px solid #e5edf7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
}

.admin-nav-dropdown:hover .admin-nav-dropdown-menu,
.admin-nav-dropdown:focus-within .admin-nav-dropdown-menu {
  display: block;
}

.fade-up {
  opacity: 0;
  transform: translateY(14px);
  animation: diaryFadeUp .58s ease forwards;
}

@keyframes diaryFadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.soft-pill,
.mini-status span,
.plan-chip,
.icon-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--diary-line);
  color: #5272aa;
  font-size: 12px;
  font-weight: 800;
}

.app-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--diary-line);
  border-radius: 28px;
  padding: 22px 20px 24px;
  background:
    linear-gradient(135deg, rgba(226, 239, 255, .96), rgba(247, 240, 255, .86)),
    #fff;
  box-shadow: 0 20px 42px rgba(69, 104, 170, .12);
}

.app-topline,
.section-heading,
.admin-console-head,
.call-app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.app-name {
  display: block;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--diary-ink);
}

.app-topline small {
  display: block;
  margin-top: 2px;
  color: #63708a;
  font-size: 12px;
}

.app-hero h1 {
  margin: 34px 0 8px;
  font-size: 34px;
  line-height: 1.14;
  letter-spacing: -.04em;
  color: var(--diary-ink);
}

.app-hero p {
  margin: 0;
  color: #526079;
  font-weight: 700;
}

.mini-status {
  display: flex;
  gap: 8px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.home-section {
  margin-top: 24px;
}

.section-heading {
  margin-bottom: 12px;
}

.section-heading h2,
.soft-card h2 {
  margin: 0;
  color: var(--diary-ink);
  font-size: 17px;
  letter-spacing: -.02em;
}

.section-heading a {
  color: #5b7fc0;
  font-size: 13px;
  font-weight: 800;
}

.friend-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.friend-card,
.character-option {
  position: relative;
  flex: 0 0 138px;
  min-height: 154px;
  border: 1px solid var(--diary-line);
  border-radius: 22px;
  background: rgba(255,255,255,.82);
  padding: 15px 13px;
  text-align: left;
  cursor: pointer;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
  scroll-snap-align: start;
  font-family: inherit;
}

.friend-card.selected,
.character-option.selected {
  transform: scale(1.02);
  border-color: rgba(91, 141, 239, .55);
  background: linear-gradient(135deg, rgba(234,242,255,.98), rgba(250,247,255,.94));
  box-shadow: 0 16px 30px rgba(91, 141, 239, .16);
}

.friend-avatar,
.big-friend-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #34517c;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72);
}

.friend-avatar {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  margin-bottom: 14px;
}

.friend-card strong,
.character-option strong {
  display: block;
  color: var(--diary-ink);
  font-size: 16px;
  margin-bottom: 4px;
}

.friend-card small,
.character-option small {
  display: block;
  color: var(--diary-muted);
  font-size: 12px;
  white-space: nowrap;
}

.friend-card em,
.character-option em {
  display: none;
  position: absolute;
  right: 10px;
  top: 10px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #5b8def;
  color: #fff;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}

.friend-card.selected em,
.character-option.selected em {
  display: inline-flex;
}

.call-cta-card,
.usage-soft,
.soft-card,
.diary-preview,
.diary-entry-card,
.next-call-card {
  border: 1px solid var(--diary-line);
  border-radius: 24px;
  background: var(--diary-card);
  box-shadow: 0 16px 34px rgba(69, 104, 170, .08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.call-cta-card {
  margin-top: 18px;
  padding: 22px 18px 20px;
  text-align: center;
}

.call-ready-text strong {
  display: block;
  color: var(--diary-ink);
  font-size: 19px;
  letter-spacing: -.02em;
}

.call-ready-text span {
  display: block;
  margin-top: 5px;
  color: var(--diary-muted);
  font-size: 13px;
  font-weight: 700;
}

.soft-input {
  display: block;
  margin: 18px 0 20px;
  text-align: left;
}

.soft-input span {
  display: block;
  margin-bottom: 8px;
  color: #6d7892;
  font-size: 12px;
  font-weight: 900;
}

.soft-input input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--diary-line);
  border-radius: 16px;
  padding: 0 15px;
  background: rgba(255,255,255,.72);
  font: inherit;
  outline: none;
}

.call-orb {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 0 auto;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #6ca1ff, #7f8cff);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 18px 36px rgba(91, 141, 239, .36);
  animation: callPulse 2.2s ease-in-out infinite;
}

.call-ready-text + .call-orb {
  margin-top: 20px;
}

.call-orb::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: inherit;
  border: 1px solid rgba(91, 141, 239, .28);
  animation: callRing 2.2s ease-in-out infinite;
}

.call-orb-icon {
  font-size: 30px;
  line-height: 1;
}

@keyframes callPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.025); }
}

@keyframes callRing {
  0% { opacity:.7; transform:scale(.94); }
  100% { opacity:0; transform:scale(1.18); }
}

.call-left {
  margin: 18px 0 0;
  color: #5c6b84;
  font-size: 13px;
  font-weight: 800;
}

.usage-soft {
  margin-top: 18px;
  padding: 16px;
}

.usage-row {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.usage-row span {
  display: block;
  color: var(--diary-muted);
  font-size: 12px;
  font-weight: 800;
}

.usage-row strong {
  display: block;
  color: var(--diary-ink);
  font-size: 15px;
}

.progress-track {
  height: 9px;
  border-radius: 999px;
  background: #e9eef8;
  overflow: hidden;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8db8ff, #b8c2ff);
}

.warm-tips {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.warm-tips p {
  margin: 0;
  min-height: 42px;
  border-radius: 15px;
  padding: 11px 14px;
  background: rgba(255,255,255,.58);
  color: #536176;
  font-size: 13px;
  font-weight: 800;
}

.diary-preview-list,
.diary-timeline,
.keyword-list,
.kept-sentences {
  display: grid;
  gap: 12px;
}

.diary-preview {
  display: block;
  padding: 16px;
}

.diary-preview small,
.diary-entry-card small,
.result-diary-hero span {
  display: block;
  color: #72809a;
  font-size: 12px;
  font-weight: 800;
}

.diary-preview strong,
.diary-entry-card strong {
  display: block;
  margin: 5px 0 4px;
  color: var(--diary-ink);
  font-size: 15px;
}

.diary-preview span,
.diary-entry-card em {
  color: var(--diary-muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.5;
}

.onboarding-shell {
  padding-top: 26px;
}

.onboarding-hero h1,
.list-hero h1,
.result-diary-hero h1 {
  margin: 10px 0 8px;
  color: var(--diary-ink);
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: -.04em;
}

.onboarding-hero p,
.list-hero p,
.result-diary-hero p {
  margin: 0;
  color: var(--diary-muted);
  font-weight: 700;
}

.onboarding-form,
.choice-grid {
  display: grid;
  gap: 14px;
}

.soft-card {
  padding: 18px;
  margin-top: 16px;
}

.choice-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 14px;
}

.choice-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--diary-line);
  border-radius: 16px;
  background: rgba(255,255,255,.62);
  color: #56647d;
  font-size: 13px;
  font-weight: 900;
}

.choice-chip input {
  accent-color: #6ca1ff;
  margin-right: 6px;
}

.onboarding-fields {
  grid-template-columns: 1fr;
  margin-top: 16px;
}

.character-pick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.character-option {
  flex: initial;
  width: 100%;
}

.onboarding-submit {
  width: 100%;
  margin-top: 18px;
  border-radius: 18px;
}

.auth-logo {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  font-size: 24px;
  font-weight: 900;
}

.auth-switch {
  margin: 18px 0 0;
  color: var(--diary-muted);
  font-size: 13px;
  text-align: center;
}

.auth-switch a {
  color: #4f7fd8;
  font-weight: 900;
}

.call-app-shell {
  min-height: calc(100vh - 72px);
  padding-bottom: 50px;
}

.call-app-top {
  width: min(460px, calc(100% - 32px));
  margin: 18px auto 0;
  padding: 12px 0;
}

.call-app-top a {
  color: #5b7fc0;
  font-weight: 900;
}

.call-app-top strong,
.call-app-top span {
  display: block;
  text-align: right;
}

.call-app-top strong {
  color: var(--diary-ink);
}

.call-app-top span {
  color: var(--diary-muted);
  font-size: 12px;
  font-weight: 800;
}

.diary-phone-card {
  grid-template-columns: minmax(320px, 420px) 1fr;
  justify-content: center;
}

.diary-phone-face {
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(243,247,255,.92));
}

.diary-lobby {
  min-height: 620px;
}

.diary-lobby-center {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 12px;
}

.big-friend-avatar {
  width: 112px;
  height: 112px;
  border-radius: 36px;
  font-size: 42px;
}

.diary-lobby h1 {
  margin: 8px 0 0;
  color: var(--diary-ink);
  font-size: 27px;
  line-height: 1.22;
  letter-spacing: -.04em;
}

.diary-lobby p {
  margin: 0;
  color: var(--diary-muted);
  font-weight: 800;
}

.goal-note {
  display: block;
  max-width: 280px;
  color: #64748b;
  line-height: 1.5;
}

.room-call-orb {
  width: 148px;
  height: 148px;
}

.diary-call-screen .avatar-circle-main {
  color: #34517c;
}

.diary-transcript .transcript-log {
  background: rgba(247,250,255,.82);
}

.diary-list-page,
.result-page {
  padding-top: 22px;
}

.list-hero a,
.result-diary-hero a {
  color: #5b7fc0;
  font-weight: 900;
  font-size: 13px;
}

.diary-timeline {
  margin-top: 20px;
}

.diary-entry-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  padding: 14px;
  align-items: start;
}

.diary-entry-body {
  min-width: 0;
}

.diary-entry-card em {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-diary-hero {
  padding: 4px 0 4px;
}

.diary-paper {
  margin-top: 18px;
  border-radius: 26px;
  border: 1px solid rgba(180, 197, 225, .42);
  background: rgba(255,255,255,.9);
  padding: 24px 21px;
  color: #243047;
  font-size: 16px;
  line-height: 1.9;
  box-shadow: 0 18px 34px rgba(69, 104, 170, .08);
}

.kept-sentences p {
  margin: 0;
  border-radius: 16px;
  padding: 13px 14px;
  background: #f4f8ff;
  color: #314363;
  font-weight: 800;
}

.keyword-list article {
  border-radius: 16px;
  padding: 14px;
  background: rgba(244,248,255,.88);
}

.keyword-list strong,
.keyword-list span,
.keyword-list small {
  display: block;
}

.keyword-list strong {
  color: #4f7fd8;
  font-size: 13px;
}

.keyword-list span {
  margin-top: 4px;
  color: var(--diary-ink);
  font-weight: 800;
}

.keyword-list small {
  margin-top: 5px;
  color: var(--diary-muted);
  line-height: 1.5;
}

.next-call-card {
  margin-top: 16px;
  padding: 18px;
  display: grid;
  gap: 10px;
}

.next-call-card span {
  color: var(--diary-muted);
  font-size: 12px;
  font-weight: 900;
}

.next-call-card strong {
  color: var(--diary-ink);
  line-height: 1.45;
}

.admin-console {
  width: min(1180px, calc(100% - 40px));
}

.admin-console-head {
  align-items: flex-end;
}

.admin-console-head h1 {
  margin: 10px 0 4px;
  color: var(--diary-ink);
}

.admin-console-head p {
  margin: 0;
  color: var(--diary-muted);
}

.landing-page {
  width: min(940px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 70px;
}

.landing-hero {
  min-height: 520px;
  border: 1px solid var(--diary-line);
  border-radius: 34px;
  padding: 54px 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  background:
    linear-gradient(135deg, rgba(226, 239, 255, .98), rgba(247, 240, 255, .86)),
    #fff;
  box-shadow: 0 24px 54px rgba(69, 104, 170, .12);
}

.landing-hero h1 {
  margin: 20px 0 14px;
  color: var(--diary-ink);
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -.06em;
}

.landing-hero p {
  max-width: 520px;
  margin: 0;
  color: #526079;
  font-size: 18px;
  line-height: 1.65;
  font-weight: 750;
}

.landing-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.landing-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.landing-strip article {
  border: 1px solid var(--diary-line);
  border-radius: 22px;
  background: rgba(255,255,255,.76);
  padding: 18px;
}

.landing-strip strong,
.landing-strip span {
  display: block;
}

.landing-strip strong {
  color: var(--diary-ink);
  font-size: 16px;
}

.landing-strip span {
  margin-top: 4px;
  color: var(--diary-muted);
  font-size: 13px;
  font-weight: 800;
}

.landing-friends {
  margin-top: 30px;
}

.landing-friends h2 {
  margin: 0 0 14px;
  color: var(--diary-ink);
  font-size: 22px;
}

@media (min-width: 900px) {
  .app-shell {
    width: min(760px, calc(100% - 24px));
  }
}

@media (max-width: 620px) {
  .layout-container {
    width: min(460px, calc(100% - 32px));
  }

  .site-header-inner {
    width: calc(100% - 24px);
    height: 62px;
    padding: 0;
    align-items: center;
    margin-left: 8px;
    margin-right: auto;
  }

  .brand {
    gap: 9px;
    flex: 0 1 auto;
    min-width: 0;
    margin-left: -6px;
  }

  .brand-logo {
    max-width: min(360px, 84vw);
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 13px;
    font-size: 16px;
  }

  .brand strong {
    font-size: 15px;
  }

  .brand small {
    display: none;
  }

  .site-nav {
    gap: 8px;
    font-size: 12px;
  }

  .site-nav a:not(.nav-cta):not(:first-child),
  .user-chip {
    display: none;
  }

  .nav-cta {
    padding: 7px 12px;
  }

  .app-shell {
    width: calc(100% - 32px);
    padding-top: 16px;
  }

  .app-hero h1 {
    font-size: 32px;
  }

  .friend-card {
    flex-basis: 132px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .character-pick-grid {
    grid-template-columns: 1fr 1fr;
  }

  .call-stage {
    padding: 18px 0;
  }

  .diary-phone-card {
    grid-template-columns: 1fr;
  }

  .diary-lobby {
    min-height: 600px;
  }

  .phone-screen {
    padding: 28px 20px;
  }

  .transcript-panel {
    height: 460px;
  }

  .landing-page {
    width: calc(100% - 32px);
    padding-top: 18px;
  }

  .landing-hero {
    min-height: 460px;
    border-radius: 28px;
    padding: 34px 22px;
  }

  .landing-hero h1 {
    font-size: 42px;
  }

  .landing-hero p {
    font-size: 15px;
  }

  .landing-actions,
  .landing-actions .btn {
    width: 100%;
  }

  .landing-strip {
    grid-template-columns: 1fr;
  }
}

/* --- AI Review Dashboard (Light Theme) --- */
.result-header-card {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  color: var(--text);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.result-header-info h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
}
.result-header-meta {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.result-header-meta .meta-badge {
  background: var(--soft);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--line);
}
.result-header-meta .meta-badge.duration {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

.result-dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  margin-bottom: 28px;
}

.dashboard-column {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Review Section Cards */
.review-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}
.review-card h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

/* Feedback box */
.summary-box {
  background: #f0f7ff;
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  border-radius: 0 12px 12px 0;
  font-size: 15px;
  line-height: 1.7;
  color: #1e3a8a;
}

/* Corrections UI */
.correction-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.correction-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.01);
}
.correction-header-original {
  background-color: #fff1f2;
  color: #e11d48;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #ffe4e6;
}
.correction-header-original .badge {
  background: #e11d48;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
}
.correction-body-natural {
  padding: 14px 16px;
}
.natural-phrase-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.natural-phrase {
  color: #059669;
  font-size: 16px;
  font-weight: 800;
}
.btn-tts {
  background: var(--soft);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--muted);
}
.btn-tts:hover {
  background: var(--primary);
  color: #ffffff;
}
.correction-note {
  margin-top: 8px;
  font-size: 13px;
  color: #4b5563;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  line-height: 1.5;
}

/* Sentences List */
.sentence-item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.01);
}
.sentence-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
}

/* Next Topic Card */
.next-topic-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.02) 0%, rgba(49, 130, 246, 0.02) 100%);
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}
.next-topic-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.next-topic-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Collapsible Transcript */
.transcript-accordion {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
  margin-top: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}
.transcript-accordion-trigger {
  width: 100%;
  padding: 18px 24px;
  background: #ffffff;
  border: none;
  font-size: 16px;
  font-weight: 800;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}
.transcript-accordion-trigger::after {
  content: '▼';
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.2s ease;
}
.transcript-accordion.open .transcript-accordion-trigger::after {
  transform: rotate(180deg);
}
.transcript-accordion-content {
  display: none;
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  background: #f9fafb;
  max-height: 450px;
  overflow-y: auto;
}
.transcript-accordion.open .transcript-accordion-content {
  display: block;
}

@media (max-width: 900px) {
  .result-dashboard-grid {
    grid-template-columns: 1fr;
  }
  .result-header-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }
  .result-header-card .btn {
    width: 100%;
    margin-top: 8px;
  }
}

@media (max-width: 600px) {
  .layout-container,
  .site-header-inner {
    width: calc(100% - 24px);
  }

  .site-header-inner {
    gap: 12px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 15px;
  }

  .brand strong {
    font-size: 15px;
  }

  .brand small {
    font-size: 10px;
  }

  .site-nav {
    font-size: 12px;
    gap: 8px;
  }

  .nav-cta,
  .user-chip {
    padding: 7px 10px;
  }

  .layout-container.hero {
    padding-top: 20px !important;
    padding-bottom: 36px !important;
  }

  .headline {
    font-size: 28px !important;
    line-height: 1.25;
  }

  .subcopy {
    font-size: 14px !important;
    line-height: 1.6;
  }

  .panel,
  .card,
  .review-card,
  .next-topic-card,
  .result-header-card {
    border-radius: 16px;
  }

  .panel {
    padding: 18px !important;
  }

  .form-grid {
    gap: 16px;
  }

  .touch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .touch-card {
    min-height: 92px;
    padding: 14px 10px;
  }

  .level-touch-group {
    gap: 8px;
  }

  .level-touch-card {
    min-height: 64px;
    padding: 10px 6px;
  }

  .topic-touch-card {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .call-topbar {
    padding: 12px 0;
  }

  .call-meta {
    align-items: flex-start;
  }

  .call-meta h1 {
    font-size: 19px;
  }

  .call-stage {
    padding: 16px 0 28px;
  }

  .phone-face {
    border-radius: 18px;
    min-height: calc(100dvh - 180px);
  }

  .phone-screen {
    padding: 22px 18px;
  }

  .lobby-header h2 {
    font-size: 22px;
  }

  .lobby-info-card {
    margin: 18px 0;
    padding: 16px;
  }

  .lobby-info-card .info-row {
    align-items: flex-start;
    gap: 10px;
  }

  .lobby-info-card .info-row .value {
    text-align: right;
  }

  .btn-call-start {
    min-height: 56px;
    font-size: 16px;
  }

  .transcript-panel {
    height: 380px;
  }

  .transcript-header {
    padding: 14px 16px;
  }

  .transcript-log {
    padding: 16px;
    gap: 12px;
  }

  .bubble {
    max-width: 92%;
    font-size: 14px;
    padding: 12px 14px;
  }

  .phone-card.in-call {
    height: 100dvh;
  }

  .phone-card.in-call .phone-face {
    height: 100dvh;
    min-height: 100dvh;
  }

  .phone-card.in-call .phone-screen {
    padding: calc(env(safe-area-inset-top) + 20px) 18px calc(env(safe-area-inset-bottom) + 18px);
  }

  .phone-card.in-call .transcript-panel {
    height: min(62dvh, 520px);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .avatar-ring-container {
    width: 118px;
    height: 118px;
    margin-bottom: 16px;
  }

  .avatar-circle-main {
    width: 96px;
    height: 96px;
    font-size: 32px;
  }

  .caller-name {
    font-size: 22px;
  }

  .call-screen-body {
    margin: 20px 0;
  }

  .keypad-grid {
    gap: 8px;
    margin-bottom: 18px;
  }

  .keypad-btn {
    width: 64px;
  }

  .keypad-btn .icon-circle {
    width: 50px;
    height: 50px;
  }

  .btn-hangup {
    width: 60px;
    height: 60px;
  }

  .result-header-card,
  .review-card,
  .next-topic-card {
    padding: 18px;
  }

  .result-header-info h1 {
    font-size: 22px;
  }

  .summary-box {
    padding: 14px 16px;
    font-size: 14px;
  }

  .sentence-item-card,
  .natural-phrase-row {
    align-items: flex-start;
  }

  .transcript-accordion-trigger {
    padding: 16px;
    font-size: 14px;
  }

  .transcript-accordion-content {
    padding: 14px;
  }
}

/* --- Final user-facing UI override --- */
:root {
  --primary: #3182f6;
  --primary-dark: #1b64da;
  --primary-glow: rgba(49, 130, 246, 0.18);
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #191f28;
  --muted: #6b7684;
  --line: #e5e8eb;
  --soft: #f2f4f6;
  --diary-blue: var(--primary);
  --diary-blue-soft: #eef6ff;
  --diary-lavender: #f2f4f6;
  --diary-ink: #191f28;
  --diary-muted: #6b7684;
  --diary-line: #e5e8eb;
  --diary-card: #ffffff;
}

body {
  background: #ffffff;
  color: #191f28;
}

body,
button,
input,
select,
textarea,
.headline,
.app-hero h1,
.landing-hero h1,
.onboarding-hero h1,
.list-hero h1,
.result-diary-hero h1 {
  letter-spacing: 0;
}

.site-header {
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(229, 232, 235, 0.72);
  box-shadow: 0 1px 0 rgba(25, 31, 40, 0.02);
}

.site-header-inner,
.landing-page,
.call-app-top {
  width: min(1120px, calc(100% - 40px));
}

.site-header-inner {
  height: 66px;
}

.brand-mark,
.auth-logo {
  background: #3182f6;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(49, 130, 246, 0.22);
}

.site-nav {
  gap: 8px;
}

.site-nav a,
.user-chip,
.nav-cta {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 13px;
}

.site-nav a:hover {
  background: #f2f4f6;
  color: #191f28;
}

.nav-cta {
  background: var(--btn-primary-bg);
  border: 0;
  color: #fff;
  box-shadow: var(--btn-primary-shadow);
}
.nav-cta:hover {
  background: var(--btn-primary-bg-hover);
}

.user-chip {
  background: #f2f4f6;
  border: 0;
  color: #4e5968;
}

.btn,
.call-orb {
  background: var(--btn-primary-bg);
  box-shadow: var(--btn-primary-shadow);
}

.btn {
  min-height: 54px;
  border-radius: 16px;
}

.btn.secondary {
  background: #f2f4f6;
  border: 0;
  color: #191f28;
  box-shadow: none;
}

.panel,
.card,
.soft-card,
.call-cta-card,
.usage-soft,
.diary-preview,
.diary-entry-card,
.next-call-card,
.transcript-panel,
.phone-face,
.landing-strip article {
  background: #ffffff;
  border: 1px solid #e5e8eb;
  box-shadow: 0 18px 45px rgba(25, 31, 40, 0.06);
}

.soft-pill,
.mini-status span,
.plan-chip,
.icon-link {
  background: #eef6ff;
  border: 0;
  color: #1b64da;
}

.app-shell.diary-home {
  width: min(1080px, calc(100% - 40px));
  padding: 34px 0 82px;
}

.home-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  gap: 22px;
  align-items: start;
}

.home-main,
.home-side {
  display: grid;
  gap: 18px;
}

.home-side {
  position: sticky;
  top: 86px;
}

.app-hero {
  min-height: 360px;
  border: 0;
  border-radius: 28px;
  padding: 30px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(235, 244, 255, 0.98));
  box-shadow: 0 22px 54px rgba(49, 130, 246, 0.12);
}

.app-hero h1 {
  max-width: 620px;
  margin: 68px 0 14px;
  color: #191f28;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.12;
}

.app-hero p {
  max-width: 520px;
  color: #4e5968;
  font-size: 17px;
  line-height: 1.7;
}

.primary-action-card {
  padding: 28px;
  text-align: left;
  border-radius: 28px;
}

.primary-action-card form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}

.call-ready-text strong {
  color: #191f28;
  font-size: 24px;
}

.call-ready-text span {
  color: #6b7684;
}

.call-orb {
  width: auto;
  min-width: 168px;
  height: 64px;
  margin: 0;
  border-radius: 18px;
  flex-direction: row;
  animation: none;
}

.call-ready-text + .call-orb {
  margin-top: 0;
}

.call-orb::before {
  display: none;
}

.call-left {
  grid-column: 1 / -1;
  margin: -4px 0 0;
  color: #8b95a1;
}

.home-section {
  margin-top: 0;
}

.home-side .home-section,
.usage-soft,
.warm-tips {
  border-radius: 24px;
  padding: 20px;
}

.friend-scroll {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  overflow: visible;
  padding: 0;
}

.friend-card,
.character-option {
  flex: initial;
  width: 100%;
  min-height: 92px;
  border-radius: 20px;
  border: 1px solid #e5e8eb;
  background: #ffffff;
  display: grid;
  grid-template-columns: 50px 1fr;
  column-gap: 12px;
  align-items: center;
  padding: 15px;
}

.friend-card.selected,
.character-option.selected {
  transform: none;
  border-color: #3182f6;
  background: #f0f7ff;
  box-shadow: 0 14px 28px rgba(49, 130, 246, 0.12);
}

.friend-avatar {
  grid-row: span 2;
  width: 50px;
  height: 50px;
  margin: 0;
  border-radius: 18px;
}

.friend-card small,
.character-option small {
  white-space: normal;
  line-height: 1.35;
}

.progress-track {
  background: #f2f4f6;
}

.progress-track i {
  background: #3182f6;
}

.warm-tips p,
.kept-sentences p,
.keyword-list article {
  background: #f8fafc;
  color: #4e5968;
}

.diary-preview,
.diary-entry-card {
  border-radius: 22px;
  padding: 18px;
}

.landing-page {
  padding: 44px 0 76px;
}

.landing-hero {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
  gap: 34px;
  align-items: center;
  border: 0;
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(234, 243, 255, 0.98));
  box-shadow: 0 24px 62px rgba(25, 31, 40, 0.08);
}

.landing-hero h1 {
  max-width: 670px;
  color: #191f28;
  font-size: clamp(44px, 5.6vw, 72px);
  line-height: 1.08;
}

.landing-hero p {
  color: #4e5968;
}

.landing-preview {
  display: flex;
  justify-content: center;
}

.preview-phone {
  width: min(330px, 100%);
  min-height: 430px;
  border-radius: 34px;
  padding: 30px 26px;
  background: #ffffff;
  border: 1px solid #e5e8eb;
  box-shadow: 0 30px 70px rgba(49, 130, 246, 0.16);
}

.preview-status,
.preview-chips span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.preview-status {
  min-height: 30px;
  padding: 0 12px;
  background: #eef6ff;
  color: #1b64da;
}

.preview-phone h2 {
  margin: 74px 0 16px;
  color: #191f28;
  font-size: 28px;
  line-height: 1.26;
}

.preview-phone p {
  color: #4e5968;
  font-size: 15px;
}

.preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.preview-chips span {
  padding: 8px 10px;
  background: #f2f4f6;
  color: #4e5968;
}

.auth-page {
  background:
    radial-gradient(circle at 50% -120px, rgba(49, 130, 246, 0.18), transparent 330px),
    #f6f8fb;
}

.auth-card {
  border-radius: 28px;
  padding: 34px;
}

.field input,
.field select,
.field textarea,
.soft-input input {
  min-height: 52px;
  border-radius: 16px;
  background: #f8fafc;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.soft-input input:focus {
  background: #ffffff;
  border-color: #3182f6;
  box-shadow: 0 0 0 4px rgba(49, 130, 246, 0.12);
}

.choice-chip:has(input:checked) {
  background: #eef6ff;
  border-color: #3182f6;
  color: #1b64da;
}

.diary-phone-card {
  grid-template-columns: minmax(320px, 420px) minmax(360px, 1fr);
}

.phone-card.in-call .phone-face {
  background: linear-gradient(180deg, #191f28 0%, #2a3340 100%);
}

.transcript-log {
  background: #f8fafc;
}

.bubble.user {
  background: #3182f6;
}

.keyword-list strong,
.section-heading a,
.list-hero a,
.result-diary-hero a,
.call-app-top a {
  color: #3182f6;
}

.site-footer {
  background: #ffffff;
}

@media (max-width: 900px) {
  .app-shell.diary-home,
  .landing-page,
  .call-app-top {
    width: min(560px, calc(100% - 32px));
  }

  .home-dashboard,
  .landing-hero,
  .diary-phone-card {
    grid-template-columns: 1fr;
  }

  .home-side {
    position: static;
  }

  .landing-preview {
    display: none;
  }

  .primary-action-card form {
    grid-template-columns: 1fr;
  }

  .call-orb {
    width: 100%;
    min-width: 0;
  }

  .friend-scroll {
    display: flex;
    overflow-x: auto;
    padding: 2px 2px 10px;
  }

  .friend-card {
    flex: 0 0 210px;
  }
}

@media (max-width: 620px) {
  .site-header-inner {
    height: 60px;
  }

  .app-shell.diary-home {
    padding-top: 18px;
  }

  .app-hero {
    min-height: 340px;
    padding: 24px;
    border-radius: 26px;
  }

  .app-hero h1 {
    margin-top: 54px;
    font-size: 36px;
  }

  .app-hero p {
    font-size: 15px;
  }

  .primary-action-card,
  .home-side .home-section,
  .usage-soft,
  .warm-tips,
  .auth-card {
    border-radius: 24px;
    padding: 20px;
  }

  .call-ready-text strong {
    font-size: 21px;
  }

  .landing-page {
    padding-top: 20px;
  }

  .landing-hero {
    min-height: 500px;
    padding: 32px 22px;
    border-radius: 28px;
  }

  .landing-hero h1 {
    font-size: 42px;
  }

  .landing-strip {
    grid-template-columns: 1fr;
  }

  .character-pick-grid {
    grid-template-columns: 1fr;
  }
}

/* --- App tutorial landing and admin console --- */
.app-tutorial {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.tutorial-card,
.app-bottom-cta,
.admin-metric-grid article,
.admin-quick-grid a,
.admin-feed-list a,
.admin-user-list div {
  background: #ffffff;
  border: 1px solid #e5e8eb;
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(25, 31, 40, 0.05);
}

.tutorial-card {
  padding: 22px;
}

.tutorial-card span {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #eef6ff;
  color: #1b64da;
  font-size: 14px;
  font-weight: 900;
}

.tutorial-card strong {
  display: block;
  margin-top: 18px;
  color: #191f28;
  font-size: 18px;
}

.tutorial-card p,
.app-bottom-cta p {
  margin: 8px 0 0;
  color: #6b7684;
  line-height: 1.65;
}

.app-bottom-cta {
  margin-top: 26px;
  padding: 28px;
  text-align: center;
}

.app-bottom-cta strong {
  display: block;
  color: #191f28;
  font-size: 24px;
}

.app-bottom-cta .landing-actions {
  justify-content: center;
}

.admin-auth-page {
  background:
    radial-gradient(circle at 50% -120px, rgba(49, 130, 246, 0.18), transparent 330px),
    #f6f8fb;
}

.admin-okta-btn {
  width: 100%;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #8b95a1;
  font-size: 12px;
  font-weight: 800;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e8eb;
}

.admin-dashboard {
  padding-bottom: 70px;
}

.admin-wrap {
  overflow-x: auto;
}

.admin-table {
  min-width: 760px;
}

.admin-dashboard-hero {
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, #ffffff, #eef6ff);
  border: 1px solid #e5e8eb;
  box-shadow: 0 22px 54px rgba(49, 130, 246, 0.1);
}

.admin-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.admin-metric-grid article {
  padding: 20px;
}

.admin-metric-grid span,
.admin-quick-grid span,
.admin-feed-list small {
  display: block;
  color: #8b95a1;
  font-size: 12px;
  font-weight: 900;
}

.admin-metric-grid strong {
  display: block;
  margin-top: 8px;
  color: #191f28;
  font-size: 30px;
}

.admin-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-quick-grid a {
  padding: 20px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.admin-quick-grid a:hover {
  transform: translateY(-2px);
  border-color: #3182f6;
  box-shadow: 0 20px 44px rgba(49, 130, 246, 0.12);
}

.admin-quick-grid strong {
  display: block;
  margin-top: 8px;
  color: #191f28;
  font-size: 17px;
}

.admin-quick-grid em {
  display: block;
  margin-top: 8px;
  color: #6b7684;
  font-style: normal;
  line-height: 1.5;
  font-size: 13px;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
}

.admin-feed-card {
  border-radius: 24px;
}

.admin-feed-list,
.admin-user-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.admin-feed-list a,
.admin-user-list div {
  display: block;
  padding: 16px;
  box-shadow: none;
}

.admin-feed-list strong,
.admin-user-list strong {
  display: block;
  margin: 5px 0;
  color: #191f28;
}

.admin-feed-list span,
.admin-user-list span {
  color: #6b7684;
  font-size: 13px;
  line-height: 1.5;
}

.admin-user-list em {
  display: inline-flex;
  margin-top: 8px;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef6ff;
  color: #1b64da;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.admin-empty {
  margin: 16px 0 0;
  color: #6b7684;
}

.admin-inline-form {
  display: grid;
  gap: 8px;
  min-width: 170px;
}

.admin-inline-form select,
.admin-table select {
  min-height: 40px;
  border: 1px solid #e5e8eb;
  border-radius: 12px;
  padding: 0 10px;
  background: #fff;
  font: inherit;
}

/* --- Redesigned Lobby Styles --- */
.selected-hero-section {
  padding: 24px 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
  border-radius: 28px;
  border: 1px solid rgba(49, 130, 246, 0.12);
  margin-bottom: 24px;
}

.hero-character-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.hero-avatar-big .hero-avatar {
  width: 82px;
  height: 82px;
  border-radius: 28px;
  font-size: 32px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.hero-content {
  flex: 1;
  min-width: 0;
}

.hero-badge {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(49, 130, 246, 0.08);
  color: #1b64da;
  font-size: 11px;
  font-weight: 900;
  border-radius: 7px;
  margin-bottom: 6px;
}

.hero-title {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
  color: #191f28;
  letter-spacing: -0.02em;
  word-break: keep-all;
}

.hero-desc {
  margin: 6px 0 0;
  color: #4e5968;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.hero-action-bar {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  padding-top: 20px;
}

.usage-exhausted-msg {
  padding: 14px;
  background: #f2f4f6;
  border-radius: 14px;
  text-align: center;
  color: #6b7684;
  font-size: 13px;
  font-weight: 700;
}

.friend-horizontal-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 4px 16px;
  scrollbar-width: none; /* Firefox */
}

.friend-horizontal-scroll::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.friend-chip-item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #ffffff;
  border: 1px solid #e5e8eb;
  border-radius: 999px;
  text-decoration: none;
  color: #4e5968;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s ease;
}

.friend-chip-item.active {
  background: #3182f6;
  border-color: #3182f6;
  color: #ffffff;
}

.chip-avatar {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: 11px;
}

.usage-compact-card {
  background: #f8fafc;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid #eef2f6;
}

.usage-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.usage-info span {
  font-size: 13px;
  color: #4e5968;
}

.usage-info strong {
  color: #191f28;
}

.usage-bar-bg {
  height: 6px;
  background: #e5e8eb;
  border-radius: 999px;
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  background: #3182f6;
  border-radius: inherit;
  transition: width 0.4s ease;
}

@media (max-width: 600px) {
  .hero-character-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .hero-avatar-big .hero-avatar {
    width: 80px;
    height: 80px;
    border-radius: 28px;
  }
  .hero-title {
    font-size: 22px;
  }
}


@media (max-width: 980px) {
  .app-tutorial,
  .admin-metric-grid,
  .admin-quick-grid,
  .admin-dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-console-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-head-actions {
    width: 100%;
    justify-content: stretch;
  }

  .admin-head-actions .btn {
    flex: 1;
  }
}

@media (max-width: 680px) {
  .app-tutorial,
  .admin-metric-grid,
  .admin-quick-grid,
  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .app-bottom-cta,
  .tutorial-card,
  .admin-dashboard-hero {
    border-radius: 24px;
    padding: 22px;
  }

  .app-bottom-cta .landing-actions,
  .app-bottom-cta .btn {
    width: 100%;
  }

  .admin-wrap {
    padding-top: 18px;
  }

  .responsive-admin-table {
    display: block;
    min-width: 0;
    border: 0;
    background: transparent;
  }

  .responsive-admin-table thead {
    display: none;
  }

  .responsive-admin-table tbody,
  .responsive-admin-table tr,
  .responsive-admin-table td {
    display: block;
    width: 100%;
  }

  .responsive-admin-table tr {
    margin-bottom: 14px;
    border: 1px solid #e5e8eb;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 12px 28px rgba(25, 31, 40, 0.05);
  }

  .responsive-admin-table td {
    border-bottom: 1px solid #f2f4f6;
    padding: 12px 14px;
  }

  .responsive-admin-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: #8b95a1;
    font-size: 11px;
    font-weight: 900;
  }

  .responsive-admin-table td:last-child {
    border-bottom: 0;
  }

  .responsive-admin-table form,
  .admin-inline-form {
    width: 100%;
  }

  .responsive-admin-table select,
  .responsive-admin-table .btn {
    width: 100%;
  }
}

/* --- Emotion calendar and plan defaults --- */
.app-hero-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.emotion-calendar-page {
  width: min(960px, calc(100% - 40px));
}

.calendar-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 26px;
  border-radius: 28px;
  background: linear-gradient(135deg, #ffffff, #eef6ff);
  border: 1px solid #e5e8eb;
  box-shadow: 0 22px 54px rgba(49, 130, 246, 0.1);
}

.calendar-hero h1 {
  margin: 12px 0 8px;
  color: #191f28;
  font-size: 36px;
  letter-spacing: 0;
}

.calendar-hero p {
  margin: 0;
  color: #6b7684;
  font-weight: 700;
}

.calendar-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.calendar-summary article,
.emotion-calendar-card {
  background: #fff;
  border: 1px solid #e5e8eb;
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(25, 31, 40, 0.05);
}

.calendar-summary article {
  padding: 18px;
}

.calendar-summary span {
  display: block;
  color: #8b95a1;
  font-size: 12px;
  font-weight: 900;
}

.calendar-summary strong {
  display: block;
  margin-top: 8px;
  color: #191f28;
  font-size: 24px;
}

.emotion-calendar-card {
  padding: 18px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.calendar-toolbar a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 14px;
  background: #f2f4f6;
  color: #4e5968;
  font-weight: 900;
}

.calendar-toolbar strong {
  color: #191f28;
  font-size: 19px;
}

.calendar-weekdays,
.emotion-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekdays {
  margin-bottom: 8px;
}

.calendar-weekdays span {
  text-align: center;
  color: #8b95a1;
  font-size: 12px;
  font-weight: 900;
}

.calendar-day {
  min-height: 106px;
  border-radius: 18px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid #f2f4f6;
}

.calendar-day.empty {
  visibility: hidden;
}

.calendar-day.has-entry {
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--emotion-color) 12%, #ffffff);
  border-color: color-mix(in srgb, var(--emotion-color) 36%, #e5e8eb);
}

.day-number {
  color: #8b95a1;
  font-size: 12px;
  font-weight: 900;
}

.calendar-day strong {
  margin-top: auto;
  color: #191f28;
  font-size: 14px;
}

.calendar-day em,
.calendar-day small {
  color: var(--emotion-color);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.emotion-list {
  display: grid;
  gap: 10px;
}

.emotion-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #e5e8eb;
}

.emotion-row > span {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: color-mix(in srgb, var(--emotion-color) 14%, #ffffff);
  color: var(--emotion-color);
  font-weight: 900;
}

.emotion-row strong,
.emotion-row small {
  display: block;
}

.emotion-row strong {
  color: #191f28;
}

.emotion-row small {
  margin-top: 4px;
  color: #6b7684;
}

.admin-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 11px;
  background: #eef6ff;
  color: #1b64da;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 680px) {
  .emotion-calendar-page {
    width: calc(100% - 32px);
  }

  .calendar-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-hero .btn {
    width: 100%;
  }

  .calendar-summary {
    grid-template-columns: 1fr;
  }

  .emotion-calendar-card {
    padding: 14px;
  }

  .calendar-weekdays,
  .emotion-calendar-grid {
    gap: 5px;
  }

  .calendar-day {
    min-height: 76px;
    border-radius: 14px;
    padding: 7px;
  }

  .calendar-day strong {
    font-size: 11px;
  }

  .calendar-day em,
  .calendar-day small {
    font-size: 10px;
  }
}

/* --- Mobile app onboarding landing --- */
body:has(.onboarding-landing) {
  background: #ffffff;
}

body:has(.onboarding-landing) .site-header,
body:has(.onboarding-landing) .site-footer,
body.auth-flow-page .site-header,
body.auth-flow-page .site-footer,
body.auth-flow-page .guest-site-footer {
  display: none !important;
}

body.auth-flow-page {
  background: #ffffff;
}

.onboarding-landing {
  min-height: 100dvh;
  width: min(520px, 100%);
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: #ffffff;
  color: #191f28;
  display: flex;
  flex-direction: column;
}

.onboarding-top {
  position: absolute;
  inset: calc(env(safe-area-inset-top) + 16px) 20px auto;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
}

.onboarding-skip {
  color: #6b7684;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 12px;
}

.onboarding-slides {
  flex: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.onboarding-slides::-webkit-scrollbar {
  display: none;
}

.onboarding-slide {
  scroll-snap-align: start;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 20px) 24px 240px;
  position: relative;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.onboarding-copy {
  padding-top: 20px;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.onboarding-copy h1 {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.25;
  margin: 12px 0 8px;
  color: #191f28;
}

.onboarding-copy p {
  font-size: 16px;
  color: #4e5968;
  line-height: 1.6;
  font-weight: 500;
}

.onboarding-visual {
  flex: 1;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 300px;
}

.visual-inner {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 40px;
  background: transparent;
  overflow: visible;
}

.chat-mockup {
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 20px;
}

.chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateY(10px);
  animation: bubbleFadeIn 0.5s ease forwards;
}

.chat-bubble:nth-child(1) { animation-delay: 0.2s; }
.chat-bubble:nth-child(2) { animation-delay: 0.9s; }
.chat-bubble:nth-child(3) { animation-delay: 1.6s; }
.chat-bubble:nth-child(4) { animation-delay: 2.3s; }
.chat-bubble:nth-child(5) { animation-delay: 3.0s; }

@keyframes bubbleFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-bubble.left {
  align-self: flex-start;
  background: #eef4ff;
  color: #3182f6;
  border-bottom-left-radius: 4px;
}

.chat-bubble.right {
  align-self: flex-end;
  background: #ffffff;
  color: #191f28;
  border-bottom-right-radius: 4px;
}

.friend-grid-onboarding {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 12px 0;
  height: 100%;
}

.friend-mini-card {
  background: #fff;
  border-radius: 24px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.friend-mini-card img {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  object-fit: cover;
  margin-bottom: 10px;
}

.friend-mini-card .onboarding-gif-avatar {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  margin-bottom: 10px;
  overflow: hidden;
}

.friend-mini-card .onboarding-gif-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  margin-bottom: 0;
}

.friend-mini-card .avatar-placeholder {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: #34517c;
  margin-bottom: 10px;
}

.friend-mini-card strong { font-size: 15px; color: #191f28; }
.friend-mini-card small {
  display: block;
  font-size: 11px;
  color: #6b7684;
  margin-top: 2px;
  line-height: 1.45;
}

.mini-calendar-container {
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 32px;
  padding: 20px 16px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
}

.mini-calendar-header {
  font-size: 17px;
  font-weight: 900;
  margin-bottom: 16px;
  color: #191f28;
  padding-left: 4px;
}

.mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-dot {
  aspect-ratio: 1;
  border-radius: 10px;
  background: #f2f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #adb5bd;
  transition: all 0.3s ease;
}

.calendar-dot.has-emoji {
  background: #ffffff;
  font-size: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #f2f4f6;
}

.features-grid {
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
}

.feature-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.feature-icon {
  font-size: 28px;
}

.feature-card strong {
  font-size: 13px;
  color: #191f28;
  white-space: nowrap;
}

.service-summary-card {
  position: relative;
  margin-top: 24px;
  background: transparent;
  color: #3182f6;
  padding: 12px;
  text-align: center;
}

.service-summary-card strong { display: block; font-size: 18px; margin-bottom: 8px; }
.service-summary-card p { font-size: 14px; color: rgba(255, 255, 255, 0.8); margin: 0; line-height: 1.5; }

.onboarding-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 16px 24px calc(env(safe-area-inset-bottom) + 20px);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 100;
}

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.onboarding-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5e8eb;
  transition: all 0.3s ease;
}

.onboarding-dots span.active {
  width: 24px;
  border-radius: 4px;
  background: #3182f6;
}

.onboarding-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.onboarding-btns .btn {
  width: 100%;
  height: 60px;
  border-radius: 18px;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

@media (max-height: 740px) {
  .onboarding-slide {
    padding-top: calc(env(safe-area-inset-top) + 40px);
    padding-bottom: calc(env(safe-area-inset-bottom) + 140px);
  }
  .onboarding-copy {
    padding-top: 16px;
  }
  .onboarding-copy h1 {
    font-size: 26px;
    margin: 8px 0 6px;
  }
  .onboarding-copy p {
    font-size: 15px;
  }
  .chat-mockup {
    gap: 8px;
  }
  .chat-bubble {
    padding: 10px 14px;
    font-size: 13px;
  }
  .mini-calendar-container {
    padding: 16px 12px;
  }
  .mini-calendar-header {
    font-size: 15px;
    margin-bottom: 12px;
  }
  .mini-calendar-grid {
    gap: 6px;
  }
}

.primary-btn {
  background: var(--btn-primary-bg);
  color: #ffffff;
  box-shadow: var(--btn-primary-shadow);
}

.login-link {
  text-align: center;
  color: #6b7684;
  font-size: 15px;
  font-weight: 600;
  margin-top: 8px;
}

@media (min-width: 1100px) {
  .onboarding-landing {
    height: 90vh;
    margin-top: 5vh;
    border-radius: 32px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.1);
  }
  .onboarding-slide {
    height: 90vh;
  }
  .onboarding-actions {
    position: absolute;
    bottom: 0;
  }
}

/* PWA viewport fix for tutorial landing */
body:has(.onboarding-landing):not(:has(.auth-tutorial-page)) {
  overflow: hidden;
}

.onboarding-landing:not(.auth-tutorial-page) {
  --onboarding-action-height: calc(132px + env(safe-area-inset-bottom));
  height: var(--app-height, 100svh);
  min-height: 0;
  max-height: var(--app-height, 100svh);
}

.onboarding-landing:not(.auth-tutorial-page) .onboarding-slides {
  flex: 0 0 auto;
  height: calc(var(--app-height, 100svh) - var(--onboarding-action-height));
  min-height: 0;
}

.onboarding-landing:not(.auth-tutorial-page) .onboarding-slide {
  height: calc(var(--app-height, 100svh) - var(--onboarding-action-height));
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  padding: calc(env(safe-area-inset-top) + 44px) 24px 14px;
}

.onboarding-landing:not(.auth-tutorial-page) .onboarding-copy {
  order: 1;
  padding-top: 0;
  margin-bottom: 0;
}

.onboarding-landing:not(.auth-tutorial-page) .onboarding-copy h1 {
  font-size: clamp(31px, 8.2vw, 43px);
  line-height: 1.16;
  margin: 10px 0 8px;
}

.onboarding-landing:not(.auth-tutorial-page) .onboarding-copy p {
  font-size: clamp(15px, 4.1vw, 19px);
  line-height: 1.55;
}

.onboarding-landing:not(.auth-tutorial-page) .onboarding-visual {
  order: 2;
  min-height: 0;
  height: auto;
  align-items: stretch;
  overflow: hidden;
}

.onboarding-landing:not(.auth-tutorial-page) .visual-inner {
  min-height: 0;
  overflow: visible;
}

.onboarding-landing:not(.auth-tutorial-page) .chat-mockup {
  height: 100%;
  justify-content: space-evenly;
  gap: 8px;
  padding-bottom: 0;
}

.onboarding-landing:not(.auth-tutorial-page) .chat-bubble {
  padding: 11px 15px;
  font-size: clamp(13px, 3.6vw, 16px);
}

.onboarding-landing:not(.auth-tutorial-page) .onboarding-actions {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  height: var(--onboarding-action-height);
  padding: 9px 24px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.onboarding-landing:not(.auth-tutorial-page) .onboarding-dots {
  margin-bottom: 10px;
}

.onboarding-landing:not(.auth-tutorial-page) .onboarding-btns .btn {
  height: 56px;
}

@media (max-height: 760px) {
  .onboarding-landing:not(.auth-tutorial-page) {
    --onboarding-action-height: calc(118px + env(safe-area-inset-bottom));
  }

  .onboarding-landing:not(.auth-tutorial-page) .onboarding-slide {
    gap: 12px;
    padding-top: calc(env(safe-area-inset-top) + 30px);
    padding-bottom: 10px;
  }

  .onboarding-landing:not(.auth-tutorial-page) .onboarding-copy h1 {
    font-size: clamp(28px, 7.4vw, 36px);
  }

  .onboarding-landing:not(.auth-tutorial-page) .onboarding-copy p {
    font-size: 14px;
    line-height: 1.45;
  }

  .onboarding-landing:not(.auth-tutorial-page) .chat-bubble {
    padding: 9px 13px;
    font-size: 13px;
  }
}

/* --- diary_call.php mobile app layout fix --- */
@media (max-width: 700px) {
  body:has(.diary-home) {
    background: #f6f8fb;
    overflow-x: hidden;
  }

  body:has(.diary-home) .site-header {
    position: sticky;
    top: 0;
    border-bottom: 1px solid #e5e8eb;
  }

  .site-header-inner {
    max-width: none;
  }

  .app-shell.diary-home {
    width: 100%;
    padding: 18px 16px 72px;
    overflow: hidden;
  }

  .home-dashboard,
  .home-main,
  .home-side {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    width: 100%;
  }

  .home-side {
    position: static;
  }

  .app-hero {
    min-height: auto;
    border-radius: 30px;
    padding: 26px 22px 28px;
    box-shadow: 0 18px 42px rgba(49, 130, 246, .1);
  }

  .app-topline {
    align-items: flex-start;
  }

  .app-name {
    font-size: 17px;
  }

  .app-hero-links {
    flex: 0 0 auto;
  }

  .app-hero h1 {
    margin: 58px 0 12px;
    font-size: 40px;
    line-height: 1.12;
  }

  .app-hero p {
    font-size: 15px;
    line-height: 1.65;
  }

  .mini-status {
    margin-top: 24px;
  }

  .primary-action-card {
    padding: 22px;
    border-radius: 28px;
  }

  .primary-action-card form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .call-ready-text strong {
    font-size: 28px;
    line-height: 1.22;
  }

  .call-orb {
    width: 100%;
    min-width: 0;
    height: 72px;
    border-radius: 24px;
    justify-self: stretch;
  }

  .call-left {
    margin: -8px 0 0;
  }

  .home-side .home-section,
  .usage-soft,
  .warm-tips {
    padding: 20px;
    border-radius: 24px;
  }

  .friend-scroll {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
    padding: 0;
  }

  .friend-card {
    width: 100%;
    min-width: 0;
  }

  .diary-preview {
    border-radius: 22px;
  }
}

/* --- UX polish: drawer, auth, lists, call controls --- */
.is-js body {
  opacity: 0;
  transition: opacity .28s ease;
}

.is-js body.page-ready {
  opacity: 1;
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 15px;
  background: #f2f4f6;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.menu-button span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #191f28;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(25,31,40,.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.user-menu-drawer {
  position: fixed;
  top: 0;
  right: -380px;
  z-index: 1300;
  width: min(360px, 88vw);
  height: 100dvh;
  min-height: 100dvh;
  max-height: none;
  padding: calc(env(safe-area-inset-top) + 22px) 22px calc(env(safe-area-inset-bottom) + 22px);
  background: #fff;
  box-shadow: -24px 0 70px rgba(25,31,40,.16);
  transform: none;
  transition: right .28s cubic-bezier(.16,1,.3,1);
  box-sizing: border-box;
}

body.menu-open .menu-overlay {
  opacity: 1;
  pointer-events: auto;
}

body.menu-open .user-menu-drawer {
  right: 0;
}

.menu-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 15px;
  background: #f2f4f6;
  font-size: 26px;
  color: #4e5968;
}

.drawer-profile {
  margin-top: 22px;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, #eef6ff, #ffffff);
}

.drawer-profile strong,
.drawer-profile small,
.drawer-nav a {
  display: block;
}

.drawer-profile strong {
  margin-top: 12px;
  color: #191f28;
  font-size: 20px;
}

.drawer-profile small {
  margin-top: 4px;
  color: #8b95a1;
}

.drawer-nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.drawer-nav a {
  border-radius: 18px;
  padding: 16px;
  background: #f8fafc;
  color: #191f28;
  font-weight: 900;
}

.drawer-nav .drawer-danger {
  color: #f04452;
}

.auth-modern {
  align-items: stretch;
  background: linear-gradient(180deg, #eef4ff, #ffffff);
}

.auth-modern-card {
  position: relative;
  width: min(430px, calc(100% - 32px));
  border-radius: 32px;
  padding: 30px 26px;
}

.auth-back {
  position: absolute;
  right: 22px;
  top: 22px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 13px;
  background: #f2f4f6;
  color: #4e5968;
  font-size: 13px;
  font-weight: 900;
}

.auth-modern-card h1 {
  margin: 22px 0 8px;
  color: #191f28;
  font-size: 34px;
  line-height: 1.18;
  letter-spacing: 0;
}

.visual-start .start-auth-card {
  position: absolute;
  left: 28px;
  right: 28px;
  border-radius: 28px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 24px 54px rgba(25,31,40,.1);
}

.visual-start .start-auth-card.primary {
  top: 78px;
}

.visual-start .start-auth-card.secondary {
  top: 242px;
}

.start-auth-card span,
.start-auth-card small {
  display: block;
  color: #6b7684;
  font-weight: 800;
}

.start-auth-card strong {
  display: block;
  margin: 8px 0;
  color: #191f28;
  font-size: 30px;
}

.mbti-quick-grid {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.mbti-chip {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 11px;
  background: #eef6ff;
  color: #1b64da;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.diary-month-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
}

.diary-month-tabs a {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 10px 14px;
  background: #f2f4f6;
  color: #6b7684;
  font-weight: 900;
}

.diary-month-tabs a.active {
  background: #3182f6;
  color: #fff;
}

.diary-month-group {
  display: grid;
  gap: 14px;
}

.diary-month-group h2 {
  margin: 10px 0 0;
  color: #191f28;
  font-size: 22px;
}

.diary-topic-group {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid #e5e8eb;
}

.topic-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topic-group-head strong {
  color: #191f28;
}

.topic-group-head span {
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef6ff;
  color: #1b64da;
  font-size: 12px;
  font-weight: 900;
}

.diary-topic-group .diary-entry-card {
  box-shadow: none;
  background: #f8fafc;
}

.keypad-grid {
  grid-template-columns: repeat(4, 1fr);
}

.keypad-btn.active .icon-circle {
  background: #3182f6;
}

@media (max-width: 700px) {
  .site-nav {
    display: none;
  }

  .menu-button {
    display: inline-flex;
  }

  .brand small {
    display: none;
  }

  .auth-page {
    padding: 18px;
  }

  .auth-modern-card {
    margin: auto 0;
  }

  .keypad-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .keypad-btn {
    width: 58px;
  }

  .keypad-btn .icon-circle {
    width: 48px;
    height: 48px;
  }

  .keypad-btn span {
    font-size: 11px;
  }
}

/* --- Diary UX follow-up: stable drawer, avatars, calendar reviews, result tabs --- */
body.menu-open {
  overflow: hidden;
}

body:not(.menu-open) .menu-overlay,
body:not(.menu-open) .user-menu-drawer {
  visibility: hidden;
  pointer-events: none;
}

.menu-overlay,
.user-menu-drawer {
  will-change: opacity, transform;
}

body.menu-open .menu-overlay,
body.menu-open .user-menu-drawer {
  visibility: visible;
}

.drawer-profile em {
  display: inline-flex;
  margin-top: 12px;
  border-radius: 999px;
  padding: 7px 10px;
  background: #e8f3ff;
  color: #1b64da;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.friend-avatar.has-image,
.big-friend-avatar.has-image,
.avatar-circle-main.has-image,
.hero-avatar.has-image,
.chip-avatar.has-image {
  overflow: hidden;
  background: #eef4ff;
  color: transparent;
}

.friend-avatar.has-image img,
.big-friend-avatar.has-image img,
.avatar-circle-main.has-image img,
.hero-avatar.has-image img,
.chip-avatar.has-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.admin-character-cell,
.character-image-admin {
  display: flex;
  align-items: center;
  gap: 14px;
}

.character-image-admin {
  justify-content: space-between;
  border-radius: 20px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e5e8eb;
}

.character-image-admin label,
.character-image-admin small {
  display: block;
}

.character-image-admin small {
  margin-top: 8px;
  color: #8b95a1;
  font-weight: 700;
}

.admin-avatar-preview {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  flex: 0 0 auto;
}

.admin-table-avatar {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  flex: 0 0 auto;
}

.diary-entry-card {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.diary-entry-link {
  min-width: 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.diary-delete-btn {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: #fff1f2;
  color: #f04452;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.diary-delete-btn:disabled {
  opacity: .55;
  cursor: wait;
}

.hero-delete {
  background: #fff1f2;
}

.calendar-day.selected {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--emotion-color) 18%, transparent);
}

.daily-review-panel {
  margin-top: 18px;
}

.daily-review-card {
  border: 1px solid color-mix(in srgb, var(--emotion-color) 24%, #e5e8eb);
  border-radius: 26px;
  padding: 22px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--emotion-color) 9%, #fff), #fff);
  box-shadow: 0 18px 44px rgba(25, 31, 40, .05);
}

.daily-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.daily-review-head span,
.daily-review-card p,
.included-diary-list small {
  color: #6b7684;
}

.daily-review-head h2 {
  margin: 6px 0 0;
  color: #191f28;
  font-size: 28px;
}

.daily-review-head > strong {
  min-width: 62px;
  min-height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: var(--emotion-color);
  color: #fff;
  font-size: 18px;
}

.daily-review-card p {
  margin: 16px 0 0;
  line-height: 1.75;
  font-weight: 700;
}

.daily-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.daily-highlights span {
  border-radius: 999px;
  padding: 8px 11px;
  background: #fff;
  color: #191f28;
  font-size: 12px;
  font-weight: 900;
}

.included-diary-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.emotion-row.compact {
  grid-template-columns: 44px minmax(0, 1fr);
}

.tiny-avatar {
  width: 44px;
  height: 44px;
  border-radius: 15px;
}

.result-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-hero-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 18px;
  border-radius: 28px;
  padding: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--emotion-color) 10%, #fff), #fff);
  border: 1px solid color-mix(in srgb, var(--emotion-color) 18%, #e5e8eb);
}

.result-avatar {
  width: 58px;
  height: 58px;
  border-radius: 20px;
}

.result-hero-card span,
.result-hero-card p {
  color: #6b7684;
  font-weight: 800;
}

.result-hero-card h1 {
  margin: 4px 0;
}

.result-tabs {
  position: sticky;
  top: 74px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 18px 0;
  border-radius: 20px;
  padding: 6px;
  background: rgba(242, 244, 246, .92);
  backdrop-filter: blur(14px);
}

.result-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: #6b7684;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.result-tabs button.active {
  background: #fff;
  color: #191f28;
  box-shadow: 0 8px 18px rgba(25,31,40,.07);
}

.result-tab-panel {
  display: none;
}

.result-tab-panel.active {
  display: block;
}

.handwritten-diary {
  font-family: "Gowun Batang", Georgia, "Apple SD Gothic Neo", serif;
  font-size: 20px;
  line-height: 1.9;
  color: #243047;
}

.emotion-detail-card {
  border-radius: 26px;
  padding: 22px;
  background: color-mix(in srgb, var(--emotion-color) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--emotion-color) 24%, #e5e8eb);
}

.emotion-detail-card span,
.emotion-detail-card strong {
  display: block;
}

.emotion-detail-card span {
  color: #6b7684;
  font-weight: 900;
}

.emotion-detail-card h2 {
  margin: 8px 0;
  color: #191f28;
  font-size: 32px;
}

.emotion-detail-card strong {
  color: var(--emotion-color);
  font-size: 22px;
}

.result-transcript-log {
  height: auto;
  max-height: 620px;
  padding: 0;
}

.result-hero-card {
  grid-template-columns: minmax(0, 1fr);
}

.result-action-row {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.result-message-list {
  display: grid;
  gap: 12px;
}

.result-message {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border-radius: 20px;
  padding: 14px;
  background: #fff;
  border: 1px solid #e5e8eb;
}

.result-message.ai {
  background: #f8fafc;
}

.result-message strong {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef6ff;
  color: #1b64da;
  font-size: 13px;
}

.result-message.user strong {
  background: #191f28;
  color: #fff;
}

.result-message p {
  margin: 0;
  color: #191f28;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.diary-writing-screen {
  min-height: calc(100dvh - 160px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
}

.writing-avatar-wrap {
  position: relative;
  width: 136px;
  height: 136px;
  display: grid;
  place-items: center;
}

.writing-avatar {
  width: 86px;
  height: 86px;
  border-radius: 30px;
  position: relative;
  z-index: 2;
}

.writing-avatar-wrap > span:not(.writing-avatar) {
  position: absolute;
  inset: 16px;
  border-radius: 36px;
  border: 1px solid rgba(49,130,246,.22);
  animation: diaryPulse 1.8s ease-out infinite;
}

.writing-avatar-wrap > span:nth-of-type(2) {
  animation-delay: .35s;
}

.writing-avatar-wrap > span:nth-of-type(3) {
  animation-delay: .7s;
}

@keyframes diaryPulse {
  0% { opacity: .8; transform: scale(.82); }
  100% { opacity: 0; transform: scale(1.35); }
}

.diary-writing-screen h1 {
  margin: 0;
  color: #191f28;
  font-size: clamp(30px, 8vw, 46px);
  line-height: 1.14;
}

.diary-writing-screen p,
.diary-writing-screen small {
  color: #6b7684;
  font-weight: 800;
}

.writing-progress {
  width: min(280px, 70vw);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e8eb;
}

.writing-progress i {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: #3182f6;
  animation: writingBar 1.2s ease-in-out infinite alternate;
}

@keyframes writingBar {
  from { transform: translateX(-20%); }
  to { transform: translateX(160%); }
}

.billing-page {
  width: 100%;
}

.app-main.billing-page .app-container {
  width: min(760px, calc(100% - var(--app-gutter) * 2));
  max-width: 100%;
  margin-inline: auto;
  box-sizing: border-box;
}

.billing-page-header {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 24px;
}

.billing-page-header .page-back {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f6f8fb;
  color: #191f28;
  font-size: 24px;
  text-decoration: none;
  margin-top: 2px;
}

.billing-page-header .app-page-title {
  margin-bottom: 6px;
}

.billing-page-subtitle {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #8b95a1;
  line-height: 1.5;
}

.billing-current-card {
  background: linear-gradient(135deg, rgba(226, 239, 255, .96), rgba(247, 250, 255, .92)), #fff;
  border: 1px solid rgba(49, 130, 246, 0.12);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 12px 32px rgba(49, 130, 246, 0.08);
}

.billing-current-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.billing-current-label {
  font-size: 13px;
  font-weight: 700;
  color: #8b95a1;
}

.billing-current-badge {
  font-size: 12px;
  font-weight: 800;
  color: #3182f6;
  background: #e8f3ff;
  padding: 4px 10px;
  border-radius: 999px;
}

.billing-current-plan {
  display: block;
  font-size: 28px;
  font-weight: 900;
  color: #191f28;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}

.billing-usage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.billing-usage-item {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 16px;
  padding: 14px;
}

.billing-usage-item span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #8b95a1;
  margin-bottom: 6px;
}

.billing-usage-item strong {
  display: block;
  font-size: 18px;
  font-weight: 900;
  color: #191f28;
  margin-bottom: 10px;
}

.billing-progress {
  height: 6px;
  border-radius: 999px;
  background: #eef1f4;
  overflow: hidden;
}

.billing-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #3182f6;
}

.billing-progress--soft i {
  background: #8eb9ff;
}

.billing-pending-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
  border-radius: 18px;
  background: #fff7ed;
  border: 1px solid #ffe2c4;
  text-decoration: none;
  color: inherit;
}

.billing-pending-banner strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #191f28;
}

.billing-pending-banner p {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #e67e00;
}

.billing-pending-cta {
  font-size: 14px;
  font-weight: 800;
  color: #e67e00;
  white-space: nowrap;
}

.billing-plans-section {
  margin-top: 8px;
}

.billing-section-head {
  margin-bottom: 14px;
}

.billing-section-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 900;
  color: #191f28;
}

.billing-section-head p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #8b95a1;
}

.billing-plan-list {
  display: grid;
  gap: 12px;
}

.billing-plan-card {
  width: 100%;
  text-align: left;
  border: 1.5px solid #eef1f4;
  border-radius: 20px;
  background: #fff;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  box-shadow: 0 4px 14px rgba(25, 31, 40, 0.03);
}

.billing-plan-card:active:not(:disabled) {
  transform: scale(0.985);
}

.billing-plan-card.is-current {
  border-color: #3182f6;
  background: #f8fbff;
  cursor: default;
}

.billing-plan-card.is-popular:not(.is-current) {
  border-color: #c9e2ff;
}

.billing-plan-card:disabled {
  opacity: 1;
}

.billing-plan-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.billing-plan-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 900;
  color: #191f28;
}

.billing-plan-card p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #6b7684;
  line-height: 1.45;
}

.billing-plan-tag {
  display: inline-block;
  margin-bottom: 8px;
  margin-right: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #3182f6;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.billing-plan-tag--current {
  background: #e8f3ff;
  color: #3182f6;
}

.billing-plan-price strong {
  display: block;
  font-size: 22px;
  font-weight: 900;
  color: #191f28;
  text-align: right;
}

.billing-plan-price strong span {
  font-size: 16px;
  font-weight: 800;
}

.billing-plan-price small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: #8b95a1;
  text-align: right;
}

.billing-plan-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.billing-plan-features li {
  font-size: 12px;
  font-weight: 700;
  color: #4e5968;
  background: #f2f4f6;
  padding: 6px 10px;
  border-radius: 999px;
}

.billing-plan-card.is-current .billing-plan-features li {
  background: #e8f3ff;
  color: #3182f6;
}

.billing-footnote {
  margin: 24px 0 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #adb5bd;
  line-height: 1.6;
}

.billing-modal-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: #3182f6;
}

/* Plan apply bottom sheet */
.billing-apply-modal .billing-apply-sheet {
  padding: 10px 20px 0;
  max-height: min(92dvh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.billing-apply-handle {
  width: 40px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: #e5e8eb;
}

.billing-apply-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.billing-apply-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #8b95a1;
}

.billing-apply-title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  color: #191f28;
  letter-spacing: -0.02em;
}

.billing-apply-close {
  flex-shrink: 0;
  margin-top: 2px;
}

.billing-apply-summary {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(145deg, #f0f7ff 0%, #ffffff 58%);
  border: 1px solid #d6e8ff;
}

.billing-apply-summary-top {
  margin-bottom: 12px;
}

.billing-apply-plan-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #3182f6;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.billing-apply-plan-desc {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #4e5968;
  line-height: 1.5;
}

.billing-apply-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 14px;
}

.billing-apply-price {
  font-size: 28px;
  font-weight: 900;
  color: #191f28;
  letter-spacing: -0.03em;
}

.billing-apply-period {
  font-size: 14px;
  font-weight: 700;
  color: #8b95a1;
}

.billing-apply-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.billing-apply-features li {
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e8f0ff;
  font-size: 12px;
  font-weight: 800;
  color: #3182f6;
}

.billing-apply-form {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
}

.billing-apply-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
  color: #191f28;
}

.billing-apply-field input {
  width: 100%;
  height: 52px;
  border: 1px solid #e5e8eb;
  border-radius: 14px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 700;
  color: #191f28;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.billing-apply-field input:focus {
  outline: none;
  border-color: #3182f6;
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.12);
}

.billing-apply-field-hint {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #8b95a1;
  line-height: 1.45;
}

.billing-apply-info-card {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f9fafb;
  border: 1px solid #f2f4f6;
}

.billing-apply-info-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.billing-apply-info-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #e8f3ff;
  color: #3182f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}

.billing-apply-info-row strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 800;
  color: #191f28;
}

.billing-apply-info-row p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #6b7684;
  line-height: 1.5;
}

.billing-apply-info-row em {
  font-style: normal;
  font-weight: 800;
  color: #3182f6;
}

.billing-apply-policy-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 800;
  color: #8b95a1;
  text-decoration: none;
}

.billing-apply-policy-link:hover {
  color: #3182f6;
}

.billing-apply-footer {
  flex-shrink: 0;
  padding: 12px 0 calc(env(safe-area-inset-bottom) + 16px);
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 28%);
}

body.app-has-bottom-nav .billing-apply-modal .billing-apply-footer,
body:has(.app-bottom-nav) .billing-apply-modal .billing-apply-footer {
  padding-bottom: calc(env(safe-area-inset-bottom) + var(--bottom-nav-height) + 12px);
}

.billing-apply-submit {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  background: #3182f6;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(49, 130, 246, 0.28);
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.billing-apply-submit:active:not(:disabled) {
  transform: scale(0.985);
}

.billing-apply-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.billing-modal-body {
  display: grid;
  gap: 12px;
}

.billing-input-field span {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
  color: #191f28;
}

.billing-input-field input {
  width: 100%;
  height: 52px;
  border: 1px solid #e5e8eb;
  border-radius: 14px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 600;
  background: #f9fafb;
  box-sizing: border-box;
}

.billing-input-hint {
  margin: -4px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #8b95a1;
}

.billing-submit-btn {
  width: 100%;
  min-height: 56px;
  margin-top: 8px;
  border: 0;
  border-radius: 16px;
  background: #3182f6;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(49, 130, 246, 0.24);
}

.billing-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.billing-page .binding-payment-panel {
  margin-top: 4px;
}

.billing-hero {
  padding: 24px 0 8px;
}

.billing-hero a {
  color: #3182f6;
  font-weight: 900;
}

.billing-hero h1 {
  margin: 12px 0 6px;
  color: #191f28;
  font-size: 38px;
}

.billing-hero p {
  color: #6b7684;
  font-weight: 800;
}

.current-plan-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border-radius: 30px;
  padding: 24px;
  background: linear-gradient(135deg, #eef6ff, #fff);
  border: 1px solid #e5e8eb;
}

.current-plan-card span,
.current-plan-card small {
  display: block;
  color: #6b7684;
  font-weight: 800;
}

.current-plan-card strong {
  display: block;
  margin-top: 6px;
  color: #191f28;
  font-size: 30px;
}

.plan-usage-ring {
  min-width: 118px;
  min-height: 118px;
  display: grid;
  place-items: center;
  border-radius: 34px;
  background: #3182f6;
  color: #fff;
  text-align: center;
}

.plan-usage-ring strong,
.plan-usage-ring span {
  margin: 0;
  color: #fff;
}

.plan-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.plan-purchase-card {
  position: relative;
  display: grid;
  gap: 12px;
  border-radius: 26px;
  padding: 22px;
  background: #fff;
  border: 1px solid #e5e8eb;
  box-shadow: 0 18px 38px rgba(25,31,40,.05);
}

.plan-purchase-card.active {
  border-color: #3182f6;
}

.plan-purchase-card h2 {
  margin: 0;
}

.plan-purchase-card p,
.plan-purchase-card li {
  color: #6b7684;
  font-weight: 800;
}

.plan-purchase-card ul {
  display: grid;
  gap: 7px;
  padding-left: 18px;
}

.plan-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  border-radius: 999px;
  padding: 6px 9px;
  background: #e8f3ff;
  color: #1b64da;
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 700px) {
  .character-image-admin,
  .current-plan-card {
    align-items: stretch;
    flex-direction: column;
  }

  .emotion-calendar-page,
  .billing-page .app-container {
    width: min(460px, calc(100% - var(--app-gutter) * 2));
  }

  .calendar-summary {
    grid-template-columns: 1fr;
  }

  .calendar-day {
    min-height: 76px;
    padding: 8px;
  }

  .calendar-day strong {
    font-size: 12px;
  }

  .calendar-day em,
  .calendar-day small {
    font-size: 11px;
  }

  .result-tabs {
    top: 12px;
  }

  .handwritten-diary {
    font-size: 18px;
  }

  .diary-entry-card {
    grid-template-columns: 1fr;
  }

  .diary-delete-btn {
    justify-self: end;
  }
}

/* --- Dedicated admin shell --- */
.admin-body {
  background: #f4f6fb;
  min-height: 100vh;
}

.admin-shell-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(15, 23, 42, .96);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
}

.admin-shell-inner {
  width: min(1440px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
}

.admin-shell-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 900;
}

.admin-shell-brand span {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: #3182f6;
}

.admin-shell-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}

.admin-shell-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  padding: 0 13px;
  color: rgba(255,255,255,.72);
  font-weight: 800;
  white-space: nowrap;
}

.admin-shell-nav a.active,
.admin-shell-nav a:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.admin-shell-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
}

.admin-shell-user span {
  color: rgba(255,255,255,.78);
}

.admin-shell-user a {
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255,255,255,.1);
  color: #fff;
}

.admin-professional-page,
.admin-dashboard,
.admin-print-page {
  padding-top: 28px;
}

.admin-professional-page .admin-console-head,
.admin-dashboard .admin-console-head,
.admin-print-page .admin-console-head {
  border-radius: 28px;
  padding: 24px;
  background: linear-gradient(135deg, #fff, #eef6ff);
  border: 1px solid #e5e8eb;
  box-shadow: 0 18px 48px rgba(25,31,40,.05);
}

.admin-table {
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(25,31,40,.05);
}

.admin-table th {
  background: #f8fafc;
  color: #4e5968;
}

.admin-shell-footer {
  width: min(1440px, calc(100% - 40px));
  margin: 34px auto 24px;
  display: flex;
  justify-content: space-between;
  color: #8b95a1;
  font-size: 12px;
  font-weight: 800;
}

.admin-print-paper {
  margin-top: 18px;
  border-radius: 28px;
  padding: 42px;
  background: #fff;
  border: 1px solid #e5e8eb;
  box-shadow: 0 22px 58px rgba(25,31,40,.06);
}

.admin-print-meta {
  color: #6b7684;
  font-size: 13px;
  font-weight: 800;
}

.admin-print-paper h2 {
  margin: 14px 0 20px;
  color: #111827;
  font-size: 34px;
}

.admin-print-summary {
  color: #1f2937;
  font-size: 17px;
  line-height: 1.9;
  white-space: normal;
}

.admin-print-messages {
  margin-top: 30px;
  border-top: 1px solid #e5e8eb;
  padding-top: 22px;
}

.admin-print-messages h3 {
  margin: 0 0 14px;
}

.admin-print-messages p {
  margin: 0 0 14px;
  border-radius: 16px;
  padding: 14px;
  background: #f8fafc;
}

.admin-print-messages strong,
.admin-print-messages span {
  display: block;
}

.admin-print-messages strong {
  color: #3182f6;
  font-size: 12px;
  margin-bottom: 4px;
}

@media print {
  .admin-shell-header,
  .admin-shell-footer,
  .admin-print-page .admin-console-head {
    display: none;
  }

  body.admin-body {
    background: #fff;
  }

  .admin-print-page {
    width: 100%;
    padding: 0;
    margin: 0;
  }

  .admin-print-paper {
    margin: 0;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }
}

@media (max-width: 920px) {
  .admin-shell-inner {
    grid-template-columns: 1fr;
    padding: 14px 0;
  }

  .admin-shell-user {
    flex-wrap: wrap;
  }

}

@media (max-width: 700px) {
  .result-message {
    grid-template-columns: 1fr;
  }

  .admin-print-paper {
    padding: 24px 18px;
  }
}

/* --- Admin page refinements: separate pages, modal forms, clean tables --- */
.admin-page-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 18px;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e5e8eb;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(25,31,40,.05);
}

.admin-table-wrap .admin-table {
  min-width: 920px;
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  border-collapse: separate;
  border-spacing: 0;
}

.admin-table th,
.admin-table td {
  padding: 17px 18px;
  border-bottom: 1px solid #edf0f3;
  text-align: left;
  vertical-align: middle;
}

.admin-table thead th {
  background: #f8fafc;
  color: #4e5968;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.admin-table tbody tr {
  transition: background .18s ease;
}

.admin-table tbody tr:hover {
  background: #f9fbff;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table .btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  white-space: nowrap;
}

.admin-table select {
  min-height: 40px;
  border: 1px solid #d9dee7;
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  font-weight: 800;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}

.admin-modal.open {
  display: block;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.admin-modal-panel {
  position: absolute;
  top: 24px;
  right: 24px;
  bottom: 24px;
  width: min(760px, calc(100vw - 48px));
  overflow: auto;
  border-radius: 28px;
  padding: 26px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(15, 23, 42, .28);
}

.admin-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.admin-modal-head h2 {
  margin: 8px 0 0;
  color: #191f28;
  font-size: 28px;
  letter-spacing: -.03em;
}

.admin-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: #f2f4f6;
  color: #4e5968;
  font-size: 24px;
  font-weight: 900;
}

@media (max-width: 720px) {
  .admin-modal-panel {
    inset: auto 12px 12px;
    top: 62px;
    width: calc(100vw - 24px);
    border-radius: 24px;
    padding: 20px;
  }

  .admin-page-actions {
    justify-content: stretch;
  }

  .admin-page-actions .btn {
    width: 100%;
  }
}

/* --- App home v2 --- */
body:has(.diary-home) {
  background:
    radial-gradient(circle at 20% 0%, rgba(168, 132, 255, .18), transparent 280px),
    radial-gradient(circle at 80% 9%, rgba(255, 211, 227, .55), transparent 300px),
    #fff;
}

/* Ensure header/footer visibility */
body:has(.diary-home) .site-header,
body:has(.diary-home) .site-footer {
  display: block !important;
}

.app-shell.diary-home {
  width: min(920px, 100%);
  padding: 0 0 96px;
}

.home-mobile-frame {
  width: min(860px, 100%);
  margin: 0 auto;
  min-height: 100svh;
  padding: 24px 36px 112px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.76), rgba(255,255,255,.94) 38%, rgba(251,247,255,.96)),
    radial-gradient(circle at 78% 14%, rgba(180, 137, 255, .18), transparent 220px);
}

.home-statusbar,
.home-appbar,
.home-app-actions,
.home-brand,
.section-heading,
.home-call-time,
.home-tabbar {
  display: flex;
  align-items: center;
}

.home-statusbar {
  justify-content: space-between;
  color: #0f172a;
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 28px;
}

.home-appbar {
  justify-content: space-between;
  gap: 16px;
}

.home-brand {
  gap: 14px;
  color: #171b32;
}

.home-brand-mark {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #c9b6ff, #8d68dd);
  color: #fff;
  font-size: 34px;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(141,104,221,.22);
}

.home-brand strong,
.home-brand small {
  display: block;
}

.home-brand strong {
  font-size: 26px;
  letter-spacing: -.04em;
}

.home-brand small {
  margin-top: 3px;
  color: #6b7280;
  font-size: 15px;
  font-weight: 800;
}

.home-app-actions {
  gap: 16px;
}

.round-icon {
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.9);
  color: #334155;
  font-family: inherit;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 16px 36px rgba(102, 77, 145, .1);
  cursor: pointer;
}

.home-hero-v2 {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, .86fr);
  align-items: end;
  gap: 12px;
  min-height: 320px;
  margin-top: 38px;
}

.home-hero-copy {
  position: relative;
  z-index: 2;
  padding-bottom: 26px;
}

.home-hero-copy h1 {
  margin: 0;
  color: #19213b;
  font-size: clamp(42px, 8vw, 66px);
  line-height: 1.12;
  letter-spacing: -.06em;
}

.home-hero-copy h1 span {
  color: #8b6fdd;
}

.home-hero-copy p {
  margin: 28px 0 0;
  color: #5c6574;
  font-size: 20px;
  line-height: 1.6;
  font-weight: 800;
}

.home-hero-friend {
  position: relative;
  min-height: 285px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.home-speech {
  position: absolute;
  left: -16px;
  top: 84px;
  z-index: 3;
  border-radius: 20px;
  padding: 14px 18px;
  background: rgba(255,255,255,.92);
  color: #334155;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
  box-shadow: 0 18px 36px rgba(88,74,120,.12);
}

.home-hero-avatar {
  width: 250px;
  height: 250px;
  margin: 0;
  border-radius: 46px;
  font-size: 76px;
  box-shadow: 0 24px 58px rgba(130, 99, 198, .22);
}

.home-hero-avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-card {
  border: 1px solid rgba(225, 229, 235, .86);
  border-radius: 34px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 18px 46px rgba(31, 41, 55, .08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.home-friends {
  padding: 26px;
}

.home-friends .friend-scroll {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 8px 2px 2px;
}

.home-friends .friend-card {
  flex: 0 0 108px;
  min-height: auto;
  width: 108px;
  display: block;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.home-friends .friend-avatar {
  width: 88px;
  height: 88px;
  margin: 0 auto 12px;
  border-radius: 50%;
  font-size: 28px;
  background: #eef2f7;
}

.home-friends .friend-card.selected .friend-avatar {
  outline: 5px solid #8b6fdd;
  box-shadow: 0 14px 26px rgba(139,111,221,.22);
}

.home-friends .friend-card strong {
  margin: 0;
  font-size: 16px;
}

.home-friends .friend-card small {
  margin-top: 4px;
  color: #8a93a2;
  white-space: normal;
  font-size: 13px;
}

.home-friends .friend-card em {
  top: 68px;
  right: 10px;
  width: 28px;
  height: 28px;
  padding: 0;
  align-items: center;
  justify-content: center;
  background: #8b6fdd;
  border: 3px solid #fff;
}

.home-call-card-v2 {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  border-radius: 34px;
  padding: 34px 28px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 24px 54px rgba(49, 130, 246, 0.25);
}

.home-call-card-v2 form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.home-call-copy .friend-context {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 8px 14px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 13px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
}

.home-call-copy .call-headline {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -0.04em;
  word-break: keep-all;
  color: #fff;
}

.home-call-copy .friend-desc {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
  margin: 0;
}

.home-call-button {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  cursor: pointer;
  margin-top: 10px;
}

.home-call-time {
  grid-column: 1 / -1;
  gap: 34px;
}

.home-call-time div + div {
  border-left: 1px solid rgba(255,255,255,.25);
  padding-left: 34px;
}

.home-call-time span,
.home-call-time strong {
  display: block;
}

.home-call-time span {
  color: rgba(255,255,255,.7);
  font-weight: 800;
}

.home-call-time strong {
  margin-top: 5px;
  font-size: 28px;
  letter-spacing: -.04em;
}

.call-length {
  margin-top: 18px;
  padding: 20px 24px 24px;
}

.call-length h2,
.home-topics h2,
.usage-summary h2 {
  margin: 0 0 16px;
  color: #1d2437;
  font-size: 18px;
  letter-spacing: -.03em;
}

.length-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.length-options button {
  min-height: 72px;
  border: 0;
  border-radius: 24px;
  background: #f5f2fb;
  color: #334155;
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.length-options button.selected {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 16px 32px rgba(49, 130, 246, 0.24);
}

.length-options span,
.length-options small {
  display: block;
}

.length-options small {
  margin-top: 4px;
  opacity: .76;
}

.home-topics {
  margin-top: 30px;
}

.topic-scroll {
  display: grid;
  grid-template-columns: repeat(5, minmax(118px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding: 4px 2px 10px;
}

.topic-card {
  min-height: 150px;
  border: 1px solid #ebeef4;
  border-radius: 24px;
  background: rgba(255,255,255,.82);
  color: #1d2437;
  font-family: inherit;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(31,41,55,.06);
  cursor: pointer;
}

.topic-card.selected {
  border-color: var(--primary);
  background: #f5f9ff;
  box-shadow: 0 16px 34px rgba(49, 130, 246, 0.12);
}

.topic-card span,
.topic-card strong {
  display: block;
}

.topic-card span {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8f3ff;
  color: var(--primary);
  font-size: 26px;
}

.topic-card strong {
  padding: 0 12px;
  line-height: 1.35;
}

.home-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, .72fr);
  gap: 18px;
  margin-top: 20px;
}

.usage-summary,
.today-word,
.recent-diary-v2 {
  padding: 24px;
}

.usage-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.usage-mini-grid > * {
  min-height: 94px;
  border-radius: 22px;
  padding: 16px;
  background: #f7f5ff;
  color: #1d2437;
}

.usage-mini-grid span,
.usage-mini-grid strong,
.usage-mini-grid small {
  display: block;
}

.usage-mini-grid span {
  color: #7a8291;
  font-size: 13px;
  font-weight: 900;
}

.usage-mini-grid strong {
  margin-top: 8px;
  font-size: 21px;
  letter-spacing: -.04em;
}

.usage-mini-grid i {
  display: block;
  width: 42px;
  height: 42px;
  margin-top: 8px;
  border-radius: 50%;
  background: conic-gradient(#8b6fdd var(--value), #e8e3f7 0);
}

.usage-mini-grid b {
  display: block;
  height: 8px;
  margin-top: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #e6e1f3;
}

.usage-mini-grid em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #8b6fdd;
}

.today-word {
  background: linear-gradient(135deg, #ffffff, #efe6ff);
  color: #2d2542;
  text-align: center;
}

.today-word span {
  display: block;
  color: #8b6fdd;
  font-weight: 900;
}

.today-word strong {
  display: block;
  margin-top: 12px;
  font-size: 24px;
  line-height: 1.4;
  letter-spacing: -.04em;
}

.recent-diary-v2 {
  margin-top: 18px;
}

.home-tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 80;
  transform: translateX(-50%);
  width: min(860px, 100%);
  height: 88px;
  justify-content: space-around;
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
  border-radius: 34px 34px 0 0;
  background: rgba(255,255,255,.94);
  box-shadow: 0 -18px 42px rgba(31,41,55,.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.home-tabbar a,
.home-tabbar button {
  border: 0;
  background: transparent;
  color: #7a8291;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.home-tabbar span {
  display: block;
  font-size: 25px;
  line-height: 1.1;
}

.home-tabbar a.active {
  color: var(--primary);
}

.home-tabbar button {
  width: 78px;
  height: 78px;
  margin-top: -38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 18px 34px rgba(49, 130, 246, .28);
  cursor: pointer;
}

.home-tabbar button span {
  font-size: 32px;
}

@media (max-width: 720px) {
  .home-mobile-frame {
    padding: 18px 20px 112px;
  }

  .home-statusbar {
    font-size: 16px;
    margin-bottom: 22px;
  }

  .home-brand strong {
    font-size: 22px;
  }

  .home-brand small {
    font-size: 13px;
  }

  .home-brand-mark {
    width: 46px;
    height: 46px;
    font-size: 28px;
  }

  .round-icon {
    width: 54px;
    height: 54px;
    font-size: 22px;
  }

  .home-hero-v2 {
    grid-template-columns: 1fr;
    min-height: 420px;
    margin-top: 22px;
  }

  .home-hero-copy h1 {
    font-size: 40px;
  }

  .home-hero-copy p {
    font-size: 17px;
    margin-top: 20px;
  }

  .home-hero-friend {
    position: absolute;
    right: -10px;
    bottom: 0;
    min-height: 230px;
    width: 230px;
  }

  .home-hero-avatar {
    width: 190px;
    height: 190px;
    border-radius: 38px;
  }

  .home-speech {
    left: -42px;
    top: 36px;
    font-size: 13px;
  }

  .home-friends {
    padding: 20px;
  }

  .home-friends .friend-scroll {
    gap: 16px;
  }

  .home-call-card-v2 {
    padding: 26px 22px;
  }

  .home-call-card-v2 form {
    grid-template-columns: 1fr 104px;
  }

  .home-call-copy h2 {
    margin-top: 24px;
    font-size: 25px;
  }

  .home-call-button {
    width: 104px;
    height: 104px;
    font-size: 42px;
    box-shadow: 0 0 0 16px rgba(255,255,255,.08), 0 0 0 30px rgba(255,255,255,.05);
  }

  .home-call-time {
    gap: 18px;
  }

  .home-call-time div + div {
    padding-left: 18px;
  }

  .home-call-time strong {
    font-size: 22px;
  }

  .length-options {
    gap: 10px;
  }

  .length-options button {
    border-radius: 18px;
    font-size: 14px;
  }

  .topic-scroll {
    grid-template-columns: repeat(5, 132px);
  }

  .home-bottom-grid,
  .usage-mini-grid {
    grid-template-columns: 1fr;
  }

  .home-tabbar {
    height: 82px;
    border-radius: 28px 28px 0 0;
  }
}

/* --- Lavender mobile app system v3 --- */
:root {
  --color-primary: var(--primary);
  --color-primary-strong: var(--primary-dark);
  --color-primary-light: #e8f3ff;
  --color-primary-soft: #f5f9ff;
  --color-bg: #ffffff;
  --color-card: rgba(255, 255, 255, .92);
  --color-text: #171b32;
  --color-muted: #737b8f;
  --color-line: rgba(49, 130, 246, .1);
  --radius-lg: 24px;
  --radius-xl: 34px;
  --shadow-soft: 0 18px 46px rgba(49, 130, 246, .09);
}

/* Fix for diary_call.php call card text */
.home-call-copy .friend-context {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.home-call-copy .call-headline {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--color-text);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  word-break: keep-all;
}

.home-call-copy .friend-desc {
  font-size: 15px;
  color: var(--color-muted);
  line-height: 1.5;
  margin: 0;
  font-weight: 500;
}

body:has(.diary-home),
body:has(.diary-list-page),
body:has(.result-page),
body:has(.report-v2-page),
body:has(.emotion-calendar-page),
body:has(.billing-page),
body:has(.my-page),
body:has(.call-app-shell) {
  background: #ffffff;
}

/* Remove header/footer hiding for unification */
/* body:has(.diary-home) .site-header, ... */

body.app-has-bottom-nav main.app-shell,
body.app-has-bottom-nav .call-app-shell,
body.app-has-bottom-nav .v3-home-shell,
body.app-has-bottom-nav .app-main,
body:has(.app-bottom-nav) main.app-shell,
body:has(.app-bottom-nav) .call-app-shell,
body:has(.app-bottom-nav) .v3-home-shell,
body:has(.app-bottom-nav) .app-main {
  padding-bottom: calc(var(--bottom-nav-height) + 48px + env(safe-area-inset-bottom, 0px)) !important;
}

body:has(.phone-card.in-call) .app-bottom-nav {
  display: none;
}

.app-shell.diary-home,
.app-shell.diary-list-page,
.app-shell.result-page,
.app-shell.emotion-calendar-page,
.app-shell.billing-page,
.app-shell.my-page,
.call-app-shell {
  width: min(580px, 100%);
  margin: 0 auto;
  padding: 18px var(--app-gutter);
}

@media (min-width: 768px) {
  .app-shell.diary-home,
  .app-shell.diary-list-page,
  .app-shell.result-page,
  .app-shell.emotion-calendar-page,
  .app-shell.billing-page,
  .app-shell.my-page,
  .call-app-shell {
    width: min(760px, 100%);
    padding-inline: var(--app-gutter);
  }
}

@media (min-width: 1024px) {
  .app-shell.diary-home,
  .app-shell.diary-list-page,
  .app-shell.result-page,
  .app-shell.emotion-calendar-page,
  .app-shell.billing-page,
  .app-shell.my-page,
  .call-app-shell {
    width: min(840px, 100%);
  }
}

.soft-card,
.home-card,
.diary-entry-card,
.diary-preview,
.emotion-calendar-card,
.daily-review-card,
.current-plan-card,
.plan-purchase-card,
.result-hero-card,
.diary-paper,
.emotion-detail-card,
.billing-hero,
.calendar-hero,
.list-hero,
.result-friend-note {
  border: 1px solid var(--color-line) !important;
  border-radius: var(--radius-lg) !important;
  background: var(--color-card) !important;
  box-shadow: var(--shadow-soft) !important;
}

.app-page-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: 52px;
  margin-bottom: 14px;
}

.app-page-header h1 {
  margin: 0;
  color: var(--color-text);
  font-size: 21px;
  text-align: center;
  letter-spacing: -.04em;
}

.page-back,
.page-icon-link {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.72);
  color: var(--color-text);
  font-size: 26px;
  font-weight: 900;
}

.section-heading {
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2 {
  color: var(--color-text);
  font-size: 18px;
  letter-spacing: -.04em;
}

.section-heading a {
  color: var(--color-primary-strong);
  white-space: nowrap;
}

.home-mobile-frame {
  width: 100%;
  min-height: auto;
  padding: 0;
  background: transparent;
}

.home-statusbar {
  display: none !important;
}

.home-appbar {
  margin-bottom: 18px;
}

.home-brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, #8ec5ff, var(--color-primary));
}

.home-brand strong {
  color: var(--color-text);
  font-size: clamp(22px, 5.8vw, 28px);
  letter-spacing: -.06em;
}

.home-brand small {
  color: var(--color-muted);
  font-size: 14px;
}

.home-app-actions {
  gap: 10px;
}

.round-icon {
  width: 52px;
  height: 52px;
  color: #354052;
  font-size: 22px;
  box-shadow: 0 14px 34px rgba(100, 76, 140, .09);
}

.home-hero-v2 {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(118px, 34vw, 210px);
  align-items: end;
  gap: 14px;
  min-height: auto;
  margin: 22px 0 18px;
  padding: 8px 0 0;
}

.home-hero-copy {
  z-index: 1;
  min-width: 0;
  padding: 0 0 10px;
}

.home-hero-copy h1 {
  max-width: 100%;
  font-size: clamp(34px, 9.4vw, 58px);
  line-height: 1.15;
  letter-spacing: -.07em;
  word-break: keep-all;
}

.home-hero-copy h1 span {
  color: var(--color-primary);
}

.home-hero-copy p {
  margin-top: 18px;
  color: #626b7c;
  font-size: clamp(15px, 4.1vw, 19px);
  line-height: 1.62;
  word-break: keep-all;
}

.home-hero-friend {
  position: relative !important;
  right: auto !important;
  bottom: auto !important;
  width: auto !important;
  min-height: 0;
  display: grid;
  gap: 10px;
  align-content: end;
  justify-items: center;
}

.home-speech {
  position: static;
  max-width: 100%;
  border-radius: 16px;
  padding: 10px 12px;
  color: var(--color-text);
  font-size: clamp(12px, 3.1vw, 14px);
  line-height: 1.35;
  text-align: center;
}

.home-hero-avatar {
  width: min(100%, 210px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 34px;
  overflow: hidden;
  font-size: clamp(42px, 15vw, 76px);
}

.home-hero-avatar.has-image img,
.friend-avatar.has-image img,
.big-friend-avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-friends {
  padding: 20px 18px;
}

.home-friends .friend-scroll {
  gap: 14px;
  padding: 10px 2px 6px;
  scrollbar-width: none;
}

.home-friends .friend-scroll::-webkit-scrollbar,
.topic-scroll::-webkit-scrollbar,
.diary-month-tabs::-webkit-scrollbar {
  display: none;
}

.home-friends .friend-card {
  flex: 0 0 96px;
  width: 96px;
  min-height: 154px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 4px;
  overflow: visible;
}

.home-friends .friend-avatar {
  width: 78px;
  height: 78px;
  flex: 0 0 78px;
  margin-bottom: 10px;
}

.home-friends .friend-card strong {
  width: 100%;
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.25;
}

.home-friends .friend-card small {
  width: 100%;
  min-height: 34px;
  color: #8a90a3;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.home-friends .friend-card.selected {
  transform: scale(1.02);
}

.home-friends .friend-card.selected .friend-avatar {
  outline: 4px solid var(--color-primary);
}

.home-friends .friend-card em {
  top: 60px;
  right: 6px;
}

.home-call-card-v2 {
  margin-top: 18px;
  padding: 24px 22px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 84% 34%, rgba(255,255,255,.2), transparent 150px),
    linear-gradient(135deg, #6b56d8, #392c96) !important;
}

.home-call-card-v2 form {
  grid-template-columns: minmax(0, 1fr) clamp(92px, 28vw, 132px);
  gap: 16px;
}

.home-call-copy h2 {
  margin: 22px 0 10px;
  font-size: clamp(24px, 6.7vw, 34px);
  line-height: 1.25;
}

.home-call-copy p {
  font-size: 16px;
}

.home-call-button {
  width: clamp(92px, 28vw, 132px);
  height: clamp(92px, 28vw, 132px);
  font-size: clamp(38px, 11vw, 54px);
  box-shadow: 0 0 0 16px rgba(255,255,255,.08), 0 16px 36px rgba(23, 14, 86, .22);
  animation: appPulse 2.4s ease-in-out infinite;
}

.home-call-time {
  gap: 18px;
}

.home-call-time div + div {
  padding-left: 18px;
}

.home-call-time strong {
  font-size: clamp(20px, 5.6vw, 27px);
}

.length-options {
  gap: 10px;
}

.length-options button {
  min-height: 66px;
  border-radius: 20px;
  background: var(--color-primary-soft);
}

.length-options button.selected {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));
}

.home-topics {
  margin-top: 22px;
}

.topic-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.topic-card {
  flex: 0 0 122px;
  min-height: 132px;
  border-radius: 22px;
}

.topic-card span {
  width: 50px;
  height: 50px;
  margin-bottom: 12px;
}

.topic-card strong {
  font-size: 14px;
}

.home-bottom-grid,
.usage-mini-grid {
  grid-template-columns: 1fr;
}

.usage-summary,
.today-word,
.recent-diary-v2 {
  padding: 20px;
}

@media (max-width: 380px) {
  .home-hero-v2 {
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 10px;
  }

  .home-hero-copy h1 {
    font-size: clamp(30px, 8.6vw, 34px);
  }

  .home-hero-copy p {
    font-size: 14px;
  }

  .home-speech {
    padding: 8px 9px;
    font-size: 11px;
  }

  .round-icon {
    width: 48px;
    height: 48px;
  }
}

body.app-has-bottom-nav {
  overflow-x: clip;
}

/* iOS: keep bottom nav pinned to the visual viewport */
html.ios-device {
  height: var(--app-vh, 100dvh);
}

html.ios-device body {
  min-height: var(--app-vh, 100dvh);
}

html.ios-device .app-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  transform: none;
  -webkit-transform: none;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.app-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  box-sizing: border-box;
  padding: 0 4px env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  transform: none;
  -webkit-transform: none;
}

.app-bottom-nav a {
  flex: 1;
  min-height: var(--bottom-nav-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #8b95a1;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s ease;
  min-width: 0;
}

.app-bottom-nav a > i {
  font-size: 20px;
  line-height: 1;
  display: block;
  font-weight: 400;
}

.app-bottom-nav a.active {
  color: #3182f6;
}

.app-bottom-nav a.nav-talk {
  position: relative;
  color: #fff;
  margin-top: -18px;
}

.app-bottom-nav a.nav-talk span {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(180deg, #4593ff 0%, #3182f6 100%);
  box-shadow: 0 8px 22px rgba(49, 130, 246, 0.38);
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
}

.app-bottom-nav a.nav-talk.active span,
.app-bottom-nav a.nav-talk:active span {
  background: linear-gradient(180deg, #3182f6 0%, #1b64da 100%);
}

.app-bottom-nav a.nav-talk.active {
  color: #3182f6;
}

.app-bottom-nav a:active,
.round-icon:active,
.home-call-button:active,
.topic-card:active,
.length-options button:active,
.soft-button:active {
  transform: scale(.97);
}

.list-hero,
.calendar-hero,
.billing-hero {
  padding: 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff, #f5efff) !important;
}

.list-hero a,
.calendar-hero a,
.billing-hero a,
.result-diary-hero a {
  color: var(--color-primary-strong);
  font-weight: 900;
}

.list-hero h1,
.calendar-hero h1,
.billing-hero h1 {
  margin: 8px 0 6px;
  color: var(--color-text);
  font-size: clamp(28px, 8vw, 38px);
  letter-spacing: -.06em;
}

.list-hero p,
.calendar-hero p,
.billing-hero p {
  color: var(--color-muted);
  font-weight: 800;
}

.diary-month-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 14px;
}

.diary-month-tabs a {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 10px 16px;
  background: #fff;
  color: var(--color-muted);
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(54,40,96,.06);
}

.diary-month-tabs a.active {
  background: var(--color-primary);
  color: #fff;
}

.diary-month-group h2,
.diary-topic-group .topic-group-head strong {
  color: var(--color-text);
  letter-spacing: -.04em;
}

.diary-topic-group {
  display: grid;
  gap: 12px;
}

.diary-entry-card {
  position: relative;
  padding: 16px;
}

.diary-entry-link {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.diary-entry-card .friend-avatar {
  width: 54px;
  height: 54px;
  border-radius: 18px;
}

.diary-entry-body small,
.diary-entry-body strong,
.diary-entry-body em {
  display: block;
}

.diary-entry-body small {
  color: #9096a8;
  font-size: 12px;
  font-weight: 800;
}

.diary-entry-body strong {
  margin-top: 5px;
  color: var(--color-text);
  font-size: 17px;
  line-height: 1.32;
}

.diary-entry-body em {
  margin-top: 8px;
  color: var(--color-muted);
  font-style: normal;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.diary-delete-btn {
  border-radius: 999px;
  border: 0;
  padding: 8px 12px;
  background: #fff0f4;
  color: #ec4b72;
  font-weight: 900;
}

.result-diary-hero {
  margin-bottom: 14px;
}

.result-hero-card {
  position: relative;
  display: block;
  overflow: visible;
  padding: 22px 22px 20px !important;
}

.result-hero-card-main {
  min-width: 0;
}

.result-hero-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.result-hero-meta {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 13px;
  color: #8b95a1;
  font-weight: 700;
}

.result-hero-title {
  margin: 8px 0 0;
  padding-right: 0;
  color: #191f28;
  font-size: clamp(22px, 6vw, 30px);
  line-height: 1.32;
  letter-spacing: -0.02em;
  overflow: visible;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.result-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 12px;
  padding-right: 88px;
}

.result-hero-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: #3182f6;
  background: #e8f3ff;
  padding: 4px 10px;
  border-radius: 12px;
}

.result-hero-settings {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #191f28;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.result-hero-settings:active {
  background: #f2f4f6;
}

.result-settings-body {
  display: grid;
  gap: 16px;
}

.result-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 12px;
  border-bottom: 1px solid #f2f4f6;
  cursor: pointer;
}

.result-settings-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.result-settings-copy strong {
  color: #191f28;
  font-size: 15px;
  font-weight: 800;
}

.result-settings-copy span {
  color: #8b95a1;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.result-settings-created-date {
  margin-top: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #eef2f6;
}

.result-settings-created-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #6b7684;
  margin-bottom: 4px;
}

.result-settings-created-value {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #191f28;
}

.result-settings-created-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #8b95a1;
  line-height: 1.45;
}

.result-settings-delete {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  font-size: 15px;
}

.result-hero-duration {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: #8b95a1;
  background: #f2f4f6;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.diary-highlight,
.handwritten-diary mark.diary-highlight,
.result-hero-title mark.diary-highlight {
  background: linear-gradient(120deg, #dbeafe 0%, #dbeafe 100%);
  color: inherit;
  padding: 2px 4px;
  border-radius: 4px;
  text-decoration: none;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.result-tabs {
  position: sticky;
  top: 8px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.84);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.result-tabs button {
  min-height: 42px;
  border-radius: 999px;
}

.result-tabs button.active {
  background: var(--color-primary);
  color: #ffffff;
}

.diary-paper {
  padding: 24px !important;
  color: #33384c;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 17px !important;
  line-height: 1.92 !important;
  word-break: keep-all;
}

.result-friend-note {
  margin-top: 14px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f2ff, #fff) !important;
}

.result-friend-note span,
.result-friend-note strong {
  display: block;
}

.result-friend-note span {
  color: var(--color-primary-strong);
  font-weight: 900;
}

.result-friend-note strong {
  margin-top: 10px;
  color: #55417d;
  line-height: 1.65;
}

.result-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.result-quick-actions button,
.soft-button {
  min-height: 48px;
  border: 0;
  border-radius: 18px;
  background: var(--color-primary-soft);
  color: var(--color-primary-strong);
  font-family: inherit;
  font-weight: 900;
}

.emotion-calendar-page {
  padding-top: 18px;
}

.calendar-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.calendar-summary article {
  min-width: 0;
  border-radius: 20px;
  padding: 14px 10px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 24px rgba(54,40,96,.06);
}

.calendar-summary span,
.calendar-summary strong {
  display: block;
}

.calendar-summary span {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 900;
}

.calendar-summary strong {
  margin-top: 6px;
  color: var(--color-primary-strong);
  font-size: 18px;
}

.emotion-calendar-card {
  padding: 16px !important;
  overflow: hidden;
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  align-items: center;
  margin-bottom: 14px;
}

.calendar-toolbar a {
  color: var(--color-muted);
  font-size: 0;
}

.calendar-toolbar a::before {
  content: "‹";
  font-size: 28px;
  font-weight: 900;
}

.calendar-toolbar a:last-child::before {
  content: "›";
}

.calendar-toolbar strong {
  text-align: center;
  color: var(--color-text);
  font-size: 20px;
}

.calendar-weekdays,
.emotion-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.calendar-weekdays span {
  color: #7a8291;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.emotion-calendar-grid {
  margin-top: 8px;
}

.calendar-day {
  min-width: 0;
  min-height: 54px;
  aspect-ratio: 1 / 1.12;
  border-radius: 16px;
  padding: 6px 3px;
  text-align: center;
  background: #fbfaff;
  overflow: hidden;
}

.calendar-day .day-number {
  display: block;
  color: #1f2538;
  font-size: 13px;
  font-weight: 900;
}

.calendar-day.has-entry {
  border: 1px solid color-mix(in srgb, var(--emotion-color) 34%, #ece7f8);
  background: color-mix(in srgb, var(--emotion-color) 10%, #fff);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.day-emoji {
  font-size: 20px;
  margin: 2px 0;
  line-height: 1;
}

.calendar-day small {
  display: block;
  font-size: 9px;
  color: #8b95a1;
  font-weight: 500;
}

.calendar-day.selected {
  box-shadow: 0 0 0 2px var(--color-primary);
}

.daily-review-card {
  padding: 20px !important;
}

.daily-review-card p {
  color: #4b5267;
  line-height: 1.7;
  word-break: keep-all;
}

.emotion-row {
  border-radius: 20px;
  background: rgba(255,255,255,.9);
}

.current-plan-card,
.plan-purchase-card {
  padding: 20px !important;
}

.current-plan-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.plan-usage-ring {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 14px;
  background:
    radial-gradient(circle at center, #ffffff 0 58%, transparent 59%),
    conic-gradient(var(--color-primary) var(--usage-percent, 0%), #e8eef8 0);
}

.plan-usage-ring strong,
.plan-usage-ring span,
.plan-usage-ring small {
  position: relative;
  z-index: 1;
}

.plan-usage-ring small {
  display: block;
  margin-top: 4px;
  color: #6b7684;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.plan-card-grid {
  display: grid;
  gap: 14px;
}

.plan-purchase-card.active {
  border-color: rgba(143,99,232,.34) !important;
  background: linear-gradient(135deg, #fff, #f8f2ff) !important;
}

.my-page {
  display: grid;
  gap: 14px;
}

.my-profile-card {
  padding: 30px;
  background: linear-gradient(135deg, #f3eaff, #fff) !important;
  overflow: hidden;
}

.my-profile-card h2 {
  margin: 0;
  color: var(--color-text);
  font-size: 28px;
}

.my-profile-card p {
  margin: 8px 0 16px;
  color: var(--color-muted);
  font-weight: 800;
}

.plan-summary-card,
.my-friend-card,
.my-settings-card,
.my-record-card {
  padding: 20px;
}

.my-usage-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.my-usage-row > div {
  min-width: 0;
  border-radius: 20px;
  padding: 14px;
  background: var(--color-primary-soft);
}

.my-usage-row span,
.my-usage-row strong {
  display: block;
}

.my-usage-row span {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 900;
}

.my-usage-row strong {
  margin-top: 7px;
  color: var(--color-primary-strong);
  font-size: 20px;
}

.my-usage-row i {
  display: block;
  height: 7px;
  margin-top: 10px;
  border-radius: 999px;
  background: #e9e1fa;
  overflow: hidden;
}

.my-usage-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-primary);
}

.my-friend-row {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.my-friend-row .friend-avatar {
  width: 60px;
  height: 60px;
  border-radius: 22px;
}

.my-friend-row strong,
.my-friend-row span {
  display: block;
}

.my-friend-row strong {
  color: var(--color-text);
  font-size: 18px;
}

.my-friend-row span {
  color: var(--color-muted);
  font-weight: 800;
}

.my-settings-card h2,
.my-record-card h2 {
  margin: 0 0 12px;
  color: var(--color-text);
  font-size: 18px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(142,123,186,.12);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row span {
  color: #5f6678;
  font-weight: 800;
}

.setting-row strong {
  color: var(--color-text);
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.record-grid article {
  min-height: auto;
  border-radius: 20px;
  padding: 13px;
  background: linear-gradient(135deg, #f4edff, #fff);
}

.record-grid span,
.record-grid strong {
  display: block;
}

.record-grid span {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 900;
}

.record-grid strong {
  margin-top: 8px;
  color: var(--color-primary-strong);
  font-size: 24px;
}

.my-footer-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 8px 0 4px;
  color: #9aa0ad;
  font-size: 12px;
  font-weight: 800;
}

/* --- My page redesign --- */
.app-shell.my-page {
  width: min(760px, calc(100% - var(--app-gutter) * 2));
  gap: 18px;
  padding-bottom: 124px;
}

.my-page .app-page-header {
  margin-bottom: 8px;
}

.my-page .app-page-header h1 {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.my-page .page-back,
.my-page .page-icon-link {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f6f8fb;
  color: #191f28;
  font-size: 28px;
  text-decoration: none;
}

.my-page .page-icon-link {
  font-size: 22px;
}

.my-page .soft-card {
  border: 1px solid rgba(49, 130, 246, 0.08);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 10px 34px rgba(25, 31, 40, 0.04);
}

.my-profile-card {
  position: relative;
  padding: 28px 24px !important;
  background:
    radial-gradient(circle at 86% 16%, rgba(49, 130, 246, 0.12), transparent 120px),
    linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%) !important;
}

.my-profile-card::after {
  content: "♡";
  position: absolute;
  right: 26px;
  top: 28px;
  color: rgba(49, 130, 246, 0.18);
  font-size: 58px;
  font-weight: 900;
  line-height: 1;
}

.my-profile-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #eef6ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.my-profile-card h2 {
  position: relative;
  z-index: 1;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.my-profile-card p {
  position: relative;
  z-index: 1;
  margin: 8px 0 20px;
  color: #6b7684;
  font-size: 17px;
  font-weight: 800;
}

.my-profile-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.my-page .soft-button,
.my-ghost-button {
  min-height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.my-page .soft-button {
  background: var(--primary);
  color: #ffffff;
}

.my-ghost-button {
  background: #f2f4f6;
  color: #4e5968;
}

.my-profile-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.my-profile-stats span {
  border-radius: 16px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.76);
  color: #6b7684;
  font-size: 13px;
  font-weight: 800;
}

.my-profile-stats strong {
  display: block;
  margin-bottom: 2px;
  color: #191f28;
  font-size: 22px;
  font-weight: 900;
}

.plan-summary-card,
.my-friend-card,
.my-settings-card,
.my-record-card {
  padding: 22px !important;
}

.my-page .section-heading {
  margin-bottom: 18px;
}

.my-page .section-heading h2,
.my-settings-card h2,
.my-record-card h2 {
  color: #191f28;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.my-page .section-heading a {
  color: var(--primary);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.my-usage-row {
  gap: 12px;
}

.my-usage-row > div {
  border-radius: 22px;
  padding: 18px;
  background: #f7f9fc;
}

.my-usage-row span {
  color: #6b7684;
  font-size: 13px;
}

.my-usage-row strong {
  margin-top: 10px;
  color: var(--primary);
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.my-usage-row i {
  height: 8px;
  background: #e8eef7;
}

.my-usage-row b {
  background: linear-gradient(90deg, var(--primary), #5ba2ff);
}

.my-friend-row {
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
}

.my-friend-row .friend-avatar {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  box-shadow: 0 10px 24px rgba(25, 31, 40, 0.08);
}

.my-friend-row strong {
  color: #191f28;
  font-size: 22px;
  font-weight: 900;
}

.my-friend-row span {
  margin-top: 4px;
  color: #6b7684;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

.my-settings-card {
  padding-bottom: 10px !important;
}

.setting-row {
  min-height: 56px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #f2f4f6;
}

.setting-row span {
  color: #191f28;
  font-size: 16px;
  font-weight: 800;
}

.setting-row strong {
  color: #8b95a1;
  font-size: 14px;
  font-weight: 800;
}

.record-grid {
  gap: 12px;
}

.record-grid article {
  min-height: 100px;
  border-radius: 22px;
  padding: 16px;
  background: #f7f9fc;
}

.record-grid span {
  color: #6b7684;
  font-size: 12px;
}

.record-grid strong {
  color: #191f28;
  font-size: 25px;
  letter-spacing: -0.03em;
}

.my-footer-links {
  padding: 10px 0 0;
}

@media (max-width: 520px) {
  .app-shell.my-page {
    width: min(760px, calc(100% - var(--app-gutter) * 2));
    gap: 16px;
  }

  .my-profile-card {
    padding: 26px 20px !important;
  }

  .my-profile-card h2 {
    font-size: 31px;
  }

  .my-profile-stats,
  .my-usage-row {
    grid-template-columns: 1fr;
  }

  .record-grid {
    grid-template-columns: 1fr;
  }
}

.call-app-top {
  width: 100%;
  margin: 0 0 14px;
  border-radius: 24px;
  padding: 16px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow-soft);
}

.call-stage.layout-container {
  width: 100%;
}

.diary-phone-card {
  width: 100%;
  grid-template-columns: 1fr;
}

.phone-card,
.phone-face,
.diary-lobby,
.diary-call-screen {
  border-radius: var(--radius-xl);
}

@media (max-width: 390px) {
  .app-shell.diary-home,
  .app-shell.diary-list-page,
  .app-shell.result-page,
  .app-shell.emotion-calendar-page,
  .app-shell.billing-page,
  .app-shell.my-page,
  .call-app-shell {
    padding-inline: var(--app-gutter);
  }

  .app-bottom-nav {
    grid-template-columns: repeat(5, 1fr);
    padding-inline: 8px;
  }

  .home-call-card-v2 form,
  .current-plan-card,
  .my-profile-card {
    grid-template-columns: 1fr;
  }

  .home-call-button {
    justify-self: start;
  }

  .my-profile-art {
    display: none;
  }

  .calendar-summary,
  .my-usage-row,
  .record-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .app-bottom-nav,
  .result-tabs,
  .result-quick-actions,
  .result-action-row,
  .site-header,
  .site-footer {
    display: none !important;
  }

  .app-shell.result-page {
    width: 100%;
    padding: 0 !important;
  }
}

/* --- App Premium Design System --- */
.app-main {
  background-color: var(--app-page-bg);
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--bottom-nav-height) + 48px + env(safe-area-inset-bottom, 0px));
}

.app-container {
  width: min(760px, calc(100% - var(--app-gutter) * 2));
  margin: 0 auto;
  padding-top: 16px;
}

.app-header {
  margin-bottom: 28px;
}

.app-greeting {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.45;
  color: #191f28;
  letter-spacing: -0.02em;
}

.app-sub-greeting {
  font-size: 15px;
  color: #6b7684;
  margin-top: 8px;
  font-weight: 500;
}

.app-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid #f2f4f6;
  box-shadow: 0 4px 16px rgba(25, 31, 40, 0.03);
}

.diary-home .selected-hero-section {
  padding: 28px;
}

.diary-home .hero-character-wrap {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.diary-home .hero-avatar-big {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
}

.diary-home .hero-avatar-big .hero-avatar,
.diary-home .hero-avatar-big .hero-avatar.has-image {
  width: 96px !important;
  height: 96px !important;
  max-width: 96px;
  max-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 28px;
  overflow: hidden;
}

.diary-home .hero-avatar-big .hero-avatar img {
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: cover;
}

.diary-home .hero-form {
  margin: 0;
}

.app-btn-primary,
.diary-home .app-btn-primary {
  width: 100%;
  min-height: var(--btn-primary-min-height);
  border: 0;
  border-radius: var(--btn-primary-radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--btn-primary-bg);
  color: #ffffff;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--btn-primary-shadow);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.app-btn-primary:hover,
.diary-home .app-btn-primary:hover {
  background: var(--btn-primary-bg-hover);
}

.app-btn-primary:active,
.diary-home .app-btn-primary:active {
  transform: scale(0.98);
}

.diary-home .btn-icon {
  font-size: 18px;
  line-height: 1;
}

.app-section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 4px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #191f28;
}

.header-link {
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
}

/* Call Hero Card */
.call-hero-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  padding: 32px 24px;
  position: relative;
  overflow: hidden;
}

.call-hero-empty {
  text-align: center;
  padding: 20px 0;
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.call-hero-empty h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}

.call-hero-empty p {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 20px;
}

.friend-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 16px;
}

.call-hero-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}

.call-hero-desc {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 28px;
  font-weight: 500;
}

.call-start-btn {
  width: 100%;
  height: 56px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  color: var(--primary);
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.call-start-btn:active {
  transform: scale(0.97);
}

.call-hero-footer {
  display: flex;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.usage-stat {
  flex: 1;
  text-align: center;
}

.usage-stat span {
  display: block;
  font-size: 11px;
  opacity: 0.7;
  margin-bottom: 4px;
}

.usage-stat strong {
  font-size: 16px;
  font-weight: 700;
}

.usage-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
}

/* Friend Selector */
.friend-selector-grid {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 4px 16px;
  margin: 0 -4px;
  -webkit-overflow-scrolling: touch;
}

.friend-selector-grid::-webkit-scrollbar {
  height: 4px;
  display: block;
}

.friend-selector-grid::-webkit-scrollbar-track {
  background: transparent;
}

.friend-selector-grid::-webkit-scrollbar-thumb {
  background: rgba(49, 130, 246, 0.1);
  border-radius: 10px;
}

.app-friend-item {
  flex: 0 0 auto;
  width: 84px;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 0;
}

.friend-avatar-wrap {
  position: relative;
  width: 68px;
  height: 68px;
}

.app-friend-avatar {
  width: 100% !important;
  height: 100% !important;
  border-radius: 22px !important;
  object-fit: cover;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.app-friend-item.active .app-friend-avatar {
  border-color: var(--primary);
  transform: scale(1.05);
}

.active-dot {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--primary);
  border: 3px solid #f2f4f6;
  border-radius: 50%;
}

.friend-name {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #4e5968 !important;
  transition: all 0.2s ease !important;
  text-align: center !important;
  margin-top: 4px !important;
}

.app-friend-item.active .friend-name {
  color: var(--primary) !important;
  font-weight: 700 !important;
}

/* Options */
.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.option-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: #191f28;
  margin-bottom: 16px;
}

.app-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-pill {
  padding: 10px 16px;
  border-radius: 12px;
  background: #f2f4f6;
  color: #4e5968;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.app-pill.active {
  background: var(--primary);
  color: #ffffff;
}

/* Usage Card */
.usage-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.usage-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: #191f28;
}

.usage-progress-wrap {
  margin-bottom: 20px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.progress-info span {
  color: #8b95a1;
}

.progress-info strong {
  color: #191f28;
}

.app-progress-bar {
  height: 8px;
  background: #f2f4f6;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
}

.usage-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.plan-badge {
  font-size: 12px;
  background: #eef6ff;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
}

.usage-hint {
  font-size: 12px;
  color: #8b95a1;
}

/* Diary List */
.app-diary-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-diary-item {
  background: #ffffff;
  border-radius: 20px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease;
}

.app-diary-item:active {
  transform: scale(0.98);
}

.diary-icon {
  font-size: 24px;
}

.diary-info {
  flex: 1;
}

.diary-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #191f28;
  margin-bottom: 4px;
}

.diary-meta {
  font-size: 13px;
  color: #8b95a1;
}

.diary-arrow {
  color: #ccd2d9;
  font-size: 20px;
  font-weight: 300;
}

.empty-diary {
  text-align: center;
  color: #8b95a1;
  padding: 40px 20px;
}

/* Quote Card */
.app-quote-card {
  background: #e8f3ff;
  border-radius: 24px;
  padding: 24px;
  text-align: center;
}

.quote-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #3182f6;
  margin-bottom: 12px;
}

.quote-text {
  font-size: 16px;
  font-weight: 600;
  color: #334155;
  line-height: 1.6;
}

.friend-call-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.friend-call-modal.open {
  visibility: visible;
  opacity: 1;
}

.friend-call-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.42);
  cursor: pointer;
}

.friend-call-panel {
  position: relative;
  width: min(420px, 100%);
  border-radius: 28px 28px 24px 24px;
  padding: 28px 22px 20px;
  background: #ffffff;
  text-align: center;
  box-shadow: 0 -18px 46px rgba(15, 23, 42, 0.16);
  transform: translateY(18px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.friend-call-modal.open .friend-call-panel {
  transform: translateY(0);
}

.friend-call-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f2f4f6;
  color: #8b95a1;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.friend-call-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
}

.friend-call-avatar .chip-avatar {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  font-size: 26px;
}

.friend-call-avatar .chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.friend-call-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef6ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.friend-call-panel h2 {
  margin: 0;
  color: #191f28;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.friend-call-desc {
  margin: 12px 0 22px;
  color: #4e5968;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 600;
  word-break: keep-all;
}

.friend-call-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
}

.friend-call-secondary,
.friend-call-primary {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.friend-call-secondary {
  background: #f2f4f6;
  color: #4e5968;
}

.friend-call-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(49, 130, 246, 0.22);
}

.friend-call-secondary:active,
.friend-call-primary:active {
  transform: scale(0.98);
}

body.friend-modal-open {
  overflow: hidden;
}

@media (min-width: 600px) {
  .app-grid {
    grid-template-columns: 1fr 1fr;
  }

  .friend-call-modal {
    align-items: center;
  }
}

@media (max-width: 600px) {
  .diary-home .selected-hero-section {
    padding: 24px 20px;
  }

  .diary-home .hero-character-wrap {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 16px;
  }

  .diary-home .hero-avatar-big,
  .diary-home .hero-avatar-big .hero-avatar,
  .diary-home .hero-avatar-big .hero-avatar.has-image {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px;
    max-height: 80px;
  }

  .friend-call-modal {
    padding: 0 14px calc(14px + env(safe-area-inset-bottom));
  }

  .friend-call-actions {
    grid-template-columns: 1fr;
  }
}

/* --- Force Header/Footer and Scroll Fix --- */
body.page-ready:has(.diary-home) .site-header,
body.page-ready:has(.diary-home) .site-footer {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.site-header {
  z-index: 1000 !important;
}

.app-main .friend-selector-grid {
  display: flex !important;
  gap: 24px !important;
  overflow-x: auto !important;
  padding: 12px 10px 24px !important;
  margin: 0 -10px !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin !important;
}

.app-main .friend-selector-grid::-webkit-scrollbar {
  height: 5px !important;
  display: block !important;
}

.app-main .friend-selector-grid::-webkit-scrollbar-thumb {
  background: rgba(49, 130, 246, 0.2) !important;
  border-radius: 10px !important;
}

.app-friend-item {
  flex: 0 0 auto !important;
  width: 72px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 12px !important;
}

.app-friend-avatar {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 28px !important;
  border: 3.5px solid transparent !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  color: #fff !important;
  box-sizing: border-box !important;
  transition: all 0.25s ease !important;
}

.app-friend-item.active .app-friend-avatar {
  border-color: var(--primary) !important;
  transform: scale(1.08) !important;
  box-shadow: 0 8px 24px rgba(49, 130, 246, 0.2) !important;
}

.active-dot {
  width: 20px !important;
  height: 20px !important;
  border: 4px solid #f6f8fb !important;
  bottom: -2px !important;
  right: -2px !important;
}

.app-friend-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: inherit !important;
}

/* --- Call Room Premium Design --- */
.call-room-page {
  background-color: #f2f4f6;
  overflow: hidden;
}

.call-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 4px;
}

.nav-back {
  font-size: 32px;
  color: #191f28;
  text-decoration: none;
  font-weight: 300;
}

.nav-title {
  text-align: center;
}

.nav-title strong {
  display: block;
  font-size: 17px;
  color: #191f28;
}

.nav-title span {
  font-size: 13px;
  color: #8b95a1;
  font-weight: 500;
}

.usage-badge {
  font-size: 12px;
  background: #eef6ff;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
}

.call-interface-wrap {
  position: relative;
  height: calc(100vh - 180px);
  min-height: 540px;
}

/* Lobby */
.call-lobby {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  text-align: center;
}

.character-preview {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 40px auto 24px;
}

.character-large-avatar {
  width: 100%;
  height: 100%;
  border-radius: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 20px 40px rgba(49, 130, 246, 0.2);
  z-index: 2;
  position: relative;
}

.character-large-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.status-pulse {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 54px;
  border: 2px solid rgba(49, 130, 246, 0.2);
  animation: pulseLoop 2s infinite;
  z-index: 1;
}

@keyframes pulseLoop {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 0.4; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.lobby-title {
  font-size: 26px;
  font-weight: 800;
  color: #191f28;
  line-height: 1.4;
  margin-bottom: 12px;
}

.lobby-desc {
  font-size: 16px;
  color: #4e5968;
  font-weight: 500;
}

.goal-chip {
  display: inline-block;
  margin-top: 20px;
  padding: 8px 16px;
  background: #ffffff;
  border-radius: 12px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.lobby-actions {
  margin-bottom: 40px;
}

.start-call-btn {
  width: 100%;
  height: 64px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(49, 130, 246, 0.25);
}

.permission-hint {
  font-size: 13px;
  color: #8b95a1;
  margin-top: 16px;
}

/* Active Call */
.active-call-view {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.call-visual {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.avatar-animation-container {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
}

.active-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #fff;
  font-weight: 800;
  z-index: 5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.active-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.pulse-ring {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(49, 130, 246, 0.15);
  z-index: 1;
}

.r1 { animation: ripple 3s infinite ease-out; }
.r2 { animation: ripple 3s infinite ease-out 1s; }
.r3 { animation: ripple 3s infinite ease-out 2s; }

@keyframes ripple {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

.call-info-main {
  text-align: center;
}

.caller-name-text {
  font-size: 24px;
  font-weight: 800;
  color: #191f28;
  margin-bottom: 8px;
}

.call-timer-box {
  font-size: 20px;
  font-weight: 700;
  color: #4e5968;
  font-variant-numeric: tabular-nums;
  margin-bottom: 16px;
}

.connection-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #00c7ae;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 199, 174, 0.5);
}

.call-controls {
  padding-bottom: 40px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.control-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #8b95a1;
  transition: all 0.2s ease;
}

.control-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  color: #4e5968;
}

.control-btn.active .control-icon-circle {
  background: var(--primary);
  color: #ffffff;
}

.control-btn span {
  font-size: 13px;
  font-weight: 600;
}

.end-call-wrap {
  display: flex;
  justify-content: center;
}

.end-call-btn {
  width: 80%;
  height: 64px;
  border-radius: 32px;
  background: #f04452;
  color: #ffffff;
  border: none;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 12px 24px rgba(240, 68, 82, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.end-call-btn:active {
  transform: scale(0.96);
}

.end-call-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Transcript Sheet */
.transcript-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70vh;
  background: #ffffff;
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.transcript-sheet.open {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 5px;
  background: #e5e8eb;
  border-radius: 3px;
  margin: 12px auto;
}

.sheet-header {
  padding: 0 24px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f2f4f6;
}

.sheet-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #191f28;
}

.btn-close-sheet {
  background: none;
  border: none;
  font-size: 24px;
  color: #8b95a1;
  cursor: pointer;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: #f9fafb;
}

.sheet-footer {
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom));
  background: #ffffff;
  border-top: 1px solid #f2f4f6;
  text-align: center;
}

.mic-badge {
  display: inline-block;
  font-size: 12px;
  background: #f0f7ff;
  color: #3182f6;
  padding: 4px 12px;
  border-radius: 99px;
  font-weight: 700;
}

/* Bubble Styling */
.bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.5;
  position: relative;
}

.bubble small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
  opacity: 0.6;
}

.bubble.ai {
  align-self: flex-start;
  background: #ffffff;
  color: #191f28;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.bubble.user {
  align-self: flex-end;
  background: var(--primary);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}


/* --- Call Room Animation Refinement --- */
.pulse-ring {
  opacity: 0;
}

#phoneCard.ai-speaking .pulse-ring.r1 { animation: ripple 3s infinite ease-out; }
#phoneCard.ai-speaking .pulse-ring.r2 { animation: ripple 3s infinite ease-out 1s; }
#phoneCard.ai-speaking .pulse-ring.r3 { animation: ripple 3s infinite ease-out 2s; }

#phoneCard.user-speaking .active-avatar {
  box-shadow: 0 0 20px rgba(49, 130, 246, 0.4);
  transform: scale(1.05);
  transition: all 0.2s ease;
}

/* Character Avatar Text centering */
.character-large-avatar, .active-avatar {
  font-family: inherit;
  line-height: 1;
}

/* Transcript Bubble Content fix */
.bubble-content {
  word-break: break-word;
}

/* --- Mobile footer cleanup --- */
@media (max-width: 700px) {
  .site-footer .footer-links {
    display: none !important;
  }
}

/* --- Call room polish --- */
.call-room-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -120px, rgba(49, 130, 246, 0.14), transparent 300px),
    linear-gradient(180deg, #f8fafc 0%, #ffffff 46%, #f6f8fb 100%);
  overflow: visible;
}

.call-room-page .app-container {
  width: min(520px, calc(100% - 32px));
  padding-top: 18px;
}

.call-nav {
  position: sticky;
  top: 72px;
  z-index: 30;
  margin: 0 -4px 18px;
  padding: 10px 4px;
  background: rgba(248, 250, 252, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-back {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(25, 31, 40, 0.06);
  font-size: 30px;
}

.nav-right {
  min-width: 78px;
  display: flex;
  justify-content: flex-end;
}

.usage-badge {
  background: #ffffff;
  color: #1b64da;
  box-shadow: 0 4px 14px rgba(25, 31, 40, 0.05);
}

.call-interface-wrap {
  min-height: calc(100vh - 180px);
  height: auto;
  padding-bottom: 110px;
}

.call-lobby,
.active-call-view {
  min-height: calc(100vh - 210px);
  border: 1px solid rgba(49, 130, 246, 0.08);
  border-radius: 32px;
  padding: 28px 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 46px rgba(25, 31, 40, 0.06);
}

.character-preview {
  width: 128px;
  height: 128px;
  margin: 18px auto 24px;
}

.character-large-avatar {
  border-radius: 42px;
  box-shadow: 0 18px 36px rgba(49, 130, 246, 0.18);
}

.status-pulse {
  border-radius: 48px;
  border-color: rgba(49, 130, 246, 0.24);
}

.lobby-title {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.32;
  letter-spacing: -0.03em;
}

.lobby-desc {
  margin: 0 auto;
  max-width: 280px;
  color: #6b7684;
  line-height: 1.55;
}

.goal-chip {
  box-shadow: none;
  border: 1px solid #e8eef7;
}

.lobby-actions {
  width: 100%;
  margin: 34px 0 0;
}

.start-call-btn {
  width: 100%;
  height: 60px;
  border: 0;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #ffffff;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(49, 130, 246, 0.24);
  appearance: none;
  -webkit-appearance: none;
}

.permission-hint {
  margin: 14px 0 0;
}

.active-call-view {
  background:
    radial-gradient(circle at 50% 18%, rgba(49, 130, 246, 0.12), transparent 230px),
    rgba(255, 255, 255, 0.94);
}

.avatar-animation-container {
  width: 170px;
  height: 170px;
  margin-bottom: 30px;
}

.active-avatar {
  width: 116px;
  height: 116px;
  border: 5px solid #ffffff;
  box-shadow: 0 18px 34px rgba(25, 31, 40, 0.12);
}

.pulse-ring {
  width: 116px;
  height: 116px;
  background: rgba(49, 130, 246, 0.13);
}

.caller-name-text {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.call-timer-box {
  margin-bottom: 12px;
  color: #191f28;
  font-size: 24px;
  font-weight: 900;
}

.connection-status {
  color: #6b7684;
  font-size: 14px;
  font-weight: 700;
}

.call-controls {
  padding-bottom: 0;
}

.control-grid {
  gap: 12px;
  margin-bottom: 24px;
}

.control-icon-circle {
  width: 58px;
  height: 58px;
  box-shadow: 0 8px 18px rgba(25, 31, 40, 0.06);
}

.end-call-btn {
  width: 100%;
  max-width: 280px;
  height: 58px;
  border-radius: 18px;
  font-size: 17px;
}

.transcript-sheet {
  left: 50%;
  right: auto;
  width: min(520px, 100%);
  transform: translate(-50%, 100%);
  border-radius: 30px 30px 0 0;
}

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

@media (max-width: 700px) {
  .call-room-page .app-container {
    width: min(100% - 28px, 520px);
    padding-top: 12px;
  }

  .call-nav {
    top: 61px;
  }

  .call-lobby,
  .active-call-view {
    min-height: calc(100vh - 190px);
    padding: 24px 18px;
    border-radius: 28px;
  }

  .character-preview {
    width: 112px;
    height: 112px;
  }

  .lobby-title {
    font-size: 25px;
  }

  .control-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* --- Call room redesign v2 --- */
.call-room-page {
  background:
    linear-gradient(180deg, #f6f9ff 0%, #ffffff 42%, #f7f9fc 100%) !important;
  padding-bottom: 0;
}

.call-room-page .app-container {
  width: min(480px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

body:has(.call-room-page) .site-footer,
.call-room-page .site-footer {
  display: none;
}

.call-room-page .call-nav {
  position: relative;
  top: auto;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 10px;
  margin: 2px 0 18px;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.call-room-page .nav-back {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  color: #191f28;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(25, 31, 40, 0.07);
}

.call-room-page .nav-title strong {
  font-size: 20px;
  font-weight: 900;
}

.call-room-page .nav-title span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 13px;
  font-weight: 800;
}

.call-room-page .nav-title span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00c7ae;
  box-shadow: 0 0 0 4px rgba(0, 199, 174, 0.12);
}

.call-room-page .usage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 14px;
  background: #ffffff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(25, 31, 40, 0.06);
  white-space: nowrap;
}

.call-room-page .call-interface-wrap {
  min-height: auto;
  padding-bottom: calc(98px + env(safe-area-inset-bottom));
}

.call-room-page .call-lobby,
.call-room-page .active-call-view {
  min-height: auto;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.call-room-page .call-lobby {
  display: grid;
  gap: 20px;
}

.call-room-page .lobby-content {
  width: 100%;
  box-sizing: border-box;
  border-radius: 34px;
  padding: 34px 24px 28px;
  background:
    radial-gradient(circle at 50% 12%, rgba(49, 130, 246, 0.11), transparent 210px),
    #ffffff;
  border: 1px solid rgba(49, 130, 246, 0.08);
  box-shadow: 0 18px 42px rgba(25, 31, 40, 0.05);
  text-align: center;
}

.call-room-page .character-preview {
  width: 154px;
  height: 154px;
  margin: 0 auto 24px;
}

.call-room-page .character-large-avatar {
  border-radius: 50%;
  border: 6px solid #ffffff;
  box-shadow: 0 18px 44px rgba(49, 130, 246, 0.18);
  overflow: hidden;
}

.call-room-page .character-large-avatar img {
  transform: scale(1.03);
}

.call-room-page .status-pulse {
  top: -12px;
  right: -12px;
  bottom: -12px;
  left: -12px;
  border-radius: 50%;
  border: 2px solid rgba(49, 130, 246, 0.18);
}

.call-ready-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 6px 11px;
  background: #eef6ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.call-room-page .lobby-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.28;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.call-room-page .lobby-desc {
  max-width: 310px;
  margin-top: 13px;
  color: #4e5968;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}

.call-ready-points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 22px;
}

.call-ready-points span {
  min-height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f6f8fb;
  color: #4e5968;
  font-size: 13px;
  font-weight: 800;
}

.call-room-page .lobby-actions {
  position: sticky;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 20;
  margin: 0;
  border-radius: 28px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 44px rgba(25, 31, 40, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.call-room-page .start-call-btn {
  height: 62px;
  border-radius: 20px;
  font-size: 18px;
}

.call-room-page .permission-hint {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
}

.call-room-page .active-call-view {
  min-height: calc(100vh - 210px);
  padding: 26px 20px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 18%, rgba(49, 130, 246, 0.13), transparent 230px),
    #ffffff;
  border: 1px solid rgba(49, 130, 246, 0.08);
  box-shadow: 0 18px 42px rgba(25, 31, 40, 0.05);
}

.call-room-page .call-visual {
  justify-content: center;
}

.call-room-page .control-grid {
  border-radius: 24px;
  padding: 12px;
  background: #f6f8fb;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.call-room-page .control-icon-circle {
  background: #ffffff;
}

.call-room-page .end-call-btn {
  border-radius: 20px;
}

.hidden-transcript-store {
  display: none !important;
}

@media (max-width: 700px) {
  .call-room-page .app-container {
    width: calc(100% - 28px);
    margin-left: auto;
    margin-right: auto;
  }

  .call-room-page .call-nav {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    width: 100%;
  }

  .call-room-page .lobby-content {
    padding: 30px 20px 24px;
  }

  .call-room-page .character-preview {
    width: 138px;
    height: 138px;
  }

  .call-room-page .lobby-title {
    font-size: 28px;
  }

  .call-ready-points {
    grid-template-columns: 1fr;
  }
}

.admin-user-detail-link {
  color: inherit;
  text-decoration: none;
}

.admin-user-detail-link:hover {
  color: var(--primary);
}

.admin-user-detail-panel {
  max-width: 860px;
}

.admin-detail-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
  overflow-x: auto;
}

.admin-detail-tabs button {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: #f2f4f6;
  color: #4e5968;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.admin-detail-tabs button.active {
  background: var(--primary);
  color: #fff;
}

.admin-detail-panel {
  display: none;
}

.admin-detail-panel.active {
  display: block;
}

.admin-detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.admin-detail-list div,
.admin-mini-list a,
.admin-mini-list-button,
.admin-detail-stats article {
  border-radius: 16px;
  padding: 14px;
  background: #f8fafc;
}

.admin-detail-list dt {
  color: #8b95a1;
  font-size: 12px;
  font-weight: 900;
}

.admin-detail-list dd {
  margin: 4px 0 0;
  color: #191f28;
  font-weight: 800;
}

.admin-mini-list {
  display: grid;
  gap: 10px;
}

.admin-mini-list a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.admin-mini-list-button {
  display: block;
  width: 100%;
  border: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.admin-mini-list strong,
.admin-mini-list span,
.admin-mini-list-button strong,
.admin-mini-list-button span {
  display: block;
}

.admin-mini-list span,
.admin-mini-list-button span {
  margin-top: 4px;
  color: #6b7684;
  font-size: 13px;
  font-weight: 700;
}

.admin-print-range-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid #e5e8eb;
  border-radius: 20px;
  padding: 16px;
  background: #fff;
}

.admin-print-range-form strong,
.admin-print-range-form span {
  display: block;
}

.admin-print-range-form span {
  margin-top: 4px;
  color: #6b7684;
  font-size: 13px;
  font-weight: 700;
}

.admin-print-range-form label {
  display: grid;
  gap: 6px;
  color: #6b7684;
  font-size: 12px;
  font-weight: 900;
}

.admin-print-range-form input {
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}

.admin-diary-modal-panel {
  max-width: 760px;
}

.admin-diary-modal-body {
  display: grid;
  gap: 12px;
}

.admin-diary-modal-body h3 {
  margin: 8px 0 0;
  color: #191f28;
  font-size: 15px;
  font-weight: 900;
}

.admin-diary-modal-body p,
.admin-diary-emotion {
  margin: 0;
  border-radius: 16px;
  padding: 14px;
  background: #f8fafc;
  color: #333d4b;
  font-weight: 700;
  white-space: pre-wrap;
}

.admin-diary-emotion {
  background: #eef6ff;
  color: #1b64da;
}

@media (max-width: 820px) {
  .admin-print-range-form {
    grid-template-columns: 1fr;
  }
}

.admin-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.admin-detail-stats span,
.admin-detail-stats strong {
  display: block;
}

.admin-detail-stats span {
  color: #8b95a1;
  font-size: 12px;
  font-weight: 900;
}

.admin-detail-stats strong {
  margin-top: 6px;
  color: #191f28;
  font-size: 22px;
  font-weight: 900;
}

.admin-user-detail-page {
  padding-bottom: 80px;
}

.admin-user-detail-hero {
  align-items: stretch;
}

.admin-back-link {
  display: inline-flex;
  margin-bottom: 12px;
  color: #4e5968;
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
}

.admin-back-link:hover {
  color: var(--primary);
}

.admin-page-tabs {
  position: sticky;
  top: 88px;
  z-index: 5;
  margin-bottom: 22px;
  padding: 10px;
  border: 1px solid #e5e8eb;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-detail-card {
  border: 1px solid #e5e8eb;
  border-radius: 24px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(49, 130, 246, 0.08);
}

.admin-detail-card h2 {
  margin: 0 0 16px;
  color: #191f28;
  font-size: 20px;
  font-weight: 900;
}

.admin-detail-form {
  margin-top: 16px;
  justify-content: flex-start;
}

.admin-detail-stats.compact {
  min-width: min(520px, 100%);
  align-self: center;
}

@media (max-width: 820px) {
  .admin-detail-grid,
  .admin-detail-stats,
  .admin-detail-stats.compact {
    grid-template-columns: 1fr;
  }

  .admin-page-tabs {
    top: 0;
  }
}

.counseling-start-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  background:
    radial-gradient(circle at 88% 18%, rgba(49, 130, 246, 0.12), transparent 130px),
    #ffffff;
}

.counseling-start-card span {
  display: inline-flex;
  margin-bottom: 8px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef6ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.counseling-start-card h2 {
  margin: 0;
  color: #191f28;
  font-size: 23px;
  line-height: 1.35;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.counseling-start-card p {
  margin: 8px 0 0;
  color: #6b7684;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 700;
}

.counseling-start-card a {
  min-height: 50px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background: var(--primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.counseling-report-list {
  display: grid;
  gap: 12px;
}

.counseling-report-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.report-emoji {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #f2f7ff;
  font-size: 24px;
}

.counseling-report-item strong,
.counseling-report-item span {
  display: block;
}

.counseling-report-item strong {
  color: #191f28;
  font-size: 16px;
  font-weight: 900;
}

.counseling-report-item span {
  margin-top: 4px;
  color: #8b95a1;
  font-size: 13px;
  font-weight: 700;
}

.counseling-report-item i {
  color: #d1d6db;
  font-style: normal;
  font-size: 22px;
}

.counseling-report-paper {
  border: 1px solid #dbe7ff;
  border-radius: 24px;
  padding: 22px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(25, 31, 40, 0.04);
}

.counseling-report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 2px solid #dbe7ff;
  padding-bottom: 16px;
  margin-bottom: 18px;
}

.counseling-report-head span {
  display: inline-flex;
  margin-bottom: 7px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.counseling-report-head h2 {
  margin: 0;
  color: #191f28;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.counseling-report-head strong {
  border-radius: 999px;
  padding: 8px 12px;
  background: #eef6ff;
  color: var(--primary);
  font-size: 13px;
  white-space: nowrap;
}

.counseling-score-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border-radius: 18px;
  padding: 14px;
  background: #f8fafc;
  margin-bottom: 18px;
}

.counseling-score-row span,
.counseling-score-row strong {
  display: block;
}

.counseling-score-row span {
  color: #6b7684;
  font-size: 12px;
  font-weight: 900;
}

.counseling-score-row strong {
  margin-top: 2px;
  color: #191f28;
  font-size: 28px;
  font-weight: 900;
}

.counseling-score-row i {
  height: 12px;
  border-radius: 999px;
  background: #e8eef7;
  overflow: hidden;
}

.counseling-score-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #5ba2ff);
}

.counseling-report-body {
  color: #334155;
  font-size: 15px;
  line-height: 1.85;
  word-break: keep-all;
}

.login-redesign {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background:
    radial-gradient(circle at 50% -120px, rgba(49, 130, 246, 0.16), transparent 320px),
    linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
}

.login-card {
  width: min(430px, 100%);
  border: 1px solid rgba(49, 130, 246, 0.08);
  border-radius: 32px;
  padding: 34px 26px 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 54px rgba(25, 31, 40, 0.08);
}

.login-card .auth-back {
  display: inline-flex;
  margin-bottom: 22px;
  color: #6b7684;
  font-weight: 800;
  text-decoration: none;
}

.login-hero-mark {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  background: var(--primary);
  color: #fff;
  font-size: 23px;
  font-weight: 900;
  box-shadow: 0 14px 26px rgba(49, 130, 246, 0.24);
}

.login-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef6ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.login-card h1 {
  margin: 0;
  color: #191f28;
  font-size: 34px;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.login-card .subcopy {
  margin: 12px 0 24px;
  color: #6b7684;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 700;
}

.login-form {
  gap: 14px;
}

.login-form .field label {
  color: #4e5968;
  font-size: 13px;
  font-weight: 900;
}

.login-form .field input {
  min-height: 54px;
  border: 1px solid #e5e8eb;
  border-radius: 16px;
  background: #f8fafc;
  font-size: 16px;
}

.login-form .field input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(49, 130, 246, 0.08);
}

.login-submit {
  min-height: 56px;
  border-radius: 18px;
  background: var(--primary);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(49, 130, 246, 0.22);
}

.login-keep-note {
  margin: 14px 0 0;
  color: #8b95a1;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 600px) {
  .counseling-start-card {
    grid-template-columns: 1fr;
  }

  .counseling-start-card a {
    width: 100%;
  }
}

/* Diary Entry Emoji Wrap */
.diary-entry-icon-wrap {
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: #f2f4f6;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-right: 12px;
}

/* Custom Modal Alert */
.app-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: all 0.2s ease-out;
}
.app-modal.active {
  visibility: visible;
  opacity: 1;
}
.app-modal-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
}
.app-modal-content {
  position: relative;
  background: #fff;
  width: 85%;
  max-width: 320px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transform: scale(0.9);
  transition: transform 0.2s ease-out;
}
.app-modal.active .app-modal-content {
  transform: scale(1);
}
.app-modal-body {
  padding: 32px 24px 24px;
  text-align: center;
}
.app-modal-body p {
  font-size: 16px;
  font-weight: 500;
  color: #1f2538;
  line-height: 1.5;
  margin: 0;
  word-break: keep-all;
  white-space: pre-line;
}
.app-modal-footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0 16px 16px;
}

.app-modal-footer.is-confirm {
  grid-template-columns: 1fr 1fr;
}
.app-modal-btn {
  width: 100%;
  height: 52px;
  background: #f2f4f6;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  color: #3182f6;
  cursor: pointer;
}
.app-modal-btn.secondary {
  background: #f6f8fb;
  color: #4e5968;
}
.app-modal-btn:active {
  background: #e5e8eb;
}

.app-celebrate-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.app-celebrate-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.app-celebrate-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(6px);
}
.app-celebrate-card {
  position: relative;
  width: min(360px, 100%);
  padding: 32px 24px 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 24px 60px rgba(25, 31, 40, 0.18);
  text-align: center;
  transform: translateY(12px) scale(0.96);
  transition: transform 0.24s ease;
}
.app-celebrate-modal.is-open .app-celebrate-card {
  transform: translateY(0) scale(1);
}
.app-celebrate-emoji {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 12px;
}
.app-celebrate-card h2 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 900;
  color: #191f28;
}
.app-celebrate-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #6b7684;
  font-weight: 600;
}
.app-celebrate-actions {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}
.app-celebrate-actions .btn {
  width: 100%;
  min-height: 48px;
}

.copy-protected,
.copy-protected * {
  -webkit-user-select: none;
  user-select: none;
}

.page-progress-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10050;
  height: 3px;
  pointer-events: none;
  overflow: hidden;
  background: transparent;
  opacity: 0;
  transition: opacity .18s ease;
}
.page-progress-indicator.is-loading {
  opacity: 1;
}
.page-progress-indicator-bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--color-primary, #3182f6), #8b5cf6, var(--color-primary, #3182f6));
  border-radius: 0 999px 999px 0;
  box-shadow: 0 0 12px rgba(49, 130, 246, .28);
}
.page-progress-indicator.is-loading .page-progress-indicator-bar {
  animation: page-progress-loading 1s ease-in-out infinite;
}
@keyframes page-progress-loading {
  0% { transform: translateX(-35%) scaleX(.18); opacity: .78; }
  55% { transform: translateX(40%) scaleX(.46); opacity: 1; }
  100% { transform: translateX(105%) scaleX(.24); opacity: .78; }
}
@media (prefers-reduced-motion: reduce) {
  .page-progress-indicator-bar {
    animation: none !important;
    transition: none;
  }
}

/* Diary List Redesign (Timeline) */
.diary-list-redesign {
  padding-bottom: calc(var(--bottom-nav-height) + 48px + env(safe-area-inset-bottom));
}
.header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.header-back-btn {
  font-size: 28px;
  font-weight: 300;
  color: #8b95a1;
  margin-top: -4px;
}
.diary-timeline-container {
  margin-top: 32px;
}
.diary-list-month-label {
  font-size: 13px;
  font-weight: 800;
  color: #8b95a1;
  margin-bottom: 12px;
  padding-left: 2px;
}
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px 20px;
  min-height: 72px;
}
.loading-indicator-text {
  font-size: 13px;
  font-weight: 700;
  color: #8b95a1;
}
.diary-list-end-message {
  text-align: center;
  padding: 16px 20px 8px;
  font-size: 13px;
  font-weight: 700;
  color: #adb5bd;
}
.month-group {
  margin-bottom: 24px;
}
.month-label {
  margin-bottom: 16px;
  padding-left: 4px;
}
.month-label span {
  font-size: 18px;
  font-weight: 800;
  color: #191f28;
}
.entries-stack {
  display: grid;
  gap: 8px;
}
.diary-timeline-card {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 20px !important;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid rgba(0,0,0,0.02);
}
.diary-timeline-card:active {
  transform: scale(0.98);
  background-color: #f9fafb;
}
.card-date-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  margin-right: 20px;
  padding-right: 20px;
  border-right: 1px solid #f2f4f6;
}
.card-date-side .d-day {
  font-size: 20px;
  font-weight: 800;
  color: #191f28;
}
.card-date-side .d-week {
  font-size: 12px;
  font-weight: 600;
  color: #8b95a1;
}
.card-date-side .d-emoji {
  margin-top: 6px;
  font-size: 20px;
  line-height: 1;
}
.card-main-content {
  flex: 1;
  min-width: 0;
}
.card-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.friend-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--tag-color);
  background: color-mix(in srgb, var(--tag-color) 8%, #fff);
  padding: 2px 8px;
  border-radius: 6px;
}
.time-tag {
  font-size: 11px;
  font-weight: 500;
  color: #adb5bd;
}
.diary-entry-title {
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  color: #191f28;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.diary-entry-title .title-text {
  flex: 1;
  min-width: 0;
  display: block;
}
.title-emoji {
  flex: 0 0 auto;
  font-size: 18px;
}
.card-arrow {
  color: #d1d6db;
  font-size: 20px;
  margin-left: 12px;
}
.empty-state {
  text-align: center;
  padding: 60px 24px;
}
.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

/* Month Filter Navigation */
.month-filter-nav {
  position: sticky;
  top: 72px; /* Height of site-header */
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 40;
  margin: 0 -20px 24px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.filter-scroll-wrapper {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.filter-scroll-wrapper::-webkit-scrollbar {
  display: none;
}
.filter-chip {
  flex: 0 0 auto;
  padding: 8px 16px;
  background: #f2f4f6;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  color: #4e5968;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.filter-chip:active {
  background: #e5e8eb;
  transform: scale(0.95);
}
.filter-chip.active {
  background: var(--primary);
  color: #fff;
}

/* Spinner */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(49, 130, 246, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spinner 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spinner {
  to { transform: rotate(360deg); }
}

/* Emotion Calendar Redesign */
.calendar-hero-section {
  padding: 24px 16px !important;
  margin-bottom: 24px;
}
.calendar-nav-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 8px;
}
.nav-arrow-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2f4f6;
  border-radius: 50%;
  font-size: 20px;
  color: #8b95a1;
  transition: all 0.2s ease;
}
.nav-arrow-btn:active {
  background: #e5e8eb;
  transform: scale(0.9);
}
.current-month-label {
  font-size: 18px;
  font-weight: 800;
  color: #191f28;
}
.calendar-compact-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.weekday-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}
.weekday-labels span {
  font-size: 12px;
  font-weight: 600;
  color: #adb5bd;
}
.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.day-cell {
  aspect-ratio: 1/1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 14px;
  background: #f9fafb;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.day-cell:active {
  transform: scale(0.9);
}
.day-cell.selected {
  background: #fff;
  box-shadow: 0 0 0 2px var(--primary);
  z-index: 2;
}
.day-cell.has-entry {
  background: color-mix(in srgb, var(--day-color, var(--primary)) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--day-color, var(--primary)) 20%, transparent);
}
.day-num {
  font-size: 13px;
  font-weight: 700;
  color: #4e5968;
  margin-top: 2px;
}
.day-cell.selected .day-num {
  color: var(--primary);
}
.day-emoji-pop {
  font-size: 20px;
  line-height: 1;
  margin-bottom: 2px;
  animation: diaryEmojiPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes diaryEmojiPop {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.day-dot {
  width: 5px;
  height: 5px;
  background: #adb5bd;
  border-radius: 50%;
  margin-top: 4px;
}

/* Detail Panel */
.calendar-detail-panel {
  margin-bottom: 100px;
}
.empty-detail-state {
  text-align: center;
  padding: 48px 24px;
  background: rgba(255,255,255,0.6);
  border: 1px dashed #e5e8eb;
  box-shadow: none !important;
}
.review-detail-card {
  border-left: 6px solid var(--emotion-color);
  padding: 24px !important;
}
.review-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}
.review-date-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #8b95a1;
  margin-bottom: 4px;
}
.review-emotion-title {
  font-size: 22px;
  font-weight: 800;
  color: #191f28;
  display: flex;
  align-items: center;
  gap: 8px;
}
.review-score-badge {
  background: #f2f4f6;
  padding: 8px 14px;
  border-radius: 12px;
  text-align: center;
}
.review-score-badge strong {
  font-size: 20px;
  font-weight: 900;
  color: #191f28;
}
.review-score-badge span {
  font-size: 12px;
  color: #8b95a1;
  margin-left: 2px;
}
.review-summary-text {
  font-size: 15px;
  line-height: 1.65;
  color: #4e5968;
  margin-bottom: 20px;
  word-break: keep-all;
}
.review-summary-text mark {
  background: linear-gradient(180deg, transparent 55%, rgba(49, 130, 246, .24) 0);
  color: #1b64da;
  font-weight: 800;
  padding: 0 2px;
  border-radius: 3px;
}
.review-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.h-chip {
  background: #f9fafb;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #4e5968;
}

.section-sub-title {
  font-size: 16px;
  font-weight: 700;
  color: #191f28;
  margin: 24px 0 12px 4px;
}
.mini-session-card {
  display: flex;
  align-items: center;
  padding: 16px !important;
  margin-bottom: 10px;
  text-decoration: none;
}
.ms-emoji {
  font-size: 24px;
  margin-right: 14px;
}
.ms-body {
  flex: 1;
}
.ms-body strong {
  display: block;
  font-size: 15px;
  color: #191f28;
  margin-bottom: 2px;
}
.ms-body span {
  font-size: 12px;
  color: #8b95a1;
}
.ms-arrow {
  color: #d1d6db;
  font-size: 18px;
}

/* Final app UI refinements */
.plan-usage-ring strong {
  color: #191f28 !important;
  font-size: 18px !important;
  line-height: 1.15;
}

.plan-usage-ring span {
  color: #6b7684 !important;
  font-size: 11px;
  font-weight: 900;
}

.app-btn-primary {
  width: 100%;
  min-height: var(--btn-primary-min-height);
  border: 0;
  border-radius: var(--btn-primary-radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  background: var(--btn-primary-bg);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--btn-primary-shadow);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.15s ease, opacity 0.15s ease;
}

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

.my-settings-form .section-heading {
  align-items: center;
}

.my-settings-form .section-heading button {
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  background: #eef6ff;
  color: var(--primary, #3182f6);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.setting-row select {
  min-width: 128px;
  border: 0;
  border-radius: 12px;
  padding: 9px 32px 9px 12px;
  background: #f6f8fb;
  color: #191f28;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-align: right;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #8b95a1 50%),
    linear-gradient(135deg, #8b95a1 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.setting-toggle-row input[type="checkbox"] {
  width: 48px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #d1d6db;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  transition: background .2s ease;
}

.setting-toggle-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
  transition: transform .2s ease;
}

.setting-toggle-row input[type="checkbox"]:checked {
  background: var(--primary, #3182f6);
}

.setting-toggle-row input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}

button.day-cell {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.day-cell.empty {
  background: transparent;
  pointer-events: none;
}

.app-modal-btn[hidden] {
  display: none !important;
}

/* Tutorial-style auth pages */
body:has(.auth-tutorial-page) {
  background: #ffffff;
}

body:has(.auth-tutorial-page) .site-header,
body:has(.auth-tutorial-page) .site-footer,
body.auth-flow-page .site-header,
body.auth-flow-page .site-footer {
  display: none !important;
}

body:has(.auth-tutorial-page) .guest-site-footer,
body.auth-flow-page .guest-site-footer {
  display: none !important;
}

.auth-tutorial-page {
  position: relative;
  width: min(430px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
  padding-bottom: calc(138px + env(safe-area-inset-bottom));
}

.auth-tutorial-back {
  position: fixed;
  z-index: 20;
  top: calc(16px + env(safe-area-inset-top));
  left: max(16px, calc((100vw - 430px) / 2 + 16px));
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(246, 248, 251, .92);
  color: #191f28;
  font: inherit;
  font-size: 28px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.auth-tutorial-stage,
.auth-tutorial-slide {
  width: 100%;
  min-height: calc(100dvh - 138px - env(safe-area-inset-bottom));
  padding: calc(96px + env(safe-area-inset-top)) 22px 24px;
  display: flex;
  flex-direction: column;
}

.auth-tutorial-visual {
  min-height: 220px;
  margin-bottom: 24px;
}

.auth-tutorial-copy {
  margin-bottom: 16px;
}

/* HTTP error pages (400/403/404/500/503) */
.http-error-page .http-error-stage {
  justify-content: center;
  text-align: left;
}

.http-error-code {
  font-size: clamp(56px, 18vw, 88px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.06em;
  color: #e8f1ff;
  margin-bottom: 8px;
  user-select: none;
}

.http-error-copy h1 {
  font-size: clamp(28px, 7vw, 34px);
  line-height: 1.28;
  letter-spacing: -0.03em;
  color: #191f28;
  margin: 12px 0 10px;
}

.http-error-copy p {
  font-size: 15px;
  line-height: 1.65;
  color: #6b7684;
  margin: 0;
}

.http-error-actions {
  display: grid;
  gap: 10px;
}

.auth-tutorial-copy h1 {
  margin: 8px 0 0;
  color: #191f28;
  font-size: 30px;
  line-height: 1.16;
  letter-spacing: -0.05em;
}

.auth-tutorial-copy p {
  margin: 8px 0 0;
  color: #6b7684;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
  word-break: keep-all;
}

.auth-tutorial-form {
  display: grid;
  gap: 10px;
}

.auth-tutorial-form label:not(.onboarding-choice-card) {
  display: grid;
  gap: 7px;
}

.auth-tutorial-form label:not(.onboarding-choice-card) > span {
  color: #4e5968;
  font-size: 13px;
  font-weight: 900;
}

.auth-tutorial-form input:not([type="radio"]):not([type="hidden"]):not([type="checkbox"]) {
  width: 100%;
  min-width: 0;
  height: 56px;
  border: 1px solid #edf1f7;
  border-radius: 18px;
  padding: 0 16px;
  background: #f8fafc;
  color: #191f28;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  outline: none;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.auth-tutorial-form input:focus {
  border-color: rgba(49,130,246,.45);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(49,130,246,.08);
}

.auth-tutorial-form input.is-invalid {
  border-color: #f04452;
  box-shadow: 0 0 0 4px rgba(240,68,82,.08);
}

.auth-date-trigger {
  width: 100%;
  min-width: 0;
  height: 56px;
  border: 1px solid #edf1f7;
  border-radius: 18px;
  padding: 0 16px;
  background: #f8fafc;
  color: #191f28;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  outline: none;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
}

.auth-date-trigger:focus-visible {
  border-color: rgba(49,130,246,.45);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(49,130,246,.08);
}

.auth-date-trigger.is-invalid {
  border-color: #f04452;
  box-shadow: 0 0 0 4px rgba(240,68,82,.08);
}

.auth-date-trigger-label.is-placeholder {
  color: #8b95a1;
  font-weight: 700;
}

.auth-date-chevron {
  color: #8b95a1;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.birth-date-wheel {
  position: relative;
  margin-bottom: 16px;
}

.birth-date-wheel-highlight {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 10px);
  transform: translateY(-50%);
  height: 44px;
  background: #f2f4f6;
  border-radius: 14px;
  pointer-events: none;
  z-index: 0;
}

.birth-date-wheel-columns {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr 0.85fr;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.birth-date-wheel-column {
  min-width: 0;
}

.birth-date-wheel-header {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #8b95a1;
  margin-bottom: 8px;
}

.birth-date-wheel-mount {
  position: relative;
}

.birth-date-wheel-mount::before,
.birth-date-wheel-mount::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 72px;
  z-index: 2;
  pointer-events: none;
}

.birth-date-wheel-mount::before {
  top: 0;
  background: linear-gradient(to bottom, #fff 10%, rgba(255, 255, 255, 0));
}

.birth-date-wheel-mount::after {
  bottom: 0;
  background: linear-gradient(to top, #fff 10%, rgba(255, 255, 255, 0));
}

.birth-date-wheel-list {
  height: 220px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior: contain;
}

.birth-date-wheel-list::-webkit-scrollbar {
  display: none;
}

.birth-date-wheel-spacer {
  height: 88px;
  flex-shrink: 0;
}

.birth-date-wheel-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  border: 0;
  background: transparent;
  color: #b0b8c1;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  scroll-snap-align: center;
  cursor: pointer;
  transition: color .15s ease, transform .15s ease;
}

.birth-date-wheel-item.is-selected {
  color: #191f28;
  font-size: 18px;
  font-weight: 800;
}

.birth-date-wheel-item:active {
  transform: scale(0.98);
}

.birth-date-confirm-btn {
  width: 100%;
  min-height: 52px;
}

.auth-inline-error {
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff1f2;
  color: #e03131;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.auth-inline-error.success {
  background: #eef6ff;
  color: #1b64da;
}

.auth-tutorial-actions {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  transform: translateX(-50%);
  width: min(430px, 100%);
  padding: 18px 22px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255,255,255,.74), #fff 30%);
  backdrop-filter: blur(16px);
}

body.auth-keyboard-open .auth-tutorial-actions {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 24px);
}

.auth-tutorial-actions .btn {
  width: 100%;
  height: 56px;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 900;
}

.auth-tutorial-actions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: #6b7684;
  text-align: center;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.auth-action-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.auth-action-links.single {
  grid-template-columns: 1fr;
}

.auth-action-links a {
  border-radius: 14px;
  background: #f6f8fb;
}

.auth-action-links a:active {
  transform: translateY(1px);
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 2px 0 14px;
  padding: 4px;
  border-radius: 18px;
  background: #f6f8fb;
}

.auth-mode-tabs a {
  min-height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7684;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.auth-mode-tabs a.active {
  background: #fff;
  color: #1b64da;
  box-shadow: 0 8px 22px rgba(25,31,40,.08);
}

.auth-tutorial-progress {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 35;
  transform: translateX(-50%);
  width: min(430px, 100%);
  height: 4px;
  background: #edf1f7;
}

.auth-tutorial-steps-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.auth-tutorial-steps {
  width: 100%;
  display: flex;
  transition: transform .34s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}

.auth-tutorial-steps > .auth-tutorial-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
}

.features-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(280px, 100%);
}

.register-tutorial .auth-tutorial-visual {
  min-height: 180px;
}

.register-tutorial .service-summary-card {
  position: static;
  margin: 0 auto;
  width: min(260px, 100%);
}

@media (max-width: 390px) {
  .auth-tutorial-stage,
  .auth-tutorial-slide {
    padding-inline: 18px;
    padding-top: calc(44px + env(safe-area-inset-top));
  }

  .auth-tutorial-visual {
    min-height: 150px;
  }

  .register-tutorial .auth-tutorial-visual {
    min-height: 120px;
  }

  .auth-tutorial-copy h1 {
    font-size: 26px;
  }
}

/* Keep auth inputs close to the first viewport focus. */
.auth-tutorial-page .auth-tutorial-stage,
.auth-tutorial-page .auth-tutorial-slide {
  justify-content: flex-start;
  padding-top: calc(116px + env(safe-area-inset-top));
}

.auth-tutorial-page .auth-tutorial-visual {
  display: none;
}

.login-tutorial .auth-tutorial-visual {
  min-height: 104px;
  max-height: 124px;
}

.register-tutorial .auth-tutorial-visual {
  min-height: 88px;
  max-height: 112px;
  margin-bottom: 8px;
}

.auth-tutorial-page .auth-tutorial-copy {
  margin-bottom: 10px;
}

.auth-tutorial-page .auth-tutorial-copy h1 {
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.14;
}

.auth-tutorial-page .auth-tutorial-copy p {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.45;
}

.auth-tutorial-page .auth-tutorial-form {
  gap: 10px;
  margin-top: 18px;
}

.auth-tutorial-page .auth-tutorial-form input {
  height: 54px;
}

.auth-field-link {
  justify-self: end;
  margin: -2px 2px 2px 0;
  color: #6b7684;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.auth-field-link:active {
  color: #1b64da;
}

.friend-onboarding-page .auth-tutorial-form .onboarding-choice-card {
  display: flex !important;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  min-height: 72px;
  text-align: left;
}

.friend-onboarding-page .auth-tutorial-form .onboarding-choice-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 22px;
  line-height: 1;
  background: #eef6ff;
}

.friend-onboarding-page .auth-tutorial-form .onboarding-choice-card--warm .onboarding-choice-icon {
  background: #fff0f3;
}

.friend-onboarding-page .auth-tutorial-form .onboarding-choice-card--calm .onboarding-choice-icon {
  background: #eef8f4;
}

.friend-onboarding-page .auth-tutorial-form .onboarding-choice-card--bright .onboarding-choice-icon {
  background: #fff8e8;
}

.friend-onboarding-page .auth-tutorial-form .onboarding-choice-card--practical .onboarding-choice-icon {
  background: #f3f0ff;
}

.friend-onboarding-page .auth-tutorial-form .onboarding-choice-body {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.friend-onboarding-page .auth-tutorial-form .onboarding-choice-card input[type="radio"] {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  width: 22px;
  height: 22px;
  margin: 0;
  flex: 0 0 22px;
  align-self: center;
}

.onboarding-choice-stack {
  display: grid;
  gap: 10px;
}

.auth-tutorial-form .onboarding-choice-card {
  min-height: 72px;
  border: 1px solid #edf1f7;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: #f8fafc;
  position: relative;
  overflow: visible;
  cursor: pointer;
  text-align: left;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.auth-tutorial-form .onboarding-choice-card::before,
.auth-tutorial-form .onboarding-choice-card::after {
  display: none;
  content: none;
}

.auth-tutorial-form .onboarding-choice-card input[type="radio"] {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex: 0 0 22px;
  border: 2px solid #d1d6db;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  cursor: pointer;
}

.auth-tutorial-form .onboarding-choice-card input[type="radio"]:checked {
  border-color: #3182f6;
  background: #3182f6;
  box-shadow: 0 0 0 4px rgba(49, 130, 246, .12);
}

.auth-tutorial-form .onboarding-choice-card input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
}

.onboarding-choice-card::before {
  content: "";
  position: absolute;
  inset: 14px auto 14px 0;
  width: 4px;
  border-radius: 999px;
  background: #dbeafe;
  opacity: 0;
  transition: opacity .18s ease;
}

.onboarding-choice-card::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d1d6db;
  box-shadow: 0 0 0 6px rgba(209,214,219,.16);
  transform: translateY(-50%);
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.onboarding-choice-card:not(.auth-tutorial-form .onboarding-choice-card) input,
.onboarding-character-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.onboarding-choice-body,
.onboarding-character-card span {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.onboarding-choice-card strong,
.onboarding-character-card strong {
  display: block;
  color: #191f28;
  font-size: 15px;
  font-weight: 900;
}

.onboarding-choice-card small,
.onboarding-character-card small {
  display: block;
  margin-top: 4px;
  color: #6b7684;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  word-break: keep-all;
}

.onboarding-choice-card:has(input:checked) {
  border-color: rgba(49,130,246,.32);
  background: #eef6ff;
  box-shadow: 0 10px 24px rgba(49,130,246,.08);
}

.onboarding-choice-card:has(input:checked)::before {
  opacity: 1;
}

.onboarding-choice-card:has(input:checked)::after {
  background: #3182f6;
  box-shadow: 0 0 0 7px rgba(49,130,246,.14);
  transform: translateY(-50%) scale(1.08);
}

.auth-mbti-grid {
  margin: -2px 0 2px;
}

.auth-chip-field {
  display: grid;
  gap: 9px;
}

.auth-chip-field > span {
  color: #4e5968;
  font-size: 13px;
  font-weight: 900;
}

.mbti-axis-list {
  display: grid;
  gap: 8px;
}

.mbti-axis-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.auth-tutorial-form .mbti-axis-row label {
  min-height: 58px;
  border: 1px solid #e5e8eb;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mbti-axis-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mbti-axis-row strong {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #6b7684;
  font-size: 15px;
  font-weight: 900;
}

.mbti-axis-row small {
  min-width: 0;
  color: #6b7684;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  word-break: keep-all;
}

.auth-tutorial-form .mbti-axis-row label:has(input:checked) {
  border-color: rgba(49,130,246,.34);
  background: #eef6ff;
  box-shadow: 0 8px 20px rgba(49,130,246,.08);
}

.mbti-axis-row label:has(input:checked) strong {
  background: #3182f6;
  color: #fff;
}

.mbti-axis-row label:has(input:checked) small {
  color: #1b64da;
}

.onboarding-personality-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.personality-chip {
  min-height: 40px;
  border: 1px solid #edf1f7;
  border-radius: 999px;
  padding: 0 13px;
  background: #f8fafc;
  color: #4e5968;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.personality-chip.selected {
  border-color: rgba(49,130,246,.32);
  background: #eef6ff;
  color: #1b64da;
  box-shadow: 0 8px 18px rgba(49,130,246,.08);
}

.personality-chip:active {
  transform: translateY(1px);
}

.onboarding-character-list {
  max-height: min(460px, calc(100dvh - 340px));
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 4px 2px 20px;
  -webkit-overflow-scrolling: touch;
}

.onboarding-character-list.collapsed {
  display: none;
}

.onboarding-character-card {
  width: 100%;
  border: 1px solid #edf1f7;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 10px;
  background: #f8fafc;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
}

.character-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.onboarding-character-card .friend-avatar {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  overflow: hidden;
}

.character-info strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: #191f28;
  margin-bottom: 4px;
}

.character-info p {
  font-size: 13px;
  color: #4e5968;
  margin: 0 0 8px;
  line-height: 1.4;
  font-weight: 500;
}

.character-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.character-tags .tag {
  font-size: 11px;
  color: #3182f6;
  background: #eef6ff;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
}

.onboarding-character-card.selected {
  border-color: #3182f6;
  background: #fff;
  box-shadow: 0 12px 26px rgba(49, 130, 246, 0.12);
  transform: translateY(-2px);
}

.onboarding-character-card:active {
  transform: translateY(1px);
}

.recommend-story-stage {
  min-height: 240px;
  border: 0;
  border-radius: 0;
  padding: 26px 8px;
  background: transparent;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  text-align: center;
  box-shadow: none;
  animation: onboardingStoryIn .7s ease both;
  transition: opacity .72s ease, transform .72s ease, min-height .72s ease, padding .72s ease;
}

.recommend-story-stage.is-switching {
  opacity: 0;
  transform: translateY(12px) scale(.985);
}

.recommend-story-stage.is-done {
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.recommend-story-icon {
  width: 64px;
  height: 64px;
  border-radius: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  font-size: 32px;
  box-shadow: 0 16px 38px rgba(25,31,40,.08);
  animation: thinkingPulse 1.8s ease-in-out infinite;
}

.recommend-story-stage.is-found .recommend-story-icon {
  display: none;
}

.recommend-story-stage.is-found {
  animation: foundMessagePop .9s cubic-bezier(.2,.8,.2,1) both;
}

.recommend-story-stage p,
.recommend-story-stage .recommend-story-text {
  margin: 0;
  color: #191f28;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.55;
  word-break: keep-all;
  letter-spacing: -0.025em;
}

.recommend-story-stage.is-found p,
.recommend-story-stage.is-found .recommend-story-text {
  color: #1b64da;
  font-size: 28px;
  line-height: 1.32;
  text-shadow: 0 12px 30px rgba(49,130,246,.12);
}

.recommended-friend-card {
  border: 1px solid #edf1f7;
  border-radius: 30px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 20px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 20px 48px rgba(25,31,40,.075);
  animation: onboardingFriendReveal .9s .12s cubic-bezier(.2,.8,.2,1) both;
}

.recommended-friend-card.is-hidden,
.change-friend-btn.is-hidden,
.friend-change-note.is-hidden {
  display: none;
}

.friend-reveal-avatar {
  flex: 0 0 auto;
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 30px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(49,130,246,.18), transparent 62%),
    #eef6ff;
  box-shadow: 0 18px 40px rgba(49,130,246,.16);
}

.friend-reveal-avatar::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 34px;
  border: 2px solid rgba(49,130,246,.16);
  background: linear-gradient(135deg, rgba(49,130,246,.22), rgba(255,255,255,0)) border-box;
  pointer-events: none;
}

.friend-highlight-badge {
  position: absolute;
  z-index: 2;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  min-height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  background: #3182f6;
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  box-shadow: 0 10px 20px rgba(49,130,246,.22);
}

.friend-reveal-avatar .friend-avatar {
  position: relative;
  z-index: 1;
  width: 78px;
  height: 78px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(25,31,40,.08);
}

.recommended-friend-card strong {
  display: block;
  color: #191f28;
  font-size: 23px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.recommended-friend-card small {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  margin-top: 8px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef6ff;
  color: #1b64da;
  font-size: 13px;
  font-weight: 900;
}

.recommended-friend-card p {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  color: #4e5968;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
  word-break: keep-all;
}

.change-friend-btn {
  min-height: 50px;
  border: 0;
  border-radius: 18px;
  background: #f6f8fb;
  color: #4e5968;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.friend-change-note {
  display: block;
  margin-top: -2px;
  color: #8b95a1;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.auth-tutorial-actions .btn:disabled {
  background: #dbe2ea;
  color: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
}

@keyframes onboardingStoryIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes thinkingPulse {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.04);
  }
}

@keyframes foundMessagePop {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(.96);
  }
  45% {
    opacity: 1;
    transform: translateY(0) scale(1.035);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes onboardingFriendReveal {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-tutorial .auth-action-links {
  grid-template-columns: 1fr;
}

.login-tutorial .auth-action-links a + a {
  margin-top: 0;
}

.login-tutorial .chat-mockup {
  gap: 7px;
}

.login-tutorial .chat-bubble {
  padding: 8px 12px;
  font-size: 12px;
}

body:has(.login-tutorial) {
  overflow: hidden;
  height: 100dvh;
  overscroll-behavior: none;
}

.login-tutorial {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.login-tutorial .auth-tutorial-stage {
  flex: 1 1 auto;
  min-height: 0 !important;
  overflow: hidden;
  padding-bottom: 12px;
}

.login-tutorial .auth-tutorial-actions {
  flex: 0 0 auto;
}

.register-tutorial .features-grid.compact {
  gap: 10px;
}

.register-tutorial .feature-card {
  min-height: 78px;
  padding: 12px 10px;
  border-radius: 18px;
}

.register-tutorial .feature-icon {
  font-size: 22px;
}

@media (max-height: 760px), (max-width: 390px) {
  .auth-tutorial-page .auth-tutorial-stage,
  .auth-tutorial-page .auth-tutorial-slide {
    padding-top: calc(94px + env(safe-area-inset-top));
  }

  .auth-tutorial-page .auth-tutorial-visual,
  .login-tutorial .auth-tutorial-visual,
  .register-tutorial .auth-tutorial-visual {
    min-height: 76px;
    max-height: 96px;
  }

  .auth-tutorial-page .auth-tutorial-copy h1 {
    font-size: 25px;
  }

  .auth-tutorial-page .auth-tutorial-copy p {
    font-size: 13px;
  }

  .auth-tutorial-page .auth-tutorial-form input {
    height: 50px;
  }

  .auth-tutorial-page .auth-tutorial-form {
    margin-top: 16px;
  }
}

/* Mind Report */
.mind-report-page {
  background: linear-gradient(180deg, #f7faff 0%, #ffffff 32%);
}

.mind-report-hero {
  margin-bottom: 18px;
}

.report-summary-card {
  margin-top: 18px;
  border-radius: 28px;
  padding: 24px;
  background:
    radial-gradient(circle at 86% 12%, rgba(49, 130, 246, .18), transparent 120px),
    linear-gradient(135deg, #ffffff, #eef6ff);
  border: 1px solid rgba(49, 130, 246, .12);
  box-shadow: 0 18px 42px rgba(49, 130, 246, .08);
}

.report-summary-card > span,
.report-insight-card > span,
.report-section-head > span,
.monthly-letter-card > span {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #eef6ff;
  color: var(--primary, #3182f6);
  font-size: 12px;
  font-weight: 900;
}

.report-summary-card h2 {
  margin: 0;
  color: #191f28;
  font-size: 28px;
  line-height: 1.28;
  letter-spacing: -0.04em;
}

.report-summary-card p,
.report-value-card p,
.report-section-head p,
.report-list-card p,
.topic-pattern-card p,
.recovery-card p,
.monthly-letter-card p,
.report-insight-card p {
  color: #4e5968;
  line-height: 1.68;
  word-break: keep-all;
}

.report-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.report-hero-stats strong {
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,.72);
  color: #191f28;
  font-size: 24px;
  font-weight: 900;
}

.report-hero-stats small {
  display: block;
  margin-top: 2px;
  color: #8b95a1;
  font-size: 12px;
}

.report-month-nav {
  margin-bottom: 16px;
}

.report-tabs {
  position: sticky;
  top: 78px;
  z-index: 20;
  display: flex;
  gap: 8px;
  margin: 0 -20px 18px;
  padding: 8px 20px;
  overflow-x: auto;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(14px);
}

.report-tabs button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: #f2f4f6;
  color: #6b7684;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.report-tabs button.active {
  background: #191f28;
  color: #fff;
}

.report-panel {
  display: none;
  padding-bottom: 120px;
}

.report-panel.active {
  display: grid;
  gap: 14px;
}

.report-insight-card,
.report-value-card,
.report-calendar-card,
.report-graph-card,
.report-section-head,
.report-list-card,
.topic-pattern-card,
.recovery-card,
.monthly-letter-card,
.report-mini-card {
  margin-bottom: 0;
  border: 1px solid rgba(49, 130, 246, .08);
  box-shadow: 0 10px 32px rgba(25,31,40,.04);
}

.report-grid-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.report-mini-card span {
  display: block;
  color: #8b95a1;
  font-size: 12px;
  font-weight: 900;
}

.report-mini-card strong {
  display: block;
  margin-top: 8px;
  color: #191f28;
  font-size: 18px;
  line-height: 1.35;
}

.report-value-card {
  background: #191f28;
}

.report-value-card strong,
.report-value-card p {
  color: #fff;
}

.report-calendar-card .days-grid {
  gap: 6px;
}

.report-calendar-card .day-cell {
  min-width: 0;
  border: 0;
}

.report-graph-card h2 {
  margin: 0 0 14px;
  color: #191f28;
  font-size: 19px;
}

.emotion-graph-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
  margin-top: 11px;
}

.emotion-graph-row span,
.emotion-graph-row strong {
  color: #6b7684;
  font-size: 12px;
  font-weight: 900;
}

.emotion-graph-row i {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf1f7;
}

.emotion-graph-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8ec5ff, var(--primary, #3182f6));
}

.report-list-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
}

.report-list-card em {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef6ff;
  color: var(--primary, #3182f6);
  font-style: normal;
  font-weight: 900;
}

.report-list-card strong,
.topic-pattern-card strong,
.recovery-card strong {
  display: block;
  color: #191f28;
  font-size: 17px;
  line-height: 1.4;
}

.growth-point-list {
  display: grid;
  gap: 8px;
}

.growth-point-list span {
  border-radius: 16px;
  padding: 13px 14px;
  background: #f6f8fb;
  color: #4e5968;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.monthly-letter-card {
  padding: 28px !important;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, rgba(49,130,246,.5), rgba(0,199,174,.28)) border-box;
  border: 1px solid transparent;
}

.monthly-letter-card p {
  color: #191f28;
  font-size: 16px;
}

@media (max-width: 480px) {
  .report-summary-card h2 {
    font-size: 24px;
  }

  .report-grid-cards {
    grid-template-columns: 1fr;
  }
}

/* Mind Report v2 */
.mind-report-page .app-container {
  padding-top: 18px;
}

.mind-report-hero {
  margin-bottom: 12px;
}

.mind-report-hero .app-sub-greeting {
  margin-top: 4px;
}

.report-summary-card {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 14px;
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 95% 0%, rgba(0, 199, 174, .18), transparent 105px),
    linear-gradient(135deg, #ffffff 0%, #f5f9ff 100%);
}

.report-summary-main {
  min-width: 0;
}

.report-summary-main > span {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef6ff;
  color: var(--primary, #3182f6);
  font-size: 11px;
  font-weight: 900;
}

.report-summary-card h2 {
  font-size: 30px;
  line-height: 1.05;
}

.report-summary-main p {
  margin: 8px 0 0;
  color: #6b7684;
  font-size: 13px;
  font-weight: 900;
}

.report-summary-bubbles {
  display: grid;
  gap: 8px;
}

.report-summary-bubbles span {
  min-width: 0;
  border-radius: 17px;
  padding: 10px 12px;
  background: rgba(255,255,255,.84);
  color: #191f28;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(25,31,40,.04);
}

.report-summary-bubbles b {
  display: inline-flex;
  margin-right: 8px;
  border-radius: 999px;
  padding: 3px 7px;
  background: #f2f4f6;
  color: #6b7684;
  font-size: 10px;
}

.report-analyzing-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  border-radius: 24px;
  padding: 16px;
  background: #191f28;
  color: #fff;
  box-shadow: 0 18px 36px rgba(25,31,40,.16);
}

.report-analyzing-card strong {
  display: block;
  font-size: 17px;
  font-weight: 900;
}

.report-analyzing-card p {
  margin: 5px 0 0;
  color: rgba(255,255,255,.72);
  font-size: 13px;
  line-height: 1.5;
}

.analyzing-orbit {
  position: relative;
  width: 56px;
  height: 56px;
}

.report-ai-avatar,
.report-ai-avatar.has-image {
  width: 56px;
  height: 56px;
  border-radius: 20px;
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.report-ai-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.analyzing-orbit i {
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 22px;
  animation: reportPulse 1.4s ease-in-out infinite;
}

.analyzing-orbit i + i {
  inset: -11px;
  animation-delay: .35s;
}

@keyframes reportPulse {
  0%, 100% { opacity: .25; transform: scale(.95); }
  50% { opacity: .8; transform: scale(1.04); }
}

.report-analyzing-card.is-done {
  background: #0f9f7a;
}

.report-analyzing-card.is-error {
  background: #4e5968;
}

.report-tabs {
  gap: 10px;
  margin-bottom: 14px;
}

.report-tabs button {
  min-width: 78px;
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 9px 12px;
  border-radius: 18px;
}

.report-tabs button span {
  font-size: 10px;
  color: inherit;
  opacity: .64;
}

.report-focus-card {
  border: 0;
  background:
    radial-gradient(circle at 90% 15%, rgba(49,130,246,.12), transparent 110px),
    #ffffff;
}

.report-focus-card > span,
.report-card-title > span {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #eef6ff;
  color: var(--primary, #3182f6);
  font-size: 12px;
  font-weight: 900;
}

.report-focus-card h2 {
  margin: 0 0 12px;
  color: #191f28;
  font-size: 24px;
  line-height: 1.32;
  letter-spacing: -0.04em;
}

.report-focus-card mark,
.report-section-head mark {
  border-radius: 8px;
  padding: 0 5px;
  background: linear-gradient(180deg, transparent 48%, rgba(49,130,246,.18) 0);
  color: inherit;
}

.report-bubble-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.report-bubble-card {
  min-height: 116px;
  border-radius: 24px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.report-bubble-card span {
  color: rgba(25,31,40,.62);
  font-size: 12px;
  font-weight: 900;
}

.report-bubble-card strong {
  color: #191f28;
  font-size: 17px;
  line-height: 1.35;
  word-break: keep-all;
}

.report-bubble-card.emotion { background: #eef6ff; }
.report-bubble-card.worry { background: #fff5e8; }
.report-bubble-card.recovery { background: #eafbf5; }

.report-card-title {
  display: grid;
  gap: 2px;
  margin-bottom: 12px;
}

.report-card-title strong {
  color: #191f28;
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: -0.03em;
}

.report-section-head.emphasis {
  background: #f7f9fc;
  border: 0;
}

.emotion-line-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.emotion-line-chart line {
  stroke: #edf1f7;
  stroke-width: 1;
}

.emotion-line-chart polyline {
  fill: none;
  stroke: var(--primary, #3182f6);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 10px rgba(49,130,246,.18));
}

.emotion-line-chart circle {
  fill: #fff;
  stroke: var(--primary, #3182f6);
  stroke-width: 3;
}

.emotion-line-chart text {
  fill: #8b95a1;
  font-size: 10px;
  font-weight: 800;
  text-anchor: middle;
}

@media (max-width: 520px) {
  .report-summary-card {
    grid-template-columns: 1fr;
  }

  .report-summary-bubbles {
    grid-template-columns: 1fr;
  }

  .report-bubble-grid {
    grid-template-columns: 1fr;
  }

  .report-bubble-card {
    min-height: 88px;
  }
}

/* Mind Report compact mobile dashboard */
body:has(.mind-report-page) {
  background: #fff;
}

body:has(.mind-report-page) .site-footer {
  display: none;
}

.mind-report-page {
  min-height: 100dvh;
  padding-bottom: calc(var(--bottom-nav-height, 82px) + 34px + env(safe-area-inset-bottom));
}

.mind-report-page .app-container {
  padding-top: 12px;
  padding-bottom: 0;
}

.mind-report-page .header-top {
  margin-bottom: 2px;
}

.mind-report-page .app-greeting {
  font-size: 22px;
}

.report-month-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 8px;
  border-radius: 999px;
  padding: 5px 8px;
  background: #f6f8fb;
}

.report-month-inline a {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #6b7684;
  font-size: 18px;
  text-decoration: none;
}

.report-month-inline strong {
  color: #191f28;
  font-size: 13px;
  font-weight: 900;
}

.report-summary-card {
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 10px;
  margin-top: 4px;
  padding: 13px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(49,130,246,.06);
}

.report-summary-main > span {
  margin-bottom: 7px;
  padding: 4px 7px;
  font-size: 10px;
}

.report-summary-card h2 {
  font-size: 18px;
  line-height: 1.22;
  word-break: keep-all;
}

.report-summary-main p {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.35;
}

.report-summary-bubbles {
  gap: 6px;
}

.report-summary-bubbles span {
  padding: 7px 9px;
  border-radius: 13px;
  font-size: 12px;
}

.report-summary-bubbles b {
  margin-right: 6px;
  padding: 2px 6px;
  font-size: 9px;
}

.report-analyzing-card {
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 10px;
  border-radius: 18px;
  padding: 11px;
}

.report-analyzing-card strong {
  font-size: 14px;
}

.report-analyzing-card p {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
}

.analyzing-orbit,
.report-ai-avatar,
.report-ai-avatar.has-image {
  width: 42px;
  height: 42px;
  border-radius: 15px;
}

.report-first-glance {
  margin: 10px 0;
}

.report-mini-flow-card {
  border-radius: 20px;
  padding: 12px 14px 6px;
  background: #191f28;
  color: #fff;
  box-shadow: 0 14px 30px rgba(25,31,40,.12);
}

.report-mini-flow-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: -4px;
}

.report-mini-flow-card span {
  color: rgba(255,255,255,.64);
  font-size: 11px;
  font-weight: 900;
}

.report-mini-flow-card strong {
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.report-mini-flow-card .emotion-line-chart {
  display: block;
  margin-top: -2px;
  max-height: 116px;
}

.report-mini-flow-card .emotion-line-chart line {
  stroke: rgba(255,255,255,.12);
}

.report-mini-flow-card .emotion-line-chart polyline,
.report-mini-flow-card .emotion-line-chart path {
  fill: none;
  stroke: #73d7ff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report-mini-flow-card .emotion-line-chart circle {
  fill: #191f28;
  stroke: #73d7ff;
}

.report-tabs {
  position: sticky;
  top: 70px;
  justify-content: center;
  gap: 6px;
  margin: 0 -10px 10px;
  padding: 6px 10px;
}

.report-tabs button {
  min-width: 0;
  flex: 1 1 0;
  max-width: 110px;
  border-radius: 14px;
  padding: 9px 10px;
  font-size: 13px;
}

.report-tabs button span {
  display: none;
}

.report-panel {
  padding-bottom: 0;
}

.report-panel.active {
  gap: 10px;
}

.report-panel-continuation {
  margin-top: 10px;
}

.report-focus-card h2 {
  margin-bottom: 8px;
  font-size: 21px;
}

.report-bubble-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.report-bubble-card {
  min-height: auto;
  border-radius: 18px;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.report-bubble-card strong {
  min-width: 0;
  font-size: 15px;
}

.report-card-title strong {
  font-size: 17px;
}

.report-expand {
  color: #4e5968;
}

.report-expand summary {
  width: fit-content;
  border-radius: 999px;
  padding: 7px 10px;
  background: #f2f4f6;
  color: #4e5968;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.report-expand summary::-webkit-details-marker {
  display: none;
}

.report-expand p {
  margin: 10px 0 0;
}

.report-calendar-card,
.report-graph-card,
.report-focus-card,
.report-insight-card,
.report-section-head,
.report-list-card,
.topic-pattern-card,
.recovery-card,
.monthly-letter-card {
  border-radius: 20px;
  padding: 18px !important;
}

.report-calendar-card .days-grid {
  gap: 5px;
}

.report-calendar-card .day-cell {
  border-radius: 10px;
}

.report-calendar-card .day-emoji-pop {
  font-size: 16px;
}

.emotion-line-chart {
  max-height: 160px;
}

.monthly-letter-card {
  margin-bottom: 0;
}

.report-insufficient-card {
  border: 0;
  background: linear-gradient(135deg, #f7f9fc, #eef6ff);
}

.report-insufficient-card span {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: var(--primary, #3182f6);
  font-size: 12px;
  font-weight: 900;
}

.report-insufficient-card strong {
  display: block;
  color: #191f28;
  font-size: 20px;
  font-weight: 900;
}

.report-insufficient-card p {
  margin: 8px 0 0;
  color: #6b7684;
  line-height: 1.58;
  word-break: keep-all;
}

@media (max-width: 380px) {
  .report-summary-card {
    grid-template-columns: 1fr;
  }
}

/* Admin API and grouped navigation */
.admin-shell-nav-groups {
  overflow: visible;
}

.admin-nav-dropdown {
  position: relative;
}

.admin-nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.admin-nav-dropdown.active .admin-nav-dropdown-toggle,
.admin-nav-dropdown:hover .admin-nav-dropdown-toggle {
  background: #eef5ff;
  color: #1d64d8;
}

.admin-nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 50;
  min-width: 160px;
  display: none;
  padding: 8px;
  border: 1px solid #e5edf7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
}

.admin-nav-dropdown:hover .admin-nav-dropdown-menu,
.admin-nav-dropdown:focus-within .admin-nav-dropdown-menu {
  display: grid;
  gap: 4px;
}

.admin-nav-dropdown-menu a {
  display: block;
  border-radius: 10px;
  padding: 10px 12px;
  color: #334155;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 800;
}

.admin-nav-dropdown-menu a.active,
.admin-nav-dropdown-menu a:hover {
  background: #f2f7ff;
  color: #1d64d8;
}

.admin-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #eef5ff;
  color: #1d64d8;
  font-size: 12px;
  font-weight: 900;
}

.admin-api-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.admin-api-summary article {
  border: 1px solid #e5edf7;
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.admin-api-summary span,
.admin-api-summary small {
  display: block;
  color: #6b7684;
  font-size: 12px;
  font-weight: 800;
}

.admin-api-summary strong {
  display: block;
  margin: 8px 0 4px;
  color: #191f28;
  font-size: 24px;
  font-weight: 950;
}

.admin-api-key-form,
.admin-api-log-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.admin-api-key-form label,
.admin-api-log-filter label,
.admin-api-edit label {
  display: grid;
  gap: 6px;
  color: #4e5968;
  font-size: 12px;
  font-weight: 900;
}

.admin-api-key-form input,
.admin-api-log-filter input,
.admin-api-log-filter select,
.admin-api-edit input {
  width: 100%;
  border: 1px solid #dfe7f3;
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  color: #191f28;
  font-size: 14px;
}

.admin-api-log-filter .wide {
  grid-column: span 2;
}

.admin-section-head,
.admin-setting-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.admin-api-test-result {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 14px;
  background: #f8fbff;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.admin-api-test-result div {
  display: grid;
  gap: 3px;
}

.admin-api-test-result span {
  color: #64748b;
  font-weight: 700;
}

.admin-api-key-table .mono {
  display: block;
  margin-top: 4px;
  color: #0f766e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.ok {
  background: #ecfdf3;
  color: #079455;
}

.status-pill.stop {
  background: #fff1f3;
  color: #d92d20;
}

.admin-api-edit summary,
.admin-api-log-detail summary {
  cursor: pointer;
  color: #2563eb;
  font-weight: 900;
}

.admin-api-edit form {
  display: grid;
  gap: 10px;
  min-width: 220px;
  margin-top: 10px;
  border: 1px solid #e5edf7;
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.admin-api-log-detail pre {
  max-width: 520px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid #e5edf7;
  border-radius: 12px;
  padding: 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
}

.admin-pagination {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

.btn.danger {
  background: #fff1f3;
  color: #d92d20;
}

@media (max-width: 980px) {
  .admin-api-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-api-key-form,
  .admin-api-log-filter {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .admin-shell-nav-groups {
    overflow-x: auto;
  }

  .admin-nav-dropdown-menu {
    position: fixed;
    left: 14px;
    right: 14px;
    top: 72px;
  }

  .admin-api-summary,
  .admin-api-key-form,
  .admin-api-log-filter {
    grid-template-columns: 1fr;
  }

  .admin-api-log-filter .wide {
    grid-column: auto;
  }
}

/* Global input overflow prevention styles */
input, select, textarea {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* App site footer */
.app-site-footer,
.guest-site-footer {
  background: #ffffff;
  color: #6b7684;
  border-top: 1px solid #eeeeee;
}

.app-site-footer {
  padding: 40px var(--app-gutter) calc(var(--bottom-nav-height) + 24px + env(safe-area-inset-bottom, 0px));
}

.guest-site-footer {
  padding: 40px var(--app-gutter) calc(24px + env(safe-area-inset-bottom, 0px));
}

.app-site-footer-inner {
  width: min(760px, calc(100% - var(--app-gutter) * 2));
  margin: 0 auto;
}

.app-site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #eeeeee;
}

.app-site-footer-nav a {
  color: #333d4b;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.app-site-footer-company {
  display: grid;
  gap: 4px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #eeeeee;
  font-size: 12px;
  line-height: 1.6;
  color: #8b95a1;
}

.app-site-footer-company a {
  color: inherit;
  text-decoration: none;
}

.app-site-footer-contributors {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid #eeeeee;
}

.app-site-footer-contributors strong {
  display: block;
  margin-bottom: 12px;
  color: #333d4b;
  font-size: 14px;
  font-weight: 800;
}

.contributor-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contributor-avatars {
  display: flex;
  gap: 8px;
}

.contributor-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f2f4f6;
  color: #4e5968;
  font-size: 13px;
  font-weight: 800;
}

.contributor-link {
  color: #8b95a1;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.app-site-footer-brand {
  color: #b0b8c1;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.guest-footer-actions {
  margin-top: 20px;
  text-align: center;
}

.guest-footer-actions a {
  color: #8b95a1;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 700px) {
  .app-site-footer {
    padding: 20px 16px calc(var(--bottom-nav-height) + 14px + env(safe-area-inset-bottom, 0px));
  }

  .guest-site-footer {
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .app-site-footer-inner {
    width: 100%;
  }

  .app-site-footer-nav {
    gap: 8px 14px;
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  .app-site-footer-nav a {
    font-size: 12px;
  }

  .app-site-footer-nav a:nth-child(-n+2),
  .app-site-footer-contributors,
  .app-site-footer-brand {
    display: none;
  }

  .app-site-footer-company {
    gap: 2px;
    margin: 0;
    padding: 0;
    border-bottom: 0;
    font-size: 10px;
    line-height: 1.45;
  }

  .app-site-footer-company p:nth-child(2),
  .app-site-footer-company p:nth-child(3) {
    display: none;
  }
}

/* Call room + auth tutorial integration */
body:has(.call-room-page) .site-header,
body:has(.call-room-page) .app-bottom-nav,
body:has(.call-room-page) .app-site-footer,
body.in-active-call .site-header,
body.in-active-call .app-bottom-nav,
body.in-active-call .app-site-footer {
  display: none !important;
}

.call-room-page.auth-tutorial-page {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.call-room-page .call-room-container {
  padding-top: calc(72px + env(safe-area-inset-top));
}

.call-room-notice {
  padding: 24px 0;
}

.call-room-page .control-btn {
  border: 0;
  background: transparent;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: #4e5968;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.call-room-page .control-btn.active .control-icon-circle {
  background: #3182f6;
  color: #ffffff;
}

.call-room-page .control-icon-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffffff;
  font-size: 20px;
}

.call-room-page .end-call-btn {
  width: 100%;
  border: 0;
  border-radius: 20px;
  min-height: 58px;
  background: #f04452;
  color: #ffffff;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(240, 68, 82, 0.22);
}

.call-room-page .end-call-btn:disabled {
  background: #b0b8c1;
  box-shadow: none;
}

.call-room-page .call-transcript-panel {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 120;
  transform: translateX(-50%) translateY(calc(100% - 56px));
  width: min(430px, 100%);
  height: 360px;
  background: rgba(255, 255, 255, 0.94);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  border-top: 1px solid #f2f4f6;
  box-shadow: 0 -10px 32px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.call-room-page .call-transcript-panel.open {
  transform: translateX(-50%) translateY(0);
}

.call-room-page .transcript-handle {
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-bottom: 1px solid #f2f4f6;
}

.call-room-page .handle-line {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: #dddfeb;
  margin-bottom: 6px;
}

.call-room-page .handle-text {
  font-size: 11px;
  font-weight: 800;
  color: #8b95a1;
}

.call-room-page .transcript-log {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.call-room-page .bubble {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}

.call-room-page .bubble.user {
  align-self: flex-end;
  align-items: flex-end;
}

.call-room-page .bubble.ai {
  align-self: flex-start;
  align-items: flex-start;
}

.call-room-page .bubble small {
  font-size: 11px;
  font-weight: 800;
  color: #8b95a1;
  margin-bottom: 4px;
}

.call-room-page .bubble-content {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
}

.call-room-page .bubble.user .bubble-content {
  background: #3182f6;
  color: #ffffff;
}

.call-room-page .bubble.ai .bubble-content {
  background: #f2f4f6;
  color: #191f28;
}

.phone-card.in-call .call-lobby {
  display: none !important;
}

.phone-card.in-call .active-call-view {
  display: flex !important;
  flex-direction: column;
  justify-content: space-between;
}

.phone-card.ai-speaking .pulse-ring {
  background: rgba(168, 85, 247, 0.12);
}

.phone-card.user-speaking .pulse-ring {
  background: rgba(49, 130, 246, 0.12);
}

.phone-card.ai-speaking .active-avatar {
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.28);
}

.phone-card.user-speaking .active-avatar {
  box-shadow: 0 0 24px rgba(49, 130, 246, 0.28);
}

.phone-card.in-call .ui-call-lobby,
.phone-card.in-call .call-lobby,
.ui-call-room-v3.in-call .ui-call-lobby {
  display: none !important;
}

.phone-card.in-call .ui-call-active,
.phone-card.in-call .active-call-view,
.ui-call-room-v3.in-call .ui-call-active {
  display: flex !important;
}

body:has(.ui-call-room-v3) .site-header,
body:has(.ui-call-room-v3) .app-bottom-nav,
body:has(.ui-call-room-v3) .app-site-footer,
body.in-active-call .app-bottom-nav,
body.in-active-call .app-site-footer {
  display: none !important;
}

/* Home page */
body:has(.ui-home-page) { background: #ffffff; }
.ui-home-page .app-container {
  padding-top: 16px;
}
.ui-home-page .ui-home-hero { margin-bottom: 8px; padding-top: 12px; }
.ui-home-page .ui-home-kicker { margin-bottom: 12px; }
.ui-home-kicker { font-size: 14px; font-weight: 700; color: #3182f6; margin: 0 0 8px; }
.ui-home-hero { margin-bottom: 18px; }
.ui-call-hero-card {
  background: linear-gradient(160deg, #ffffff 0%, #f7fbff 100%);
  border: 1px solid rgba(49,130,246,.08);
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 16px 40px rgba(49,130,246,.08);
  margin-bottom: 14px;
}
.ui-call-hero-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.ui-call-hero-avatar {
  width: 54px; height: 54px; border-radius: 18px; overflow: hidden; flex-shrink: 0;
  background: #eef6ff; display: grid; place-items: center; font-weight: 800; color: #3182f6;
}
.ui-call-hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ui-call-hero-copy { flex: 1; min-width: 0; }
.ui-call-hero-copy strong { display: block; font-size: 18px; color: #191f28; }
.ui-call-hero-copy span { display: block; font-size: 13px; color: #6b7684; margin-top: 2px; }
.ui-link-btn { border: 0; background: #eef6ff; color: #3182f6; font-weight: 800; font-size: 12px; padding: 8px 12px; border-radius: 999px; cursor: pointer; }
.ui-call-primary-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 58px; border-radius: 18px; border: 0;
  background: var(--btn-primary-bg); color: #fff; font-size: 17px; font-weight: 800;
  text-decoration: none; box-shadow: var(--btn-primary-shadow);
}
.ui-call-primary-btn:hover { background: var(--btn-primary-bg-hover); }
.ui-call-primary-btn:disabled { background: #e5e8eb; color: #b0b8c1; box-shadow: none; opacity: 1; }
.ui-call-hints { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.ui-call-hints span { font-size: 11px; font-weight: 700; color: #6b7684; background: #f2f4f6; padding: 6px 10px; border-radius: 999px; }
.ui-home-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.ui-stat-chip { background: #fff; border-radius: 18px; padding: 14px 16px; border: 1px solid #f2f4f6; }
.ui-stat-chip small { display: block; font-size: 11px; color: #8b95a1; font-weight: 700; margin-bottom: 4px; }
.ui-stat-chip strong { font-size: 18px; color: #191f28; }
.ui-section-head { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 10px; }
.ui-section-head h2 { margin: 0; font-size: 16px; font-weight: 900; color: #191f28; }
.ui-section-head a { font-size: 12px; font-weight: 800; color: #8b95a1; text-decoration: none; }
.ui-list-card { background: #fff; border-radius: 20px; padding: 4px 16px; border: 1px solid #f2f4f6; margin-bottom: 14px; }
.ui-list-item { display: block; padding: 14px 0; border-bottom: 1px solid #f2f4f6; text-decoration: none; }
.ui-list-item:last-child { border-bottom: 0; }
.ui-list-item strong { display: block; font-size: 15px; color: #333d4b; margin-bottom: 4px; }
.ui-list-item span { font-size: 12px; color: #adb5bd; font-weight: 600; }
.ui-report-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: #fff; border-radius: 20px; padding: 18px 20px; text-decoration: none;
  border: 1px solid #f2f4f6; margin-bottom: 16px;
}
.ui-report-banner strong { display: block; font-size: 15px; color: #191f28; }
.ui-report-banner p { margin: 4px 0 0; font-size: 13px; color: #8b95a1; }
.ui-report-banner > span { color: #3182f6; font-weight: 800; font-size: 13px; white-space: nowrap; }

/* Home main (diary_call.php) */
body:has(.home-main) { background: #f9fafb; }
.home-main .app-container { padding-top: 8px; }
.home-top { margin-bottom: 4px; padding-top: 8px; }
.home-top-kicker {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #3182f6;
  letter-spacing: -0.01em;
}
.home-top-title {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.32;
  color: #191f28;
  letter-spacing: -0.03em;
}
.home-call-card {
  margin-top: 14px;
  margin-bottom: 12px;
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid #eef2f6;
  box-shadow: 0 8px 24px rgba(25, 31, 40, 0.06);
}
.home-call-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.home-call-avatar {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #f0f7ff;
  box-shadow: 0 6px 16px rgba(49, 130, 246, 0.12);
  background: #eef6ff;
  display: grid;
  place-items: center;
}
.home-call-info {
  min-width: 0;
  flex: 1;
  text-align: left;
}
.home-call-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.home-call-name-row strong {
  font-size: 18px;
  font-weight: 900;
  color: #191f28;
  letter-spacing: -0.02em;
}
.home-call-desc {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: #6b7684;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-change-btn {
  flex-shrink: 0;
  border: 0;
  background: #f2f4f6;
  color: #4e5968;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.home-call-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  background: var(--btn-primary-bg);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--btn-primary-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.home-call-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.home-call-btn--text {
  background: #ffffff;
  color: var(--btn-primary-bg);
  border: 1.5px solid #d1d6db;
  box-shadow: none;
}
.home-call-btn--text:hover:not(.is-disabled):not(:disabled) {
  background: #f8f9fa;
}
.home-call-btn--text.is-disabled,
.home-call-btn--text:disabled {
  background: #f2f4f6;
  color: #b0b8c1;
  border-color: #e5e8eb;
}
.home-call-btn-emoji,
.home-call-btn-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  font-size: 16px;
  line-height: 1;
}
.home-call-btn--voice .home-call-btn-icon {
  color: #ffffff;
}
.home-call-btn--text .home-call-btn-icon {
  color: var(--btn-primary-bg);
}
.home-call-btn--text.is-disabled .home-call-btn-icon,
.home-call-btn--text:disabled .home-call-btn-icon {
  color: #b0b8c1;
}
.home-call-btn--voice.is-disabled .home-call-btn-icon,
.home-call-btn--voice:disabled .home-call-btn-icon {
  color: #b0b8c1;
}
.home-call-btn:hover:not(.is-disabled):not(:disabled) {
  background: var(--btn-primary-bg-hover);
  color: #fff;
}
.home-call-btn--text:hover:not(.is-disabled):not(:disabled) {
  background: #f8f9fa;
  color: var(--btn-primary-bg);
}
.home-call-btn--text:hover:not(.is-disabled):not(:disabled) .home-call-btn-icon {
  color: var(--btn-primary-bg);
}
.home-call-btn-icon--text::after {
  content: '···';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  transform: none;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
}
.home-call-btn:active { transform: scale(0.985); }
.home-call-btn.is-disabled,
.home-call-btn:disabled {
  background: #e5e8eb;
  color: #b0b8c1;
  box-shadow: none;
  cursor: not-allowed;
}
.home-call-btn--text.is-disabled,
.home-call-btn--text:disabled {
  background: #f2f4f6;
  color: #b0b8c1;
  border-color: #e5e8eb;
}
.home-call-btn-icon--legacy {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  position: relative;
}
.home-call-btn-icon--legacy::after {
  content: '';
  position: absolute;
  inset: 4px 3px 3px 4px;
  border: 2px solid #fff;
  border-radius: 4px 4px 6px 4px;
  transform: rotate(-12deg);
}
.home-call-note {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: #8b95a1;
  text-align: center;
}
.home-call-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f2f4f6;
  font-size: 12px;
  font-weight: 700;
  color: #8b95a1;
}
.home-call-foot span:last-child {
  color: #3182f6;
  font-weight: 800;
}
.home-call-avatar .home-avatar-img,
.home-call-avatar > div,
.home-call-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.home-call-avatar > div {
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
}
.home-call-avatar > div img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-call-avatar span:not([class]) {
  font-size: 28px;
  font-weight: 900;
  color: #3182f6;
}
.home-quick-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.home-quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 10px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #f2f4f6;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(25, 31, 40, 0.03);
  transition: transform 0.15s ease;
  text-align: center;
}
.home-quick-item:active { transform: scale(0.98); }
.home-quick-icon { font-size: 20px; line-height: 1; }
.home-quick-item strong {
  font-size: 13px;
  font-weight: 800;
  color: #191f28;
}
.home-plan-card {
  display:block;
  margin-bottom:16px;
  padding:14px 16px;
  border-radius:16px;
  background:#fff;
  border:1px solid #edf0f3;
  box-shadow:0 5px 18px rgba(25,31,40,.035);
  color:inherit;
  text-decoration:none;
}
.home-plan-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.home-plan-head span { color:#8b95a1; font-size:12px; font-weight:750; }
.home-plan-head strong { color:#3182f6; font-size:14px; }
.home-plan-head i { font-size:10px; margin-left:3px; }
.home-plan-count { display:flex; align-items:baseline; gap:4px; margin-top:7px; }
.home-plan-count strong { color:#191f28; font-size:20px; letter-spacing:-.03em; }
.home-plan-count span { color:#6b7684; font-size:12px; font-weight:700; }
.home-plan-progress { height:4px; margin-top:9px; overflow:hidden; border-radius:999px; background:#e9eef5; }
.home-plan-progress i { display:block; height:100%; border-radius:inherit; background:#3182f6; }
.home-report-card { background:#f6f9ff; border-color:#e5efff; }
.home-report-badge { background:#e8f2ff; color:#3182f6; }
.home-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}
.home-stat-pill {
  background: #fff;
  border: 1px solid #f2f4f6;
  border-radius: 16px;
  padding: 14px 16px;
}
.home-stat-pill small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #8b95a1;
  margin-bottom: 4px;
}
.home-stat-pill strong {
  font-size: 18px;
  font-weight: 900;
  color: #191f28;
  letter-spacing: -0.02em;
}
.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 10px;
}
.home-section-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #191f28;
}
.home-section-head a {
  font-size: 12px;
  font-weight: 800;
  color: #8b95a1;
  text-decoration: none;
}
.home-recent-card {
  background: #fff;
  border: 1px solid #f2f4f6;
  border-radius: 20px;
  padding: 4px 8px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(25, 31, 40, 0.03);
}
.home-recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 8px;
  text-decoration: none;
  border-bottom: 1px solid #f2f4f6;
}
.home-recent-item:last-child { border-bottom: 0; }
.home-recent-emoji {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #f9fafb;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.home-recent-body { min-width: 0; flex: 1; }
.home-recent-body strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #333d4b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-recent-body small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  color: #adb5bd;
}
.home-recent-chevron {
  font-size: 22px;
  font-weight: 300;
  color: #d1d6db;
  line-height: 1;
}
.home-recent-empty {
  padding: 36px 16px;
  text-align: center;
}
.home-recent-empty-icon { font-size: 32px; display: block; margin-bottom: 10px; }
.home-recent-empty p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  color: #adb5bd;
}
.home-report-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 18px;
  margin-bottom: 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff8ef 0%, #fff4f8 100%);
  border: 1px solid rgba(255, 159, 10, 0.14);
}
.home-report-card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}
.home-report-badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 159, 10, 0.14);
  color: #e67e00;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.home-report-badge--status {
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}
.home-report-copy strong {
  display: block;
  font-size: 16px;
  font-weight: 900;
  color: #191f28;
}
.home-report-copy p {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #6b7684;
}
.home-report-go {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 800;
  color: #e67e00;
  white-space: nowrap;
}
.home-report-verify-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 14px;
  background: var(--btn-primary-bg);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--btn-primary-shadow);
}
.home-report-verify-btn:hover {
  background: var(--btn-primary-bg-hover);
}

.app-ad-slot {
  width: 100%;
  overflow: visible;
}
.app-ad-slot .kakao-ad-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
  width: 100%;
  min-height: 0;
  overflow: visible;
}
.app-page-ad-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav-height, 56px) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(760px, 100%);
  max-width: 100%;
  margin: 0;
  padding: 8px var(--app-gutter, 16px) 10px;
  overflow: visible;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid #f2f4f6;
  box-shadow: 0 -4px 20px rgba(25, 31, 40, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1050;
}
body:has(.app-page-ad-bar:not(:has(.app-ad-slot[data-ad-status="failed"]))) .app-main {
  min-height: auto;
  padding-bottom: calc(var(--bottom-nav-height, 56px) + var(--ad-height, 100px) + 28px + env(safe-area-inset-bottom, 0px)) !important;
}
body:has(.app-page-ad-bar:not(:has(.app-ad-slot[data-ad-status="failed"]))) .app-site-footer {
  padding-bottom: calc(var(--bottom-nav-height, 56px) + var(--ad-height, 100px) + 24px + env(safe-area-inset-bottom, 0px)) !important;
}
.app-page-ad-bar .app-ad-slot {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
.app-page-ad-bar .app-ad-slot ins.kakao_ad_area,
.app-page-ad-bar .app-ad-slot iframe {
  height: var(--ad-height, 100px) !important;
  min-height: 0 !important;
}
.app-page-ad-bar .kakao-ad-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.app-page-ad-bar .kakao-ad-wrapper::-webkit-scrollbar {
  display: none;
}
.app-ad-slot--global {
  max-width: none;
  margin: 0 auto;
  padding: 0;
  overflow: visible;
}
.app-ad-slot ins,
.app-ad-slot iframe {
  margin-left: auto;
  margin-right: auto;
}
.app-ad-slot ins.kakao_ad_area {
  display: block !important;
  width: min(var(--ad-width, 320px), 100%) !important;
  min-width: 0;
  max-width: 100%;
  height: var(--ad-height, 480px) !important;
  min-height: var(--ad-height, 480px);
  border: 0;
}
.app-ad-slot iframe {
  width: min(var(--ad-width, 320px), 100%) !important;
  height: var(--ad-height, 480px) !important;
  max-width: 100%;
  border: 0;
}
/* 광고 실패 시 빈 공간 제거 */
.app-ad-slot[data-ad-status="failed"] {
  display: none !important;
}
.app-page-ad-bar:has(.app-ad-slot[data-ad-status="failed"]) {
  display: none !important;
}
.app-ad-slot--home {
  margin-bottom: 8px;
}
.app-ad-slot--report {
  margin-top: 40px;
  text-align: center;
}
.app-ad-slot--call {
  min-height: 50px;
}

@media (max-width: 360px) {
  .home-top-title { font-size: 25px; }
  .home-quick-item { padding: 12px 10px; }
  .home-quick-item strong { font-size: 12px; }
}

.ui-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
}
.ui-sheet.open { display: block; }
.ui-sheet-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.45); z-index: 1; }
.ui-sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; background: #fff;
  border-radius: 24px 24px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  z-index: 2;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.ui-sheet.open .ui-sheet-panel { transform: translateY(0); }
.ui-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.ui-sheet-head h3 { margin: 0; font-size: 18px; font-weight: 900; }
.ui-sheet-close { border: 0; background: #f2f4f6; width: 32px; height: 32px; border-radius: 50%; font-size: 20px; cursor: pointer; }
.ui-sheet-list {
  max-height: min(60vh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.ui-sheet-list form { margin: 0; display: block; }
.ui-sheet-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid #f2f4f6;
  border-radius: 16px;
  background: #fff;
  margin-bottom: 8px;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}
.ui-sheet-item.active {
  border-color: #3182f6;
  background: #f0f7ff;
}
.ui-sheet-copy {
  min-width: 0;
  flex: 1;
}
.ui-sheet-item strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #191f28;
}
.ui-sheet-item p {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  color: #6b7684;
}
.ui-sheet-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  display: block;
}
.ui-sheet-avatar .ui-sheet-face,
.ui-sheet-avatar > div {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: none;
}
.ui-sheet-avatar .ui-sheet-face img,
.ui-sheet-avatar .ui-sheet-face.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ui-sheet-avatar .ui-sheet-face span {
  font-size: 16px;
  font-weight: 900;
}

/* Call room */
body:has(.ui-call-room-v3) {
  background: linear-gradient(180deg, #eef4ff 0%, #f6f8fb 38%, #ffffff 100%);
}
.ui-call-room-v3 {
  width: min(430px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
  color: #191f28;
}
.ui-call-topbar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 8px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: transparent;
}
.ui-call-top-spacer {
  width: 44px;
  height: 44px;
}
.ui-call-back {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  text-decoration: none;
  color: #191f28;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.ui-call-top-title {
  min-width: 0;
  text-align: center;
}
.ui-call-top-title strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #191f28;
  letter-spacing: -0.02em;
}
.ui-call-top-title span {
  display: block;
  font-size: 12px;
  color: #3182f6;
  font-weight: 700;
  margin-top: 2px;
}
.ui-call-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  color: #3182f6;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  border: 1px solid #eef2f6;
  cursor: pointer;
}
.ui-call-room-v3.in-call .ui-call-time-badge {
  display: none;
}
.ui-call-end-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #ffffff;
}

body.call-end-overlay-open {
  overflow: hidden;
}

body.call-end-overlay-open .ui-call-topbar,
body.call-end-overlay-open .site-header,
body.call-end-overlay-open .app-bottom-nav,
body.call-end-overlay-open .user-menu-drawer,
body.call-end-overlay-open .sidebar-drawer {
  visibility: hidden !important;
  pointer-events: none !important;
}

body.diary-writing-lock {
  overflow: hidden;
}

body.diary-writing-lock .site-header,
body.diary-writing-lock .app-bottom-nav,
body.diary-writing-lock .user-menu-drawer,
body.diary-writing-lock .sidebar-drawer,
body.diary-writing-lock .app-site-footer {
  visibility: hidden !important;
  pointer-events: none !important;
}

.diary-writing-lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #ffffff;
}

.diary-writing-lock-overlay .diary-writing-screen {
  width: min(100%, 420px);
  margin: 0 auto;
}
.ui-call-end-overlay-inner {
  width: min(100%, 340px);
  text-align: center;
  padding: 8px 12px;
}
.ui-call-end-spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid #e5e8eb;
  border-top-color: #3182f6;
  animation: uiCallSpin 0.9s linear infinite;
}
.ui-call-end-overlay-inner h2 {
  margin: 22px 0 8px;
  font-size: 22px;
  font-weight: 900;
  color: #191f28;
  letter-spacing: -0.03em;
}
.ui-call-end-overlay-inner p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #6b7684;
  line-height: 1.55;
}
@keyframes uiCallSpin {
  to { transform: rotate(360deg); }
}
.ui-call-empty {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px 20px 40px;
}
.ui-call-empty-card {
  width: 100%;
  max-width: 320px;
  text-align: center;
  background: #fff;
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
  border: 1px solid #f2f4f6;
}
.ui-call-empty-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
}
.ui-call-empty-card p {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
  color: #4e5968;
  line-height: 1.5;
}
.ui-call-empty-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  background: var(--btn-primary-bg);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--btn-primary-shadow);
}
.ui-call-empty-link:hover {
  background: var(--btn-primary-bg-hover);
}
.ui-call-lobby {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 16px 12px;
  min-height: 0;
}
.ui-call-lobby-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 8px 0 12px;
  text-align: center;
}
.ui-call-greeting {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.32;
  color: #191f28;
  margin: 0 0 4px;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.ui-call-lobby-panel {
  background: #fff;
  border-radius: 20px;
  padding: 18px 16px 16px;
  box-shadow: 0 8px 24px rgba(49, 130, 246, 0.06);
  border: 1px solid rgba(49, 130, 246, 0.06);
}
.ui-call-lobby-panel .ui-call-subcopy {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
}
.ui-call-character-tags {
  margin-top: 10px;
}
.ui-call-lobby-settings {
  background: #fff;
  border-radius: 20px;
  border: 1px solid #f2f4f6;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(25, 31, 40, 0.03);
  text-align: left;
  margin-bottom: 12px;
}
.ui-call-settings-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 0;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.ui-call-settings-row + .ui-call-settings-row {
  border-top: 1px solid #f9fafb;
}
.ui-call-settings-row > span:first-child {
  font-size: 14px;
  font-weight: 600;
  color: #333d4b;
}
.ui-call-settings-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 800;
  color: #3182f6;
  white-space: nowrap;
}
.ui-call-settings-value .chevron {
  font-size: 17px;
  color: #adb5bd;
  font-weight: 300;
}
.ui-call-friend-desc {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: #4e5968;
  line-height: 1.45;
}
.ui-call-lobby-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.ui-call-lobby-meta span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #eef2f6;
  font-size: 12px;
  font-weight: 800;
  color: #4e5968;
}
.ui-call-lobby-tips {
  list-style: none;
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(49, 130, 246, 0.06);
  text-align: left;
}
.ui-call-lobby-tips li {
  position: relative;
  padding-left: 14px;
  font-size: 13px;
  font-weight: 600;
  color: #4e5968;
  line-height: 1.5;
}
.ui-call-lobby-tips li + li {
  margin-top: 6px;
}
.ui-call-lobby-tips li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3182f6;
}
.ui-call-rel-selector {
  margin-top: 4px;
}
.ui-call-rel-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #8b95a1;
  margin-bottom: 10px;
}
.ui-call-rel-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.ui-call-rel-chip {
  min-height: 42px;
  border: 1px solid #e5e8eb;
  border-radius: 12px;
  background: #fff;
  color: #4e5968;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ui-call-rel-chip.is-active {
  background: #3182f6;
  border-color: #3182f6;
  color: #fff;
  box-shadow: 0 8px 18px rgba(49, 130, 246, 0.22);
}
.ui-call-bottom-action {
  flex-shrink: 0;
  padding-top: 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.ui-call-room-v3.in-call .ui-call-back,
.ui-call-room-v3.in-call .ui-call-top-spacer {
  display: none;
}
.ui-call-room-v3.in-call .ui-call-topbar {
  grid-template-columns: 1fr;
}
.ui-call-room-v3.in-call .ui-call-top-title {
  text-align: center;
}
.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  animation: pulseDot 1.4s infinite;
}
.ui-call-friend-stage {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 0 auto 8px;
}
.ui-call-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(49, 130, 246, 0.16);
  animation: uiRingPulse 3s infinite ease-in-out;
}
.ui-call-ring.ring-2 {
  inset: -12px;
  animation-delay: 0.8s;
}
.ui-call-friend-photo {
  position: relative;
  z-index: 2;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  overflow: hidden;
  border: 5px solid #fff;
  box-shadow: 0 16px 36px rgba(49, 130, 246, 0.16);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 40px;
  font-weight: 900;
}
.ui-call-friend-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ui-call-friend-desc {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #6b7684;
  line-height: 1.45;
}
.ui-call-subcopy {
  font-size: 15px;
  font-weight: 600;
  color: #6b7684;
  line-height: 1.55;
  margin: 0 0 14px;
  padding: 0 8px;
}
.ui-call-meta-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.ui-call-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #eef2f6;
  font-size: 12px;
  font-weight: 800;
  color: #4e5968;
}
.ui-call-tags {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ui-call-tags span {
  font-size: 12px;
  font-weight: 800;
  color: #3182f6;
  background: rgba(49, 130, 246, 0.08);
  padding: 7px 12px;
  border-radius: 999px;
}
.ui-call-bottom-action {
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.ui-call-start-btn {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 18px;
  background: var(--btn-primary-bg);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  box-shadow: var(--btn-primary-shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: -0.02em;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.ui-call-start-btn:hover:not(:disabled) {
  background: var(--btn-primary-bg-hover);
}
}
.ui-call-start-btn:active:not(:disabled) {
  transform: scale(0.98);
}
.ui-call-start-btn:disabled {
  background: #b0b8c1;
  box-shadow: none;
  cursor: not-allowed;
}
.ui-call-start-icon {
  display: grid;
  place-items: center;
}
.ui-call-permission {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #8b95a1;
  text-align: center;
}
.ui-call-notice {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #e11d48;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}
.ui-call-active {
  flex: 1;
  display: none;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 0;
  padding: 0;
}
.ui-call-active-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 20px 20px;
  min-height: 0;
}
.ui-call-active-avatar {
  position: relative;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  overflow: visible;
  margin: 0 auto 16px;
}
.ui-call-active-avatar img,
.ui-call-active-avatar > span {
  position: relative;
  z-index: 2;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  object-fit: cover;
  font-size: 38px;
  font-weight: 900;
  color: #fff;
  border: 5px solid #fff;
  box-shadow: 0 14px 32px rgba(49, 130, 246, 0.18);
}
.ui-call-avatar-glow {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(49, 130, 246, 0.18) 0%, rgba(49, 130, 246, 0) 70%);
  z-index: 1;
  opacity: 0.6;
  transition: opacity 0.25s, transform 0.25s;
}
.ui-call-active-main h2 {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 900;
  color: #191f28;
  letter-spacing: -0.03em;
}
.ui-call-status-line {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: #6b7684;
}
.ui-call-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #eef2f6;
  font-size: 12px;
  font-weight: 800;
  color: #4e5968;
}
.ui-call-status-chip--muted {
  color: #8b95a1;
  font-weight: 700;
}
.ui-call-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
  animation: uiCallPulseDot 1.6s infinite;
}
.ui-call-timer-block {
  margin-top: 4px;
}
.ui-call-timer-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #8b95a1;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.ui-call-timer {
  font-size: 44px;
  font-weight: 900;
  color: #191f28;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
}
.ui-call-ad-bar {
  margin: 18px auto 0;
  padding: 0;
  max-width: 360px;
  min-height: 50px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}
.ui-call-stage {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ui-call-toolbar {
  flex-shrink: 0;
}
.ui-call-toolbar:has(#btnAudioMode[hidden]),
.ui-call-toolbar:not(:has(#btnAudioMode)),
.ui-call-toolbar.is-ios {
  grid-template-columns: 76px minmax(0, 1fr);
}
.ui-call-ad-bar .app-ad-slot {
  margin: 0 auto;
}
.ui-call-toolbar {
  display: grid;
  grid-template-columns: 72px 72px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  position: relative;
  z-index: 40;
}
.ui-call-tool {
  border: 0;
  background: #fff;
  border-radius: 18px;
  min-height: 64px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  border: 1px solid #f2f4f6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: #4e5968;
  font-weight: 800;
  padding: 8px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ui-call-tool.active {
  background: #eef6ff;
  color: #3182f6;
  border-color: #3182f6;
}
.ui-call-tool-icon {
  position: relative;
  width: 24px;
  height: 24px;
}
.ui-call-icon-mic-off {
  display: none;
}
.ui-call-tool.active .ui-call-icon-mic {
  display: none;
}
.ui-call-tool.active .ui-call-icon-mic-off {
  display: block;
}
.ui-call-tool small {
  font-size: 11px;
}
.ui-call-end {
  min-height: 64px;
  border: 0;
  border-radius: 18px;
  background: #f04452;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(240, 68, 82, 0.24);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: -0.02em;
  transition: transform 0.15s, background 0.15s;
  min-width: 0;
  padding: 12px 14px;
  width: 100%;
  white-space: nowrap;
  word-break: keep-all;
  overflow: hidden;
}
.ui-call-end:active:not(:disabled) {
  transform: scale(0.98);
  background: #d93644;
}
.ui-call-end:disabled {
  background: #b0b8c1;
  box-shadow: none;
  cursor: not-allowed;
}
.ui-end-call-sheet .ui-modal-desc {
  margin: 0 0 20px;
  color: #6b7684;
  font-size: 15px;
  line-height: 1.65;
  word-break: keep-all;
}
.ui-end-call-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.ui-end-call-actions .ui-btn {
  width: 100%;
  min-height: 52px;
  padding: 12px 10px;
  white-space: normal;
  line-height: 1.25;
}

/* During active call, render confirmation modals inside #callScreen (Android WebView stacking). */
#callScreen > .ui-bottom-modal.ui-call-inline-modal {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  z-index: 200 !important;
}
#callScreen.call-inline-modal-open > .ui-call-toolbar,
#callScreen.call-inline-modal-open > .call-transcript-panel {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

/* Call overlays must sit above the full-screen active call layer (z-index 9999). */
body:has(.ui-call-room-v3) .ui-bottom-modal,
body.call-modal-open .ui-bottom-modal.open {
  z-index: 2147483646 !important;
}
body.call-modal-open .ui-call-room-v3.in-call {
  z-index: 9000 !important;
}
.ui-call-room-v3.call-overlay-open .ui-call-toolbar,
.ui-call-room-v3.call-overlay-open .call-transcript-panel,
.ui-call-toolbar.is-call-modal-hidden,
.call-transcript-panel.is-call-modal-hidden,
body.call-modal-open .ui-call-room-v3.in-call .ui-call-toolbar,
body.call-modal-open .ui-call-room-v3.in-call .call-transcript-panel,
body.modal-open:has(.ui-call-room-v3.in-call) .ui-call-toolbar,
body.modal-open:has(.ui-call-room-v3.in-call) .call-transcript-panel {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
}
body:has(.ui-call-room-v3) .ui-end-call-sheet,
body:has(.ui-call-room-v3) .ui-recover-call-sheet {
  width: min(100%, 430px);
  max-height: min(78dvh, 540px);
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom)) !important;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.diary-photo-section {
  margin: 0 0 28px;
  padding: 20px;
  border: 1px solid #eef1f4;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(49, 130, 246, .06);
}
.diary-photo-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.diary-photo-heading h2 {
  margin: 0;
  color: #191f28;
  font-size: 17px;
  font-weight: 900;
}
.diary-photo-heading p {
  margin: 5px 0 0;
  color: #8b95a1;
  font-size: 12px;
  line-height: 1.45;
}
.diary-photo-add {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 14px;
  background: #e8f3ff;
  color: #3182f6;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.diary-photo-upload-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: #3182f6;
  font-size: 12px;
  font-weight: 700;
}
.diary-photo-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.diary-photo-gallery.is-empty { grid-template-columns: 1fr; }
.diary-photo-item {
  position: relative;
  aspect-ratio: 1 / 1;
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #f2f4f6;
}
.diary-photo-open {
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.diary-photo-open:focus-visible {
  outline: 3px solid #3182f6;
  outline-offset: -3px;
}
.diary-photo-open img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.diary-photo-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(25, 31, 40, .72);
  color: #fff;
  font-size: 20px;
  line-height: 1;
}
.diary-photo-empty {
  width: 100%;
  min-height: 132px;
  border: 1px dashed #bfdbfe;
  border-radius: 18px;
  background: #f8fbff;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: #3182f6;
}
.diary-photo-empty span { font-size: 24px; }
.diary-photo-empty strong { font-size: 14px; }
.diary-photo-empty small { color: #8b95a1; font-size: 11px; }
@media (min-width: 620px) {
  .diary-photo-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
body.photo-viewer-open { overflow: hidden; }
.diary-photo-viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 13000;
  isolation: isolate;
  opacity: 0;
  transition: opacity .18s ease;
}
.diary-photo-viewer[hidden] { display: none; }
.diary-photo-viewer.is-open { opacity: 1; }
.diary-photo-viewer-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(15, 23, 42, .72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.diary-photo-viewer-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: max(56px, env(safe-area-inset-top)) 54px max(34px, env(safe-area-inset-bottom));
  pointer-events: none;
}
.diary-photo-viewer-content figure {
  max-width: min(100%, 1040px);
  max-height: 100%;
  margin: 0;
  display: grid;
  place-items: center;
  gap: 12px;
}
.diary-photo-viewer-content img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 130px);
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .35);
  pointer-events: auto;
}
.diary-photo-viewer-content figcaption {
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.diary-photo-viewer-close,
.diary-photo-viewer-nav {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  pointer-events: auto;
  backdrop-filter: blur(8px);
}
.diary-photo-viewer-close {
  top: max(16px, env(safe-area-inset-top));
  right: 18px;
  width: 42px;
  height: 42px;
  font-size: 28px;
}
.diary-photo-viewer-nav {
  top: 50%;
  width: 44px;
  height: 44px;
  font-size: 34px;
  transform: translateY(-50%);
}
.diary-photo-viewer-nav.is-prev { left: 8px; }
.diary-photo-viewer-nav.is-next { right: 8px; }
.diary-photo-viewer-nav:disabled { opacity: .25; }
@media (min-width: 720px) {
  .diary-photo-viewer-content { padding-inline: 92px; }
  .diary-photo-viewer-nav { width: 52px; height: 52px; }
  .diary-photo-viewer-nav.is-prev { left: 24px; }
  .diary-photo-viewer-nav.is-next { right: 24px; }
}
.app-shell.board-page {
  width: min(620px, 100%);
  padding: 22px var(--app-gutter) 110px;
}
.board-page-head { margin: 4px 0 24px; }
.board-page-head > span {
  display: inline-block;
  margin-bottom: 8px;
  color: #3182f6;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}
.board-page-head h1 {
  margin: 0;
  color: #191f28;
  font-size: clamp(25px, 7vw, 32px);
  line-height: 1.25;
  letter-spacing: -.04em;
}
.board-page-head p {
  margin: 9px 0 0;
  color: #6b7684;
  font-size: 14px;
  line-height: 1.6;
}
.board-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 15px;
  background: #f2f4f6;
}
.board-tabs a {
  min-height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #8b95a1;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}
.board-tabs a.active {
  background: #fff;
  color: #191f28;
  box-shadow: 0 2px 10px rgba(25, 31, 40, .08);
}
.board-search {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  min-height: 52px;
  margin-bottom: 18px;
  padding-left: 16px;
  overflow: hidden;
  border: 1px solid #e5e8eb;
  border-radius: 15px;
  background: #fff;
}
.board-search > i { color: #8b95a1; font-size: 14px; }
.board-search input {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #191f28;
  font-size: 14px;
}
.board-search > a {
  display: grid;
  place-items: center;
  width: 30px;
  color: #8b95a1;
  font-size: 20px;
  text-decoration: none;
}
.board-search button {
  align-self: stretch;
  min-width: 68px;
  border: 0;
  background: #3182f6;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.board-list {
  overflow: hidden;
  border: 1px solid #eef1f4;
  border-radius: 20px;
  background: #fff;
}
.board-row {
  display: block;
  padding: 20px;
  color: #191f28;
  text-decoration: none;
}
.board-row + .board-row { border-top: 1px solid #f2f4f6; }
.board-row:active { background: #f8fbff; }
.board-row-top,
.board-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.board-row-top { justify-content: space-between; }
.board-row-top time,
.board-meta {
  color: #8b95a1;
  font-size: 11px;
  font-weight: 600;
}
.board-kind-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #e8f3ff;
  color: #1b64da;
  font-size: 11px;
  font-weight: 800;
}
.board-row h2 {
  margin: 13px 0 7px;
  color: #191f28;
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: -.02em;
}
.board-row > p {
  display: -webkit-box;
  margin: 0 0 13px;
  overflow: hidden;
  color: #6b7684;
  font-size: 13px;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.board-empty-state {
  padding: 64px 24px;
  border: 1px solid #eef1f4;
  border-radius: 20px;
  background: #fff;
  text-align: center;
}
.board-empty-state.is-compact { border: 0; border-radius: 0; }
.board-empty-state > span { display: block; margin-bottom: 12px; font-size: 32px; }
.board-empty-state h1,
.board-empty-state h2 { margin: 0; color: #191f28; font-size: 18px; }
.board-empty-state p { margin: 8px 0 20px; color: #8b95a1; font-size: 13px; line-height: 1.55; }
.board-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
}
.board-pagination a {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #6b7684;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.board-pagination a.active { background: #3182f6; color: #fff; }
.board-detail-card {
  overflow: hidden;
  border: 1px solid #eef1f4;
  border-radius: 22px;
  background: #fff;
}
.board-detail-head { padding: 24px 22px 20px; border-bottom: 1px solid #f2f4f6; }
.board-detail-head h1 {
  margin: 14px 0 12px;
  color: #191f28;
  font-size: clamp(23px, 6vw, 30px);
  line-height: 1.35;
  letter-spacing: -.04em;
}
.board-content {
  min-height: 180px;
  padding: 26px 22px;
  color: #333d4b;
  font-size: 15px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.board-content img { max-width: 100%; height: auto; border-radius: 14px; }
.board-content iframe { max-width: 100%; }
.board-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-top: 1px solid #f2f4f6;
}
.board-detail-actions > a { color: #6b7684; font-size: 13px; font-weight: 800; text-decoration: none; }
.board-like-button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid #e5e8eb;
  border-radius: 999px;
  background: #fff;
  color: #6b7684;
  font-weight: 800;
}
.board-like-button span { margin-right: 4px; color: #b0b8c1; }
.board-like-button.liked { border-color: #fecdd3; background: #fff1f2; color: #e11d48; }
.board-like-button.liked span { color: #e11d48; }
@media (min-width: 720px) {
  .app-shell.board-page { padding-top: 32px; }
  .board-row { padding: 23px 24px; }
}
.ui-recover-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.ui-recover-actions .ui-btn {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 12px 8px;
  line-height: 1.3;
  white-space: normal;
}
.ui-recover-status {
  min-height: 20px;
  margin: -8px 0 14px;
  color: #6f52ed;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}
@media (max-width: 359px) {
  .ui-end-call-actions,
  .ui-recover-actions {
    grid-template-columns: 1fr;
  }
}
.ui-call-room-v3:not(.in-call) .call-transcript-panel {
  display: none !important;
}
.ui-call-room-v3.in-call .ui-call-active {
  position: relative;
  padding-bottom: 0;
}
.phone-card.ai-speaking .ui-call-active-avatar .ui-call-avatar-glow,
.ui-call-room-v3.ai-speaking .ui-call-active-avatar .ui-call-avatar-glow {
  opacity: 1;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.28) 0%, rgba(168, 85, 247, 0) 72%);
  transform: scale(1.06);
}
.phone-card.user-speaking .ui-call-active-avatar .ui-call-avatar-glow,
.ui-call-room-v3.user-speaking .ui-call-active-avatar .ui-call-avatar-glow {
  opacity: 1;
  background: radial-gradient(circle, rgba(49, 130, 246, 0.28) 0%, rgba(49, 130, 246, 0) 72%);
  transform: scale(1.06);
}
.phone-card.ai-speaking .ui-call-active-avatar img,
.phone-card.ai-speaking .ui-call-active-avatar > span,
.ui-call-room-v3.ai-speaking .ui-call-active-avatar img,
.ui-call-room-v3.ai-speaking .ui-call-active-avatar > span {
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.16), 0 14px 32px rgba(168, 85, 247, 0.2);
}
.phone-card.user-speaking .ui-call-active-avatar img,
.phone-card.user-speaking .ui-call-active-avatar > span,
.ui-call-room-v3.user-speaking .ui-call-active-avatar img,
.ui-call-room-v3.user-speaking .ui-call-active-avatar > span {
  box-shadow: 0 0 0 4px rgba(49, 130, 246, 0.16), 0 14px 32px rgba(49, 130, 246, 0.2);
}
@keyframes uiRingPulse {
  0%, 100% { transform: scale(1); opacity: 0.45; }
  50% { transform: scale(1.05); opacity: 0.9; }
}
@keyframes uiCallPulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.ui-modal-desc {
  margin: 0 0 12px;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 700;
  color: #8b95a1;
  line-height: 1.5;
}
.ui-modal-desc-break {
  line-height: 1.65;
}
.ui-modal-options-scroll {
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.option-check {
  font-weight: 800;
}

/* Legal + consent + encryption UI */
.legal-content-card { padding: 24px; line-height: 1.7; color: #4e5968; }
.legal-content-card h2 { font-size: 18px; color: #191f28; margin: 24px 0 8px; }
.legal-content-card h2:first-child { margin-top: 0; }
.auth-consent-box { margin-top: 14px; display: grid; gap: 10px; }
.auth-consent-item { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; font-weight: 700; color: #4e5968; line-height: 1.5; }
.auth-consent-item a { color: #3182f6; }
.auth-consent-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: #3182f6;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.auth-consent-link:hover,
.auth-consent-link:focus-visible {
  color: #1b64da;
}
.register-legal-modal.ui-bottom-modal.open {
  align-items: stretch;
  justify-content: center;
}
.register-legal-modal .ui-modal-overlay {
  z-index: 1;
}
.register-legal-modal .register-legal-sheet {
  z-index: 2;
  position: relative;
  transform: none !important;
  transition: none;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100dvh;
  border-radius: 0;
  padding: calc(env(safe-area-inset-top) + 8px) 0 calc(env(safe-area-inset-bottom) + 8px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.register-legal-header {
  position: relative;
  flex: 0 0 auto;
  padding: 8px 56px 12px 20px;
  border-bottom: 1px solid #f2f4f6;
}
.register-legal-title {
  margin: 0;
  color: #191f28;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.35;
}
.register-legal-close {
  position: absolute;
  top: 4px;
  right: 12px;
}
.register-legal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
.register-legal-body h2 {
  font-size: 17px;
}
.register-legal-body p,
.register-legal-body li {
  font-size: 14px;
}
body.register-legal-modal-open {
  overflow: hidden;
}
.settings-row-desc { display: block; font-size: 11px; color: #8b95a1; margin-top: 2px; font-weight: 600; }
.ui-switch { position: relative; width: 48px; height: 28px; display: inline-block; }
.ui-switch input { opacity: 0; width: 0; height: 0; }
.ui-switch span {
  position: absolute; inset: 0; background: #e5e8eb; border-radius: 999px; transition: .2s;
}
.ui-switch span:before {
  content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.ui-switch input:checked + span { background: #3182f6; }
.ui-switch input:checked + span:before { transform: translateX(20px); }
.encryption-modal-body { padding: 0 4px 12px; color: #4e5968; font-size: 14px; line-height: 1.6; }
.encryption-warning-box {
  margin-top: 14px; padding: 14px; border-radius: 16px; background: #fff7ed; border: 1px solid #fed7aa;
}
.encryption-warning-box strong { display: block; margin-bottom: 6px; color: #c2410c; }
.encryption-modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 8px; }
/* Bottom drawer modals */
.ui-bottom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1500;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.ui-bottom-modal[hidden] {
  display: none !important;
}
.ui-bottom-modal.open {
  display: flex;
}
.ui-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  animation: fadeInOverlay 0.2s ease-out;
}
.ui-modal-sheet {
  position: relative;
  width: 100%;
  max-width: 540px;
  box-sizing: border-box;
  background: #ffffff;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  padding: 24px 20px calc(env(safe-area-inset-bottom) + 24px) 20px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.08);
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
}
.ui-bottom-modal.open .ui-modal-sheet {
  transform: translateY(0);
}

body.app-has-bottom-nav .ui-bottom-modal .ui-modal-sheet,
body:has(.app-bottom-nav) .ui-bottom-modal .ui-modal-sheet {
  padding-bottom: calc(env(safe-area-inset-bottom) + var(--bottom-nav-height) + 24px);
  max-height: calc(100dvh - 12px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.app-has-bottom-nav .refine-sheet-modal .ui-modal-sheet,
body:has(.app-bottom-nav) .refine-sheet-modal .ui-modal-sheet {
  padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
  max-height: calc(100dvh - var(--bottom-nav-height) - 8px);
  overflow: hidden;
}

body.app-has-bottom-nav .billing-apply-modal .billing-apply-sheet,
body:has(.app-bottom-nav) .billing-apply-modal .billing-apply-sheet {
  padding-bottom: 0;
  overflow: hidden;
}

body.pin-modal-open .app-bottom-nav {
  z-index: 900;
}

.ui-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.ui-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: #191f28;
}
.ui-modal-close {
  border: none;
  background: #f2f4f6;
  color: #4e5968;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ui-modal-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ui-modal-option-btn {
  border: none;
  background: transparent;
  width: 100%;
  padding: 16px;
  font-size: 15px;
  font-weight: 700;
  color: #4e5968;
  text-align: left;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s;
}
.ui-modal-option-btn:hover {
  background: #f9fafb;
}
.ui-modal-option-btn.selected {
  color: #3182f6;
  background: #f0f7ff;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ui-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 16px; border-radius: 14px;
  font-size: 15px; font-weight: 800; cursor: pointer; transition: background .15s, opacity .15s;
  border: 0; font-family: inherit; width: 100%;
}
.ui-btn:disabled { opacity: .55; cursor: not-allowed; }
.ui-btn-secondary { background: #f2f4f6; color: #4e5968; }
.ui-btn-primary {
  background: var(--btn-primary-bg);
  color: #fff;
  box-shadow: var(--btn-primary-shadow);
}
.ui-btn-primary:hover:not(:disabled) { background: var(--btn-primary-bg-hover); }

/* Global user primary action buttons */
.ui-btn-primary,
.app-btn-primary,
.binding-btn-primary,
.binding-verify-btn,
.ui-call-primary-btn,
.btn.primary,
.btn.primary-btn,
.primary-btn {
  background: var(--btn-primary-bg);
  color: #ffffff;
  box-shadow: var(--btn-primary-shadow);
}
.ui-btn-primary:hover:not(:disabled),
.app-btn-primary:hover,
.binding-btn-primary:hover:not(:disabled),
.binding-verify-btn:hover:not(:disabled),
.ui-call-primary-btn:hover,
.btn.primary:hover:not(:disabled),
.btn.primary-btn:hover:not(:disabled),
.primary-btn:hover {
  background: var(--btn-primary-bg-hover);
}
.ui-btn-primary:disabled,
.app-btn-primary:disabled,
.binding-btn-primary:disabled,
.binding-verify-btn:disabled,
.ui-call-primary-btn:disabled,
.btn:disabled,
.btn.primary:disabled,
.btn.primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* Unified user-page shell */
body:has(.app-main),
body:has(.my-shell),
body:has(.report-v2-page),
body:has(.home-main),
body:has(.ui-call-room-v3) {
  background: #ffffff;
}
body:has(.home-main) {
  background: #f9fafb;
}
.my-shell {
  max-width: min(760px, calc(100% - var(--app-gutter) * 2));
  margin: 0 auto;
}

/* Call room — keep light theme during active call */
body.in-active-call:has(.ui-call-room-v3),
body:has(.ui-call-room-v3.in-call) {
  background: linear-gradient(180deg, #eef5ff 0%, #f8fafc 42%, #ffffff 100%) !important;
  overflow: hidden;
}
.ui-call-room-v3.in-call {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  z-index: 9999;
  width: min(430px, 100vw);
  max-width: 430px;
  margin: 0;
  min-height: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ui-call-room-v3.in-call .ui-call-active-main h2 {
  display: none;
}
.ui-call-room-v3.in-call .ui-call-active-main h2,
.ui-call-room-v3.in-call .ui-call-timer {
  color: #191f28;
}
.ui-call-room-v3.in-call .ui-call-active {
  flex: 1 1 auto;
  min-height: 0;
}
.ui-call-room-v3.in-call .ui-call-active-main {
  flex: 1 1 auto;
  justify-content: flex-start;
  padding: clamp(18px, 5dvh, 48px) 20px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ui-call-room-v3.in-call .ui-call-active-avatar,
.ui-call-room-v3.in-call .ui-call-active-avatar img,
.ui-call-room-v3.in-call .ui-call-active-avatar > span {
  width: clamp(112px, 20dvh, 148px);
  height: clamp(112px, 20dvh, 148px);
}
.ui-call-room-v3.in-call .ui-call-active-avatar {
  margin-bottom: 14px;
}
.ui-call-room-v3.in-call .ui-call-status-line {
  margin-bottom: clamp(12px, 2.2dvh, 20px);
}
.ui-call-room-v3.in-call .ui-call-timer {
  font-size: clamp(48px, 8dvh, 68px);
}
.ui-call-room-v3.in-call .ui-call-ad-bar {
  width: 100%;
  max-width: 360px;
  margin-top: clamp(14px, 3dvh, 26px);
}
.ui-call-room-v3.in-call .ui-call-toolbar {
  width: 100%;
  box-sizing: border-box;
}

/* Report page — align with app design system */
.mind-report-page.report-v2-page,
.report-v2-page.app-main {
  background: #ffffff;
}
.report-v2-page .app-container,
.mind-report-page .app-container {
  padding-top: 16px;
}
.report-v2-page .report-hero-card,
.report-v2-page .v2-card,
.report-v2-page .no-data-card,
.report-v2-page .letter-v2 {
  border: 1px solid #f2f4f6;
  box-shadow: 0 4px 16px rgba(25, 31, 40, 0.03);
}
.report-v2-page .report-v2-back,
.report-v2-page .report-v2-month {
  border: 1px solid #f2f4f6;
}
.report-v2-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 16px;
  background: var(--btn-primary-bg);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  border: 0;
  text-decoration: none;
  box-shadow: var(--btn-primary-shadow);
}
.report-v2-page .btn:hover {
  background: var(--btn-primary-bg-hover);
}

/* Diary View Toggle */
.view-toggle,
.ui-view-toggle {
  display: flex;
  gap: 4px;
  background: #f2f4f6;
  padding: 4px;
  border-radius: 14px;
}
.view-toggle button,
.ui-view-toggle button {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  color: #8b95a1;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.view-toggle button.active,
.ui-view-toggle button.active {
  background: #fff;
  color: #3182f6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.diary-entries-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.diary-entries-head .app-page-title {
  margin: 0;
}

.ui-month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 18px;
}
.ui-month-nav-label {
  font-size: 17px;
  font-weight: 900;
  color: #191f28;
  min-width: 110px;
  text-align: center;
}
.ui-month-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #f2f4f6;
  color: #4e5968;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}
.diary-search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.diary-search-bar input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  border: 1px solid #e5e8eb;
  border-radius: 14px;
  padding: 0 14px;
  font-size: 14px;
  box-sizing: border-box;
  background: #fff;
}
.diary-search-bar input[type="search"]:focus {
  outline: none;
  border-color: #3182f6;
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.12);
}
.diary-search-submit {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: var(--btn-primary-bg);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--btn-primary-shadow);
}
.diary-search-submit:hover {
  background: var(--btn-primary-bg-hover);
}
.diary-search-reset {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: #8b95a1;
  text-decoration: none;
  white-space: nowrap;
}
.diary-search-meta {
  margin: 0 0 14px;
  font-size: 13px;
  color: #8b95a1;
  font-weight: 600;
}
.ui-month-nav-btn:active {
  background: #f9fafb;
}

.is-hidden {
  display: none !important;
}

.public-tag {
  font-size: 11px;
  color: #3182f6;
  background: #e8f3ff;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}
.author-tag {
  font-size: 11px;
  color: #8b95a1;
  background: #f2f4f6;
  padding: 2px 8px;
  border-radius: 6px;
}

/* Diary calendar */
.ui-diary-calendar {
  background: #fff;
  border: 1px solid #f2f4f6;
  border-radius: 24px;
  padding: 20px 16px 16px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(25, 31, 40, 0.04);
}
.ui-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}
.ui-cal-weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #8b95a1;
  padding: 4px 0 8px;
}
.ui-cal-weekday.sun { color: #f04452; }
.ui-cal-weekday.sat { color: #3182f6; }
.ui-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.ui-cal-cell {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
}
.ui-cal-cell.is-empty {
  pointer-events: none;
}
.ui-cal-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.ui-cal-date:active {
  transform: scale(0.96);
}
.ui-cal-day {
  font-size: 13px;
  font-weight: 800;
  color: #4e5968;
  line-height: 1.2;
}
.ui-cal-emoji {
  font-size: 16px;
  line-height: 1;
  min-height: 18px;
}
.ui-cal-date.is-today .ui-cal-day {
  color: #3182f6;
}
.ui-cal-date.is-today:not(.is-selected) {
  background: #f0f7ff;
}
.ui-cal-date.is-selected {
  background: #3182f6;
  box-shadow: 0 6px 16px rgba(49, 130, 246, 0.28);
}
.ui-cal-date.is-selected .ui-cal-day {
  color: #fff;
}
.ui-cal-date.has-entry:not(.is-selected) .ui-cal-emoji {
  transform: scale(1.05);
}
.ui-calendar-entries-head {
  margin-bottom: 12px;
}
.ui-calendar-entries-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: #191f28;
}
.ui-calendar-entries-sub {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #8b95a1;
}
.ui-cal-loading {
  text-align: center;
  padding: 24px;
  color: #8b95a1;
  font-size: 14px;
  font-weight: 700;
}
.ui-cal-empty-card {
  padding: 28px 20px;
  text-align: center;
  color: #8b95a1;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

/* Legacy calendar (keep minimal) */
.cal-header {
    text-align: center;
    font-weight: 800;
    margin-bottom: 15px;
}
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}
.cal-day-label {
    text-align: center;
    font-size: 12px;
    color: #8b95a1;
}
.cal-date {
    text-align: center;
    padding: 10px 0;
    cursor: pointer;
    border-radius: 8px;
}
.cal-date:hover {
    background: #f2f4f6;
}
.cal-date.active {
    background: #3182f6;
    color: #fff;
}

/* ===== Unified user page shell (my.php style) ===== */
body:has(.my-page),
body:has(.binding-page),
body:has(.billing-page),
body:has(.diary-list-redesign),
body:has(.legal-page),
body:has(.counseling-list-page),
body:has(.emotion-calendar-redesign) {
  background: #ffffff;
}

.app-main.binding-page {
  display: block;
  min-width: 0;
  overflow-x: clip;
}

.binding-page .app-container {
  width: min(760px, calc(100% - var(--app-gutter) * 2));
  max-width: 100%;
  margin-inline: auto;
  box-sizing: border-box;
  min-width: 0;
}

.binding-page #bindingFlow,
.binding-page .step-section {
  min-width: 0;
  max-width: 100%;
}

.app-page-title {
  font-size: 24px;
  font-weight: 900;
  color: #191f28;
  margin: 0 0 20px;
  letter-spacing: -0.03em;
}

.app-page-section-title {
  font-size: 18px;
  font-weight: 900;
  color: #191f28;
  margin: 0 0 16px;
}

.app-user-card {
  background: #ffffff;
  border: 1px solid #f2f4f6;
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(25, 31, 40, 0.03);
}

.my-page .profile-section {
  background: linear-gradient(135deg, rgba(226, 239, 255, .96), rgba(247, 240, 255, .86)), #fff;
  border: 1px solid rgba(119, 139, 180, 0.18);
  border-radius: 28px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 20px 42px rgba(69, 104, 170, .12);
}
.my-page .profile-section h2 {
  font-size: 22px;
  font-weight: 800;
  color: #191f28;
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}
.my-page .profile-section p {
  font-size: 14px;
  color: #8b95a1;
  margin: 0 0 16px;
}
.my-page .profile-stats-row {
  display: flex;
  gap: 16px;
  border-top: 1px solid #f2f4f6;
  padding-top: 16px;
}
.my-page .profile-stats-row div {
  font-size: 14px;
  color: #4e5968;
}
.my-page .profile-stats-row strong {
  color: #191f28;
  font-weight: 800;
}

.my-page .plan-card,
.binding-page .plan-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px;
  border: 1px solid #f2f4f6;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 16px rgba(25, 31, 40, 0.03);
}

.my-page .settings-list,
.binding-page .settings-list {
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid #f2f4f6;
  margin-bottom: 16px;
  overflow: hidden;
  padding: 8px 0;
  box-shadow: 0 4px 16px rgba(25, 31, 40, 0.03);
}

.my-page .settings-list-title,
.binding-page .settings-list-title {
  font-size: 14px;
  font-weight: 800;
  color: #8b95a1;
  padding: 12px 24px 6px;
}

.my-page .settings-row-item,
.binding-page .settings-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
}

.my-page .promo-banner {
  background: linear-gradient(135deg, #f0f7ff, #ffffff);
  border: 1px solid #d1e9ff;
  border-radius: 24px;
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  gap: 12px;
  color: inherit;
}
.my-page .promo-banner.promo-banner--active {
  flex-direction: column;
  align-items: stretch;
  background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
  border-color: #d1e9ff;
  box-shadow: 0 4px 16px rgba(49, 130, 246, 0.06);
}
.my-page .promo-banner-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.my-page .promo-banner-text {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.my-page .promo-banner-arrow {
  flex-shrink: 0;
}

.legal-page .app-card,
.legal-content-card {
  background: #ffffff;
  border: 1px solid #f2f4f6;
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(25, 31, 40, 0.03);
}

.legal-page-subtitle {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: #6b7684;
  line-height: 1.5;
}

.legal-related-links {
  margin: 16px 4px 0;
  font-size: 13px;
  font-weight: 700;
  color: #8b95a1;
}

.legal-related-links a {
  color: #3182f6;
  text-decoration: none;
}

.legal-related-links a:hover {
  text-decoration: underline;
}

/* Open source page */
.oss-page .app-container {
  max-width: 640px;
}

.oss-hero {
  text-align: center;
  padding: 8px 8px 28px;
}

.oss-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, #e8f3ff 0%, #f2f4ff 100%);
  color: #3182f6;
  font-size: 26px;
  font-weight: 900;
}

.oss-hero-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b95a1;
}

.oss-hero-title {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  color: #191f28;
  letter-spacing: -0.02em;
}

.oss-hero-desc {
  margin: 12px auto 0;
  max-width: 420px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  color: #6b7684;
}

.oss-content-card {
  margin-bottom: 16px;
}

.oss-content-card .oss-lead {
  font-size: 15px;
  font-weight: 600;
  color: #4e5968;
}

.oss-content-card .oss-license-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.oss-content-card .oss-license-list li {
  position: relative;
  padding: 12px 0 12px 16px;
  border-bottom: 1px solid #f2f4f6;
}

.oss-content-card .oss-license-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3182f6;
}

.oss-actions {
  display: grid;
  gap: 12px;
}

.oss-github-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 20px;
  background: #191f28;
  color: #ffffff;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.oss-github-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(25, 31, 40, 0.18);
}

.oss-github-icon {
  display: flex;
  flex-shrink: 0;
}

.oss-github-text {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.oss-github-text strong {
  font-size: 15px;
  font-weight: 800;
}

.oss-github-text span {
  font-size: 13px;
  font-weight: 600;
  color: #b0b8c1;
}

.oss-github-arrow {
  font-size: 18px;
  font-weight: 700;
  color: #8b95a1;
}

.oss-contributors-link {
  display: block;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: #3182f6;
  text-decoration: none;
  padding: 8px;
}

.oss-contributors-link:hover {
  text-decoration: underline;
}

.diary-timeline-card,
.app-card:not(.legal-content-card) {
  background: #ffffff;
  border: 1px solid #f2f4f6;
  box-shadow: 0 4px 16px rgba(25, 31, 40, 0.03);
}

/* Binding page */
.binding-page .stepper-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.binding-page .stepper-dot {
  height: 6px;
  width: 16px;
  border-radius: 3px;
  background: #e5e8eb;
  transition: all 0.3s ease;
}
.binding-page .stepper-dot.completed {
  background: #93c5fd;
}
.binding-page .binding-step-label {
  margin: -12px 0 20px;
  font-size: 13px;
  font-weight: 800;
  color: #3182f6;
  letter-spacing: -0.02em;
}
.binding-page .field-hint {
  font-size: 12px;
  color: #8b95a1;
  margin: 4px 0 0;
}
.binding-page .form-group.is-invalid label {
  color: #ef4444;
}
.binding-page .form-group.is-invalid input {
  border-color: #fca5a5;
  background: #fff7f7;
}
.binding-page .address-search-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.binding-page .address-search-row input {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  background: #f9fafb;
}
.binding-page .address-search-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 88px;
  max-width: 108px;
  padding: 0 14px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid #e5e8eb;
  background: #f2f4f6;
  color: #4e5968;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.binding-address-modal.ui-bottom-modal.open {
  align-items: stretch;
  justify-content: center;
}
.binding-address-modal .ui-modal-overlay {
  z-index: 1;
}
.binding-address-modal .binding-address-sheet {
  z-index: 2;
  position: relative;
  transform: none !important;
  transition: none;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100dvh;
  border-radius: 0;
  padding: calc(env(safe-area-inset-top) + 44px) 0 calc(env(safe-area-inset-bottom) + 8px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.binding-address-modal .binding-address-close {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 10px);
  right: 12px;
  z-index: 3;
}
.binding-address-modal .binding-address-desc {
  padding: 0 20px 8px;
  margin-bottom: 0;
}
.binding-address-modal .binding-postcode-panel {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 420px;
}
.binding-postcode-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
}
.binding-postcode-loading[hidden] {
  display: none !important;
}
.binding-postcode-loading p {
  margin: 0;
  color: #8b95a1;
  font-size: 14px;
  font-weight: 600;
}
.binding-postcode-spinner {
  width: 36px;
  height: 36px;
  border-width: 3px;
}
.binding-address-modal .binding-postcode-embed {
  flex: 1 1 auto;
  width: 100%;
  min-height: 420px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 0;
  border-radius: 0;
  background: #fff;
}
.binding-address-modal .binding-postcode-embed > div {
  width: 100% !important;
  min-height: 420px;
}
.binding-address-modal .binding-postcode-embed iframe {
  width: 100% !important;
  min-height: 420px !important;
  border: 0;
}
body.binding-address-modal-open {
  overflow: hidden;
}
.binding-page .binding-empty-diaries {
  margin-top: 8px;
}
.binding-page .step-section {
  display: none;
  animation: bindingFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.binding-page .step-section.active {
  display: block;
}
.binding-page .step-section[hidden] {
  display: none !important;
}
.binding-page .stepper-dot.active {
  width: 32px;
  background: #3182f6;
}
@keyframes bindingFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.binding-page .product-grid {
  display: grid;
  gap: 16px;
}
.binding-page .product-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #f2f4f6;
  border-radius: 24px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(25, 31, 40, 0.03);
}
.binding-page .product-card:active {
  transform: scale(0.99);
  border-color: #3182f6;
}
.binding-page .product-card-badge {
  display: inline-block;
  padding: 4px 8px;
  background: #f0f7ff;
  color: #3182f6;
  font-size: 11px;
  font-weight: 800;
  border-radius: 8px;
  margin-bottom: 12px;
}
.binding-page .product-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.binding-page .product-card-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: #191f28;
  margin: 0 0 4px;
}
.binding-page .product-subtext {
  font-size: 13px;
  color: #8b95a1;
  margin: 0;
}
.binding-page .product-price strong {
  font-size: 18px;
  color: #3182f6;
  font-weight: 900;
  white-space: nowrap;
}
.binding-page .product-card-divider {
  height: 1px;
  background: #f2f4f6;
  margin: 16px 0;
}
.binding-page .product-desc {
  font-size: 13px;
  color: #4e5968;
  line-height: 1.6;
}
.binding-page .form-group {
  margin-bottom: 20px;
}
.binding-page .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #4e5968;
  margin-bottom: 8px;
}
.binding-page .form-group input {
  width: 100%;
  padding: 16px;
  font-size: 15px;
  border-radius: 14px;
  border: 1.5px solid #e5e8eb;
  background: #ffffff;
  color: #191f28;
  outline: none;
  box-sizing: border-box;
}
.binding-page .stats-row > .form-group { min-width:0; }
.binding-page .form-group input[type="date"] {
  display:block;
  min-width:0;
  max-width:100%;
  -webkit-appearance:none;
  appearance:none;
}
.binding-page .form-group input:focus {
  border-color: #3182f6;
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.12);
}
.binding-page .stats-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.binding-page .total-summary-card {
  background: #e8f3ff;
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #3182f6;
  margin-bottom: 12px;
}
.binding-page .binding-diary-select-hint {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #8b95a1;
  font-weight: 600;
}
.binding-page .binding-quote-card {
  background: #f8fafc;
  border: 1px solid #e5e8eb;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}

.binding-page .binding-quote-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  color: #4e5968;
}

.binding-page .binding-quote-row + .binding-quote-row {
  margin-top: 8px;
}

.binding-page .binding-quote-row strong {
  margin-left: auto;
  font-size: 18px;
  color: #191f28;
}

.binding-page .binding-quote-price-row strong {
  color: #3182f6;
}

.binding-page .binding-quote-note {
  font-size: 12px;
  color: #8b95a1;
}

.binding-page .binding-quote-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: #8b95a1;
  line-height: 1.5;
}

.binding-page .binding-max-pages-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  color: #b91c1c;
}

.binding-page .binding-max-pages-alert strong {
  display: block;
  margin-bottom: 4px;
}

.binding-page .binding-max-pages-alert p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.binding-page .binding-blank-pages-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1.5px solid #e8ecf1;
  border-radius: 18px;
  background: #fafbfc;
}
.binding-page .binding-blank-pages-copy strong {
  display: block;
  font-size: 15px;
  color: #191f28;
  margin-bottom: 4px;
}
.binding-page .binding-blank-pages-copy p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #8b95a1;
  font-weight: 600;
}
.binding-page .binding-blank-pages-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.binding-page .binding-blank-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #d7dde5;
  border-radius: 12px;
  background: #ffffff;
  color: #4e5968;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.binding-page .binding-blank-count {
  min-width: 28px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: #191f28;
}
.binding-page .binding-diary-toolbar {
  margin-bottom: 12px;
}
.binding-page .binding-diary-search {
  display: flex;
  gap: 8px;
}
.binding-page .binding-diary-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  border: 1px solid #e5e8eb;
  border-radius: 14px;
  padding: 0 14px;
  font-size: 14px;
  box-sizing: border-box;
}
.binding-page .binding-diary-search input:focus {
  outline: none;
  border-color: #3182f6;
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.12);
}
.binding-page .binding-diary-search-btn {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: var(--btn-primary-bg);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--btn-primary-shadow);
}
.binding-page .binding-diary-search-btn:hover {
  background: var(--btn-primary-bg-hover);
}
.binding-page .binding-diary-search-meta {
  margin: 8px 2px 0;
  font-size: 12px;
  color: #8b95a1;
  font-weight: 600;
}
.binding-page .diary-selection-list {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}
.binding-page .diary-select-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border: 1.5px solid #e8ecf1;
  border-radius: 18px;
  padding: 16px;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.binding-page .diary-select-item.selected {
  border-color: #9ec5ff;
  background: #f5f9ff;
  box-shadow: 0 0 0 1px rgba(49, 130, 246, 0.1);
}
.binding-page .diary-text-wrap {
  flex: 1 1 auto;
  min-width: 0;
}
.binding-page .diary-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.binding-page .diary-select-item.excluded {
  background: #fafbfc;
  border-color: #edf0f3;
  opacity: 0.82;
}
.binding-page .diary-checkbox-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.binding-page .diary-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid #b0b8c1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.binding-page .diary-select-item.selected .diary-checkbox {
  border-color: #3182f6;
  background: #3182f6;
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.16);
}
.binding-page .diary-select-item.selected .diary-checkbox::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translateY(-1px);
}
.binding-page .diary-select-item.excluded .diary-checkbox {
  background: #f8f9fb;
  border-color: #c5ccd3;
}
.binding-page .summary-card {
  background: #ffffff;
  border: 1px solid #f2f4f6;
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(25, 31, 40, 0.03);
}
.binding-page .summary-title {
  font-size: 14px;
  font-weight: 800;
  color: #8b95a1;
  margin-bottom: 16px;
}
.binding-page .summary-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid #f9fafb;
}
.binding-page .summary-item-label { color: #8b95a1; font-weight: 600; }
.binding-page .summary-item-value { color: #191f28; font-weight: 700; text-align: right; }
.binding-page .summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f2f4f6;
  padding-top: 16px;
  margin-top: 12px;
}
.binding-page .summary-total-price {
  font-size: 22px;
  font-weight: 900;
  color: #3182f6;
}
.binding-page .bank-transfer-card {
  background: #f2f4f6;
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 24px;
}
.binding-page .bank-account-number {
  font-size: 16px;
  color: #191f28;
  font-weight: 800;
  margin-bottom: 16px;
  word-break: break-all;
  line-height: 1.4;
}
.binding-page .copy-badge {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  color: #4e5968;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid #ccd2d9;
  cursor: pointer;
}
.binding-page .ui-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  text-decoration: none;
}
.binding-page .ui-btn-primary {
  background: var(--btn-primary-bg);
  color: #ffffff;
  box-shadow: var(--btn-primary-shadow);
}
.binding-page .ui-btn-primary:hover:not(:disabled) {
  background: var(--btn-primary-bg-hover);
}
.binding-page .ui-btn-secondary {
  background: #f2f4f6;
  color: #4e5968;
}
.binding-page .button-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.binding-page .history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}
.binding-page .history-header h2 {
  font-size: 18px;
  font-weight: 900;
  color: #191f28;
  margin: 0;
}
.binding-page .order-card {
  background: #ffffff;
  border: 1px solid #f2f4f6;
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(25, 31, 40, 0.03);
}
.binding-page .order-status-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 10px;
}
.binding-page .status-pending { background: #fff1db; color: #ff9f0a; }
.binding-page .status-paid { background: #e1f0ff; color: #3182f6; }
.binding-page .status-manufacturing { background: #f3e8ff; color: #a855f7; }
.binding-page .status-shipping_ready { background: #e0f2fe; color: #0284c7; }
.binding-page .status-shipping { background: #dcfce7; color: #15803d; }
.binding-page .status-completed { background: #dcfce7; color: #15803d; }
.binding-page .status-cancelled { background: #fee2e2; color: #ef4444; }
.binding-page .empty-state-card {
  text-align: center;
  background: #ffffff;
  border: 1px solid #f2f4f6;
  border-radius: 24px;
  padding: 48px 24px;
  box-shadow: 0 4px 16px rgba(25, 31, 40, 0.03);
}
.binding-page .pagination-container {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}
.binding-page .pagination-btn {
  border: 1px solid #e5e8eb;
  background: #ffffff;
  color: #4e5968;
  font-size: 13px;
  font-weight: 700;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
}
.binding-page .pagination-btn.active {
  background: #3182f6;
  color: #ffffff;
  border-color: #3182f6;
}
.binding-page .pagination-btn.pagination-nav {
  width: auto;
  min-width: 52px;
  padding: 0 12px;
}
.binding-page .pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.binding-page .loading {
  text-align: center;
  padding: 40px 20px;
  color: #8b95a1;
  font-size: 14px;
}

/* Toss-like checkout & order detail */
.binding-page .binding-checkout {
  display: grid;
  gap: 16px;
}
.binding-page .binding-checkout-hero,
.binding-page .binding-detail-status-card {
  background: linear-gradient(160deg, #3182f6 0%, #1b64da 100%);
  border-radius: 24px;
  padding: 28px 24px;
  color: #ffffff;
  box-shadow: 0 12px 32px rgba(49, 130, 246, 0.28);
}
.binding-page .binding-checkout-kicker,
.binding-page .binding-detail-date {
  display: block;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.88;
  margin-bottom: 8px;
}
.binding-page .binding-checkout-price,
.binding-page .binding-detail-amount {
  margin: 0;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.binding-page .binding-checkout-price em,
.binding-page .binding-detail-amount span {
  font-size: 22px;
  font-weight: 800;
  font-style: normal;
  margin-left: 2px;
}
.binding-page .binding-checkout-sub {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.9;
  font-weight: 600;
}
.binding-page .binding-detail-card {
  background: #ffffff;
  border: 1px solid #eef1f4;
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(25, 31, 40, 0.04);
}
.binding-page .binding-detail-card-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #191f28;
}
.binding-page .binding-detail-card-head p {
  margin: 6px 0 0;
  font-size: 13px;
  color: #8b95a1;
  font-weight: 600;
  line-height: 1.5;
}
.binding-page .binding-detail-card-head {
  margin-bottom: 14px;
}
.binding-page .binding-detail-rows {
  margin: 0;
  padding: 0;
}
.binding-page .binding-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #f4f6f8;
}
.binding-page .binding-detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.binding-page .binding-detail-row dt {
  margin: 0;
  font-size: 14px;
  color: #8b95a1;
  font-weight: 600;
  flex-shrink: 0;
}
.binding-page .binding-detail-row dd {
  margin: 0;
  font-size: 14px;
  color: #191f28;
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}
.binding-page .binding-detail-sub {
  font-size: 12px;
  color: #8b95a1;
  font-weight: 600;
}
.binding-page .binding-detail-deposit-card {
  background: #f8fafc;
}
.binding-page .binding-deposit-bank {
  background: #ffffff;
  border: 1px solid #e8ecf1;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}
.binding-page .binding-deposit-bank-text {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
  color: #191f28;
  line-height: 1.5;
  word-break: break-all;
}
.binding-page .binding-deposit-copy {
  border: none;
  background: #eef4ff;
  color: #3182f6;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
}
.binding-page .binding-detail-footnote {
  margin: 14px 0 0;
  font-size: 12px;
  color: #8b95a1;
  line-height: 1.5;
  font-weight: 600;
}
.binding-page .binding-checkout-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  margin-top: 8px;
}
.binding-page .binding-btn-primary,
.binding-page .binding-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 20px;
  border-radius: 16px;
  border: none;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}
.binding-page .binding-btn-primary {
  background: var(--btn-primary-bg);
  color: #ffffff;
  box-shadow: var(--btn-primary-shadow);
}
.binding-page .binding-btn-primary:hover:not(:disabled) {
  background: var(--btn-primary-bg-hover);
}
.binding-page .binding-btn-secondary {
  background: #f2f4f6;
  color: #4e5968;
}
.binding-page .binding-btn-full {
  width: 100%;
}
.binding-page .binding-btn-compact {
  min-height: 44px;
  padding: 0 16px;
  font-size: 14px;
  border-radius: 14px;
  white-space: nowrap;
}
.binding-page .binding-history-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.binding-page .binding-history-title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #191f28;
}
.binding-page .binding-history-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: #8b95a1;
  font-weight: 600;
}
.binding-page .binding-history-list {
  display: grid;
  gap: 12px;
}
.binding-page .binding-history-hero {
  background: linear-gradient(165deg, #f8fbff 0%, #ffffff 70%);
  border: 1px solid #eef1f4;
  border-radius: 24px;
  padding: 24px 20px;
  margin-bottom: 16px;
  box-shadow: 0 10px 28px rgba(25, 31, 40, 0.04);
}
.binding-page .binding-history-hero-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  color: #3182f6;
  letter-spacing: 0.04em;
}
.binding-page .binding-history-hero-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
  color: #191f28;
}
.binding-page .binding-history-hero-sub {
  margin: 0 0 16px;
  font-size: 14px;
  color: #6b7684;
  line-height: 1.55;
  font-weight: 600;
}
.binding-page .binding-history-hero-cta {
  display: inline-flex;
}
.binding-page .binding-history-card {
  position: relative;
  display: block;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #eef1f4;
  border-radius: 20px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 24px rgba(25, 31, 40, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.binding-page .binding-history-card-accent {
  height: 4px;
  background: linear-gradient(90deg, #3182f6, #60a5fa);
}
.binding-page .binding-history-card-body {
  padding: 14px 16px;
}
.binding-page .binding-history-card:active {
  transform: scale(0.99);
}
.binding-page .binding-history-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 7px;
}
.binding-page .binding-history-date {
  display: block;
  font-size: 12px;
  color: #8b95a1;
  font-weight: 700;
  margin-bottom: 4px;
}
.binding-page .binding-history-product {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #191f28;
}
.binding-page .binding-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.binding-page .binding-tone-warning { background: #fff4e5; color: #f59e0b; }
.binding-page .binding-tone-info { background: #e8f3ff; color: #3182f6; }
.binding-page .binding-tone-purple { background: #f3e8ff; color: #9333ea; }
.binding-page .binding-tone-success { background: #e8f7ee; color: #16a34a; }
.binding-page .binding-tone-danger { background: #feecec; color: #ef4444; }
.binding-page .binding-tone-neutral { background: #f2f4f6; color: #6b7684; }
.binding-page .binding-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
  color: #6b7684;
  font-weight: 600;
  margin-bottom: 8px;
}
.binding-page .binding-history-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.binding-page .binding-history-bottom strong {
  font-size: 17px;
  font-weight: 900;
  color: #191f28;
}
.binding-page .binding-history-chevron {
  font-size: 22px;
  color: #b0b8c1;
  line-height: 1;
}
.binding-page .binding-history-pending-note {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px dashed #e5e8eb;
  font-size: 12px;
  color: #f59e0b;
  font-weight: 700;
}
.binding-ebook-card { background:linear-gradient(145deg,#f7fbff,#fff); }
.binding-ebook-link-row,.binding-ebook-password>div { display:flex; gap:8px; }
.binding-ebook-link-row input,.binding-ebook-password input { min-width:0; flex:1; height:46px; border:1px solid #dbe5ef; border-radius:13px; padding:0 13px; background:#fff; color:#4e5968; }
.binding-ebook-link-row button,.binding-ebook-password button,.binding-ebook-actions a,.binding-ebook-actions button { min-height:42px; border:0; border-radius:12px; padding:0 14px; background:#e8f3ff; color:#3182f6; font-size:13px; font-weight:850; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.binding-ebook-actions { display:flex; gap:8px; margin-top:10px; }
.binding-ebook-actions a { background:#3182f6; color:#fff; }
.binding-ebook-password { margin-top:18px; padding-top:16px; border-top:1px solid #eef1f4; }
.binding-ebook-password>label { display:block; margin-bottom:8px; color:#4e5968; font-size:13px; font-weight:800; }
.binding-ebook-password small { display:block; margin-top:7px; color:#8b95a1; font-size:11px; }
.binding-page .binding-empty-state {
  text-align: center;
  padding: 48px 24px;
  background: #ffffff;
  border: 1px solid #eef1f4;
  border-radius: 24px;
}
.binding-page .binding-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.binding-page .binding-empty-state h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: #191f28;
}
.binding-page .binding-empty-state p {
  margin: 0 0 24px;
  font-size: 14px;
  color: #8b95a1;
  line-height: 1.6;
  font-weight: 600;
}
.binding-page .binding-success-screen {
  display: grid;
  gap: 16px;
}
.binding-page .binding-success-hero {
  text-align: center;
  padding: 24px 8px 8px;
}
.binding-page .binding-success-check {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #e8f3ff;
  color: #3182f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
}
.binding-page .binding-success-hero h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
  color: #191f28;
}
.binding-page .binding-success-hero p {
  margin: 0;
  font-size: 14px;
  color: #8b95a1;
  line-height: 1.6;
  font-weight: 600;
}
.binding-order-detail-page .binding-detail-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.binding-order-detail-page .binding-detail-back {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f2f4f6;
  color: #4e5968;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
}
.binding-order-detail-page .binding-detail-title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #191f28;
}
.binding-order-detail-page .binding-success-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #e8f7ee;
  border: 1px solid #bbf7d0;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 16px;
}
.binding-order-detail-page .binding-success-banner--info {
  background: #e8f3ff;
  border-color: #bfdbfe;
}
.binding-order-detail-page .binding-success-banner strong {
  display: block;
  font-size: 15px;
  color: #191f28;
  margin-bottom: 4px;
}
.binding-order-detail-page .binding-success-banner p {
  margin: 0;
  font-size: 13px;
  color: #4e5968;
  line-height: 1.5;
  font-weight: 600;
}
.binding-order-detail-page .binding-success-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex-shrink: 0;
}
.binding-order-detail-page .binding-detail-status-card {
  margin-bottom: 16px;
}
.binding-order-detail-page .binding-detail-status-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.binding-order-detail-page .binding-detail-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 13px;
  font-weight: 800;
}
.binding-order-detail-page .binding-detail-order-no {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.85;
}
.binding-order-detail-page .binding-detail-product {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  opacity: 0.92;
}
.binding-order-detail-page .binding-detail-card {
  margin-bottom: 12px;
}
.binding-order-detail-page .binding-diary-preview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.binding-order-detail-page .binding-diary-preview-list li {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
}
.binding-order-detail-page .binding-diary-preview-list--muted li {
  background: #f2f4f6;
  opacity: 0.9;
}
.binding-order-detail-page .binding-diary-preview-date {
  font-size: 12px;
  color: #8b95a1;
  font-weight: 700;
}
.binding-order-detail-page .binding-diary-preview-title {
  font-size: 14px;
  color: #191f28;
  font-weight: 700;
  line-height: 1.4;
}
.binding-order-detail-page .binding-detail-empty {
  margin: 0;
  font-size: 13px;
  color: #8b95a1;
  font-weight: 600;
}
.binding-order-detail-page .binding-tone-warning.binding-detail-status-card {
  background: linear-gradient(160deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 12px 32px rgba(245, 158, 11, 0.25);
}
.binding-order-detail-page .binding-tone-success.binding-detail-status-card,
.binding-order-detail-page .binding-tone-info.binding-detail-status-card {
  background: linear-gradient(160deg, #3182f6 0%, #1b64da 100%);
}

/* Binding order hero + deposit panel (v2) */
.binding-order-detail-page .binding-order-hero,
.binding-page .binding-order-hero {
  background: #ffffff;
  border: 1px solid #eef1f4;
  border-radius: 24px;
  padding: 22px 20px;
  margin-bottom: 12px;
  box-shadow: 0 10px 28px rgba(25, 31, 40, 0.05);
}
.binding-order-detail-page .binding-order-hero-top,
.binding-page .binding-order-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.binding-order-detail-page .binding-order-hero-no,
.binding-page .binding-order-hero-no {
  font-size: 13px;
  font-weight: 700;
  color: #8b95a1;
}
.binding-order-detail-page .binding-order-hero-product,
.binding-page .binding-order-hero-product {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: #6b7684;
}
.binding-order-detail-page .binding-order-hero-amount,
.binding-page .binding-order-hero-amount {
  margin: 0;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #191f28;
}
.binding-order-detail-page .binding-order-hero-amount span,
.binding-page .binding-order-hero-amount span {
  font-size: 20px;
  font-weight: 800;
  margin-left: 2px;
}
.binding-order-detail-page .binding-order-hero-date,
.binding-page .binding-order-hero-date {
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #8b95a1;
}
.binding-page .binding-status-pill,
.binding-order-detail-page .binding-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.binding-page .binding-deposit-panel,
.binding-order-detail-page .binding-deposit-panel {
  background: #ffffff;
  border: 1px solid #eef1f4;
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: 0 10px 28px rgba(25, 31, 40, 0.05);
}
.binding-page .binding-deposit-panel-head h2,
.binding-order-detail-page .binding-deposit-panel-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: #191f28;
}
.binding-page .binding-deposit-panel-head p,
.binding-order-detail-page .binding-deposit-panel-head p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #8b95a1;
  font-weight: 600;
}
.binding-page .binding-deposit-panel-head,
.binding-order-detail-page .binding-deposit-panel-head {
  margin-bottom: 16px;
}
.binding-page .binding-bank-sheet,
.binding-order-detail-page .binding-bank-sheet {
  background: #f8fafc;
  border-radius: 18px;
  padding: 18px 16px;
  text-align: center;
}
.binding-page .binding-bank-chip,
.binding-order-detail-page .binding-bank-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #3182f6;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 12px;
}
.binding-page .binding-bank-account,
.binding-order-detail-page .binding-bank-account {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #191f28;
  word-break: break-all;
}
.binding-page .binding-bank-label,
.binding-order-detail-page .binding-bank-label {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: #8b95a1;
}
.binding-page .binding-bank-copy-btn,
.binding-order-detail-page .binding-bank-copy-btn {
  width: 100%;
  margin-top: 14px;
  min-height: 46px;
  border: 1px solid #dbeafe;
  background: #ffffff;
  color: #3182f6;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.binding-page .binding-deposit-summary,
.binding-order-detail-page .binding-deposit-summary {
  margin-top: 14px;
  border-top: 1px solid #f2f4f6;
  padding-top: 4px;
}
.binding-page .binding-deposit-summary-row,
.binding-order-detail-page .binding-deposit-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f4f6f8;
  font-size: 14px;
  color: #6b7684;
  font-weight: 700;
}
.binding-page .binding-deposit-summary-row:last-child,
.binding-order-detail-page .binding-deposit-summary-row:last-child {
  border-bottom: none;
}
.binding-page .binding-deposit-summary-row strong,
.binding-order-detail-page .binding-deposit-summary-row strong {
  color: #191f28;
  font-size: 15px;
  font-weight: 900;
}
.binding-page .binding-verify-btn,
.binding-order-detail-page .binding-verify-btn {
  width: 100%;
  min-height: var(--btn-primary-min-height);
  margin-top: 16px;
  border: none;
  border-radius: var(--btn-primary-radius);
  background: var(--btn-primary-bg);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--btn-primary-shadow);
}
.binding-page .binding-verify-btn:hover:not(:disabled),
.binding-order-detail-page .binding-verify-btn:hover:not(:disabled) {
  background: var(--btn-primary-bg-hover);
}
.binding-page .binding-verify-btn:disabled,
.binding-order-detail-page .binding-verify-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.binding-page .binding-deposit-hint,
.binding-order-detail-page .binding-deposit-hint {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: #8b95a1;
  font-weight: 600;
  text-align: center;
}
.binding-order-detail-page .binding-detail-card-head--split {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.binding-order-detail-page .binding-diary-page-indicator {
  font-size: 12px;
  font-weight: 800;
  color: #8b95a1;
  white-space: nowrap;
  padding-top: 4px;
}
.binding-order-detail-page .binding-diary-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.binding-order-detail-page .binding-diary-page-btn {
  min-width: 72px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  background: #f2f4f6;
  color: #4e5968;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.binding-order-detail-page .binding-diary-page-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.binding-page .binding-period-chips-wrap {
  margin-bottom: 4px;
}
.binding-page .binding-period-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.binding-page .binding-period-chip {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #e8ecf1;
  border-radius: 999px;
  background: #fff;
  color: #4e5968;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.binding-page .binding-period-chip.is-active {
  background: #191f28;
  border-color: #191f28;
  color: #fff;
}
.binding-page .binding-payment-panel,
.binding-order-detail-page .binding-payment-panel {
  background: #ffffff;
  border: 1px solid #eef1f4;
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: 0 10px 28px rgba(25, 31, 40, 0.05);
}
.binding-page .binding-payment-method-card {
  background: #f8fafc;
  border-radius: 18px;
  padding: 16px;
}
.binding-page .binding-payment-method-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.binding-page .binding-payment-method-label {
  font-size: 14px;
  color: #6b7684;
  font-weight: 700;
}
.binding-page .binding-payment-method-value {
  font-size: 15px;
  color: #191f28;
  font-weight: 900;
}
.binding-page .binding-payment-method-note,
.binding-order-detail-page .binding-payment-method-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #8b95a1;
  font-weight: 600;
}
.binding-verify-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(25, 31, 40, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.binding-verify-overlay[hidden] {
  display: none !important;
}
.binding-verify-overlay-card {
  width: min(100%, 320px);
  background: #fff;
  border-radius: 20px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(25, 31, 40, 0.18);
}
.binding-verify-overlay-card strong {
  display: block;
  margin-top: 14px;
  font-size: 16px;
  color: #191f28;
}
.binding-verify-overlay-card p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #8b95a1;
  font-weight: 600;
}
.binding-verify-spinner {
  margin: 0 auto;
}
.binding-order-detail-page .binding-diary-page-btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.binding-order-cancel-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 16px calc(var(--bottom-nav-height) + 8px + env(safe-area-inset-bottom));
  margin-top: -8px;
}
.binding-order-cancel-link {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #8b95a1;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.binding-order-cancel-link:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

body.app-chrome-hidden:has(.ui-text-room) {
  overflow: hidden;
  width: 100%;
}

body.app-chrome-hidden.ui-text-keyboard-open {
  position: fixed;
  inset: 0;
  width: 100%;
  height: var(--text-vv-height, 100svh);
}

.ui-text-room {
  display: flex;
  flex-direction: column;
  height: 100svh;
  min-height: 100svh;
  max-height: 100svh;
  overflow: hidden;
  background: #f8f9fb;
}

body.ui-text-keyboard-open .ui-text-room {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--text-vv-offset-top, 0px);
  width: 100%;
  height: var(--text-vv-height, 100svh);
  min-height: 0;
  max-height: var(--text-vv-height, 100svh);
}
.ui-text-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 12px;
  background: #fff;
  border-bottom: 1px solid #f2f4f6;
  position: sticky;
  top: 0;
  z-index: 20;
}
.ui-text-top-copy {
  flex: 1 1 auto;
  min-width: 0;
}
.ui-text-top-copy strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #191f28;
}
.ui-text-top-copy span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: #8b95a1;
}
.ui-text-end-link {
  border: 0;
  background: transparent;
  color: #ef4444;
  font-size: 14px;
  font-weight: 800;
  padding: 8px 4px;
  cursor: pointer;
}
.ui-text-end-link:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ui-text-chat {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px 18px 0;
  overflow: hidden;
}
.ui-text-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #8b95a1;
}
.ui-text-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 12px 4px 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ui-text-messages::-webkit-scrollbar { display: none; width: 0; height: 0; }
.ui-text-bubble {
  max-width: min(88%, 320px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ui-text-bubble--user {
  align-self: flex-end;
  align-items: flex-end;
}
.ui-text-bubble--ai {
  align-self: flex-start;
  align-items: flex-start;
}
.ui-text-bubble-label {
  display: none;
}
.ui-text-bubble-body {
  padding: 14px 16px;
  border-radius: 22px;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 600;
  word-break: break-word;
  letter-spacing: -0.01em;
}
.ui-text-bubble--user .ui-text-bubble-body {
  background: #ffffff;
  color: #191f28;
  border: 1px solid rgba(229, 232, 235, 0.9);
  box-shadow: 0 2px 10px rgba(25, 31, 40, 0.06);
}
.ui-text-bubble--ai .ui-text-bubble-body {
  background: #eff2ff;
  color: #3355cc;
  border: 0;
  box-shadow: none;
}
.ui-text-bubble-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  line-height: 1;
  padding: 0 4px;
}
.ui-text-bubble-meta time {
  font-variant-numeric: tabular-nums;
}
.ui-text-bubble--user .ui-text-bubble-meta {
  justify-content: flex-end;
}
.ui-text-bubble--ai .ui-text-bubble-meta {
  justify-content: flex-start;
}
.ui-text-bubble-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b0b8c1;
  font-size: 10px;
}
.ui-text-bubble-check i {
  font-size: 10px;
}
.ui-text-typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 18px;
}
.ui-text-typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8fa3e8;
  animation: uiTextTyping 1.2s infinite ease-in-out;
}
.ui-text-typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.ui-text-typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes uiTextTyping {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-3px); opacity: 1; }
}
.ui-text-composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 0 max(10px, env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  margin-top: auto;
  background: #f8f9fb;
  z-index: 5;
}

body.ui-text-keyboard-open .ui-text-composer {
  padding-bottom: 8px;
}
.ui-text-composer textarea {
  flex: 1 1 auto;
  min-height: 48px;
  max-height: 120px;
  resize: none;
  border: 1px solid #e8ebf0;
  border-radius: 22px;
  padding: 12px 16px;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  background: #fff;
  box-shadow: 0 2px 10px rgba(25, 31, 40, 0.04);
}
.ui-text-composer textarea:focus {
  outline: none;
  border-color: #c9d1d9;
  box-shadow: 0 0 0 3px rgba(25, 31, 40, 0.06);
}
.ui-text-send-btn {
  flex: 0 0 auto;
  min-width: 68px;
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  background: var(--btn-primary-bg);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: var(--btn-primary-shadow);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ui-text-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.ui-text-wrap-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.ui-text-wrap-modal[hidden] {
  display: none !important;
}

.ui-text-wrap-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.ui-text-wrap-sheet {
  position: relative;
  width: min(100%, 420px);
  background: #fff;
  border-radius: 24px 24px 20px 20px;
  padding: 24px 20px 20px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
}

.ui-text-wrap-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  color: #3182f6;
}

.ui-text-wrap-sheet h2 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 900;
  color: #191f28;
  line-height: 1.35;
}

.ui-text-wrap-desc {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
  color: #4e5968;
}

.ui-text-wrap-actions {
  display: grid;
  gap: 10px;
}

.ui-text-wrap-primary,
.ui-text-wrap-secondary {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
}

body.text-wrap-modal-open {
  overflow: hidden;
}

.result-quality-panel {
  background: #fff;
  border: 1px solid #f2f4f6;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.result-quality-head h2 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 900;
  color: #191f28;
}

.result-quality-head p {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: #8b95a1;
}

.result-quality-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.result-quality-btn {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #e5e8eb;
  border-radius: 14px;
  background: #f9fafb;
  color: #333d4b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
}

.result-quality-btn:disabled {
  opacity: 0.6;
}

.result-diary-content.is-locked {
  display: none;
}

.diary-lock-gate {
  margin-top: 16px;
}

.diary-lock-card {
  background: #fff;
  border: 1px solid #f2f4f6;
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.diary-lock-icon {
  display: block;
  font-size: 32px;
  margin-bottom: 12px;
}

.diary-lock-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 900;
  color: #191f28;
}

.diary-lock-card p {
  margin: 0 0 18px;
  font-size: 14px;
  font-weight: 700;
  color: #8b95a1;
}

.diary-pin-form {
  display: grid;
  gap: 12px;
  padding: 0 20px 24px;
}

.diary-pin-form label {
  font-size: 13px;
  font-weight: 800;
  color: #4e5968;
}

.diary-pin-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #e5e8eb;
  border-radius: 14px;
  padding: 0 14px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.welcome-call-sheet {
  border-radius: 28px 28px 0 0;
}

.welcome-call-body {
  padding: 28px 24px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
}

.welcome-call-emoji {
  display: block;
  font-size: 40px;
  margin-bottom: 12px;
}

.welcome-call-body h2 {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 900;
  color: #191f28;
}

.welcome-call-body p {
  margin: 0 0 20px;
  font-size: 15px;
  font-weight: 700;
  color: #4e5968;
  line-height: 1.5;
}

.welcome-call-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  margin-bottom: 10px;
  border: 0;
  border-radius: 16px;
  background: var(--btn-primary-bg);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--btn-primary-shadow);
  transition: background 0.15s ease, transform 0.15s ease;
}

.welcome-call-primary:hover {
  background: var(--btn-primary-bg-hover);
  color: #fff;
}

.welcome-call-primary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  font-size: 16px;
  line-height: 1;
}

.welcome-call-secondary {
  width: 100%;
  min-height: 44px;
  border: none;
  background: transparent;
  color: #8b95a1;
  font-size: 14px;
  font-weight: 800;
}

.result-hero-toolbar {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.result-hero-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #191f28;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.result-hero-action:active {
  background: #f2f4f6;
}

.pin-keypad-widget {
  display: grid;
  gap: 20px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.pin-keypad-title {
  margin: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #8b95a1;
}

.pin-keypad-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  min-height: 16px;
}

.pin-keypad-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e5e8eb;
  transition: background 0.15s ease, transform 0.15s ease;
}

.pin-keypad-dot.is-filled {
  background: #3182f6;
  transform: scale(1.05);
}

.pin-keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.pin-keypad-key {
  width: 100%;
  min-height: 56px;
  border: none;
  border-radius: 16px;
  background: #f2f4f6;
  color: #191f28;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.pin-keypad-key.is-back {
  font-size: 18px;
  background: #eef3ff;
  color: #3182f6;
}

.pin-keypad-key.is-empty {
  background: transparent;
  pointer-events: none;
}

.pin-keypad-key:active {
  transform: scale(0.98);
  background: #e8ebee;
}

.pin-keypad-error {
  margin: -8px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #ef4444;
}

.pin-keypad-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  border: 0;
  border-radius: 16px;
  background: var(--btn-primary-bg);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: var(--btn-primary-shadow);
  cursor: pointer;
}

.pin-keypad-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pin-keypad-modal .pin-keypad-sheet {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.pin-keypad-modal .pin-keypad-widget {
  padding: 0 8px 8px;
}

.app-pin-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #ffffff;
}

.app-pin-gate.is-open {
  display: flex;
}

html.app-pin-locked-root,
body.app-pin-locked {
  overflow: hidden !important;
  height: 100%;
  position: fixed;
  width: 100%;
  touch-action: none;
}

body.app-pin-locked .app-main,
body.app-pin-locked .app-bottom-nav,
body.app-pin-locked .app-site-footer {
  visibility: hidden;
}

.app-pin-gate {
  overflow: hidden;
  overscroll-behavior: none;
}

body.modal-open {
  overflow: hidden;
  touch-action: none;
}

body.modal-open .site-header {
  z-index: 60;
}

.app-pin-gate-inner {
  width: min(100%, 360px);
  text-align: center;
}

.app-pin-gate-kicker {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: #3182f6;
}

.app-pin-gate-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 900;
  color: #191f28;
  letter-spacing: -0.03em;
}

.app-pin-gate-desc {
  margin: 0 0 28px;
  font-size: 15px;
  font-weight: 700;
  color: #6b7684;
  line-height: 1.5;
}

.app-pin-gate-mount .pin-keypad-widget {
  max-width: none;
}

.refine-sheet-modal .refine-sheet {
  max-height: min(88dvh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 20px;
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
}

.refine-sheet-header {
  flex: 0 0 auto;
  align-items: flex-start;
  margin-bottom: 8px;
}

.refine-sheet-subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #8b95a1;
  line-height: 1.45;
}

.refine-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 8px;
}

.refine-sheet-footer {
  flex: 0 0 auto;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 24%);
}

.refine-section + .refine-section {
  margin-top: 14px;
}

.refine-section-head {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.refine-section-head strong {
  font-size: 14px;
  font-weight: 800;
  color: #191f28;
}

.refine-section-head span {
  font-size: 12px;
  font-weight: 600;
  color: #8b95a1;
  line-height: 1.45;
}

.refine-date-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f9fafb;
  border: 1px solid #eef1f4;
}

.refine-date-icon {
  font-size: 18px;
  line-height: 1;
}

.refine-date-field input[type="date"] {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  color: #191f28;
  font-family: inherit;
  min-height: 28px;
}

.refine-date-field input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.55;
  cursor: pointer;
}

.refine-chip-grid {
  display: grid;
  gap: 8px;
}

.refine-chip-grid--two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.refine-chip {
  display: grid;
  grid-template-columns: 32px 1fr 22px;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  border: 1.5px solid #eef1f4;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.refine-chip-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.refine-chip-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #f2f4f6;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.refine-chip-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #191f28;
  line-height: 1.3;
  word-break: keep-all;
}

.refine-chip-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #d1d6db;
  box-sizing: border-box;
  position: relative;
}

.refine-chip.is-selected {
  border-color: #3182f6;
  background: #f8fbff;
  box-shadow: 0 4px 14px rgba(49, 130, 246, 0.08);
}

.refine-chip.is-selected .refine-chip-icon {
  background: #e8f3ff;
}

.refine-chip.is-selected .refine-chip-check {
  border-color: #3182f6;
  background: #3182f6;
}

.refine-chip.is-selected .refine-chip-check::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}

.refine-chip.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.refine-chip--restore.is-selected {
  border-color: #4e5968;
  background: #f9fafb;
  box-shadow: none;
}

.refine-chip--restore.is-selected .refine-chip-check {
  border-color: #4e5968;
  background: #4e5968;
}

.refine-apply-btn {
  width: 100%;
  min-height: 52px;
  margin-top: 0;
  border: 0;
  border-radius: 16px;
  background: #3182f6;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(49, 130, 246, 0.24);
}

.refine-apply-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.refine-apply-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.result-settings-body {
  padding-bottom: 8px;
}

/* Tablet: full-bleed tutorial / onboarding / auth shells */
@media (min-width: 520px) and (max-width: 1099px) {
  html:has(.onboarding-landing),
  body:has(.onboarding-landing),
  body:has(.auth-tutorial-page) {
    background: #ffffff;
  }

  .onboarding-landing,
  .auth-tutorial-page {
    width: 100%;
    max-width: none;
    margin: 0;
    min-height: 100dvh;
    height: auto;
    border-radius: 0;
    box-shadow: none;
  }

  .onboarding-landing:not(.auth-tutorial-page) {
    height: var(--app-height, 100dvh);
    min-height: var(--app-height, 100dvh);
    max-height: none;
  }

  .onboarding-landing:not(.auth-tutorial-page) .onboarding-slides,
  .onboarding-landing:not(.auth-tutorial-page) .onboarding-slide {
    height: calc(var(--app-height, 100dvh) - var(--onboarding-action-height));
    min-height: calc(var(--app-height, 100dvh) - var(--onboarding-action-height));
  }

  .onboarding-slide {
    min-height: calc(var(--app-height, 100dvh) - var(--onboarding-action-height, 132px));
    padding-inline: max(28px, env(safe-area-inset-left), env(safe-area-inset-right));
  }

  .onboarding-actions,
  .auth-tutorial-actions,
  .auth-tutorial-progress,
  .app-page-ad-bar {
    width: 100%;
    max-width: none;
  }

  .app-page-ad-bar {
    padding-inline: max(12px, env(safe-area-inset-left), env(safe-area-inset-right));
  }

  .onboarding-actions {
    margin: 0;
  }

  .auth-tutorial-back {
    left: max(16px, env(safe-area-inset-left, 0px));
  }

  .auth-tutorial-page .auth-tutorial-stage,
  .auth-tutorial-page .auth-tutorial-slide {
    padding-top: calc(68px + env(safe-area-inset-top));
    padding-inline: max(28px, env(safe-area-inset-left), env(safe-area-inset-right));
    min-height: calc(100dvh - 128px - env(safe-area-inset-bottom));
  }

  .auth-tutorial-stage,
  .auth-tutorial-slide {
    padding-inline: max(28px, env(safe-area-inset-left), env(safe-area-inset-right));
  }

  .friend-grid-onboarding {
    max-width: 560px;
    margin-inline: auto;
  }
}

@media (min-width: 1100px) {
  .onboarding-actions {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

/* Billing page subtitle when using site header */
.billing-page-subtitle--inline {
  margin: 0 0 20px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7684;
  line-height: 1.5;
}

/* Plan/binding sticky deposit CTA */
.binding-page.has-sticky-deposit .app-container {
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

.binding-sticky-deposit-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--bottom-nav-height, 64px) + env(safe-area-inset-bottom));
  z-index: 90;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.92) 24%, #fff 100%);
}

.binding-sticky-deposit-bar .binding-verify-btn {
  width: 100%;
  margin: 0;
}

.binding-success-banner--warn {
  background: #fffbeb;
  border-color: #fde68a;
}

.binding-success-banner--warn .binding-success-icon {
  background: #f59e0b;
}

/* Support hub (Toss-style) */
.support-hub-page .app-container {
  max-width: 640px;
}

.support-hub-hero {
  padding: 8px 4px 20px;
}

.support-hub-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b95a1;
}

.support-hub-title {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  color: #191f28;
  letter-spacing: -0.02em;
}

.support-hub-desc {
  margin: 10px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: #6b7684;
  line-height: 1.55;
}

.support-hub-toast {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
}

.support-hub-toast--success {
  background: #eff6ff;
  color: #1b64da;
  border: 1px solid #bfdbfe;
}

.support-hub-toast--error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.support-hub-quick {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.support-hub-quick-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #f2f4f6;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 16px rgba(25, 31, 40, 0.03);
}

.support-hub-quick-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #f0f7ff;
  color: #3182f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.support-hub-quick-text {
  flex: 1;
  min-width: 0;
}

.support-hub-quick-text strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #191f28;
}

.support-hub-quick-text small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  color: #8b95a1;
}

.support-hub-quick-arrow {
  color: #adb5bd;
  font-size: 20px;
  font-weight: 300;
}

.support-compose-card,
.support-history-section {
  background: #fff;
  border: 1px solid #f2f4f6;
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(25, 31, 40, 0.03);
}

.support-compose-head h3,
.support-history-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: #191f28;
}

.support-compose-head p {
  margin: 6px 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: #8b95a1;
}

.support-field-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid #e5e8eb;
  border-radius: 14px;
  background: #f9fafb;
  cursor: pointer;
  text-align: left;
}

.support-field-label {
  font-size: 13px;
  font-weight: 800;
  color: #8b95a1;
}

.support-field-value {
  flex: 1;
  font-size: 15px;
  font-weight: 800;
  color: #191f28;
  text-align: right;
}

.support-field-chevron {
  color: #adb5bd;
  font-size: 18px;
}

.support-field-block {
  margin-bottom: 12px;
}

.support-field-block label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #4e5968;
}

.support-field-block input,
.support-field-block textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e5e8eb;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  background: #f9fafb;
}

.support-submit-btn {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  border: 0;
  border-radius: 16px;
  background: #3182f6;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(49, 130, 246, 0.24);
}

.support-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.support-history-badge {
  font-size: 12px;
  font-weight: 800;
  color: #ea580c;
  background: #fff7ed;
  padding: 4px 10px;
  border-radius: 999px;
}

.support-history-empty {
  text-align: center;
  padding: 36px 16px;
  color: #8b95a1;
  font-weight: 700;
}

.support-history-empty i {
  font-size: 28px;
  margin-bottom: 10px;
  display: block;
}

.support-history-list {
  display: grid;
  gap: 12px;
}

.support-history-card {
  border: 1px solid #f2f4f6;
  border-radius: 18px;
  padding: 16px;
  background: #fafbfc;
}

.support-history-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.support-history-cat {
  font-size: 12px;
  font-weight: 800;
  color: #8b95a1;
}

.support-history-status {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
}

.support-history-status--open { background: #fff7ed; color: #ea580c; }
.support-history-status--done { background: #eff6ff; color: #1b64da; }
.support-history-status--closed { background: #f2f4f6; color: #8b95a1; }

.support-history-card h4 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
  color: #191f28;
}

.support-history-card time {
  font-size: 12px;
  color: #adb5bd;
  font-weight: 700;
}

.support-history-card > p {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: #4e5968;
}

.support-history-reply {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f0f7ff;
}

.support-history-reply strong {
  display: block;
  font-size: 12px;
  color: #1b64da;
  margin-bottom: 6px;
}

.support-history-reply p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #191f28;
}

.support-category-options .ui-modal-option-btn.selected {
  border-color: #3182f6;
  background: #f0f7ff;
  color: #1b64da;
}

.support-rel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.support-rel-label {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  color: #8b95a1;
}

/* Profile edit */
.profile-edit-page .app-container { max-width: 560px; }
.profile-edit-lead {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7684;
}
.profile-edit-alert {
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
}
.profile-edit-alert--success { background: #eff6ff; color: #1b64da; }
.profile-edit-alert--error { background: #fef2f2; color: #dc2626; }
.profile-edit-form { padding: 20px; }
.profile-edit-field { margin-bottom: 14px; }
.profile-edit-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #4e5968;
}
.profile-edit-field input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e5e8eb;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  background: #f9fafb;
}
.profile-edit-readonly-group {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f9fafb;
  display: grid;
  gap: 10px;
}
.profile-edit-readonly {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.profile-edit-readonly span { color: #8b95a1; font-weight: 700; }
.profile-edit-readonly strong { color: #191f28; font-weight: 800; text-align: right; }
.billing-apply-policy-link {
  display: inline-block;
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  font-weight: 800;
  color: #8b95a1;
  cursor: pointer;
}

.billing-apply-policy-link:hover {
  color: #3182f6;
}

.billing-footnote-policy {
  display: inline-block;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  font-weight: 800;
  color: #3182f6;
  cursor: pointer;
}

.billing-legal-modal.open {
  z-index: 1600;
}

/* Profile hub */
.profile-hub-page .app-container { max-width: 560px; }

.profile-hub-hero {
  margin-bottom: 20px;
  padding: 4px 2px;
}

.profile-hub-name {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  color: #191f28;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.profile-modal-title {
  overflow-wrap: anywhere;
}

.profile-hub-meta {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #8b95a1;
}

.profile-hub-toast {
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
}
.profile-hub-toast--success { background: #eff6ff; color: #1b64da; }
.profile-hub-toast--error { background: #fef2f2; color: #dc2626; }

.profile-hub-card {
  background: #fff;
  border: 1px solid #f2f4f6;
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(25, 31, 40, 0.03);
}

.profile-hub-section-title {
  font-size: 14px;
  font-weight: 900;
  color: #8b95a1;
  margin-bottom: 14px;
}

.profile-hub-field { margin-bottom: 14px; }
.profile-hub-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
  color: #191f28;
}
.profile-hub-required { color: #3182f6; font-size: 12px; font-weight: 800; }
.profile-hub-optional { color: #8b95a1; font-size: 12px; font-weight: 700; }
.profile-hub-field input,
.profile-hub-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e5e8eb;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  background: #f9fafb;
}
.profile-hub-field input:focus,
.profile-hub-field textarea:focus {
  outline: none;
  border-color: #3182f6;
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.12);
  background: #fff;
}
.profile-hub-hint {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #8b95a1;
  line-height: 1.45;
}

.profile-hub-readonly {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f9fafb;
  display: grid;
  gap: 10px;
}
.profile-hub-readonly div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.profile-hub-readonly span { color: #8b95a1; font-weight: 700; }
.profile-hub-readonly strong { color: #191f28; font-weight: 800; }

.profile-hub-save-btn {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  background: #3182f6;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(49, 130, 246, 0.24);
}

.profile-hub-action-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px;
  border: 0;
  background: none;
  font-size: 15px;
  font-weight: 700;
  color: #333d4b;
  cursor: pointer;
  border-bottom: 1px solid #f2f4f6;
}
.profile-hub-action-row:last-child { border-bottom: 0; }
.profile-hub-action-row i { width: 22px; margin-right: 8px; color: #8b95a1; }
.profile-hub-action-row--danger { color: #ef4444; }
.profile-hub-action-row--danger i { color: #ef4444; }
.profile-hub-action-chevron { color: #adb5bd; font-size: 18px; }

/* Keep the mobile menu trigger at one fixed coordinate on home and sub pages. */
@media (max-width: 700px) {
  .site-header.is-home .site-header-inner,
  .site-header.is-sub .site-header-inner {
    width: 100%;
    max-width: none;
    height: 60px;
    margin: 0;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    box-sizing: border-box;
  }

  .site-header.is-home .menu-button,
  .site-header.is-sub .menu-button {
    width: 42px;
    height: 42px;
    margin: 0;
    justify-self: end;
    flex: 0 0 42px;
  }
}

/* Profile modals (logout / withdraw) */
.profile-modal .profile-modal-sheet {
  padding: 10px 20px 0;
  max-height: min(92dvh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.profile-modal .profile-modal-sheet--scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.profile-modal-handle {
  width: 40px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: #e5e8eb;
  flex-shrink: 0;
}

.profile-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.profile-modal-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #8b95a1;
}

.profile-modal-title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  color: #191f28;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.profile-modal-header .ui-modal-close {
  flex-shrink: 0;
  margin-top: 2px;
}

.profile-modal-body {
  flex: 1;
  min-height: 0;
  padding-bottom: 8px;
}

.profile-modal-lead {
  margin: -4px 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7684;
  line-height: 1.5;
}

.profile-modal-info-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(145deg, #f0f7ff 0%, #ffffff 58%);
  border: 1px solid #d6e8ff;
}

.profile-modal-info-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #fff;
  color: #3182f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(49, 130, 246, 0.12);
}

.profile-modal-info-card--warning {
  margin-top: 12px;
  background: linear-gradient(145deg, #fff7ed 0%, #ffffff 62%);
  border-color: #fed7aa;
}

.profile-modal-info-card--warning .profile-modal-info-icon {
  color: #f97316;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.14);
}

.profile-modal-info-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 800;
  color: #191f28;
  line-height: 1.4;
}

.profile-modal-info-card p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #6b7684;
  line-height: 1.5;
}

.profile-modal-emphasis-card {
  padding: 22px 20px;
  border-radius: 20px;
  background: linear-gradient(145deg, #fff5f5 0%, #ffffff 62%);
  border: 1px solid #fecaca;
  text-align: center;
}

.profile-modal-emphasis-count {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #4e5968;
}

.profile-modal-emphasis-count strong {
  font-size: 28px;
  font-weight: 900;
  color: #ef4444;
  letter-spacing: -0.02em;
}

.profile-modal-emphasis-desc {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #6b7684;
  line-height: 1.55;
}

.profile-modal-reasons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.profile-modal-reason-btn {
  padding: 13px 12px;
  border-radius: 14px;
  border: 1px solid #e5e8eb;
  background: #f9fafb;
  font-size: 13px;
  font-weight: 700;
  color: #4e5968;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.profile-modal-reason-btn.selected {
  border-color: #3182f6;
  background: #f0f7ff;
  color: #1b64da;
  box-shadow: 0 0 0 1px rgba(49, 130, 246, 0.08);
}

.profile-modal-field {
  margin-bottom: 14px;
}

.profile-modal-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
  color: #191f28;
}

.profile-modal-field input,
.profile-modal-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e5e8eb;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  background: #f9fafb;
  font-family: inherit;
}

.profile-modal-field input:focus,
.profile-modal-field textarea:focus {
  outline: none;
  border-color: #3182f6;
  box-shadow: 0 0 0 3px rgba(49, 130, 246, 0.12);
  background: #fff;
}

.profile-modal-footer {
  flex-shrink: 0;
  padding: 12px 0 calc(env(safe-area-inset-bottom) + 16px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 28%);
}

.profile-modal-footer--stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

body.app-has-bottom-nav .profile-modal .profile-modal-footer,
body:has(.app-bottom-nav) .profile-modal .profile-modal-footer {
  padding-bottom: calc(env(safe-area-inset-bottom) + var(--bottom-nav-height) + 12px);
}

.profile-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.profile-modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.profile-modal-btn:active:not(:disabled) {
  transform: scale(0.985);
}

.profile-modal-btn:disabled,
.profile-modal-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
}

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

.profile-modal-btn--primary {
  background: #3182f6;
  color: #fff;
  box-shadow: 0 10px 24px rgba(49, 130, 246, 0.28);
}

.profile-modal-btn--ghost {
  background: #f2f4f6;
  color: #4e5968;
}

.profile-modal-btn--danger {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.22);
}

.profile-modal-btn--text {
  min-height: 44px;
  background: transparent;
  color: #8b95a1;
  font-size: 14px;
  font-weight: 700;
  box-shadow: none;
}

.profile-modal-btn--text:active {
  color: #6b7684;
}

.profile-edit-submit { width: 100%; margin-top: 8px; }
.copy-keep-together { white-space: nowrap; }
.report-empty-cta { width: 100%; border-radius: 16px; padding: 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.support-hub-tabs { display: flex; gap: 8px; margin: 0 0 18px; }
.support-hub-tab { flex: 1; text-align: center; padding: 12px 10px; border-radius: 14px; background: #f2f4f6; color: #4e5968; text-decoration: none; font-weight: 800; font-size: 14px; position: relative; }
.support-hub-tab.is-active { background: #191f28; color: #fff; }
.support-hub-tab-badge { display: inline-flex; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: #f04452; color: #fff; font-size: 11px; align-items: center; justify-content: center; }
.support-inquiry-cancel-btn { margin-top: 12px; border: 0; background: transparent; color: #8b95a1; font-weight: 700; cursor: pointer; }
.profile-phone-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.profile-phone-readonly { background: #f8fafc; }
.phone-verification-sms-warning { margin-top: 12px; font-size: 13px; color: #b45309; line-height: 1.5; }
.ui-end-call-hint { margin-top: -4px; color: #3182f6; font-weight: 700; }
.refine-preview-panel { margin-bottom: 12px; padding: 14px; border-radius: 14px; background: #f8fafc; text-align: left; }
.refine-preview-label { font-size: 12px; font-weight: 800; color: #8b95a1; margin-bottom: 6px; }
.refine-preview-panel h4 { margin: 0 0 8px; font-size: 16px; }
.refine-preview-panel p { margin: 0; font-size: 14px; line-height: 1.6; color: #4e5968; white-space: pre-wrap; }
.refine-apply-btn--confirm { margin-top: 8px; background: #191f28; }
.pin-keypad-key.is-pressed { transform: scale(0.94); background: #e8f3ff; }
.auth-tutorial-page .auth-tutorial-stage { overflow: visible; }
.auth-tutorial-page { min-height: 100dvh; overflow: hidden; }
.phone-verification-modal.open { display: flex; }
.phone-verification-guide{margin-top:16px;padding:22px 18px;border-radius:18px;background:#f6f9ff;border:1px solid #dbeafe;text-align:center}
.phone-verification-guide strong{display:block;font-size:17px;color:#1e3a8a}
.phone-verification-guide p{font-size:14px;line-height:1.6;color:#475569}
.phone-verification-guide small{display:block;color:#64748b}
.phone-verification-code{display:inline-flex;margin:10px 0 14px;padding:12px 22px;border-radius:14px;background:#fff;box-shadow:0 6px 20px rgba(49,130,246,.12);font-size:30px;font-weight:900;letter-spacing:.28em;color:#1d4ed8}
.phone-verification-spinner{width:36px;height:36px;margin:0 auto 12px;border:4px solid #dbeafe;border-top-color:#3182f6;border-radius:50%;animation:phoneVerifySpin .8s linear infinite}
.phone-verification-guide.is-verified{background:#ecfdf5;border-color:#a7f3d0}
@keyframes phoneVerifySpin{to{transform:rotate(360deg)}}

.ui-sidebar-drawer,
.user-menu-drawer.ui-sidebar-drawer {
  position: fixed;
  top: 0;
  right: -380px;
  bottom: 0;
  z-index: 1300;
  width: min(360px, 88vw);
  height: 100dvh;
  min-height: 100dvh;
  max-height: none;
  padding: calc(env(safe-area-inset-top) + 20px) 20px calc(env(safe-area-inset-bottom) + 20px);
  background: #ffffff;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 0;
  box-sizing: border-box;
  overflow: hidden;
}

body.menu-open .ui-sidebar-drawer {
  right: 0 !important;
}

.ui-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.ui-sidebar-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ui-avatar-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #f2f4f6;
  color: #4e5968;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  border: 1px solid rgba(0,0,0,0.03);
}

.ui-profile-info {
  display: flex;
  flex-direction: column;
}

.ui-profile-name {
  font-size: 18px;
  color: #333d4b;
  margin-bottom: 2px;
}

.ui-profile-name strong {
  font-weight: 800;
  color: #191f28;
}

.ui-profile-sub {
  font-size: 13px;
  color: #8b95a1;
  margin-bottom: 6px;
}

.ui-plan-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 10px;
  background: #e8f3ff;
  color: #3182f6;
  font-size: 11px;
  font-weight: 800;
  border-radius: 12px;
}

.menu-close-btn {
  border: none;
  background: #f2f4f6;
  color: #4e5968;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.menu-close-btn:hover {
  background: #e5e8eb;
}

.ui-sidebar-menu-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-right: 4px;
  padding-bottom: 12px;
  overscroll-behavior: contain;
}

.ui-sidebar-menu-list::-webkit-scrollbar {
  width: 4px;
}

.ui-sidebar-menu-list::-webkit-scrollbar-thumb {
  background: #e5e8eb;
  border-radius: 2px;
}

.ui-menu-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ui-menu-section-title {
  font-size: 12px;
  font-weight: 800;
  color: #8b95a1;
  margin-bottom: 8px;
  padding-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ui-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  text-decoration: none;
  border-radius: 14px;
  transition: background 0.15s ease;
  cursor: pointer;
}

.ui-menu-item:hover {
  background: #f9fafb;
}

.ui-menu-icon {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
}

.ui-menu-label {
  font-size: 15px;
  font-weight: 600;
  color: #4e5968;
}

.ui-menu-item:hover .ui-menu-label {
  color: #191f28;
}

.ui-sidebar-footer {
  flex: 0 0 auto;
  border-top: 1px solid #f2f4f6;
  padding-top: 16px;
  margin-top: auto;
  display: flex;
  justify-content: center;
}

.ui-logout-btn {
  font-size: 14px;
  font-weight: 700;
  color: #f04452;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 10px;
  transition: background 0.15s;
}

.ui-logout-btn:hover {
  background: #fef2f2;
}

/* PC Viewport constraint for all user-facing pages (auth, onboarding, and logged-in app pages) */
@media (min-width: 520px) {
  html {
    background-color: #f2f4f6 !important;
  }
  body:not(.admin-body) {
    background-color: #ffffff !important;
    width: 430px !important;
    max-width: 430px !important;
    min-height: 100vh !important;
    margin: 0 auto !important;
    border-left: 1px solid #e5e8eb !important;
    border-right: 1px solid #e5e8eb !important;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.05) !important;
    box-sizing: border-box !important;
    position: relative !important;
  }
  
  /* Make all container wrappers fill the body width on PC */
  body:not(.admin-body) .app-main,
  body:not(.admin-body) .app-shell,
  body:not(.admin-body) .call-app-shell,
  body:not(.admin-body) .ui-call-room-v3,
  body:not(.admin-body) .ui-text-room,
  body:not(.admin-body) .onboarding-landing,
  body:not(.admin-body) .v3-home-shell,
  body:not(.admin-body) .app-page {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    border: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
  }
  
  /* Let regular app pages handle height naturally */
  body:not(.admin-body) .app-main,
  body:not(.admin-body) .app-shell,
  body:not(.admin-body) .app-page {
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow-y: visible !important;
  }

  /* Force site-header to use mobile layout inside the 430px body */
  body:not(.admin-body) .site-nav {
    display: none !important;
  }
  body:not(.admin-body) .menu-button {
    display: inline-flex !important;
  }
  body:not(.admin-body) .brand small {
    display: none !important;
  }

  /* Contain sidebar drawer and overlay inside the 430px column using fixed positioning */
  body:not(.admin-body) .user-menu-drawer {
    position: fixed !important;
    left: calc(50% + 215px) !important;
    right: auto !important;
    width: 360px !important;
    height: 100vh !important;
    height: 100dvh !important;
    top: 0 !important;
    bottom: 0 !important;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    z-index: 1300 !important;
  }
  body:not(.admin-body).menu-open .user-menu-drawer {
    left: calc(50% + 215px - 360px) !important;
  }
  body:not(.admin-body) .menu-overlay {
    position: fixed !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 430px !important;
    height: 100vh !important;
    height: 100dvh !important;
    top: 0 !important;
    bottom: 0 !important;
    z-index: 1200 !important;
  }

  /* Fixed position elements constraint (align with the centered 430px body) */
  body:not(.admin-body) .app-bottom-nav,
  body:not(.admin-body) .push-foreground-toast,
  body:not(.admin-body) .push-permission-card,
  body:not(.admin-body) .app-payment-reminder,
  body:not(.admin-body) .app-page-ad-bar,
  body:not(.admin-body) .ui-bottom-modal,
  body:not(.admin-body) .start-modal,
  body:not(.admin-body) .app-modal,
  body:not(.admin-body) .ui-modal-sheet,
  body:not(.admin-body) .app-pin-gate,
  body:not(.admin-body) .binding-sticky-deposit-bar {
    width: 430px !important;
    max-width: 430px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
  }

  /* Align top-fixed elements on PC */
  body:not(.admin-body) .push-foreground-toast {
    top: 14px !important;
  }
  body:not(.admin-body) .auth-tutorial-back {
    left: max(16px, calc((100vw - 430px) / 2 + 16px)) !important;
    top: 16px !important;
  }
  body:not(.admin-body) .auth-tutorial-progress {
    width: 430px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: 0 !important;
  }
  body:not(.admin-body) .auth-tutorial-actions {
    width: 430px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    bottom: 0 !important;
    border-radius: 0 !important;
  }

  /* Bottom sheets & full modals */
  body:not(.admin-body) .ui-bottom-modal,
  body:not(.admin-body) .start-modal,
  body:not(.admin-body) .app-modal,
  body:not(.admin-body) .ui-modal-sheet,
  body:not(.admin-body) .app-pin-gate {
    height: 100vh !important;
    top: 0 !important;
    bottom: 0 !important;
    border-radius: 0 !important;
  }
  body:not(.admin-body) .ui-modal-sheet,
  body:not(.admin-body) .start-modal-content {
    border-radius: 28px 28px 0 0 !important;
    max-width: 430px !important;
  }
  body:not(.admin-body) .binding-sticky-deposit-bar {
    bottom: 56px !important;
  }
}

@media (min-width: 520px) {
  body:not(.admin-body) .ui-call-room-v3.in-call {
    width: 430px !important;
    max-width: 430px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
  }
}

/* ===== 플랜 만료 경고 모달 ===== */
.plan-expiry-sheet {
  padding: 0;
}
.plan-expiry-body {
  padding: 32px 24px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.plan-expiry-emoji {
  font-size: 48px;
  margin-bottom: 14px;
  animation: plan-expiry-pulse 1.8s ease-in-out infinite;
}
@keyframes plan-expiry-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
.plan-expiry-title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 900;
  color: #191f28;
  line-height: 1.35;
}
.plan-expiry-desc {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.65;
  color: #4e5968;
}
.plan-expiry-desc strong {
  color: #191f28;
  font-weight: 700;
}
.plan-expiry-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.plan-expiry-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  background: linear-gradient(135deg, #3182f6, #1b64da);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(49, 130, 246, 0.35);
}
.plan-expiry-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(49, 130, 246, 0.45);
}
.plan-expiry-btn-dismiss {
  width: 100%;
  min-height: 44px;
  padding: 0 20px;
  background: transparent;
  color: #8b95a1;
  border: 1.5px solid #e8ebed;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.plan-expiry-btn-dismiss:hover {
  background: #f4f6f8;
  color: #4e5968;
}

/* ===== 플랜 수량 선택 (billing) ===== */
.billing-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: #f4f6f8;
  border-radius: 14px;
}
.billing-qty-label {
  font-size: 14px;
  font-weight: 600;
  color: #191f28;
}
.billing-qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border: 1.5px solid #e8ebed;
  border-radius: 12px;
  overflow: hidden;
}
.billing-qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  font-size: 20px;
  font-weight: 700;
  color: #3182f6;
  cursor: pointer;
  transition: background 0.12s;
  line-height: 1;
}
.billing-qty-btn:hover { background: #eef4ff; }
.billing-qty-btn:disabled { color: #c3cad4; cursor: not-allowed; }
.billing-qty-value {
  min-width: 36px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: #191f28;
}
.billing-qty-total-price {
  margin: 0 0 6px;
  font-size: 13px;
  color: #6b7684;
  text-align: right;
}
.billing-qty-total-price strong {
  font-size: 15px;
  font-weight: 800;
  color: #3182f6;
}

body.modal-open,
body[style*="overflow: hidden"],
body:has(.ui-bottom-modal.open) {
  overscroll-behavior: contain !important;
  overscroll-behavior-y: contain !important;
}
