:root {
  --bg-top: #fff7ed;
  --bg-bottom: #eef3ff;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --surface-tint: rgba(247, 248, 255, 0.92);
  --border: rgba(46, 63, 102, 0.12);
  --border-strong: rgba(77, 79, 185, 0.18);
  --text: #1d2340;
  --text-strong: #11162f;
  --muted: #697188;
  --accent: #5a4fd1;
  --accent-strong: #4336c0;
  --accent-soft: rgba(90, 79, 209, 0.12);
  --accent-glow: rgba(90, 79, 209, 0.22);
  --danger: #b4233d;
  --danger-bg: rgba(180, 35, 61, 0.1);
  --warn: #a16107;
  --warn-bg: rgba(161, 97, 7, 0.12);
  --ok: #136f63;
  --ok-bg: rgba(19, 111, 99, 0.12);
  --user-bg: #283765;
  --user-text: #f7fbff;
  --assistant-bg: #f7f8ff;
  --chat-well: rgba(247, 249, 255, 0.86);
  --shadow: 0 28px 60px rgba(38, 41, 86, 0.12);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-family);
  color: var(--text);
  background:
    radial-gradient(circle at left top, rgba(255, 226, 171, 0.72), transparent 28%),
    radial-gradient(circle at right top, rgba(116, 124, 255, 0.22), transparent 26%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

a {
  color: inherit;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 22px;
  padding: 14px 16px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at left center, rgba(63, 71, 159, 0.24), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(244, 247, 255, 0.93)),
    rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(43, 53, 119, 0.12);
  backdrop-filter: blur(20px);
  box-shadow:
    0 18px 44px rgba(32, 39, 86, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px 8px 8px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top left, rgba(122, 131, 255, 0.38), transparent 46%),
    linear-gradient(135deg, rgba(22, 28, 66, 0.98), rgba(40, 48, 107, 0.96));
  border: 1px solid rgba(95, 110, 220, 0.42);
  box-shadow:
    0 18px 34px rgba(17, 23, 63, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  width: 66px;
  height: 66px;
  padding: 6px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top, rgba(92, 103, 222, 0.7), rgba(31, 38, 89, 0.98)),
    rgba(28, 35, 82, 0.98);
  border: 1px solid rgba(152, 165, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 14px 30px rgba(26, 32, 79, 0.36),
    0 0 0 8px rgba(92, 103, 222, 0.14);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 244, 238, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.78),
    0 8px 18px rgba(12, 16, 43, 0.34);
  filter: contrast(1.05) saturate(1.06);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-copy strong {
  font-size: 21px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.98);
}

.brand-copy small {
  color: rgba(214, 220, 255, 0.78);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.site-nav {
  display: inline-flex;
  justify-content: center;
  gap: 6px;
  justify-self: center;
  padding: 6px;
  border-radius: 999px;
  background: rgba(236, 240, 255, 0.74);
  border: 1px solid rgba(75, 89, 188, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 18px rgba(43, 53, 119, 0.06);
}

.site-nav a {
  padding: 11px 16px;
  border-radius: 999px;
  text-decoration: none;
  color: rgba(29, 35, 64, 0.66);
  font-weight: 700;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(237, 241, 255, 0.96));
  color: rgba(23, 31, 81, 0.96);
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px rgba(95, 110, 220, 0.18),
    0 8px 16px rgba(64, 76, 165, 0.08);
}

.session-guest .is-current {
  background: rgba(90, 79, 209, 0.1);
  color: var(--accent);
}

.session-actions,
.session-guest,
.session-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-actions[data-session-ready="false"] {
  visibility: hidden;
}

.session-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(90, 79, 209, 0.08);
  font-size: 14px;
  font-weight: 700;
}

