:root {
  color-scheme: light;
  --bg: #f3eee5;
  --bg-deep: #ebe3d6;
  --surface: rgba(255, 253, 249, 0.94);
  --surface-solid: #fffdfa;
  --surface-soft: #f8f3ea;
  --surface-strong: #eee6da;
  --sidebar: rgba(246, 240, 230, 0.96);
  --studio: rgba(250, 246, 239, 0.97);
  --text: #181714;
  --text-soft: #6e685f;
  --text-faint: #9a9287;
  --border: rgba(54, 45, 34, 0.12);
  --border-strong: rgba(54, 45, 34, 0.20);
  --accent: #e87d05;
  --accent-strong: #c95f00;
  --accent-soft: #fff0df;
  --accent-wash: rgba(232, 125, 5, 0.10);
  --danger: #c74343;
  --success: #307a55;
  --shadow-sm: 0 8px 22px rgba(55, 42, 25, 0.08);
  --shadow-md: 0 18px 44px rgba(55, 42, 25, 0.12);
  --shadow-lg: 0 34px 90px rgba(36, 26, 15, 0.18);
  --sidebar-width: 312px;
  --studio-width: 390px;
  --topbar-height: 72px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11110f;
  --bg-deep: #0c0c0b;
  --surface: rgba(25, 25, 22, 0.96);
  --surface-solid: #1a1a17;
  --surface-soft: #22211d;
  --surface-strong: #2a2823;
  --sidebar: rgba(19, 19, 17, 0.98);
  --studio: rgba(22, 22, 19, 0.98);
  --text: #f4f1ea;
  --text-soft: #aaa397;
  --text-faint: #777167;
  --border: rgba(255, 247, 231, 0.11);
  --border-strong: rgba(255, 247, 231, 0.18);
  --accent: #ff9424;
  --accent-strong: #ffad52;
  --accent-soft: rgba(255, 148, 36, 0.14);
  --accent-wash: rgba(255, 148, 36, 0.09);
  --danger: #f17676;
  --success: #5fb88a;
  --shadow-sm: 0 8px 26px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 20px 48px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 36px 90px rgba(0, 0, 0, 0.50);
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, textarea, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(232, 125, 5, 0.24);
  outline-offset: 2px;
}
.hidden { display: none !important; }
.mobile-only { display: none !important; }

.app-shell {
  width: 100%;
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--studio-width);
  background:
    radial-gradient(circle at 20% -15%, rgba(232, 125, 5, 0.16), transparent 30%),
    radial-gradient(circle at 92% 18%, rgba(232, 125, 5, 0.07), transparent 25%),
    linear-gradient(150deg, var(--bg) 0%, var(--bg-deep) 100%);
  overflow: hidden;
}

