
:root {
  --bg-0: #05070d;
  --bg-1: #090e16;
  --bg-2: #101722;
  --panel: rgba(9, 14, 22, 0.9);
  --panel-strong: rgba(9, 14, 22, 0.96);
  --surface: rgba(255, 255, 255, 0.028);
  --surface-2: rgba(255, 255, 255, 0.05);
  --surface-3: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.055);
  --line-strong: rgba(255, 255, 255, 0.095);
  --text: #f4f3ee;
  --text-soft: #b7c0cc;
  --text-muted: #7d889b;
  --accent: #e5b35c;
  --accent-2: #0f766e;
  --accent-3: #a2c7ef;
  --danger: #ef4444;
  --success: #34d399;
  --shadow: 0 28px 90px rgba(2, 6, 23, 0.44), 0 10px 34px rgba(2, 6, 23, 0.24);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 13px;
  --tabbar-height: 84px;
  --composer-height: 150px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 18% -6%, rgba(229, 179, 92, 0.16), transparent 30%),
    radial-gradient(circle at 92% 0%, rgba(162, 199, 239, 0.08), transparent 24%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 48%, var(--bg-2) 100%);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.035), transparent 22%);
  opacity: 0.24;
}

button,
input,
select,
textarea {
  font: inherit;
}

strong {
  font-weight: 600;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

#app {
  min-height: 100dvh;
}

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


.phone-frame {
  position: relative;
  width: min(100%, 460px);
  height: min(100dvh - 24px, 920px);
  min-height: min(100dvh - 24px, 920px);
  max-height: min(100dvh - 24px, 920px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 14%),
    linear-gradient(180deg, rgba(9, 14, 22, 0.98), rgba(7, 12, 19, 0.96));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  overflow: hidden;
}

.phone-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.phone-frame::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  top: -44px;
  height: 110px;
  pointer-events: none;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(229, 179, 92, 0.18), transparent 72%);
  filter: blur(18px);
  opacity: 0.45;
}

.phone-frame > * {
  position: relative;
  z-index: 1;
}

.topbar {
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0));
}

.topbar.minimal {
  min-height: 16px;
  padding: 10px 12px 6px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-block {
  display: grid;
  gap: 3px;
}

.brand-kicker {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 600;
}

.brand-title {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.54rem;
  line-height: 1;
  letter-spacing: 0.01em;
}

.brand-subtitle {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.85rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 500;
}

.pill strong {
  color: var(--text);
}

.status-banner {
  margin-top: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(229, 179, 92, 0.12);
  background: linear-gradient(180deg, rgba(229, 179, 92, 0.08), rgba(229, 179, 92, 0.04));
  color: #f7dfaa;
  font-size: 0.77rem;
}

.screen {
  min-height: 0;
  overflow-y: auto;
  padding: 20px 20px 22px;
  overscroll-behavior: contain;
}

.screen.chat-screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 18px;
  overflow: hidden;
}

.chat-top {
  display: grid;
  gap: 12px;
}

.stack {
  display: grid;
  gap: 14px;
}


.card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.045);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.022));
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.card.tight {
  padding: 13px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.card-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.card-copy {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 0.8rem;
  line-height: 1.45;
}

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

.metric {
  border-radius: var(--radius-sm);
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  background: rgba(255, 255, 255, 0.025);
}

.metric-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric-value {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 500;
}

.metric-value.long {
  font-size: 0.92rem;
  line-height: 1.45;
}

.field-grid {
  display: grid;
  gap: 12px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 6px;
}

.field > span {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(3, 8, 16, 0.74);
  color: var(--text);
  padding: 12px 13px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.textarea {
  min-height: 84px;
  max-height: 180px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(125, 211, 252, 0.42);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.08);
  background: rgba(1, 12, 28, 0.8);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.actions.spaced-top {
  margin-top: 12px;
}

.button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--text);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button.primary {
  background: linear-gradient(180deg, #edc074 0%, var(--accent) 100%);
  color: #15181f;
  box-shadow: 0 8px 20px rgba(229, 179, 92, 0.18);
}

.button.secondary {
  background: rgba(15, 118, 110, 0.16);
  border-color: rgba(15, 118, 110, 0.2);
  color: #d6fffa;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.055);
  color: var(--text-soft);
}

.button.icon {
  min-width: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 1.05rem;
}

.button.icon.active {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.18);
  background: rgba(245, 158, 11, 0.1);
}

.button.danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

.button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.tabbar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0));
}