.session-role {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.primary-button,
.secondary-button,
.compact-link,
.compact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.primary-button,
.compact-link.primary,
.session-guest .primary-button,
.wide-button,
.composer-actions button {
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 18px 28px rgba(90, 79, 209, 0.24);
}

.secondary-button,
.compact-link,
.compact-button {
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.primary-button:hover,
.secondary-button:hover,
.compact-link:hover,
.compact-button:hover,
.composer-actions button:hover {
  transform: translateY(-1px);
}

.primary-button,
.secondary-button {
  padding: 13px 20px;
}

.compact-link,
.compact-button {
  padding: 10px 16px;
}

.wide-button {
  width: 100%;
  padding: 14px 18px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 28px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-figure,
.chat-card,
.auth-card,
.detail-panel,
.info-strip,
.auth-visual {
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 36px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

.hero-panel h1,
.auth-visual h1,
.detail-panel h2,
.info-strip h2 {
  margin: 0;
}

.hero-panel h1 {
  font-size: clamp(40px, 6vw, 68px);
  line-height: 0.95;
}

.hero-text {
  max-width: 620px;
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.hero-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.hero-highlights li {
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(90, 79, 209, 0.08);
  color: var(--muted);
  font-weight: 600;
}

.hero-figure {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.95), rgba(245, 241, 255, 0.72)),
    var(--surface);
}

.mascot-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.98), rgba(247, 243, 255, 0.82)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(242, 244, 255, 0.72));
  overflow: hidden;
}

.mascot-stage img {
  width: min(100%, 360px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 24px 42px rgba(82, 79, 182, 0.16));
}

.hero-note,
.auth-card-head,
.info-strip {
  color: var(--muted);
}

.note-kicker,
.panel-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-note p,
.detail-panel p,
.info-strip p,
.auth-visual p,
.auth-card-head p {
  margin: 0;
  line-height: 1.75;
}

.chat-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 255, 0.92)),
    var(--surface);
}

.chat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 120px;
  background: linear-gradient(135deg, rgba(255, 244, 214, 0.48), rgba(111, 125, 255, 0.12));
  pointer-events: none;
}

.chat-card > * {
  position: relative;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 24px;
  align-items: stretch;
}

.auth-visual {
  padding: 28px;
}

.auth-mascot {
  min-height: 260px;
  margin-bottom: 18px;
}

.auth-card {
  padding: 28px;
}

.auth-card-head h2 {
  margin: 0 0 8px;
  color: var(--text);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.auth-form label {
  font-size: 14px;
  font-weight: 700;
}

.auth-form input,
.composer textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(46, 63, 102, 0.12);
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  color: inherit;
}

.auth-form input:focus,
.composer textarea:focus {
  outline: none;
  border-color: rgba(90, 79, 209, 0.38);
  box-shadow: 0 0 0 4px rgba(90, 79, 209, 0.1);
}