.sidebar, .studio, .workspace { min-width: 0; min-height: 0; }
.sidebar {
  position: relative;
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 18px 16px 14px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.brand-row { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 0 4px 13px; }
.brand-mark-wrap {
  width: 40px; height: 40px; border-radius: 13px; overflow: hidden;
  box-shadow: 0 8px 20px rgba(209, 91, 0, 0.24);
  flex: 0 0 auto;
}
.brand-mark { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.05; }
.brand-copy strong { font-size: 17px; letter-spacing: 0.11em; font-weight: 900; }
.brand-copy span { margin-top: 5px; color: var(--accent); font-size: 9px; letter-spacing: 0.17em; font-weight: 900; }
.preview-dot { margin-left: auto; width: 9px; height: 9px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 6px var(--accent-wash); }

.account-card {
  padding: 15px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.account-card-interactive {
  cursor: pointer;
  outline: none;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.account-card-interactive:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: var(--surface-solid);
}
.account-card-interactive:focus-visible {
  border-color: rgba(232,125,5,.62);
  box-shadow: 0 0 0 3px var(--accent-wash), var(--shadow-sm);
}
.account-card-top { display: flex; gap: 10px; align-items: center; }
.account-avatar {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  color: #fff; font-size: 12px; font-weight: 900;
  background: linear-gradient(145deg, #2b2925, #11100e);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
}
[data-theme="dark"] .account-avatar { background: linear-gradient(145deg, #f1eee7, #c8c0b5); color: #151411; }
.account-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.account-copy strong { font-size: 13px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy span { color: var(--text-faint); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-edit-cue { color: var(--accent); font-size: 15px; font-weight: 900; transform: translateY(-1px); }
.mini-icon-button, .icon-button {
  border: 1px solid var(--border); background: var(--surface-solid); color: var(--text-soft);
  cursor: pointer; transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}
.mini-icon-button { width: 29px; height: 29px; border-radius: 10px; }
.icon-button { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; font-size: 17px; }
.mini-icon-button:hover, .icon-button:hover { transform: translateY(-1px); color: var(--text); border-color: var(--border-strong); background: var(--surface-soft); }
.sync-note { display: flex; align-items: center; gap: 7px; margin: 13px 0 11px; padding: 8px 9px; border-radius: 11px; color: var(--text-soft); background: var(--surface-soft); font-size: 10px; font-weight: 650; }
.sync-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(48, 122, 85, 0.10); }
.account-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.account-stats > div { min-width: 0; padding: 9px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-solid); }
.account-stats span { display: block; color: var(--text-faint); font-size: 9px; margin-bottom: 5px; }
.account-stats strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.primary-action {
  margin-top: 13px; min-height: 48px; padding: 0 13px; border: 0; border-radius: 15px; cursor: pointer;
  display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 850;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 25px rgba(210, 91, 0, 0.22); transition: transform .16s ease, box-shadow .16s ease;
}
.primary-action:hover { transform: translateY(-1px); box-shadow: 0 15px 30px rgba(210, 91, 0, 0.28); }
.primary-action-icon { font-size: 21px; line-height: 1; }
.primary-action kbd { margin-left: auto; padding: 3px 6px; border: 1px solid rgba(255,255,255,0.30); border-radius: 7px; color: rgba(255,255,255,0.78); font-size: 9px; background: rgba(255,255,255,0.10); }

.sidebar-section { margin-top: 17px; }
.rooms-section { min-height: 124px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 5px 7px; color: var(--text-faint); font-size: 10px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.text-button { border: 0; background: transparent; color: var(--accent); font-size: 10px; font-weight: 800; cursor: pointer; }
.rooms-list { display: flex; flex-direction: column; gap: 5px; max-height: 176px; overflow: auto; scrollbar-width: thin; }
.room-item { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 8px; min-height: 42px; padding: 5px 7px; border: 1px solid transparent; border-radius: 13px; cursor: pointer; color: var(--text-soft); background: transparent; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.room-item:hover { background: var(--surface-soft); color: var(--text); }
.room-item.active { background: var(--accent-soft); color: var(--text); border-color: rgba(232, 125, 5, 0.16); }
.room-icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-solid); border: 1px solid var(--border); font-size: 13px; }
.room-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.room-copy strong { font-size: 12px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-copy span { font-size: 9px; color: var(--text-faint); }
.room-more {
  opacity: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 4px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  background: transparent;
  color: var(--text-soft);
  font-size: 0;
  line-height: 1;
}
.room-more::before {
  content: "•••";
  font-size: 11px;
  line-height: 1;
  letter-spacing: -0.75px;
  transform: translate(-1px, -1px);
}
.room-item:hover .room-more, .room-item.active .room-more { opacity: 1; }

.feature-nav { margin-top: 15px; display: flex; min-height: 0; flex-direction: column; gap: 3px; }
.nav-heading { padding-bottom: 4px; }
.feature-nav-item {
  width: 100%; min-height: 40px; padding: 0 9px; border: 1px solid transparent; border-radius: 12px;
  display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 6px;
  color: var(--text-soft); background: transparent; cursor: pointer; text-align: left; font-size: 12px; font-weight: 700;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.feature-nav-item:hover { color: var(--text); background: var(--surface-soft); transform: translateX(1px); }
.feature-nav-item.active { color: var(--text); background: var(--surface-solid); border-color: var(--border); box-shadow: 0 5px 13px rgba(55,42,25,.05); }
.feature-nav-item.purchase-nav { margin-top: 4px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); box-shadow: 0 10px 20px rgba(210,91,0,.18); }
.feature-nav-item.purchase-nav:hover, .feature-nav-item.purchase-nav.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); }
.nav-icon { width: 26px; height: 26px; display: grid; place-items: center; font-size: 14px; }
.nav-arrow { color: var(--text-faint); font-size: 18px; }
.purchase-nav .nav-arrow { color: rgba(255,255,255,.75); }
.nav-badge { min-width: 33px; padding: 4px 7px; border-radius: 999px; color: var(--accent-strong); background: var(--accent-soft); font-size: 9px; font-weight: 900; text-align: center; }

.sidebar-footer { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.footer-link { min-height: 32px; border: 0; border-radius: 9px; padding: 0 7px; background: transparent; color: var(--text-soft); cursor: pointer; text-align: left; font-size: 10px; font-weight: 650; }
.footer-link:hover { color: var(--text); background: var(--surface-soft); }
.build-label { grid-column: 1 / -1; padding: 6px 7px 0; color: var(--text-faint); font-size: 8px; letter-spacing: .03em; }

.workspace {
  position: relative; z-index: 1; display: flex; flex-direction: column; overflow: hidden;
  background:
    radial-gradient(circle at 50% -20%, var(--accent-wash), transparent 34%),
    var(--surface-solid);
}
.topbar {
  height: var(--topbar-height); flex: 0 0 var(--topbar-height); padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface-solid) 90%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); z-index: 10;
}
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.room-title-block { min-width: 0; }
.room-title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.room-title-line h1 { margin: 0; font-size: 15px; font-weight: 850; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.room-title-block p { margin: 4px 0 0; color: var(--text-faint); font-size: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.room-mode-chip { padding: 3px 7px; border-radius: 999px; color: var(--accent-strong); background: var(--accent-soft); font-size: 9px; font-weight: 900; }
.status-chip { min-height: 34px; padding: 0 11px; border: 1px solid var(--border); border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; color: var(--text-soft); background: var(--surface); cursor: pointer; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-chip:hover { color: var(--text); border-color: var(--border-strong); }
.status-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
.persona-chip { color: var(--text); }
.credit-chip { color: var(--accent-strong); }
.desktop-soft { background: var(--surface-soft); }
.studio-toggle { display: none; }

.debate-header { margin: 12px 18px 0; padding: 13px 15px; border: 1px solid rgba(232,125,5,.22); border-radius: 17px; background: linear-gradient(135deg, var(--accent-soft), var(--surface)); box-shadow: var(--shadow-sm); }
.debate-header-top { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.debate-header-top strong { font-size: 12px; }
.debate-header-top span { margin-left: auto; color: var(--text-faint); font-size: 9px; }
.debate-versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.debate-person { min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-solid); font-size: 10px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.debate-versus > b { color: var(--text-faint); font-size: 10px; }
.room-warning { margin: 10px 18px 0; padding: 11px 13px; border-radius: 14px; color: #7d4304; background: #fff3d8; border: 1px solid rgba(210,122,0,.18); font-size: 11px; line-height: 1.45; }
[data-theme="dark"] .room-warning { color: #ffd29a; background: rgba(209,122,0,.12); }

.chat-scroll { min-height: 0; flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.chat-content { width: min(900px, 100%); min-height: 100%; margin: 0 auto; padding: 32px 32px 22px; }
.empty-state { min-height: calc(100dvh - 265px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 0; }
.empty-orbit { width: 86px; height: 86px; display: grid; place-items: center; position: relative; margin-bottom: 19px; }
.empty-orbit-ring { position: absolute; inset: -8px; border: 1px dashed rgba(232,125,5,.36); border-radius: 50%; animation: orbit 18s linear infinite; }
.empty-orbit-ring::before { content: ""; position: absolute; top: 9px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--accent-wash); }
.empty-logo { width: 68px; height: 68px; border-radius: 20px; box-shadow: 0 18px 34px rgba(209,91,0,.22); }
@keyframes orbit { to { transform: rotate(360deg); } }
.eyebrow { color: var(--accent); font-size: 9px; font-weight: 950; letter-spacing: .14em; }
.empty-state h2 { margin: 10px 0 8px; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.045em; }
.empty-state > p { margin: 0; max-width: 520px; color: var(--text-soft); font-size: 13px; line-height: 1.6; }
.prompt-grid { width: min(690px, 100%); margin-top: 27px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.prompt-card { min-width: 0; padding: 15px; border: 1px solid var(--border); border-radius: 17px; text-align: left; cursor: pointer; color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.prompt-card:hover { transform: translateY(-2px); border-color: rgba(232,125,5,.30); box-shadow: var(--shadow-md); }
.prompt-card > span { display: block; font-size: 18px; margin-bottom: 12px; }
.prompt-card strong { display: block; font-size: 12px; margin-bottom: 5px; }
.prompt-card small { display: block; color: var(--text-faint); font-size: 9px; line-height: 1.45; }
.messages { display: flex; flex-direction: column; gap: 26px; }
.workspace-business-footer {
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  padding: 7px 18px calc(7px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 10px;
  color: var(--text-faint);
  background: color-mix(in srgb, var(--surface-solid) 96%, transparent);
  font-size: 7px;
  line-height: 1.45;
  text-align: center;
}
.workspace-business-footer strong { color: var(--text-soft); }
.workspace-business-footer a { color: inherit; }

.message { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 11px; align-items: start; }
.message.user { grid-template-columns: minmax(0,1fr) 34px; }
.message.user .message-avatar { grid-column: 2; }
.message.user .message-main { grid-column: 1; grid-row: 1; justify-self: end; width: min(82%, 690px); }
.message-avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); font-size: 15px; box-shadow: var(--shadow-sm); overflow: hidden; }
.message-avatar img { width: 100%; height: 100%; object-fit: cover; }
.message-main { min-width: 0; width: 100%; }
.message-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; color: var(--text-faint); font-size: 9px; }
.message-meta strong { color: var(--text); font-size: 11px; }
.message-meta .stance-badge { padding: 3px 6px; border-radius: 999px; color: var(--accent-strong); background: var(--accent-soft); font-size: 8px; font-weight: 900; }
.message.user .message-meta { justify-content: flex-end; }
.message-surface { position: relative; padding: 15px 17px; border: 1px solid var(--border); border-radius: 19px; background: var(--surface); box-shadow: var(--shadow-sm); }
.message.user .message-surface { background: var(--surface-soft); border-top-right-radius: 7px; }
.message.assistant .message-surface { border-top-left-radius: 7px; }
.message.streaming .message-surface { border-color: rgba(232,125,5,.28); }
.markdown-body { font-size: 13px; line-height: 1.72; word-break: break-word; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body p { margin: 0 0 12px; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 18px 0 9px; line-height: 1.35; }
.markdown-body h1 { font-size: 20px; } .markdown-body h2 { font-size: 17px; } .markdown-body h3 { font-size: 15px; }
.markdown-body ul, .markdown-body ol { margin: 8px 0 12px; padding-left: 22px; }
.markdown-body li { margin: 5px 0; }
.markdown-body blockquote { margin: 12px 0; padding: 9px 12px; border-left: 3px solid var(--accent); color: var(--text-soft); background: var(--accent-wash); border-radius: 0 10px 10px 0; }
.markdown-body code { padding: 2px 5px; border-radius: 6px; color: var(--accent-strong); background: var(--surface-strong); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
.markdown-body pre { position: relative; margin: 13px 0; padding: 14px; overflow: auto; border: 1px solid var(--border); border-radius: 13px; background: #1d1d1b; color: #f7f3ec; }
.markdown-body pre code { padding: 0; color: inherit; background: transparent; }
.message-actions { display: flex; gap: 5px; margin-top: 7px; opacity: 0; transition: opacity .15s ease; }
.message:hover .message-actions, .message:focus-within .message-actions { opacity: 1; }
.message-action { min-width: 28px; height: 28px; padding: 0 8px; border: 1px solid var(--border); border-radius: 9px; color: var(--text-soft); background: var(--surface-solid); cursor: pointer; font-size: 9px; }
.message-action:hover { color: var(--text); border-color: var(--border-strong); }
.message-action.icon-action {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-soft);
}
.message-action.icon-action svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.message-action.icon-action .filled-icon {
  fill: currentColor;
  stroke: none;
}
.message-action.icon-action.is-active {
  color: #fff;
  border-color: #1f1e1b;
  background: #1f1e1b;
}
.message-action.icon-action:disabled {
  opacity: .42;
  cursor: not-allowed;
}
.message.user .message-main { position: relative; }
.message.user .message-surface { padding-bottom: 54px; }
.message.user .message-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  margin: 0;
  opacity: 1;
}

.speech-player {
  position: fixed;
  z-index: 80;
  top: calc(var(--topbar-height) + env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  width: min(760px, calc(100vw - 32px));
  min-height: 74px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  transform: translateX(-50%);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-solid) 96%, transparent);
  box-shadow: 0 18px 52px rgba(38, 27, 15, .22);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.speech-player-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.speech-player-copy strong { font-size: 13px; font-weight: 900; }
.speech-player-copy span { color: var(--text-faint); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.speech-player-actions { display: flex; align-items: center; gap: 5px; }
.speech-player-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}
.speech-player-button:hover { background: var(--surface-strong); }
.speech-player-toggle { font-size: 19px; font-weight: 950; }
.speech-player-voice { font-size: 20px; font-weight: 850; }
.speech-player-seek { position: relative; font-size: 25px; line-height: 1; }
.speech-player-seek small {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 2px;
  font-size: 8px;
  font-weight: 950;
}
.speech-player-close { font-size: 30px; font-weight: 300; }
[data-theme="dark"] .speech-player { box-shadow: 0 20px 55px rgba(0,0,0,.48); }

.speech-voice-settings { display: grid; gap: 14px; }
.speech-voice-setting-copy { display: grid; gap: 6px; }
.speech-voice-setting-copy strong { font-size: 14px; }
.speech-voice-setting-copy span,
.speech-voice-note { margin: 0; color: var(--text-soft); font-size: 11px; line-height: 1.6; }
.speech-voice-select-wrap { display: grid; gap: 7px; }
.speech-voice-select-wrap > span,
.speech-voice-current-row > span { color: var(--text-faint); font-size: 10px; font-weight: 850; letter-spacing: .04em; }
.speech-voice-select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  outline: none;
  color: var(--text);
  background: var(--surface-solid);
  font: inherit;
  font-size: 12px;
}
.speech-voice-select:focus { border-color: rgba(232,125,5,.52); box-shadow: 0 0 0 3px rgba(232,125,5,.10); }
.speech-voice-current-row { padding: 12px 13px; display: grid; gap: 5px; border-radius: 13px; background: var(--surface-soft); }
.speech-voice-current-row strong { overflow-wrap: anywhere; font-size: 12px; }
.speech-voice-preview {
  min-height: 44px;
  border: 1px solid rgba(232,125,5,.28);
  border-radius: 13px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.speech-voice-preview:hover { border-color: rgba(232,125,5,.46); }
.typing-dots { display: inline-flex; align-items: center; gap: 4px; min-height: 18px; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .16s; } .typing-dots i:nth-child(3) { animation-delay: .32s; }
@keyframes blink { 0%,80%,100% { opacity:.25; transform: translateY(0);} 40% {opacity:1; transform: translateY(-3px);} }

.composer-area { flex: 0 0 auto; padding: 12px 24px 12px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface-solid) 92%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.composer-context { width: min(820px, 100%); margin: 0 auto 8px; padding: 8px 11px; border: 1px solid rgba(232,125,5,.22); border-radius: 11px; color: var(--text-soft); background: var(--accent-soft); font-size: 10px; }
.composer-shell { width: min(820px, 100%); margin: 0 auto; padding: 10px 10px 8px 14px; border: 1px solid var(--border-strong); border-radius: 22px; background: var(--surface); box-shadow: 0 13px 34px rgba(55,42,25,.10); transition: border-color .15s ease, box-shadow .15s ease; }
.composer-shell:focus-within { border-color: rgba(232,125,5,.46); box-shadow: 0 15px 38px rgba(210,91,0,.13); }
#message-input { display: block; width: 100%; min-height: 30px; max-height: 150px; resize: none; border: 0; outline: 0; padding: 5px 1px 6px; color: var(--text); background: transparent; font-size: 13px; line-height: 1.55; }
#message-input::placeholder { color: var(--text-faint); }
.composer-bottom-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer-tools, .composer-actions { display: flex; align-items: center; gap: 7px; min-width: 0; }
.composer-tool { min-width: 0; height: 29px; padding: 0 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); background: var(--surface-soft); cursor: pointer; font-size: 9px; font-weight: 750; display: inline-flex; align-items: center; gap: 5px; }
.composer-tool span:last-child { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-count { color: var(--text-faint); font-size: 8px; }
.send-button { width: 36px; height: 36px; border: 0; border-radius: 13px; display: grid; place-items: center; cursor: pointer; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); box-shadow: 0 8px 18px rgba(210,91,0,.22); font-size: 18px; font-weight: 900; transition: transform .15s ease, opacity .15s ease; }
.send-button:hover { transform: translateY(-1px); }
.send-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.send-button.stop { background: #24221f; }
.composer-footnote { width: min(820px, 100%); margin: 7px auto 0; color: var(--text-faint); text-align: center; font-size: 8px; }

.studio { z-index: 30; display: flex; flex-direction: column; overflow: hidden; border-left: 1px solid var(--border); background: var(--studio); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.studio-header { min-height: var(--topbar-height); padding: 14px 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.studio-header h2 { margin: 5px 0 0; font-size: 16px; letter-spacing: -.02em; }
#studio-close { display: none; }
.studio-content { min-height: 0; flex: 1; overflow: auto; padding: 16px; scrollbar-width: thin; }
.panel-stack { display: flex; flex-direction: column; gap: 13px; }
.panel-card { padding: 15px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-card.accent { border-color: rgba(232,125,5,.22); background: linear-gradient(145deg, var(--accent-soft), var(--surface)); }
.panel-card h3 { margin: 0 0 6px; font-size: 13px; }
.panel-card p { margin: 0; color: var(--text-soft); font-size: 10px; line-height: 1.55; }
.panel-label { display: block; margin-bottom: 7px; color: var(--text-faint); font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.metric { padding: 11px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-solid); }
.metric span { display: block; color: var(--text-faint); font-size: 8px; margin-bottom: 6px; }
.metric strong { display: block; font-size: 13px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-card { min-height: 83px; padding: 12px; border: 1px solid var(--border); border-radius: 15px; color: var(--text); background: var(--surface-solid); cursor: pointer; text-align: left; transition: transform .15s ease, border-color .15s ease; }
.quick-card:hover { transform: translateY(-1px); border-color: rgba(232,125,5,.28); }
.quick-card span { display: block; font-size: 17px; margin-bottom: 9px; }
.quick-card strong { display: block; font-size: 10px; margin-bottom: 3px; }
.quick-card small { display: block; color: var(--text-faint); font-size: 8px; line-height: 1.4; }
.connection-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 10px; }
.connection-row:last-child { border-bottom: 0; padding-bottom: 0; }
.connection-row:first-child { padding-top: 0; }
.connection-row .connection-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.connection-row span:nth-child(2) { flex: 1; color: var(--text-soft); }
.connection-row strong { font-size: 9px; }

.voltage-dial { position: relative; width: 230px; height: 190px; margin: 3px auto 0; pointer-events: none; }
.voltage-gauge { position: absolute; inset: 0 auto auto 0; width: 230px; height: 170px; overflow: visible; }
.voltage-arc,
.voltage-progress {
  fill: none;
  stroke-width: 17;
  vector-effect: non-scaling-stroke;
}
.voltage-arc { stroke: var(--surface-strong); }
.voltage-progress {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: var(--voltage-fill, 100) 100;
  filter: drop-shadow(0 5px 8px rgba(232,125,5,.16));
  transition: stroke-dasharray .24s cubic-bezier(.2,.8,.2,1);
}
.voltage-center { position: absolute; inset: 76px 60px auto; height: 90px; border: 1px solid var(--border); border-radius: 45px 45px 22px 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface-solid); box-shadow: var(--shadow-md); }
.voltage-center strong { font-size: 28px; letter-spacing: -.05em; }
.voltage-center span { margin-top: 2px; color: var(--text-soft); font-size: 10px; font-weight: 800; }
.voltage-needle { position: absolute; left: 113px; top: 100px; width: 4px; height: 52px; border-radius: 999px; background: var(--accent); transform-origin: 50% 97%; transform: rotate(var(--needle-angle, 88deg)); transition: transform .24s cubic-bezier(.2,.8,.2,1); box-shadow: 0 3px 8px rgba(232,125,5,.35); }
.voltage-needle::after { content: ""; position: absolute; bottom: -5px; left: 50%; width: 13px; height: 13px; border-radius: 50%; transform: translateX(-50%); background: var(--accent); border: 3px solid var(--surface-solid); }
.voltage-levels { position: relative; z-index: 3; display: grid; grid-template-columns: repeat(5,1fr); gap: 5px; margin-top: -4px; pointer-events: auto; }
.voltage-level-button { position: relative; z-index: 4; padding: 8px 2px; border: 1px solid var(--border); border-radius: 11px; color: var(--text-soft); background: var(--surface-solid); cursor: pointer; touch-action: manipulation; pointer-events: auto; font-size: 9px; font-weight: 850; }
.voltage-level-button.active { color: #fff; border-color: transparent; background: var(--accent); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-copy { min-width: 0; }
.setting-copy strong { display: block; font-size: 11px; margin-bottom: 3px; }
.setting-copy span { display: block; color: var(--text-faint); font-size: 8px; line-height: 1.4; }
.toggle { position: relative; width: 43px; height: 25px; flex: 0 0 auto; }
.toggle input { position: absolute; opacity: 0; }
.toggle-track { position: absolute; inset: 0; border-radius: 999px; cursor: pointer; background: var(--surface-strong); border: 1px solid var(--border); transition: background .18s ease; }
.toggle-track::after { content: ""; position: absolute; width: 19px; height: 19px; left: 2px; top: 2px; border-radius: 50%; background: var(--surface-solid); box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .18s ease; }
.toggle input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }
.scope-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); }
.scope-switch button { min-height: 30px; border: 0; border-radius: 9px; color: var(--text-soft); background: transparent; cursor: pointer; font-size: 9px; font-weight: 800; }
.scope-switch button.active { color: var(--text); background: var(--surface-solid); box-shadow: 0 3px 8px rgba(55,42,25,.08); }

.persona-list { display: flex; flex-direction: column; gap: 9px; }
.persona-card { position: relative; width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 16px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 10px; align-items: center; color: var(--text); background: var(--surface-solid); cursor: pointer; text-align: left; transition: border-color .15s ease, transform .15s ease, background .15s ease; }
.persona-card:hover { transform: translateY(-1px); border-color: rgba(232,125,5,.30); }
.persona-card.active { border-color: rgba(232,125,5,.50); background: var(--accent-soft); }
.persona-emoji { width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 14px; display: grid; place-items: center; background: var(--surface); font-size: 20px; }
.persona-copy { min-width: 0; }
.persona-copy strong { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.persona-copy p { margin: 4px 0 0; font-size: 8px; color: var(--text-faint); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.persona-badge { padding: 3px 6px; border-radius: 999px; color: var(--accent-strong); background: var(--accent-soft); font-size: 7px; font-weight: 900; }
.persona-check { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--accent); font-size: 10px; opacity: 0; }
.persona-card.active .persona-check { opacity: 1; }
.custom-persona-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.small-primary, .small-secondary, .danger-button { min-height: 34px; padding: 0 11px; border-radius: 11px; cursor: pointer; font-size: 9px; font-weight: 850; }
.small-primary { border: 0; color: #fff; background: var(--accent); }
.small-secondary { border: 1px solid var(--border); color: var(--text); background: var(--surface-solid); }
.danger-button { border: 1px solid rgba(199,67,67,.23); color: var(--danger); background: rgba(199,67,67,.07); }

.form-group { margin-bottom: 13px; }
.form-group:last-child { margin-bottom: 0; }
.form-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.form-label-row label { font-size: 10px; font-weight: 850; }
.form-label-row span { color: var(--text-faint); font-size: 8px; }
.text-input, .text-area, .select-input { width: 100%; border: 1px solid var(--border-strong); border-radius: 13px; color: var(--text); background: var(--surface-solid); outline: 0; }
.text-input, .select-input { min-height: 41px; padding: 0 12px; font-size: 10px; }
.text-area { min-height: 220px; resize: vertical; padding: 12px; font-size: 10px; line-height: 1.6; }
.text-input:focus, .text-area:focus, .select-input:focus { border-color: rgba(232,125,5,.55); box-shadow: 0 0 0 3px var(--accent-wash); }
.form-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 11px; }
.helper-box { padding: 10px 11px; border-radius: 12px; color: var(--text-soft); background: var(--surface-soft); font-size: 8px; line-height: 1.55; }

.debate-select-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 7px; }
.debate-side label { display: block; margin-bottom: 6px; font-size: 8px; color: var(--text-faint); font-weight: 850; }
.swap-button { width: 34px; height: 34px; margin-bottom: 3px; border: 1px solid var(--border); border-radius: 11px; color: var(--text-soft); background: var(--surface-solid); cursor: pointer; }
.debate-preview { display: grid; grid-template-columns: 1fr auto 1fr; gap: 7px; align-items: center; margin-top: 12px; }
.debate-preview-card { min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-solid); text-align: center; }
.debate-preview-card span { display: block; font-size: 17px; margin-bottom: 5px; }
.debate-preview-card strong { display: block; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.debate-preview-card small { display: block; margin-top: 3px; color: var(--accent-strong); font-size: 7px; font-weight: 850; }
.start-debate-button { width: 100%; min-height: 43px; margin-top: 12px; border: 0; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); cursor: pointer; font-size: 10px; font-weight: 900; }

.credit-hero { padding: 18px; border-radius: 19px; color: #fff; background: linear-gradient(140deg, #1d1b18, #373029 58%, #5b2b02); box-shadow: var(--shadow-md); }
.credit-hero .panel-label { color: rgba(255,255,255,.58); }
.credit-balance { display: flex; align-items: flex-end; gap: 6px; }
.credit-balance strong { font-size: 32px; letter-spacing: -.05em; }
.credit-balance span { padding-bottom: 4px; color: rgba(255,255,255,.68); font-size: 9px; }
.credit-split { margin-top: 13px; display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; }
.credit-split > div { padding: 9px; border-radius: 11px; background: rgba(255,255,255,.08); }
.credit-split span { display: block; color: rgba(255,255,255,.58); font-size: 7px; margin-bottom: 5px; }
.credit-split strong { font-size: 9px; }
.commerce-state { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 12px; background: var(--surface-soft); font-size: 9px; }
.commerce-state-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.commerce-state.ready .commerce-state-dot { background: var(--success); }
.purchase-card { padding: 15px; border: 1px solid rgba(232,125,5,.27); border-radius: 17px; background: linear-gradient(145deg, var(--accent-soft), var(--surface)); }
.purchase-card-top { display: flex; align-items: start; gap: 10px; }
.purchase-card-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: var(--accent); font-size: 18px; }
.purchase-card-copy { flex: 1; min-width: 0; }
.purchase-card-copy strong { display: block; font-size: 12px; }
.purchase-card-copy span { display: block; margin-top: 4px; color: var(--text-soft); font-size: 8px; }
.purchase-price { margin-top: 12px; display: flex; align-items: flex-end; justify-content: space-between; }
.purchase-price strong { font-size: 20px; }
.purchase-price span { color: var(--text-faint); font-size: 8px; }
.purchase-button { width: 100%; min-height: 40px; margin-top: 11px; border: 0; border-radius: 12px; color: #fff; background: var(--accent); cursor: pointer; font-size: 10px; font-weight: 900; }
.purchase-button:disabled { cursor: not-allowed; color: var(--text-faint); background: var(--surface-strong); }
.ledger-list { display: flex; flex-direction: column; }
.ledger-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.ledger-row:last-child { border-bottom: 0; }
.ledger-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-soft); font-size: 13px; }
.ledger-copy { min-width: 0; }
.ledger-copy strong { display: block; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-copy span { display: block; margin-top: 3px; color: var(--text-faint); font-size: 7px; }
.ledger-amount { font-size: 9px; font-weight: 900; }
.ledger-amount small { font-size: .72em; font-weight: 800; }
.ledger-amount.positive { color: var(--success); }
.ledger-amount.negative { color: var(--danger); }

.backdrop { display: none; position: fixed; inset: 0; z-index: 35; background: rgba(15,13,10,.42); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.login-overlay { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-rows: minmax(0,1fr) auto; justify-items: center; overflow-y: auto; padding: 24px 24px max(18px, env(safe-area-inset-bottom)); background: radial-gradient(circle at 50% 15%, rgba(232,125,5,.22), transparent 34%), rgba(239,233,223,.94); backdrop-filter: blur(20px); }
[data-theme="dark"] .login-overlay { background: radial-gradient(circle at 50% 15%, rgba(255,148,36,.18), transparent 34%), rgba(11,11,10,.95); }
.login-card { position: relative; align-self: center; width: min(470px, 100%); margin: 20px 0; padding: 34px; border: 1px solid var(--border); border-radius: 28px; background: var(--surface-solid); box-shadow: var(--shadow-lg); text-align: center; }
.login-overlay-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-muted); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; }
.login-overlay-close:hover { border-color: var(--accent); color: var(--accent-strong); }
.login-benefits { display: grid; gap: 8px; margin: -4px auto 20px; max-width: 370px; text-align: left; }
.login-benefits span { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-muted); color: var(--text-soft); font-size: 12px; font-weight: 750; }
.login-benefits b { display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-size: 11px; }
.guest-credit-hero p { margin: 10px 0 14px; color: var(--text-soft); line-height: 1.6; }
.login-brand { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 24px; font-weight: 950; letter-spacing: .12em; font-size: 12px; }
.login-brand img { width: 34px; height: 34px; border-radius: 11px; }
.login-card h2 { margin: 11px 0 12px; font-size: 27px; line-height: 1.28; letter-spacing: -.045em; }
.login-card > p { margin: 0 auto 22px; max-width: 370px; color: var(--text-soft); font-size: 11px; line-height: 1.65; }
.social-login-actions { display: grid; gap: 8px; width: 100%; }
.kakao-button, .secondary-button { width: 100%; min-height: 49px; border-radius: 15px; cursor: pointer; font-size: 11px; font-weight: 900; }
.kakao-button { border: 0; color: #17120a; background: #fee500; }
.google-button-host {
  width: 100%;
  min-width: 0;
  height: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 999px;
  background: #fff;
  clip-path: inset(0 round 999px);
  -webkit-clip-path: inset(0 round 999px);
  line-height: 0;
}
.google-button-host:focus-within { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.google-button-host.login-action-disabled { pointer-events: none; opacity: .62; }
#google-login-status { color: var(--text-soft); font-size: 11px; }
.apple-button { width: 100%; min-height: 52px; padding: 0; border: 0; border-radius: 15px; background: transparent; cursor: pointer; overflow: hidden; }
.apple-button img { display: block; width: min(375px, 100%); height: auto; margin: 0 auto; }
.apple-button:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.login-products-link { display: inline-block; margin-top: 12px; color: var(--accent-strong); font-size: 11px; font-weight: 850; text-decoration: none; }
.login-products-link:hover { text-decoration: underline; }
.kakao-button:disabled, .apple-button:disabled { cursor: wait; opacity: .62; }
.secondary-button { margin-top: 8px; border: 1px solid var(--border); color: var(--text); background: var(--surface-soft); }
.login-card small { display: block; margin-top: 15px; color: var(--text-faint); font-size: 8px; line-height: 1.5; }
.login-card small a { color: var(--accent); font-weight: 800; text-underline-offset: 2px; }
.login-business-footer { align-self: end; width: min(1180px, 100%); padding: 14px 4px 0; border-top: 1px solid var(--border); color: var(--text-faint); font-size: 9px; line-height: 1.55; }
.login-business-summary, .login-business-detail { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.login-business-summary strong { color: var(--text-soft); }
.login-business-detail { margin-top: 4px; }
.login-business-footer a { color: inherit; }

.modal-root { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(12,10,8,.54); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.modal-card { position: relative; width: min(560px, 100%); max-height: min(760px, calc(100dvh - 40px)); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 25px; background: var(--surface-solid); box-shadow: var(--shadow-lg); }
.modal-header { min-height: 72px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 5px 0 0; font-size: 16px; }
.modal-content { min-height: 0; overflow: auto; padding: 18px; font-size: 11px; line-height: 1.65; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--border); background: var(--surface-soft); }
.modal-actions:empty { display: none; }
.notice-card { padding: 13px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); margin-bottom: 9px; }
.notice-card:last-child { margin-bottom: 0; }
.notice-card strong { display: block; font-size: 11px; }
.notice-card p { margin: 7px 0 0; color: var(--text-soft); font-size: 9px; line-height: 1.55; white-space: pre-wrap; }

.account-profile-hero {
  display: flex; align-items: center; gap: 13px; margin-bottom: 18px; padding: 14px;
  border: 1px solid var(--border); border-radius: 17px; background: var(--surface-soft);
}
.account-profile-avatar {
  width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 15px; color: #fff; background: linear-gradient(145deg, #2b2925, #11100e);
  font-size: 17px; font-weight: 900; box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}
[data-theme="dark"] .account-profile-avatar { color: #151411; background: linear-gradient(145deg, #f1eee7, #c8c0b5); }
.account-profile-hero > div:last-child { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.account-profile-hero strong { color: var(--text); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-profile-hero span { color: var(--text-soft); font-size: 12px; }
.account-name-helper { margin-top: 8px; }
.profile-feedback { margin: 9px 0 0; padding: 9px 10px; border-radius: 11px; font-size: 12px; line-height: 1.45; }
.profile-feedback.pending { color: var(--text-soft); background: var(--surface-soft); }
.profile-feedback.success { color: var(--success); background: rgba(48,122,85,.10); }
.profile-feedback.error { color: var(--danger); background: rgba(199,67,67,.09); }
.account-profile-details { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 15px; }
.account-profile-details > div { min-width: 0; padding: 11px 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); }
.account-profile-details span { display: block; margin-bottom: 5px; color: var(--text-faint); font-size: 11px; }
.account-profile-details strong { display: block; color: var(--text); font-size: 14px; }
.account-profile-session { grid-column: 1 / -1; }
.account-profile-session code { display: block; color: var(--text-soft); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; user-select: text; }
.profile-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.profile-form-actions .small-primary,
.profile-form-actions .small-secondary { min-height: 43px; padding: 0 15px; }

.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 150; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast { max-width: 340px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 13px; color: var(--text); background: var(--surface-solid); box-shadow: var(--shadow-md); font-size: 10px; line-height: 1.45; animation: toast-in .22s ease both; }
.toast.success { border-color: rgba(48,122,85,.25); } .toast.error { border-color: rgba(199,67,67,.28); }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px) scale(.98); } }

.loading-panel { padding: 40px 10px; display: grid; place-items: center; color: var(--text-faint); font-size: 10px; }
.loading-spinner { width: 25px; height: 25px; margin-bottom: 10px; border-radius: 50%; border: 3px solid var(--surface-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-panel { padding: 26px 12px; text-align: center; color: var(--text-faint); font-size: 10px; }

@media (max-width: 1320px) {
  .app-shell { grid-template-columns: var(--sidebar-width) minmax(0,1fr); }
  .studio { position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--studio-width), 92vw); transform: translateX(104%); box-shadow: var(--shadow-lg); transition: transform .24s cubic-bezier(.2,.8,.2,1); }
  .studio.open { transform: translateX(0); }
  .studio-backdrop.visible { display: block; }
  #studio-close { display: grid; }
  .studio-toggle { display: grid; }
}

@media (max-width: 920px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: min(var(--sidebar-width), 88vw); transform: translateX(-104%); box-shadow: var(--shadow-lg); transition: transform .24s cubic-bezier(.2,.8,.2,1); }
  .sidebar.open { transform: translateX(0); }
  .backdrop.visible { display: block; }
  .studio-backdrop { z-index: 45; }
  .mobile-only { display: grid !important; }
  .brand-row .mobile-only { margin-right: 1px; }
  .workspace { width: 100%; height: 100dvh; }
  .topbar { padding: 0 12px; }
  .persona-chip, .credit-chip, .desktop-soft { display: none; }
  .chat-content { padding: 25px 20px 18px; }
  .composer-area { padding-left: 14px; padding-right: 14px; }
}

@media (max-width: 620px) {
  :root { --topbar-height: 62px; }
  .topbar { gap: 8px; }
  .topbar-left { gap: 7px; }
  .topbar-actions { gap: 6px; }
  .topbar .icon-button { width: 34px; height: 34px; border-radius: 11px; }
  .room-title-line h1 { max-width: 160px; font-size: 13px; }
  .room-title-block p { max-width: 180px; font-size: 8px; }
  .status-chip { min-height: 31px; padding: 0 9px; font-size: 9px; }
  .chat-content { padding: 20px 13px 13px; }
  .empty-state { min-height: calc(100dvh - 235px); }
  .empty-state h2 { font-size: 25px; }
  .empty-state > p { font-size: 11px; }
  .prompt-grid { grid-template-columns: 1fr; width: 100%; margin-top: 20px; }
  .prompt-card { display: grid; grid-template-columns: 34px minmax(0,1fr); grid-template-rows: auto auto; column-gap: 9px; padding: 12px; }
  .prompt-card > span { grid-row: 1 / 3; margin: 0; align-self: center; }
  .prompt-card strong, .prompt-card small { grid-column: 2; }
  .message { grid-template-columns: 29px minmax(0,1fr); gap: 8px; }
  .message.user { grid-template-columns: minmax(0,1fr) 29px; }
  .message-avatar { width: 29px; height: 29px; border-radius: 9px; font-size: 12px; }
  .message.user .message-main { width: 94%; }
  .message-surface { padding: 13px 14px; border-radius: 16px; }
  .markdown-body { font-size: 12px; }
  .message-actions { opacity: 1; }
  .composer-area { padding: 9px; }
  .composer-shell { border-radius: 18px; padding-left: 11px; }
  .composer-tool { max-width: 120px; }
  .message-count { display: none; }
  .composer-footnote { display: none; }
  .studio { width: 100vw; top: auto; height: min(82dvh, 760px); border-left: 0; border-top: 1px solid var(--border); border-radius: 25px 25px 0 0; transform: translateY(104%); }
  .studio.open { transform: translateY(0); }
  .studio-header { min-height: 66px; }
  .login-card { padding: 26px 20px; border-radius: 23px; }
  .login-card h2 { font-size: 24px; }
  .modal-root { padding: 0; align-items: end; }
  .modal-card { width: 100%; max-height: 87dvh; border-radius: 25px 25px 0 0; border-bottom: 0; }
  .toast-stack { left: 12px; right: 12px; bottom: calc(12px + var(--safe-bottom)); align-items: stretch; }
  .toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* === VESPER WEB V2 READABILITY PATCH: 2026-08-15 === */
/*
 * Fixes the dark-theme inherited-text bug and raises typography/touch targets
 * for phone-first use.  This block intentionally lives at the end so it can
 * improve readability without restructuring the proven layout rules above.
 */

:root {
  --text-soft: #5f594f;
  --text-faint: #7f776c;
}

[data-theme="dark"] {
  --text: #faf7f0;
  --text-soft: #d1c9bd;
  --text-faint: #aaa194;
  --border: rgba(255, 247, 231, 0.16);
  --border-strong: rgba(255, 247, 231, 0.27);
}

body {
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 500;
}

/* Critical dark-mode fix: theme variables were changing the surfaces, but
   unstyled headings inherited the light body color. */
.app-shell {
  color: var(--text);
  font-size: 16px;
}

.app-shell input,
.app-shell textarea,
.app-shell select {
  color: var(--text);
}

.app-shell input::placeholder,
.app-shell textarea::placeholder {
  color: var(--text-faint);
  opacity: 1;
}

[data-theme="dark"] select,
[data-theme="dark"] option {
  color: var(--text);
  background: var(--surface-solid);
}

/* Make headings explicit so future theme edits cannot regress them. */
.room-title-line h1,
.empty-state h2,
.studio-header h2,
.panel-card h3,
.modal-header h2,
.login-card h2,
.account-copy strong,
.metric strong,
.setting-copy strong,
.persona-copy strong,
.purchase-card-copy strong,
.ledger-copy strong,
.message-meta strong {
  color: var(--text);
}

/* Global legibility and touch-target pass. */
.brand-copy strong { font-size: 18px; }
.brand-copy span { font-size: 11px; }
.account-copy strong { font-size: 14px; }
.account-copy span { font-size: 12px; }
.mini-icon-button { width: 34px; height: 34px; }
.icon-button { width: 42px; height: 42px; font-size: 18px; }
.sync-note { font-size: 12px; line-height: 1.45; }
.account-stats span { font-size: 11px; }
.account-stats strong { font-size: 14px; }
.primary-action { min-height: 50px; font-size: 14px; }
.primary-action kbd { font-size: 10px; }
.section-heading { font-size: 12px; }
.text-button { font-size: 12px; }
.room-item { min-height: 48px; }
.room-copy strong { font-size: 13px; }
.room-copy span { font-size: 11px; }
.feature-nav-item { min-height: 46px; font-size: 13px; }
.nav-badge { font-size: 10px; }
.footer-link { min-height: 40px; font-size: 12px; }
.build-label { font-size: 10px; }

.room-title-line h1 { font-size: 17px; }
.room-title-block p { font-size: 12px; }
.room-mode-chip { font-size: 10px; }
.status-chip { min-height: 38px; font-size: 12px; }
.debate-header-top strong { font-size: 14px; }
.debate-header-top span { font-size: 11px; }
.debate-person,
.debate-versus > b { font-size: 12px; }
.room-warning { font-size: 13px; }

.eyebrow { font-size: 11px; }
.empty-state > p { font-size: 15px; }
.prompt-card strong { font-size: 14px; }
.prompt-card small { font-size: 12px; line-height: 1.55; }
.message-meta { font-size: 11px; }
.message-meta strong { font-size: 13px; }
.message-meta .stance-badge { font-size: 10px; }
.markdown-body { font-size: 15px; line-height: 1.75; }
.message-action { min-height: 34px; font-size: 12px; }

.composer-context { font-size: 12px; }
#message-input { font-size: 16px; }
.composer-tool { height: 36px; font-size: 12px; }
.message-count { font-size: 10px; }
.send-button { width: 44px; height: 44px; font-size: 20px; }
.composer-footnote { font-size: 10px; }

.studio-header h2 { font-size: 18px; }
.panel-card h3 { font-size: 15px; }
.panel-card p { font-size: 12px; line-height: 1.65; }
.panel-label { font-size: 11px; }
.metric span { font-size: 10px; }
.metric strong { font-size: 15px; }
.quick-card strong { font-size: 12px; }
.quick-card small { font-size: 10px; line-height: 1.5; }
.connection-row { font-size: 12px; }
.connection-row strong { font-size: 11px; }

.voltage-center span { font-size: 12px; }
.voltage-level-button { min-height: 42px; font-size: 12px; }
.setting-copy strong { font-size: 13px; }
.setting-copy span { font-size: 11px; line-height: 1.5; }
.scope-switch button { min-height: 38px; font-size: 12px; }
.persona-copy strong { font-size: 13px; }
.persona-copy p { font-size: 11px; line-height: 1.5; }
.persona-badge { font-size: 9px; }
.small-primary,
.small-secondary,
.danger-button { min-height: 40px; font-size: 12px; }
.form-label-row label { font-size: 13px; }
.form-label-row span { font-size: 10px; }
.text-input,
.select-input { min-height: 46px; font-size: 14px; }
.text-area { font-size: 14px; }
.helper-box { font-size: 11px; line-height: 1.65; }
.debate-side label { font-size: 11px; }
.swap-button { width: 40px; height: 40px; }
.debate-preview-card strong { font-size: 12px; }
.debate-preview-card small { font-size: 10px; }
.start-debate-button { min-height: 48px; font-size: 13px; }

.credit-balance span { font-size: 11px; }
.credit-split span { font-size: 9px; }
.credit-split strong { font-size: 11px; }
.commerce-state { font-size: 11px; }
.purchase-card-copy strong { font-size: 14px; }
.purchase-card-copy span { font-size: 11px; }
.purchase-price span { font-size: 10px; }
.purchase-button { min-height: 48px; font-size: 13px; }
.ledger-copy strong { font-size: 12px; }
.ledger-copy span { font-size: 10px; }
.ledger-amount { font-size: 12px; }

.login-brand { font-size: 14px; }
.login-card > p { font-size: 14px; }
.kakao-button,
.secondary-button { min-height: 52px; font-size: 14px; }
#google-login-status { font-size: 12px; }
.login-card small { font-size: 11px; }
.modal-content { font-size: 14px; }
.notice-card strong { font-size: 13px; }
.notice-card p { font-size: 12px; }
.toast { font-size: 12px; }
.loading-panel,
.empty-panel { font-size: 12px; }

[data-theme="dark"] .purchase-button:disabled {
  color: var(--text-soft);
}

/* Phone-first adjustments: readable Korean text and 44px-class controls. */
@media (max-width: 620px) {
  :root { --topbar-height: 68px; }

  .topbar { padding: 0 10px; }
  .topbar .icon-button { width: 42px; height: 42px; border-radius: 13px; }
  .room-title-line h1 { max-width: 150px; font-size: 16px; }
  .room-title-block p { max-width: 165px; font-size: 11px; line-height: 1.35; }
  .status-chip { min-height: 38px; padding: 0 10px; font-size: 12px; }

  .chat-content { padding: 22px 14px 15px; }
  .empty-state { min-height: calc(100dvh - 250px); }
  .empty-state h2 { font-size: 27px; line-height: 1.25; }
  .empty-state > p { font-size: 14px; line-height: 1.65; }
  .prompt-grid { gap: 11px; }
  .prompt-card { min-height: 76px; padding: 15px; grid-template-columns: 38px minmax(0,1fr); column-gap: 11px; }
  .prompt-card > span { font-size: 21px; }
  .prompt-card strong { font-size: 14px; }
  .prompt-card small { font-size: 11px; }

  .message { grid-template-columns: 34px minmax(0,1fr); gap: 9px; }
  .message.user { grid-template-columns: minmax(0,1fr) 34px; }
  .message-avatar { width: 34px; height: 34px; border-radius: 11px; font-size: 14px; }
  .message-surface { padding: 15px 15px; }
  .markdown-body { font-size: 15px; line-height: 1.75; }
  .message-meta { font-size: 10px; }
  .message-meta strong { font-size: 12px; }
  .message-action { min-height: 36px; font-size: 12px; }

  .composer-area { padding: 10px 9px; }
  .composer-shell { padding: 11px 10px 9px 12px; }
  #message-input { min-height: 36px; font-size: 16px; line-height: 1.55; }
  .composer-tool { height: 36px; padding: 0 11px; font-size: 12px; }
  .send-button { width: 44px; height: 44px; }

  .studio { height: min(88dvh, 800px); }
  .studio-header { min-height: 72px; padding: 15px 17px; }
  .studio-content { padding: 16px; }
  .panel-card { padding: 16px; }
  .panel-card h3 { font-size: 16px; }
  .panel-card p { font-size: 13px; }
  .quick-card { min-height: 94px; padding: 14px; }
  .quick-card strong { font-size: 13px; }
  .quick-card small { font-size: 11px; }
  .setting-row { padding: 13px 0; }
  .setting-copy strong { font-size: 14px; }
  .setting-copy span { font-size: 11px; }
  .scope-switch button { min-height: 40px; font-size: 12px; }
  .persona-card { padding: 14px; }
  .persona-copy strong { font-size: 14px; }
  .persona-copy p { font-size: 11px; }

  /* 16px prevents Safari from auto-zooming form fields. */
  .text-input,
  .text-area,
  .select-input { font-size: 16px; }
  .form-label-row label { font-size: 13px; }
  .helper-box { font-size: 12px; }
  .account-profile-hero { margin-bottom: 15px; padding: 13px; }
  .account-profile-avatar { width: 44px; height: 44px; }
  .account-profile-hero strong { font-size: 16px; }
  .account-profile-hero span { font-size: 12px; }
  .account-profile-details { grid-template-columns: 1fr 1fr; }
  .profile-form-actions { position: sticky; bottom: 0; margin: 17px -18px -18px; padding: 12px 18px calc(12px + var(--safe-bottom)); background: var(--surface-solid); border-top: 1px solid var(--border); }
  /* Account settings has a tall destructive-action card immediately above the footer.
     Keep this footer in normal flow so it never covers the account deletion card. */
  .account-profile-form .profile-form-actions {
    position: static;
    bottom: auto;
    margin: 18px 0 0;
    padding: 0;
    border-top: 0;
    background: transparent;
  }
  .profile-form-actions > button { flex: 1; min-height: 48px; font-size: 14px; }
  .modal-content { font-size: 14px; }
  .toast { font-size: 13px; }
}


/* Overlay stacking fix: the mobile Studio backdrop must sit behind the sheet. */
.sidebar,
.studio { z-index: 60; }
.backdrop { z-index: 50; }
.studio-backdrop { z-index: 55; }

/* Keep the larger sidebar typography usable on shorter laptop screens. */
.sidebar {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}
.brand-row,
.account-card,
.primary-action,
.rooms-section,
.feature-nav,
.sidebar-footer { flex-shrink: 0; }

/* VESPER WEB V2 UX FIXES: clickable centre voltage and keyboard hint. */
.composer-footnote strong { color: var(--text-soft); font-weight: 850; }


/* === VESPER WEB V2 MOBILE-FIRST PATCH: 2026-08-16 ===
 * Keeps the desktop layout intact while giving phones their own concise
 * navigation and conversation controls instead of merely hiding desktop UI.
 */
.mobile-room-menu,
.studio-mobile-tabs { display: none; }

.mobile-action-list {
  display: grid;
  gap: 9px;
}
.mobile-action-item {
  width: 100%;
  min-height: 58px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}
.mobile-action-item:hover,
.mobile-action-item:active {
  border-color: var(--border-strong);
  background: var(--surface-soft);
}
.mobile-action-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 17px;
  font-weight: 900;
}
.mobile-action-copy { min-width: 0; }
.mobile-action-copy strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}
.mobile-action-copy small {
  display: block;
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.45;
}
.mobile-action-arrow {
  color: var(--text-faint);
  font-size: 20px;
}
.mobile-action-item.danger .mobile-action-icon {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}
.mobile-action-item.danger .mobile-action-copy strong { color: var(--danger); }

@media (max-width: 920px) {
  .mobile-room-menu { display: grid; }
  .room-more { opacity: 1; }

  .studio-mobile-tabs {
    display: flex;
    flex: 0 0 auto;
    gap: 7px;
    padding: 10px 14px 11px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--studio) 96%, transparent);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .studio-mobile-tabs::-webkit-scrollbar { display: none; }
  .studio-mobile-tabs button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-soft);
    background: var(--surface-solid);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
  }
  .studio-mobile-tabs button.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 7px 17px rgba(210, 91, 0, .20);
  }
}

@media (max-width: 620px) {
  :root { --topbar-height: 64px; }

  /* Phone header: menu, title, conversation menu, settings. The duplicated
     desktop status chips move to the composer and Studio. */
  .topbar { padding: 0 9px; gap: 7px; }
  .topbar-left { flex: 1 1 auto; min-width: 0; gap: 8px; }
  .topbar-actions { flex: 0 0 auto; gap: 5px; }
  .topbar .icon-button {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }
  .room-title-block { flex: 1 1 auto; min-width: 0; }
  .room-title-line h1 {
    max-width: min(42vw, 180px);
    font-size: 16px;
  }
  .room-title-block p { display: none; }
  #voltage-chip { display: none; }
  .mobile-room-menu { font-size: 23px; line-height: 1; letter-spacing: 1px; }
  .studio-toggle { display: grid; }

  /* The drawer is a phone menu, not a squeezed desktop column. */
  .sidebar {
    width: min(88vw, 360px);
    padding: calc(12px + env(safe-area-inset-top, 0px)) 13px calc(14px + var(--safe-bottom));
  }
  .brand-row { min-height: 48px; padding-bottom: 9px; }
  .brand-mark-wrap { width: 38px; height: 38px; }
  .brand-copy strong { font-size: 17px; }
  .preview-dot { display: none; }
  .account-card { padding: 12px; border-radius: 17px; }
  .account-copy span { display: none; }
  .account-edit-cue { font-size: 16px; }
  .sync-note { display: none; }
  .account-stats { margin-top: 10px; }
  .primary-action { min-height: 48px; margin-top: 10px; }
  .primary-action kbd { display: none; }
  .rooms-section { min-height: 96px; margin-top: 14px; }
  .rooms-list { max-height: 154px; }
  .room-item { min-height: 48px; }
  .feature-nav { margin-top: 12px; gap: 3px; }
  .nav-heading { display: none; }
  .feature-nav-item { min-height: 45px; }
  .sidebar-footer {
    margin-top: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }
  .footer-link {
    min-height: 42px;
    padding: 0 5px;
    text-align: center;
    font-size: 11px;
  }
  .build-label { display: none; }
  .workspace-business-footer {
    padding: 6px 10px calc(6px + var(--safe-bottom));
    gap: 2px 7px;
    font-size: 6.5px;
    line-height: 1.4;
  }

  /* Mobile Studio behaves like a focused bottom sheet with an always-visible
     feature switcher. */
  .studio {
    height: min(91dvh, 820px);
    border-radius: 24px 24px 0 0;
  }
  .studio-header {
    min-height: 62px;
    padding: 12px 15px 8px;
  }
  .studio-header .eyebrow { display: none; }
  .studio-header h2 { margin: 0; font-size: 19px; }
  .studio-mobile-tabs { padding: 7px 12px 10px; }
  .studio-mobile-tabs button { min-height: 40px; font-size: 12px; }
  .studio-content { padding: 13px 12px calc(18px + var(--safe-bottom)); }

  /* The action sheet is the mobile home for clear/rename/new-room actions. */
  .mobile-action-item { min-height: 60px; }

  /* Keep transient notices above the fixed composer instead of covering it. */
  .toast-stack {
    bottom: calc(112px + var(--safe-bottom));
  }
}

/* === VESPER WEB V2 OPEN RESPONSE PATCH: 2026-08-16 ===
 * Contemporary AI-chat hierarchy:
 * - the user's prompt remains a compact right-aligned bubble;
 * - Vesper's answer is an open, full-width response on the conversation canvas.
 * The assistant body deliberately has no card border, fill, radius, or shadow.
 */
.messages {
  gap: 31px;
}

.message.assistant {
  display: block;
  width: 100%;
  padding: 2px 0 8px;
}

.assistant-message-head {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
}

.message.assistant .message-avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  box-shadow: none;
}

.message.assistant .message-meta {
  min-width: 0;
  margin: 0;
}

.message.assistant .message-main {
  width: 100%;
}

.message.assistant .message-surface,
.message.assistant.streaming .message-surface {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.message.assistant .markdown-body {
  width: 100%;
  max-width: none;
  color: var(--text);
}

.message.assistant .message-actions {
  margin-top: 12px;
}

.message.user .message-main {
  width: min(78%, 680px);
}

.message.user .message-surface {
  padding: 13px 16px 50px;
  border-radius: 18px 18px 7px 18px;
  box-shadow: none;
}

@media (max-width: 620px) {
  .messages {
    gap: 29px;
  }

  .message.assistant {
    padding: 0 0 6px;
  }

  .assistant-message-head {
    min-height: 30px;
    gap: 9px;
    margin-bottom: 10px;
  }

  .message.assistant .message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 13px;
  }

  .message.assistant .message-surface {
    padding: 0;
  }

  .message.assistant .markdown-body {
    font-size: 16px;
    line-height: 1.78;
  }

  .message.assistant .message-actions {
    margin-top: 11px;
  }

  .message.user .message-main {
    width: min(88%, 560px);
  }

  .message.user .message-surface {
    padding: 12px 14px 54px;
    border-radius: 17px 17px 6px 17px;
  }

  .message-action.icon-action {
    width: 42px;
    min-width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .message-action.icon-action svg { width: 21px; height: 21px; }

  .speech-player {
    top: calc(var(--topbar-height) + env(safe-area-inset-top, 0px) + 6px);
    width: calc(100vw - 18px);
    min-height: 72px;
    padding: 10px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px;
    border-radius: 16px;
  }

  .speech-player-copy strong { font-size: 14px; }
  .speech-player-copy span { font-size: 11px; }
  .speech-player-actions { gap: 2px; }
  .speech-player-button { width: 36px; height: 36px; border-radius: 11px; }
}



/* === VESPER WEB V2 iOS-CADENCE STREAMING PATCH: 2026-08-16 ===
 * Completed lines are rendered as Markdown while the actively growing tail is
 * a cheap plain-text node. This avoids replacing the entire answer DOM every
 * 60 ms and lets the browser paint every iPhone-style reveal beat.
 */
.stream-live-committed:empty { display: none; }
.stream-live-tail {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* === VESPER WEB V2 PRECISION UX FIXES: 2026-08-17 ===
 * Narrow fixes only: custom-persona visibility/actions and stable room controls.
 */
.custom-persona-list {
  max-height: min(46vh, 430px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
}
.custom-persona-card {
  grid-template-columns: 42px minmax(0, 1fr) 40px;
  padding-right: 10px;
  cursor: default;
}
.custom-persona-card .custom-select {
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.custom-persona-card .persona-emoji.custom-select {
  display: grid;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
}
.custom-persona-card .custom-edit {
  position: static;
  justify-self: end;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-right: 6px;
  opacity: 1;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--text-soft);
  background: transparent;
  font-size: 0;
  letter-spacing: 0;
}
.custom-persona-card .custom-edit:hover,
.custom-persona-card .custom-edit:focus-visible {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-soft);
}
@media (max-width: 620px) {
  .custom-persona-list { max-height: min(43dvh, 440px); }
  .custom-persona-card { grid-template-columns: 42px minmax(0, 1fr) 44px; }
  .custom-persona-card .custom-edit { width: 44px; height: 44px; margin-right: 6px; }
}



/* === VESPER WEB V2 MICRO UI POLISH: 2026-08-17 ===
 * Compact/inset overflow glyphs and a true proportional 1V–12V gauge.
 */

/* === VESPER WEB V2 GAUGE LAYOUT FIX: V10R4 ===
 * A wider outer arc and a smaller/lower value capsule keep the full gauge
 * visible instead of hiding it behind the 1V–12V label.
 */

/* === VESPER WEB V2 FINAL INPUT + PERSONA GUARD: V10R5 ===
 * 5,000-character composer parity, compact long user bubbles, and a hard
 * ten-item custom-persona creation ceiling. Existing chat/voice behavior stays intact.
 */
.message-count {
  display: none;
  min-width: 68px;
  justify-content: flex-end;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.message-count.is-visible { display: inline-flex; }
.message-count.is-limit { color: var(--danger); font-weight: 850; }

.message.user .message-surface.has-user-collapse {
  position: relative;
}
.message.user .message-surface.has-user-collapse .markdown-body {
  transition: max-height .2s ease;
}
.message.user .message-surface.has-user-collapse.is-collapsed .markdown-body {
  max-height: var(--user-message-collapsed-height, 11em);
  overflow: hidden;
}
.message.user .message-surface.has-user-collapse.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 49px;
  height: 46px;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--surface-soft));
}
.user-message-toggle {
  position: relative;
  z-index: 2;
  min-height: 29px;
  margin-top: 10px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
}
.user-message-toggle:hover,
.user-message-toggle:focus-visible {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface);
}

.custom-persona-toolbar {
  align-items: center;
}

@media (max-width: 620px) {
  .message-count.is-visible {
    display: inline-flex;
    font-size: 10px;
  }
  .composer-actions {
    margin-left: auto;
  }
  .user-message-toggle {
    min-height: 32px;
    padding-inline: 11px;
    font-size: 11px;
  }
}



/* V10R6 business menu and user-consented report/share flows */
.service-menu-launch {
  width: calc(100% - 28px);
  margin: 10px 14px 4px;
  min-height: 48px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}
.service-menu-launch:hover { border-color: var(--accent); background: var(--accent-soft); }
.service-menu-launch-icon { font-size: 19px; color: var(--accent); }
.service-menu-shell { display: grid; gap: 22px; }
.service-menu-section > h3 { margin: 0 0 10px; color: var(--text-faint); font-size: 13px; font-weight: 850; }
.service-menu-list { overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.service-menu-item {
  width: 100%; min-height: 56px; display: grid; grid-template-columns: 34px minmax(0,1fr) 18px; align-items: center; gap: 12px;
  padding: 11px 15px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); text-align: left;
  font: inherit; font-size: 14px; font-weight: 780; cursor: pointer;
}
.service-menu-item:last-child { border-bottom: 0; }
.service-menu-item:hover { background: var(--surface-soft); }
.service-menu-item.danger { color: var(--danger); }
.service-menu-icon { width: 30px; height: 30px; display: grid; place-items: center; }
.service-menu-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.service-menu-chevron { color: var(--text-faint); font-size: 22px; text-align: right; }
.account-danger-zone { margin-top: 14px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border)); border-radius: 15px; background: color-mix(in srgb, var(--danger) 5%, var(--surface)); }
.account-danger-zone div { min-width: 0; display: grid; gap: 3px; }
.account-danger-zone strong { color: var(--danger); font-size: 13px; }
.account-danger-zone span { color: var(--text-soft); font-size: 11px; line-height: 1.45; }
.small-danger { border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border)); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); color: var(--danger); border-radius: 12px; padding: 9px 12px; font-weight: 850; cursor: pointer; }
.danger-card { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)) !important; background: color-mix(in srgb, var(--danger) 5%, var(--surface)) !important; }
.consent-check { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-soft); color: var(--text-soft); font-size: 12px; line-height: 1.55; cursor: pointer; }
.consent-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); flex: 0 0 auto; }
.danger-confirm { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.consent-status { margin-top: 12px; padding: 9px 11px; border-radius: 11px; font-size: 12px; font-weight: 850; }
.consent-status.accepted { background: rgba(48,122,85,.10); color: var(--success); }
.consent-status.required { background: var(--accent-soft); color: var(--accent); }
.inline-link-button { border: 0; padding: 3px 0; background: transparent; color: var(--accent); font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.support-form, .report-form-stack { display: grid; gap: 14px; }
.support-body, .context-report-note { min-height: 160px; }
.support-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 12px; }
.support-links a { color: var(--accent); font-weight: 800; }
.report-choice-list { display: grid; gap: 10px; margin-bottom: 14px; }
.report-choice-card { width: 100%; display: grid; grid-template-columns: 42px minmax(0,1fr) 16px; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.report-choice-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.report-choice-card > span:nth-child(2) { display: grid; gap: 4px; }
.report-choice-card strong { font-size: 14px; }
.report-choice-card small { color: var(--text-soft); font-size: 11px; line-height: 1.5; }
.report-choice-card > b { color: var(--text-faint); font-size: 22px; }
.report-choice-icon { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); }
.report-choice-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.report-choice-icon.context { color: var(--accent); }
.report-preview { padding: 13px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-soft); }
.report-preview span { display: block; margin-bottom: 6px; color: var(--text-faint); font-size: 10px; font-weight: 850; }
.report-preview p { margin: 0; color: var(--text-soft); font-size: 12px; line-height: 1.55; }
.report-scope-field { display: grid; gap: 8px; margin: 0; padding: 13px; border: 1px solid var(--border); border-radius: 14px; }
.report-scope-field legend { padding: 0 5px; font-size: 12px; font-weight: 850; }
.report-scope-field label { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 12px; cursor: pointer; }
.report-scope-field input { accent-color: var(--accent); }
.report-scope-field small { color: var(--text-faint); }
.context-share-summary { display: grid; gap: 3px; padding: 11px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.context-share-summary strong { font-size: 12px; }
.context-share-summary span { font-size: 10px; line-height: 1.4; }
.message-action.report-action:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
#credits-balance-section, #credits-purchase-section, #credits-orders-section, #credits-ledger-section { scroll-margin-top: 16px; }
@media (max-width: 720px) {
  .service-menu-launch { margin-top: 8px; }
  .service-menu-item { min-height: 58px; font-size: 15px; }
  .account-danger-zone { align-items: stretch; flex-direction: column; }
  .account-danger-zone .small-danger { width: 100%; }
  .report-choice-card { grid-template-columns: 42px minmax(0,1fr) 14px; }
}

/* === V10R13 WEB COMMERCE MENU === */
.credit-catalog-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.credit-catalog-header h3 { margin: 0; }
.credit-catalog-header p { margin-top: 4px; }
.credit-product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 13px; }
.credit-product-option { position: relative; min-width: 0; padding: 13px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-solid); box-shadow: var(--shadow-sm); }
.credit-product-option.recommended { border-color: rgba(232,125,5,.48); background: linear-gradient(145deg, var(--accent-soft), var(--surface-solid)); }
.credit-product-option-top { min-height: 22px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.credit-product-option-top > strong { font-size: 12px; }
.credit-product-badge { padding: 3px 6px; border-radius: 999px; color: #fff; background: var(--accent); font-size: 7px; font-weight: 900; white-space: nowrap; }
.credit-product-amount { margin-top: 10px; display: flex; align-items: flex-end; gap: 4px; }
.credit-product-amount strong { font-size: 24px; letter-spacing: -.04em; }
.credit-product-amount span { padding-bottom: 3px; color: var(--text-soft); font-size: 8px; }
.credit-product-option > p { min-height: 32px; margin: 6px 0 0; color: var(--text-soft); font-size: 9px; line-height: 1.45; }
.credit-product-price { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; }
.credit-product-price strong { font-size: 16px; }
.credit-product-price span { color: var(--text-faint); font-size: 7px; text-align: right; }
.credit-product-option .purchase-button { margin-top: 10px; min-height: 39px; }
.commerce-notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; color: var(--text-soft); background: var(--surface-soft); }
.commerce-notice.ready { color: var(--success); background: rgba(48,122,85,.08); }
.commerce-notice-icon { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: var(--accent); background: var(--surface-solid); }
.commerce-notice.ready .commerce-notice-icon { color: var(--success); }
.commerce-notice strong { display: block; color: var(--text); font-size: 11px; }
.commerce-notice span { display: block; margin-top: 3px; font-size: 9px; line-height: 1.45; }
.payment-method-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.payment-method-list span { padding: 6px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); background: var(--surface-solid); font-size: 8px; font-weight: 800; }
.credit-policy-list { display: grid; gap: 9px; margin-top: 11px; }
.credit-policy-item { display: grid; grid-template-columns: 26px minmax(0,1fr); gap: 9px; align-items: start; }
.credit-policy-item > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 9px; color: var(--accent); background: var(--accent-soft); font-size: 11px; font-weight: 900; }
.credit-policy-item strong { display: block; font-size: 10px; }
.credit-policy-item p { margin-top: 3px; font-size: 8px; }
.credit-policy-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.credit-policy-links button { font-size: 9px; }
.order-list { display: flex; flex-direction: column; }
.order-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.order-row:last-child { border-bottom: 0; }
.order-copy strong { display: block; font-size: 10px; }
.order-copy span { display: block; margin-top: 3px; color: var(--text-faint); font-size: 8px; }
.order-summary { text-align: right; }
.order-summary strong { display: block; font-size: 10px; }
.order-status { display: inline-block; margin-top: 4px; padding: 3px 6px; border-radius: 999px; color: var(--text-soft); background: var(--surface-soft); font-size: 7px; font-weight: 850; }
.order-status.paid { color: var(--success); background: rgba(48,122,85,.09); }
.order-status.failed { color: var(--danger); background: rgba(199,67,67,.08); }
.order-refund-button { margin-top: 7px; padding: 5px 8px; border: 1px solid rgba(232,125,5,.3); border-radius: 8px; color: var(--accent); background: var(--accent-soft); font-size: 7px; font-weight: 900; }
.order-refund-button:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--accent); }
.order-refund-status { display: block; margin-top: 6px; color: var(--accent); font-size: 7px; font-weight: 850; }
.refund-quote-summary { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--border); }
.refund-quote-summary > div { display: flex; justify-content: space-between; gap: 15px; padding: 10px 12px; background: var(--surface); }
.refund-quote-summary span { color: var(--text-faint); font-size: 9px; }
.refund-quote-summary strong { text-align: right; font-size: 9px; }
.refund-quote-summary .refund-quote-total { background: var(--accent-soft); }
.refund-quote-summary .refund-quote-total span, .refund-quote-summary .refund-quote-total strong { color: var(--accent); font-weight: 950; }
.refund-review-note { margin-top: 10px; color: var(--text-faint); font-size: 8px; line-height: 1.65; }
.checkout-product-summary { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding: 15px; border: 1px solid rgba(232,125,5,.26); border-radius: 16px; background: var(--accent-soft); }
.checkout-product-summary strong { display: block; font-size: 15px; }
.checkout-product-summary span { display: block; margin-top: 4px; color: var(--text-soft); font-size: 11px; }
.checkout-product-summary b { align-self: center; font-size: 18px; }
.checkout-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.checkout-method-button { min-height: 58px; padding: 10px; border: 1px solid var(--border); border-radius: 14px; color: var(--text); background: var(--surface-solid); cursor: pointer; text-align: left; }
.checkout-method-button:hover { border-color: var(--accent); background: var(--accent-soft); }
.checkout-method-button strong { display: block; font-size: 12px; }
.checkout-method-button span { display: block; margin-top: 4px; color: var(--text-soft); font-size: 9px; line-height: 1.4; }
.checkout-method-button:disabled { cursor: wait; opacity: .55; }