.tabbar button {
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 8px 6px;
  font-size: 0.72rem;
  font-weight: 500;
}

.tabbar button.active {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.05);
}

.tab-icon {
  font-size: 0.92rem;
}

.helper {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.status-line {
  margin: 0;
  min-height: 1.2em;
  color: var(--accent-3);
  font-size: 0.74rem;
  font-weight: 500;
}


.chat-shell {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.chat-main {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
}

.chat-head {
  display: grid;
  gap: 12px;
}

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

.chat-thread-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.chat-head-primary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-thread-title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 500;
}

.chat-thread-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.conversation-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.conversation-pill {
  display: inline-flex;
  align-items: center;
  min-height: 35px;
  max-width: 170px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  white-space: nowrap;
  font-size: 0.78rem;
}

.conversation-pill.active {
  border-color: rgba(229, 179, 92, 0.14);
  background: rgba(229, 179, 92, 0.08);
  color: var(--text);
}

.conversation-pill-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-drawer-toggle {
  flex: 0 0 auto;
}

.chat-drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 6, 23, 0.48);
  z-index: 4;
}

.chat-drawer {
  position: absolute;
  top: 10px;
  left: 10px;
  bottom: 10px;
  width: min(280px, calc(100% - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(9, 14, 22, 0.98), rgba(8, 13, 20, 0.97)),
    rgba(8, 13, 20, 0.96);
  box-shadow: 0 22px 54px rgba(2, 6, 23, 0.34);
  transform: translateX(calc(-100% - 18px));
  transition: transform 180ms ease;
  z-index: 5;
}

.chat-drawer.open {
  transform: translateX(0);
}

.chat-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.chat-drawer-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.chat-drawer-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.chat-drawer-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.chat-drawer-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding-right: 2px;
}

.chat-drawer-item {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 12px 13px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
}

.chat-drawer-item.active {
  border-color: rgba(229, 179, 92, 0.15);
  background: rgba(229, 179, 92, 0.09);
}

.chat-drawer-item-title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 500;
}

.chat-drawer-item-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.chat-drawer-empty {
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-soft);
  font-size: 0.8rem;
  line-height: 1.5;
}

.filter-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 500;
}

.filter-pill.active {
  border-color: rgba(229, 179, 92, 0.14);
  background: rgba(229, 179, 92, 0.08);
  color: var(--text);
}

.conversation-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.conversation-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.conversation-rename {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 320px;
  min-width: 0;
}

.conversation-rename-input {
  min-width: 0;
  flex: 1 1 auto;
}

.chat-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.chat-view-button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 500;
}

.chat-view-button.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.messages {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.empty-state {
  display: grid;
  gap: 8px;
  padding: 18px 16px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.018);
}

.empty-state h3 {
  margin: 0;
  font-size: 1rem;
}

.empty-state p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.bubble-row {
  display: flex;
}

.bubble-row.user {
  justify-content: flex-end;
}