.auth-status {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

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

.auth-status.error {
  color: var(--danger);
}

.auth-status.pending {
  color: var(--accent);
}

.auth-footnote {
  margin: 18px 0 0;
  color: var(--muted);
}

.auth-footnote a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

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

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

.detail-panel {
  padding: 24px;
}

.detail-panel h2 {
  margin: 0 0 12px;
}

.detail-panel ul,
.flow-list {
  margin: 18px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.accent-panel {
  background:
    linear-gradient(180deg, rgba(92, 80, 208, 0.12), rgba(255, 255, 255, 0.84)),
    var(--surface);
}

.info-strip {
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: start;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.chat-header h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(28px, 4vw, 34px);
  line-height: 1.02;
}

.chat-header p {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chat-inline-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.chat-inline-highlights span {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(90, 79, 209, 0.12);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status {
  min-width: 148px;
  padding: 11px 16px;
  border-radius: 999px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid rgba(90, 79, 209, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.status.idle {
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent);
}

.status.loading {
  background: rgba(255, 243, 221, 0.9);
  color: #8b5b00;
}

.status.success {
  background: rgba(0, 128, 96, 0.12);
  color: #0f6b54;
}

.status.warn {
  background: rgba(204, 120, 0, 0.12);
  color: #8c5a00;
}

.status.error {
  background: rgba(193, 33, 66, 0.12);
  color: #9d2442;
}

.chat-stage {
  padding: 16px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 247, 255, 0.94)),
    var(--chat-well);
  border: 1px solid rgba(90, 79, 209, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.chat-list {
  min-height: 360px;
  max-height: 56vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 4px 14px;
}

.empty-state {
  padding: 36px 28px;
  border: 1px dashed rgba(90, 79, 209, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.8);
}

.empty-state h3 {
  margin: 0 0 10px;
  color: var(--text-strong);
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.message {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: fit-content;
  max-width: min(82%, 760px);
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(90, 79, 209, 0.08);
  box-shadow: 0 18px 40px rgba(30, 39, 84, 0.06);
}

.message.user {
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  background: linear-gradient(135deg, var(--user-bg), #344a8f);
  color: var(--user-text);
  border-color: rgba(255, 255, 255, 0.08);
  text-align: right;
}

.message.assistant {
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 246, 255, 0.98)),
    var(--assistant-bg);
}

.message.error {
  border-color: rgba(180, 35, 61, 0.16);
  background: rgba(255, 246, 248, 0.96);
}

.message.security-audit {
  width: 100%;
  max-width: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 255, 0.96)),
    var(--assistant-bg);
}

.message.points-report {
  width: 100%;
  max-width: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(245, 252, 248, 0.97)),
    var(--assistant-bg);
}

.message.points-exchange-detail {
  width: 100%;
  max-width: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 244, 255, 0.98)),
    var(--assistant-bg);
  border-color: rgba(90, 79, 209, 0.14);
}

.message-meta {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}

.message-body {
  white-space: pre-wrap;
  line-height: 1.85;
  word-break: break-word;
  font-size: 15px;
}

.message-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(90, 79, 209, 0.24);
  text-underline-offset: 3px;
}

.message-image-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(100%, 460px);
  margin: 10px 0;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(90, 79, 209, 0.12);
  box-shadow: 0 10px 24px rgba(30, 39, 84, 0.08);
}

.message-image-block.load-failed {
  background: rgba(255, 249, 237, 0.92);
  border-color: rgba(161, 97, 7, 0.18);
}

.message-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  object-fit: cover;
}

.message-link.image-link {
  font-size: 13px;
  text-decoration: none;
}

.replay-button,
.composer button,
.admin-actions button {
  border: 0;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

.replay-button {
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-strong);
  font-weight: 700;
}

.replay-button:hover,
.composer button:hover,
.admin-actions button:hover {
  transform: translateY(-1px);
}