/* Public PG-reviewable product page. */
body.public-commerce-page { width: 100%; height: 100dvh; min-height: 100dvh; overflow: auto; background: linear-gradient(160deg, #f8f3ea 0%, #eee5d8 100%); }
.public-commerce-header { width: min(1180px, calc(100% - 40px)); min-height: 76px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.public-brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.public-brand img { width: 42px; height: 42px; border-radius: 13px; }
.public-brand span { display: grid; gap: 3px; }
.public-brand strong { font-size: 16px; letter-spacing: .12em; }
.public-brand small { color: var(--accent); font-size: 9px; font-weight: 900; letter-spacing: .18em; }
.public-commerce-header nav { display: flex; align-items: center; gap: 22px; }
.public-commerce-header nav a { color: var(--text-soft); font-size: 13px; font-weight: 760; text-decoration: none; }
.public-commerce-header nav a:hover { color: var(--accent); }
.public-commerce-header .public-login-link { padding: 10px 15px; border-radius: 12px; color: #fff; background: var(--text); }
.public-commerce-main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 76px; }
.public-commerce-hero { max-width: 780px; padding: 38px 0 60px; }
.public-commerce-hero h1 { margin: 12px 0 18px; font-size: clamp(42px, 7vw, 76px); line-height: 1.02; letter-spacing: -.065em; }
.public-commerce-hero > p { max-width: 650px; margin: 0; color: var(--text-soft); font-size: 18px; line-height: 1.7; }
.public-commerce-trust { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 25px; }
.public-commerce-trust span { padding: 9px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); background: rgba(255,255,255,.58); font-size: 12px; font-weight: 800; }
.public-products-section, .public-policy-section { padding: 34px; border: 1px solid var(--border); border-radius: 30px; background: rgba(255,253,249,.87); box-shadow: var(--shadow-md); }
.public-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.public-section-heading h2 { margin: 7px 0 0; font-size: 27px; letter-spacing: -.035em; }
.public-section-heading > p { margin: 0; color: var(--text-soft); font-size: 13px; }
.public-product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.public-product-card { position: relative; min-width: 0; padding: 21px; border: 1px solid var(--border); border-radius: 22px; background: #fffdfa; }
.public-product-card.recommended { border-color: rgba(232,125,5,.52); background: linear-gradient(145deg, #fff0df, #fffdfa); box-shadow: 0 18px 40px rgba(210,91,0,.12); }
.public-product-top { min-height: 24px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-soft); font-size: 13px; font-weight: 850; }
.public-product-badge { padding: 4px 7px; border-radius: 999px; color: #fff; background: var(--accent); font-size: 9px; }
.public-product-card > strong { display: block; margin-top: 20px; font-size: 34px; letter-spacing: -.04em; }
.public-product-card > strong small { color: var(--text-soft); font-size: 12px; letter-spacing: 0; }
.public-product-card > p { min-height: 45px; margin: 10px 0 0; color: var(--text-soft); font-size: 12px; line-height: 1.55; }
.public-product-price { margin-top: 19px; padding-top: 16px; border-top: 1px solid var(--border); display: grid; gap: 4px; }
.public-product-price b { font-size: 22px; }
.public-product-price span { color: var(--text-faint); font-size: 10px; }
.public-product-card > a { min-height: 43px; margin-top: 16px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--text); text-decoration: none; font-size: 12px; font-weight: 900; }
.public-product-card.recommended > a { background: var(--accent); }
.public-buy-note { margin-top: 18px; padding: 15px 17px; border-radius: 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: var(--surface-soft); }
.public-buy-note p { margin: 0; color: var(--text-soft); font-size: 12px; }
.public-buy-note a { color: var(--accent-strong); font-size: 12px; font-weight: 900; text-decoration: none; }
.public-commerce-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.public-info-card { padding: 28px; border: 1px solid var(--border); border-radius: 26px; background: rgba(255,253,249,.78); }
.public-info-card h2 { margin: 8px 0 10px; font-size: 22px; }
.public-info-card p { margin: 0; color: var(--text-soft); font-size: 13px; line-height: 1.7; }
.public-info-card small { display: block; margin-top: 13px; color: var(--text-faint); font-size: 10px; line-height: 1.55; }
.public-policy-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.public-policy-grid article { padding: 17px; border: 1px solid var(--border); border-radius: 17px; background: var(--surface-soft); }
.public-policy-grid strong { font-size: 13px; }
.public-policy-grid p { margin: 6px 0 0; color: var(--text-soft); font-size: 12px; line-height: 1.65; }
.public-policy-legal { margin: 16px 0 0; color: var(--text-faint); font-size: 11px; line-height: 1.65; }
.public-policy-legal a { color: var(--accent-strong); }
.public-policy-example { margin: 14px 0 0; padding: 14px 16px; border-radius: 15px; color: var(--text-soft); background: var(--accent-soft); font-size: 12px; line-height: 1.65; }
.public-policy-example strong { color: var(--accent-strong); }
.public-business-footer { padding: 38px max(20px, calc((100% - 1180px) / 2)); border-top: 1px solid var(--border); color: var(--text-soft); background: rgba(255,253,249,.72); }
.public-business-brand { display: flex; align-items: baseline; gap: 10px; }
.public-business-brand strong { color: var(--text); font-size: 16px; }
.public-business-brand span { color: var(--accent); font-size: 11px; font-weight: 850; }
.public-business-grid { margin-top: 17px; display: flex; flex-wrap: wrap; gap: 7px 18px; font-size: 11px; line-height: 1.55; }
.public-business-grid span:not(:last-child)::after { content: ""; }
.public-business-grid a { color: inherit; }
.public-business-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 17px; }
.public-business-links a { color: var(--text); font-size: 11px; font-weight: 800; text-decoration: none; }
.public-business-footer > small { display: block; margin-top: 15px; color: var(--text-faint); font-size: 10px; }

@media (min-width: 721px) {
  .credit-product-option-top > strong { font-size: 14px; }
  .credit-product-amount span { font-size: 10px; }
  .credit-product-option > p { font-size: 10px; }
  .credit-product-price span { font-size: 8px; }
  .commerce-notice strong { font-size: 13px; }
  .commerce-notice span { font-size: 11px; }
  .payment-method-list span { font-size: 10px; }
  .credit-policy-item strong { font-size: 12px; }
  .credit-policy-item p { font-size: 10px; }
  .credit-policy-links button { font-size: 11px; }
  .order-copy strong, .order-summary strong { font-size: 12px; }
  .order-copy span { font-size: 10px; }
  .order-status { font-size: 9px; }
}

@media (max-width: 900px) {
  .public-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-commerce-info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .public-commerce-header { width: calc(100% - 28px); min-height: 66px; }
  .public-commerce-header nav { gap: 8px; }
  .public-commerce-header nav a:not(.public-login-link) { display: none; }
  .public-commerce-main { width: calc(100% - 24px); padding: 24px 0 50px; }
  .public-commerce-hero { padding: 28px 5px 42px; }
  .public-commerce-hero h1 { font-size: 45px; }
  .public-commerce-hero > p { font-size: 15px; }
  .public-products-section, .public-policy-section { padding: 19px; border-radius: 23px; }
  .public-section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .public-product-grid { grid-template-columns: 1fr; }
  .public-product-card > p { min-height: 0; }
  .public-buy-note { align-items: flex-start; flex-direction: column; gap: 8px; }
  .public-policy-grid { grid-template-columns: 1fr; }
  .public-info-card { padding: 21px; }
  .public-business-footer { padding: 30px 20px; }
  .checkout-methods { grid-template-columns: 1fr; }
  .login-overlay { padding: 14px 14px max(14px, env(safe-area-inset-bottom)); }
  .login-card { margin: 6px 0 18px; }
  .login-business-footer { font-size: 8px; }
}

@media (max-width: 390px) {
  .credit-product-grid { grid-template-columns: 1fr; }
}

/* === V10R18 LOGIN COMPOSITION FIX: 2026-08-18 === */
.login-card h2 {
  width: min(390px, 100%);
  margin: 12px auto 14px;
  font-size: clamp(18px, 1.15vw, 20px);
  line-height: 1.45;
  letter-spacing: -.035em;
  word-break: keep-all;
  overflow-wrap: normal;
  text-wrap: balance;
}

@media (max-width: 620px) {
  .login-card h2 {
    width: min(310px, 100%);
    font-size: 18px;
    line-height: 1.5;
  }
}