.bubble {
  max-width: min(86%, 320px);
  border-radius: 18px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.bubble-row.user .bubble {
  background: rgba(229, 179, 92, 0.14);
  border-color: rgba(229, 179, 92, 0.16);
}

.bubble-copy {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.52;
}

.bubble-meta {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.system-feed {
  display: grid;
  gap: 10px;
}

.system-entry {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.02);
}

.system-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.system-entry-time {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.system-entry-request {
  margin: 0;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.45;
}

.system-entry-meta {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 0.76rem;
  line-height: 1.4;
}

.system-call-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.system-call-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 0.72rem;
  white-space: nowrap;
}

.system-entry-preview {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.activity-card {
  display: grid;
  gap: 10px;
}

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

.activity-meta {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

.composer {
  position: relative;
  display: grid;
  gap: 10px;
}

.composer-form {
  display: grid;
  gap: 10px;
}

.composer-length {
  display: grid;
  gap: 8px;
}

.composer-length-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.composer-length-label {
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.composer-length-value {
  color: var(--accent-3);
  font-size: 0.8rem;
  font-weight: 700;
}

.composer-length-slider {
  width: 100%;
}

.composer-length-ticks {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.composer-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.preset-menu-wrap {
  position: relative;
}

.preset-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(320px, 78vw);
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(7, 18, 34, 0.98);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.34);
  z-index: 6;
}

.preset-menu[hidden] {
  display: none;
}

.preset-option {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  font-weight: 500;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.75);
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing-bounce {
  0%, 80%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.suggestion-box {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(125, 211, 252, 0.14);
  background: rgba(7, 18, 34, 0.94);
}

.suggestion-button {
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
}

.suggestion-button small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
}

.accordion {
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.045);
  background: rgba(255, 255, 255, 0.03);
}

.accordion > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.accordion > summary::-webkit-details-marker {
  display: none;
}

.accordion-body {
  padding: 0 16px 16px;
}

.summary-block {
  display: grid;
  gap: 4px;
}

.summary-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.summary-copy {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.summary-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 500;
}

.badge.ok {
  border-color: rgba(52, 211, 153, 0.24);
  color: #bbf7d0;
  background: rgba(52, 211, 153, 0.08);
}

.badge.warn {
  border-color: rgba(245, 158, 11, 0.22);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.08);
}

.badge.danger {
  border-color: rgba(239, 68, 68, 0.24);
  color: #fecaca;
  background: rgba(239, 68, 68, 0.08);
}

.badge.score-red {
  border-color: rgba(239, 68, 68, 0.24);
  color: #fecaca;
  background: rgba(239, 68, 68, 0.08);
}

.badge.score-orange {
  border-color: rgba(249, 115, 22, 0.24);
  color: #fdba74;
  background: rgba(249, 115, 22, 0.08);
}

.badge.score-yellow {
  border-color: rgba(245, 158, 11, 0.22);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.08);
}

.badge.score-green {
  border-color: rgba(52, 211, 153, 0.24);
  color: #bbf7d0;
  background: rgba(52, 211, 153, 0.08);
}

.location-wrap {
  position: relative;
}

.location-results {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  display: grid;
  gap: 6px;
}


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

.accordion > summary,
.list-item > summary {
  list-style: none;
}

.accordion > summary::-webkit-details-marker,
.list-item > summary::-webkit-details-marker {
  display: none;
}

.list-item {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.025);
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.list-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.persona-option strong {
  font-weight: 600;
}

.list-copy {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.45;
}

.compat-field-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.compat-field-refresh {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.compat-field-secondary {
  opacity: 0.76;
}

.compat-tone-score-red {
  border-color: rgba(239, 68, 68, 0.32);
  background: rgba(127, 29, 29, 0.14);
}

.compat-tone-score-orange {
  border-color: rgba(249, 115, 22, 0.32);
  background: rgba(124, 45, 18, 0.14);
}

.compat-tone-score-yellow {
  border-color: rgba(245, 158, 11, 0.32);
  background: rgba(120, 53, 15, 0.14);
}

.compat-tone-score-green {
  border-color: rgba(34, 197, 94, 0.32);
  background: rgba(20, 83, 45, 0.14);
}

.compat-category-title {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--text-soft);
}

.compat-section-title {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.compat-field-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.compat-keywords-inline {
  color: #93c5fd;
  font-size: 0.8rem;
  font-weight: 400;
}

.compat-stars {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.compat-stars.score-red {
  color: #fecaca;
}

.compat-stars.score-orange {
  color: #fdba74;
}

.compat-stars.score-yellow {
  color: #fde68a;
}

.compat-stars.score-green {
  color: #bbf7d0;
}

.split-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.persona-grid {
  display: grid;
  gap: 10px;
}

.persona-option {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.032);
  color: var(--text);
  padding: 14px;
  text-align: left;
}

.persona-option.active {
  border-color: rgba(229, 179, 92, 0.18);
  background: rgba(229, 179, 92, 0.08);
}

.persona-option strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
}

.persona-option span {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 0.8rem;
  line-height: 1.5;
}

.auth-wrap {
  display: grid;
  gap: 18px;
}

.auth-card {
  padding: 20px;
}

.auth-hero {
  display: grid;
  gap: 10px;
}

.auth-hero h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 2.15rem;
  line-height: 0.95;
}

.auth-hero p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.auth-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.auth-metrics .metric {
  min-height: 96px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 2px 0;
}

.note-panel {
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.55;
}


@media (max-width: 560px) {
  .page {
    padding: 0;
  }

  .phone-frame {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
  }

  .field-grid.two,
  .metrics,
  .auth-metrics {
    grid-template-columns: 1fr;
  }

  .screen {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .tabbar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .chat-drawer {
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, calc(100% - 22px));
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
}