.composer {
  margin-top: 8px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(90, 79, 209, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.composer textarea {
  width: 100%;
  resize: vertical;
  min-height: 110px;
  padding: 18px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(90, 79, 209, 0.12);
  background: rgba(248, 249, 255, 0.96);
  font: inherit;
  color: inherit;
  outline: none;
}

.composer textarea:focus {
  border-color: rgba(90, 79, 209, 0.38);
  box-shadow: 0 0 0 4px rgba(90, 79, 209, 0.08);
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
}

.composer-primary-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.composer button {
  min-width: 120px;
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.secondary-button {
  min-width: 120px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(28, 63, 96, 0.08);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.admin-actions button {
  min-width: 120px;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
}

.admin-actions button:not(.secondary-button) {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.admin-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.composer button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.voice-input-button {
  min-width: 126px;
  padding: 0 18px;
  text-align: center;
  touch-action: none;
}

.voice-input-button[data-listening="true"] {
  border-color: rgba(180, 35, 61, 0.28);
  background: rgba(180, 35, 61, 0.08);
  color: var(--danger);
  box-shadow:
    inset 0 0 0 1px rgba(180, 35, 61, 0.14),
    0 10px 20px rgba(180, 35, 61, 0.12);
}

.session-actions .primary-button,
.session-actions .secondary-button,
.session-actions .compact-link,
.session-actions .compact-button {
  min-width: auto;
  padding: 10px 16px;
  font-size: 14px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.audio-panel {
  margin-top: 22px;
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(243, 246, 255, 0.92)),
    rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(90, 79, 209, 0.08);
}

.audio-panel h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-strong);
}

.audio-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.audio-panel audio {
  width: min(360px, 100%);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 22px;
  padding: 16px 6px 0;
  color: rgba(29, 35, 64, 0.62);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.audit-overview {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: stretch;
  margin-top: 4px;
}

.audit-score {
  min-width: 128px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #163b5b, #1a5a6d);
  color: #f4fbff;
}

.audit-score-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

.audit-score strong {
  display: block;
  margin-top: 6px;
  font-size: 34px;
  line-height: 1;
}

.audit-overview-meta {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
}

.risk-pill,
.severity-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.risk-pill.ok,
.severity-pill.ok,
.metric-card.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.risk-pill.warn,
.severity-pill.warn,
.metric-card.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.risk-pill.danger,
.severity-pill.danger,
.metric-card.danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.risk-pill.neutral,
.severity-pill.neutral,
.metric-card.neutral {
  background: rgba(60, 85, 115, 0.08);
  color: var(--muted);
}

.metric-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(27, 36, 48, 0.08);
}

.metric-label {
  display: block;
  font-size: 12px;
  color: inherit;
  opacity: 0.85;
}

.metric-value {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.3;
}

.audit-summary {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(27, 36, 48, 0.08);
}

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

.chart-card,
.finding-section {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(27, 36, 48, 0.08);
}

.chart-card h4,
.finding-section h4 {
  margin: 0 0 12px;
  font-size: 16px;
}

.points-table-section {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(27, 36, 48, 0.08);
}

.points-table-section h4 {
  margin: 0 0 12px;
  font-size: 16px;
}

.points-insight-section {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(27, 36, 48, 0.08);
}

.points-insight-section h4 {
  margin: 0 0 12px;
  font-size: 16px;
}

.points-risk-section {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(27, 36, 48, 0.08);
}

.points-risk-section h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.points-risk-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.points-risk-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.points-risk-item {
  padding: 14px;
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.94);
  border: 1px solid rgba(27, 36, 48, 0.08);
}

.points-risk-item.warn {
  background: rgba(255, 248, 235, 0.96);
}

.points-risk-item.danger {
  background: rgba(255, 244, 246, 0.96);
}

.points-risk-header,
.points-risk-user,
.points-risk-actions,
.points-risk-title-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.points-risk-header {
  justify-content: space-between;
}

.points-risk-detail,
.points-risk-hint,
.points-risk-freeze-meta {
  margin: 10px 0 0;
  line-height: 1.7;
}

.points-risk-user,
.points-risk-freeze-meta,
.points-risk-feedback,
.points-risk-hint {
  color: var(--muted);
}

.points-risk-actions {
  margin-top: 12px;
  justify-content: space-between;
}

.points-risk-button {
  min-width: 120px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

.points-risk-button.freeze {
  background: linear-gradient(135deg, #b4233d, #8e1d32);
  color: #fff;
}

.points-risk-button.unfreeze {
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
}

.points-risk-button:hover {
  transform: translateY(-1px);
}

.points-risk-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.points-exchange-section {
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 255, 0.96)),
    rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(90, 79, 209, 0.12);
  box-shadow: 0 16px 34px rgba(37, 46, 92, 0.08);
}

.points-exchange-intro {
  margin-bottom: 16px;
}

.points-exchange-kicker {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(90, 79, 209, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.points-exchange-intro h4 {
  margin: 12px 0 8px;
  font-size: 20px;
  color: var(--text-strong);
}

.points-exchange-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.points-exchange-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.points-exchange-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 140px;
  padding: 18px 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(90, 79, 209, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(241, 245, 255, 0.96)),
    rgba(255, 255, 255, 0.98);
  color: var(--text-strong);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(41, 49, 97, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.points-exchange-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(90, 79, 209, 0.14), rgba(67, 54, 192, 0.08));
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.points-exchange-label {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
}

.points-exchange-summary {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.points-exchange-button:hover {
  transform: translateY(-1px);
  border-color: rgba(90, 79, 209, 0.3);
  box-shadow: 0 14px 28px rgba(41, 49, 97, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(238, 243, 255, 0.98)),
    rgba(255, 255, 255, 0.98);
}

.points-exchange-detail-card {
  margin-top: 14px;
  padding: 18px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 239, 255, 0.96)),
    rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(90, 79, 209, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.points-exchange-detail-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.points-exchange-detail-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(90, 79, 209, 0.18), rgba(67, 54, 192, 0.1));
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.points-exchange-detail-copy h4 {
  margin: 0;
  font-size: 20px;
  color: var(--text-strong);
}

.points-exchange-detail-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.points-exchange-detail-body {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(90, 79, 209, 0.08);
  color: var(--text);
  line-height: 1.85;
}

.points-insight-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.points-insight-item {
  padding: 14px;
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.92);
  border: 1px solid rgba(27, 36, 48, 0.08);
}

.points-insight-item.warn {
  background: rgba(255, 248, 235, 0.96);
}

.points-insight-item.danger {
  background: rgba(255, 244, 246, 0.96);
}

.points-insight-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.points-insight-item p {
  margin: 10px 0 0;
  line-height: 1.7;
}

.points-insight-meta,
.points-insight-hint {
  color: var(--muted);
}

.data-table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(27, 36, 48, 0.08);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table td.positive {
  color: var(--ok);
  font-weight: 700;
}

.data-table td.negative {
  color: var(--danger);
  font-weight: 700;
}

.chart-row {
  display: grid;
  grid-template-columns: 92px 1fr 42px;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.chart-label,
.chart-value {
  font-size: 13px;
  color: var(--muted);
}

.chart-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(27, 36, 48, 0.08);
}

.chart-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #1c6470, #2b87a2);
}

.finding-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.finding-item {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(27, 36, 48, 0.08);
}

.finding-item.ok {
  background: rgba(236, 250, 245, 0.9);
}

.finding-item.warn {
  background: rgba(255, 248, 235, 0.96);
}

.finding-item.danger {
  background: rgba(255, 244, 246, 0.96);
}

.finding-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.finding-item p {
  margin: 10px 0 0;
  line-height: 1.7;
}

.finding-recommendation {
  color: var(--muted);
}

.repair-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.repair-option {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(27, 36, 48, 0.08);
}

.repair-option-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.repair-mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.repair-mode.auto {
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
}

.repair-mode.manual {
  background: rgba(27, 36, 48, 0.08);
  color: var(--muted);
}

.repair-command {
  color: var(--muted);
  font-size: 13px;
}

.repair-command code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 780px) {
  .page-shell {
    width: min(980px, calc(100% - 20px));
    padding-top: 24px;
  }

  .site-header,
  .hero-panel,
  .auth-shell,
  .info-strip,
  .detail-grid,
  .chat-header,
  .audio-panel,
  .composer-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .hero-highlights,
  .metric-grid,
  .audit-charts {
    grid-template-columns: 1fr;
  }

  .points-exchange-actions {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    overflow-x: auto;
  }

  .site-nav,
  .session-actions,
  .session-user,
  .session-guest,
  .hero-actions,
  .chat-inline-highlights {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .audit-overview {
    flex-direction: column;
  }

  .chart-row {
    grid-template-columns: 80px 1fr 34px;
  }

  .message {
    max-width: 100%;
  }

  .hero-copy,
  .hero-figure,
  .auth-visual,
  .auth-card,
  .chat-card,
  .info-strip,
  .detail-panel {
    padding: 22px;
  }

  .chat-stage,
  .composer,
  .audio-panel {
    padding: 16px;
  }

  .points-exchange-section {
    padding: 16px;
  }

  .points-exchange-button {
    min-height: 128px;
    padding: 16px;
  }

  .points-exchange-label {
    font-size: 16px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 18px;
  }

  .mascot-stage {
    min-height: 240px;
  }
}
