/* Hallmark · pre-emit critique: P5 H5 E5 S5 R5 V5
 * genre: playful · macrostructure: Workbench · design-system: design.md · designed-as-app
 * theme: custom brand blue + teal on warm ivory · display: high-contrast serif · body: IBM Plex Sans
 * nav: N1b adapted brand lockup · footer: Ft2 inline legal colophon · context: user-approved visual direction
 * contrast: pass (40–41) · slop: pass (42–45) · honest: pass (46) · chrome: pass (47)
 * tokens: pass (48) · responsive/mobile: pass (34, 49, 50–57) · icons: pass (30)
 */
@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=IBM+Plex+Sans:wght@400;500;600&family=Noto+Serif+SC:wght@600;700&display=swap");
@import url("tokens.css");

:root {
  --cream: #f5f0e1;
  --cream-deep: #efe7d3;
  --surface: #fbf7ec;
  --surface-soft: #f3ecda;
  --sand: #d4c4a8;
  --terracotta: #c67b5c;
  --clay: #b5651d;
  --olive: #6b7b3c;
  --ink: #3e3226;
  --muted: #7a6a57;
  --line: #e5dac7;
  --amber: #c47a1f;
  --red: #c1503f;
  --green: #6b7b3c;
  --grad: linear-gradient(135deg, #c67b5c 0%, #a85a30 100%);
  --grad-soft: linear-gradient(135deg, rgba(198, 123, 92, 0.14), rgba(107, 123, 60, 0.1));
  --shadow-sm: 0 2px 10px rgba(102, 74, 48, 0.08);
  --shadow: 0 18px 42px rgba(102, 74, 48, 0.16);
  --radius: 20px;
  --radius-sm: 13px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(40rem 30rem at 10% -8%, rgba(198, 123, 92, 0.18), transparent 60%),
    radial-gradient(34rem 28rem at 104% 10%, rgba(212, 196, 168, 0.4), transparent 58%),
    radial-gradient(30rem 26rem at 50% 114%, rgba(107, 123, 60, 0.12), transparent 55%),
    var(--cream);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.app-shell {
  position: relative;
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 108px;
}

.app-shell.is-welcome {
  display: grid;
  align-content: center;
  padding-bottom: 18px;
}

.app-shell.is-welcome .topbar,
.app-shell.is-welcome .bottom-nav {
  display: none;
}

@media (min-width: 520px) {
  .app-shell {
    min-height: calc(100vh - 32px);
    margin: 16px auto;
  }
}

.topbar,
.section-heading,
.hero-panel,
.report-score,
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  gap: 10px;
  margin-bottom: 18px;
}

.topbar > div {
  flex: 1;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: Georgia, "Songti SC", "Noto Serif SC", "SimSun", serif;
  font-weight: 700;
}

h1 {
  margin-bottom: 0;
  font-size: 26px;
  letter-spacing: 0.01em;
}

h2 {
  margin-bottom: 8px;
  font-size: 27px;
  letter-spacing: 0;
}

h2 small {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

h3 {
  margin-bottom: 10px;
  font-size: 16.5px;
}

.icon-button,
.back-button,
.text-button,
.bottom-nav button,
.quick-prompts button {
  border: 0;
  background: transparent;
}

.icon-button,
.back-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-weight: 800;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.icon-button:active,
.back-button:active {
  transform: scale(0.94);
}

.icon-button {
  color: var(--amber);
}

.back-button {
  color: var(--terracotta);
  font-size: 26px;
  line-height: 1;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: view-in 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.welcome-view.active {
  display: grid;
  min-height: calc(100vh - 36px);
  align-items: center;
}

.demo-view.active {
  display: grid;
  min-height: calc(100vh - 36px);
  align-content: center;
  gap: 18px;
}

.demo-header {
  text-align: center;
}

.demo-header h2 {
  margin-bottom: 8px;
  font-size: 23px;
  line-height: 1.3;
}

.demo-header p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.welcome-card {
  display: grid;
  gap: 22px;
  padding: 30px 22px 24px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.brand-lockup {
  display: grid;
  justify-items: center;
}

.brand-logo {
  display: block;
  width: 100%;
  max-height: 118px;
  height: auto;
  border-radius: 18px;
  background: #fffdf7;
  object-fit: contain;
  box-shadow: var(--shadow-sm);
}

.welcome-copy h2 {
  margin-bottom: 10px;
  font-size: 25px;
  line-height: 1.3;
  text-align: center;
}

.welcome-copy .eyebrow {
  text-align: center;
}

.welcome-copy p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
}

.welcome-actions {
  display: grid;
  gap: 9px;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.how-steps li {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
}

.how-steps li span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--grad);
  font-size: 12px;
  box-shadow: 0 4px 10px rgba(168, 90, 48, 0.3);
}

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

.welcome-stats div {
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 10px 6px;
  border-radius: 16px;
  background: var(--grad-soft);
}

.welcome-stats strong {
  font-size: 18px;
  line-height: 1.1;
  background: linear-gradient(120deg, var(--terracotta), var(--clay));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.welcome-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.trust-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trust-chips li {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.demo-phone {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.demo-top,
.demo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demo-top span {
  color: var(--ink);
  font-weight: 900;
}

.demo-top strong,
.demo-score em,
.demo-row b {
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
}

.demo-top strong {
  padding: 4px 10px;
  color: var(--terracotta);
  background: #f7e9de;
  font-weight: 800;
}

.demo-score {
  padding: 20px;
  border-radius: 18px;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 14px 30px rgba(168, 90, 48, 0.32);
}

.demo-score span,
.demo-score strong,
.demo-score em {
  display: block;
}

.demo-score span {
  color: #f6dfd1;
  font-size: 12px;
  font-weight: 700;
}

.demo-score strong {
  margin: 8px 0;
  font-size: 46px;
  line-height: 1;
}

.demo-score em {
  width: max-content;
  padding: 5px 10px;
  color: #fff3ea;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 800;
}

.demo-bars {
  display: grid;
  gap: 8px;
}

.demo-bars i {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--terracotta), var(--olive));
  opacity: 0.85;
}

.demo-row {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.demo-row span {
  color: var(--muted);
  font-size: 13px;
}

.demo-row b {
  padding: 4px 9px;
  color: var(--terracotta);
  background: #f7e9de;
  font-weight: 800;
}

.secondary-button,
.quiet-button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 18px;
  color: var(--muted);
  background: var(--surface);
  font-weight: 800;
  transition: transform 0.15s ease, border-color 0.2s ease, color 0.2s ease;
}

.secondary-button:hover,
.quiet-button:hover {
  border-color: var(--sand);
  color: var(--ink);
}

.secondary-button:active,
.quiet-button:active {
  transform: scale(0.98);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 158px;
  padding: 22px 20px;
  border-radius: 24px;
  background:
    radial-gradient(16rem 12rem at 88% -20%, rgba(255, 255, 255, 0.24), transparent 60%),
    linear-gradient(140deg, #c67b5c 0%, #9c5228 100%);
  color: #fff;
  box-shadow: 0 18px 38px rgba(156, 82, 40, 0.3);
}

.hero-panel::before,
.hero-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-panel::before {
  top: -42px;
  right: -38px;
  width: 130px;
  height: 130px;
  background: rgba(255, 255, 255, 0.12);
}

.hero-panel::after {
  right: 34px;
  bottom: -54px;
  width: 96px;
  height: 96px;
  background: rgba(107, 123, 60, 0.25);
}

.hero-panel > div:first-child,
.hero-panel .score-ring {
  position: relative;
  z-index: 1;
}

.hero-panel .eyebrow {
  color: #f3d9c9;
}

.hero-panel h2 {
  margin-bottom: 2px;
  font-size: 34px;
  line-height: 1.15;
}

.risk-label {
  display: inline-flex;
  margin: 8px 0 0;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 13px;
  font-weight: 700;
}

.risk-label.good {
  color: #d7e8b3;
}

.risk-label.warn {
  color: #ffe3b0;
}

.risk-label.danger {
  color: #ffd0c8;
}

.score-ring {
  display: grid;
  width: 100px;
  height: 100px;
  place-items: center;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.1);
  transition: background 0.5s ease;
}

.score-ring span {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 50%;
  background: rgba(74, 38, 16, 0.45);
  font-size: 26px;
  font-weight: 800;
}

.card,
.chat-card,
.plan-card {
  margin-top: 14px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.section-heading h3,
.report-score p {
  margin-bottom: 0;
}

.text-button {
  color: var(--terracotta);
  font-size: 13px;
  font-weight: 800;
}

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

.metric-grid div {
  padding: 13px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.metric-grid span,
.report-score span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.metric-grid strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.wide-soft-button {
  width: 100%;
  min-height: 50px;
  margin-top: 14px;
  border: 1px solid var(--sand);
  border-radius: 14px;
  color: var(--clay);
  background: var(--surface-soft);
  font-weight: 800;
  transition: transform 0.15s ease, background 0.2s ease;
}

.wide-soft-button:active {
  transform: scale(0.985);
  background: #ece2cb;
}

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

.buffer-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.buffer-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14.5px;
}

.buffer-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.status-pill {
  align-self: start;
  min-width: 58px;
  padding: 5px 9px;
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.ok {
  color: var(--olive);
  background: rgba(107, 123, 60, 0.14);
}

.status-pill.watch {
  color: var(--amber);
  background: rgba(196, 122, 31, 0.14);
}

.status-pill.risk {
  color: var(--red);
  background: rgba(193, 80, 63, 0.13);
}

.action-card ul,
.plain-list {
  margin: 0;
  padding-left: 19px;
  color: var(--muted);
  line-height: 1.75;
}

.page-title {
  margin: 4px 0 14px;
}

.page-title p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.65;
}

.page-title.compact h2 {
  margin-bottom: 0;
}

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

.form-group {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
}

.form-group legend {
  padding: 0 8px;
  color: var(--clay);
  font-size: 13px;
  font-weight: 800;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

label small {
  color: #94836c;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
}

select:invalid {
  color: var(--muted);
}

select option {
  color: var(--ink);
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 13px;
  background: #fffdf7;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(198, 123, 92, 0.18);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

.form-privacy-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.primary-button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  padding: 0 20px;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 12px 26px rgba(168, 90, 48, 0.28);
  font-weight: 800;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.primary-button:hover {
  filter: brightness(1.05);
}

.primary-button:active {
  transform: scale(0.97);
  box-shadow: 0 7px 16px rgba(168, 90, 48, 0.22);
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.compliance-card {
  border-color: #e5cda6;
  background: #fbf3e3;
}

.compliance-card p {
  margin: 6px 0 0;
  color: #7a541b;
  font-size: 13px;
  line-height: 1.65;
}

.ai-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-color: var(--sand);
  background: #f6efdd;
}

.ai-status p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.ai-status span {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--terracotta);
  background: #f7e9de;
  font-size: 12px;
  font-weight: 800;
}

.ai-status span.ok {
  color: var(--olive);
  background: rgba(107, 123, 60, 0.14);
}

.ai-status span.error {
  color: var(--red);
  background: rgba(193, 80, 63, 0.13);
}

.ai-status span.pending {
  color: var(--muted);
  background: var(--surface-soft);
}

.ai-settings {
  padding: 0;
  overflow: hidden;
}

.ai-settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 17px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.ai-settings summary::-webkit-details-marker {
  display: none;
}

.ai-settings summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.ai-settings[open] summary::after {
  transform: rotate(-135deg);
}

.ai-settings .settings-tip {
  margin: 0;
  padding: 0 17px 13px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
  border-bottom: 1px solid var(--line);
}

.ai-settings .settings-tip code {
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--clay);
  font-size: 11px;
}

.ai-config-form {
  display: grid;
  gap: 13px;
  padding: 16px 17px 17px;
}

.radio-line {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.radio-line input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  accent-color: var(--terracotta);
}

.ai-config-actions {
  display: grid;
  gap: 8px;
}

.ai-config-actions .primary-button {
  width: 100%;
}

.ai-config-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ai-config-actions .quiet-button {
  min-height: 48px;
}

.settings-status {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.settings-status.ok {
  color: var(--clay);
}

.settings-status.error {
  color: var(--red);
}

.model-badge {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.quick-prompts {
  display: flex;
  gap: 8px;
  margin: 14px 0;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.quick-prompts::-webkit-scrollbar {
  display: none;
}

.quick-prompts button {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.quick-prompts button:active {
  transform: scale(0.96);
  border-color: var(--sand);
  background: #f7e9de;
}

.chat-card {
  display: grid;
  align-content: start;
  min-height: 330px;
  max-height: 48vh;
  overflow-y: auto;
  gap: 11px;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 17px;
  line-height: 1.6;
  font-size: 14px;
  animation: msg-in 0.22s ease both;
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.message.agent {
  border-bottom-left-radius: 5px;
  background: var(--surface-soft);
}

.message.agent::before {
  content: "AI";
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--grad);
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(168, 90, 48, 0.28);
}

.message.is-typing {
  color: var(--muted);
  animation: typing-pulse 1.1s ease-in-out infinite;
}

@keyframes typing-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.message.user {
  justify-self: end;
  border-bottom-right-radius: 5px;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 20px rgba(168, 90, 48, 0.26);
}

.chat-input {
  position: sticky;
  bottom: 90px;
  display: grid;
  grid-template-columns: 1fr 78px;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 2px 0;
  background: linear-gradient(180deg, rgba(245, 240, 225, 0), #f5f0e1 40%);
}

.report-score strong {
  font-size: 38px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.report-score {
  background:
    radial-gradient(12rem 8rem at 100% 0%, rgba(198, 123, 92, 0.12), transparent 60%),
    var(--surface);
}

.report-locked {
  display: grid;
  gap: 12px;
  text-align: center;
  padding: 28px 20px;
}

.report-locked h3,
.report-locked p {
  margin-bottom: 0;
}

.report-locked p {
  color: var(--muted);
  line-height: 1.7;
}

.lock-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--amber);
  background: rgba(196, 122, 31, 0.14);
  font-size: 25px;
  font-weight: 900;
}

.plans {
  display: grid;
  gap: 13px;
}

.free-tier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px dashed var(--sand);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.free-tier strong {
  font-size: 14px;
}

.free-tier p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.free-tier span {
  flex: 0 0 auto;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--terracotta);
  background: #f7e9de;
  font-size: 13px;
  font-weight: 800;
}

.plan-card {
  position: relative;
  padding: 20px 18px;
}

.plan-card > span {
  display: inline-flex;
  margin-bottom: 9px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--terracotta);
  font-size: 12px;
  font-weight: 800;
}

.plan-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 3px 0 11px;
}

.plan-price strong {
  color: var(--ink);
  font-size: 32px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.plan-price em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.plan-year {
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 700;
}

.plan-card small {
  display: block;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px dashed var(--sand);
  color: var(--clay);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.plan-card.featured {
  border: 1px solid transparent;
  background:
    linear-gradient(#fbf7ec, #fbf7ec) padding-box,
    linear-gradient(135deg, #c67b5c, #6b7b3c) border-box;
  box-shadow: 0 16px 34px rgba(156, 82, 40, 0.16);
}

.plan-badge {
  position: absolute;
  top: -11px;
  right: 16px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 6px 14px rgba(168, 90, 48, 0.32);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.plan-badge-pro {
  background: linear-gradient(135deg, #8a6d3b, #6b7b3c);
  box-shadow: 0 6px 14px rgba(107, 123, 60, 0.3);
}

.plans-note {
  margin: 14px 4px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.bottom-nav {
  position: fixed;
  right: 50%;
  bottom: 16px;
  width: min(calc(100% - 28px), 448px);
  transform: translateX(50%);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(251, 247, 236, 0.96);
  box-shadow: var(--shadow);
}

.bottom-nav button {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
  place-items: center;
  padding: 8px 4px;
  border-radius: 15px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.bottom-nav button:active {
  transform: scale(0.94);
}

.bottom-nav button svg {
  width: 21px;
  height: 21px;
}

.bottom-nav button.active {
  color: var(--terracotta);
  background: #f7e9de;
}

@media (max-width: 360px) {
  .app-shell {
    padding-inline: 12px;
  }

  .hero-panel {
    padding: 17px 16px;
  }

  .score-ring {
    width: 84px;
    height: 84px;
  }

  .score-ring span {
    width: 60px;
    height: 60px;
  }

  .welcome-copy h2 {
    font-size: 23px;
  }

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

  .bottom-nav button {
    font-size: 10.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .view.active,
  .message {
    animation: none;
  }
}

/* Approved landing · Workbench */
html,
body {
  overflow-x: clip;
}

.app-shell.is-welcome {
  display: block;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
}

.app-shell.is-welcome .welcome-view.active {
  display: block;
  min-height: 100vh;
  animation: none;
  transform: none;
}

.landing-nav {
  position: sticky;
  z-index: var(--z-sticky-nav);
  top: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: var(--space-2xl);
  padding-inline: var(--page-gutter);
  border-bottom: var(--rule-hair) solid var(--color-rule-2);
  background: var(--color-paper);
}

.landing-brand,
.landing-nav-links button,
.landing-demo-link {
  border: 0;
  background: transparent;
  color: var(--color-ink);
  white-space: nowrap;
}

.landing-brand {
  display: inline-flex;
  width: min(16rem, 100%);
  align-items: center;
  justify-self: start;
  padding: 0;
}

.landing-brand img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.landing-nav-links button,
.landing-demo-link {
  min-height: 2.75rem;
  padding-inline: var(--space-md);
  border-radius: var(--radius-pill);
  font-weight: 600;
  transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}

.landing-demo-link {
  justify-self: end;
  background: var(--color-paper-2);
}

.landing-brand:focus-visible,
.landing-nav-links button:focus-visible,
.landing-demo-link:focus-visible,
.landing-primary:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.landing-brand:active,
.landing-nav-links button:active,
.landing-demo-link:active,
.landing-primary:active {
  transform: translateY(1px);
}

.landing-brand:disabled,
.landing-nav-links button:disabled,
.landing-demo-link:disabled,
.landing-primary:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.landing-shell {
  width: min(100%, var(--page-max));
  margin-inline: auto;
  padding: var(--space-xl) var(--page-gutter) var(--space-4xl);
}

.landing-hero {
  display: grid;
  gap: var(--space-xl);
}

.landing-copy {
  align-self: center;
  min-width: 0;
}

.landing-context {
  margin: 0 0 var(--space-md);
  color: var(--color-accent-deep);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.landing-copy h1 {
  max-width: 10ch;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.landing-lede {
  max-width: 30rem;
  margin: var(--space-lg) 0;
  color: var(--color-ink-2);
  font-size: var(--text-md);
  line-height: 1.65;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
}

.landing-actions > span {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.landing-primary {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding-inline: var(--space-lg);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-family: var(--font-body);
  font-weight: 600;
  transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
  white-space: nowrap;
}

.landing-dashboard {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: var(--space-lg);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-card);
  background: var(--color-paper-2);
  box-shadow: 0 1.25rem 3rem -2rem var(--color-shadow);
}

.landing-dashboard-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
}

.landing-dashboard-top p {
  margin: 0 0 var(--space-lg);
  color: var(--color-accent-deep);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.landing-dashboard-top h2 {
  margin: 0;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.landing-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  color: var(--color-accent-deep);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}

.landing-status::before {
  width: var(--space-xs);
  height: var(--space-xs);
  border-radius: var(--radius-pill);
  background: var(--color-accent-deep);
  content: "";
}

.landing-score {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-lg);
  margin-block: var(--space-xl);
}

.landing-score-ring {
  position: relative;
  display: grid;
  width: 7.25rem;
  height: 7.25rem;
  place-items: center;
  border-radius: var(--radius-pill);
  background: conic-gradient(var(--color-accent) 0 76%, var(--color-rule) 76% 100%);
}

.landing-score-ring::after {
  position: absolute;
  inset: var(--space-sm);
  border-radius: var(--radius-pill);
  background: var(--color-paper-2);
  content: "";
}

.landing-score-ring strong {
  position: relative;
  z-index: 1;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
}

.landing-score > div:last-child strong,
.landing-score > div:last-child span {
  display: block;
}

.landing-score > div:last-child strong {
  color: var(--color-ink);
  font-size: var(--text-md);
}

.landing-score > div:last-child span {
  margin-top: var(--space-xs);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.landing-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
}

.landing-metrics > div {
  min-width: 0;
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--color-paper);
}

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

.landing-metrics span {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.landing-metrics strong {
  margin-top: var(--space-xs);
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.landing-dashboard figcaption {
  margin-top: var(--space-md);
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.landing-sticky-cta {
  position: fixed;
  z-index: var(--z-sticky);
  right: var(--space-xl);
  bottom: var(--space-md);
  display: flex;
  min-width: 28rem;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-xs);
  padding-left: var(--space-md);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-pill);
  background: var(--color-paper);
  color: var(--color-ink-2);
  font-size: var(--text-sm);
}

@media (hover: hover) and (pointer: fine) {
  .landing-nav-links button:hover,
  .landing-demo-link:hover {
    background: var(--color-paper-3);
  }

  .landing-primary:hover {
    background: var(--color-accent-deep);
  }

  .landing-dashboard {
    transition: transform var(--dur-short) var(--ease-out);
  }

  .landing-dashboard:hover {
    transform: translateY(-2px);
  }
}

@media (min-width: 60rem) {
  .landing-hero {
    grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
    align-items: center;
    gap: var(--space-2xl);
    min-height: 42rem;
  }

  .landing-dashboard {
    padding: var(--space-xl);
  }
}

@media (max-width: 59.99rem) {
  .landing-nav {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .landing-nav-links {
    display: none;
  }

  .landing-shell {
    padding-top: var(--space-xl);
  }
}

@media (max-width: 39.99rem) {
  .landing-nav {
    min-height: var(--space-2xl);
  }

  .landing-brand {
    width: 10.5rem;
  }

  .landing-demo-link {
    padding-inline: var(--space-md);
  }

  .landing-shell {
    padding-bottom: var(--space-3xl);
  }

  .landing-dashboard {
    padding: var(--space-lg);
  }

  .landing-score-ring {
    width: 6.5rem;
    height: 6.5rem;
  }

  .landing-metrics {
    overflow: hidden;
  }

  .landing-metrics > div {
    padding: var(--space-sm);
  }

  .landing-sticky-cta {
    right: var(--space-md);
    left: var(--space-md);
    min-width: 0;
  }
}

@media (max-width: 22.5rem) {
  .landing-brand {
    width: 9.25rem;
  }

  .landing-demo-link {
    padding-inline: var(--space-sm);
    font-size: var(--text-sm);
  }

  .landing-score {
    gap: var(--space-md);
  }

  .landing-score-ring {
    width: 5.75rem;
    height: 5.75rem;
  }

  .landing-sticky-cta span {
    display: none;
  }

  .landing-sticky-cta {
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-brand,
  .landing-nav-links button,
  .landing-demo-link,
  .landing-primary,
  .landing-dashboard {
    transition-duration: 150ms !important;
  }
}

/* Hallmark · responsive application workbench
 * Mobile keeps the original single-column flow. Tablet expands the reading
 * measure; desktop promotes each product view into a task-appropriate grid.
 */
@media (min-width: 48rem) {
  .app-shell:not(.is-welcome) {
    width: min(calc(100% - (var(--space-xl) * 2)), 46rem);
    min-height: calc(100vh - (var(--space-xl) * 2));
    margin: var(--space-xl) auto;
    padding: var(--space-lg) var(--space-xl) var(--space-3xl);
  }

  .app-shell:not(.is-welcome) .topbar {
    margin-bottom: var(--space-xl);
  }

  .app-shell:not(.is-welcome) .report-locked {
    max-width: 40rem;
    margin: var(--space-xl) auto 0;
  }

  .app-shell:not(.is-welcome) .bottom-nav {
    bottom: var(--space-lg);
    width: min(calc(100% - (var(--space-xl) * 2)), 42rem);
  }
}

@media (min-width: 60rem) {
  .app-shell:not(.is-welcome) {
    width: min(calc(100% - (var(--space-xl) * 2)), 74rem);
  }

  .app-shell:not(.is-welcome) .page-title:not(.compact) {
    max-width: 42rem;
  }

  #home-content:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
    gap: var(--space-lg);
    align-items: start;
  }

  #home-content > * {
    min-width: 0;
    margin-top: 0;
  }

  #home-content .hero-panel,
  #home-content .wide-soft-button {
    grid-column: 1 / -1;
  }

  #home-content .card {
    height: auto;
  }

  #profile .form-card {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-lg);
    align-items: start;
    padding: var(--space-lg);
  }

  #profile .form-group {
    height: 100%;
  }

  #profile .form-card > .primary-button,
  #profile .form-card > .form-privacy-note {
    grid-column: 1 / -1;
  }

  #profile .form-card > .primary-button {
    width: min(100%, 24rem);
    justify-self: center;
  }

  #agent.view.active {
    display: grid;
    grid-template-columns: minmax(18rem, 0.72fr) minmax(0, 1.28fr);
    grid-template-areas:
      "title title"
      "boundary chat"
      "status chat"
      "settings chat"
      "prompts chat"
      "badge chat"
      ". input";
    gap: var(--space-md) var(--space-lg);
    align-items: start;
  }

  #agent > * {
    min-width: 0;
    margin: 0;
  }

  #agent .page-title {
    grid-area: title;
  }

  #agent .compliance-card {
    grid-area: boundary;
  }

  #agent .ai-status {
    grid-area: status;
  }

  #agent .ai-settings {
    grid-area: settings;
  }

  #agent .quick-prompts {
    grid-area: prompts;
    flex-wrap: wrap;
    overflow: visible;
  }

  #agent .model-badge {
    grid-area: badge;
  }

  #agent .chat-card {
    grid-area: chat;
    min-height: clamp(24rem, 52vh, 36rem);
    max-height: 64vh;
  }

  #agent .chat-input {
    position: static;
    grid-area: input;
    padding-top: 0;
    background: transparent;
  }

  #report-content:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--space-lg);
    align-items: stretch;
  }

  #report-content > * {
    min-width: 0;
    height: 100%;
    margin-top: 0;
  }

  #report-content > :nth-child(1) {
    grid-column: 1 / -1;
  }

  #report-content > :nth-child(2) {
    grid-column: 1 / span 5;
  }

  #report-content > :nth-child(3) {
    grid-column: 6 / -1;
    grid-row: 2 / span 2;
  }

  #report-content > :nth-child(4) {
    grid-column: 1 / span 5;
  }

  #subscription .plans {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-lg);
    align-items: stretch;
  }

  #subscription .plan-card {
    height: 100%;
    margin-top: 0;
  }

  .app-shell:not(.is-welcome) .bottom-nav {
    width: min(calc(100% - (var(--space-xl) * 2)), 52rem);
    padding: var(--space-xs);
  }

  .app-shell:not(.is-welcome) .bottom-nav button {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
  }
}

/* Hallmark · chat-message readability · preserve intentional response rhythm */
.message.agent {
  white-space: pre-line;
}

/* Hallmark · approved disclosure layer · restrained, token-bound, responsive */
.ai-generated-note {
  margin: calc(var(--space-xs) * -1) 0 var(--space-sm);
  color: var(--color-ink-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.chat-input {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-sm);
  bottom: calc(90px + var(--space-sm));
}

.chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-xs);
}

.chat-compose .primary-button {
  min-width: 4.875rem;
  white-space: nowrap;
}

.chat-consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-xs);
  align-items: start;
  color: var(--color-ink-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.5;
  cursor: pointer;
}

.chat-consent input {
  width: 1.125rem;
  height: 1.125rem;
  min-height: 0;
  margin: var(--space-3xs) 0 0;
  accent-color: var(--color-accent);
}

.chat-consent input:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.legal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs) var(--space-md);
  width: min(100%, var(--page-max));
  margin: var(--space-2xl) auto 0;
  padding: var(--space-lg) var(--page-gutter) calc(var(--space-3xl) + var(--space-lg));
  border-top: var(--rule-hair) solid var(--color-rule);
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}

.legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs) var(--space-md);
}

.legal-footer a,
.legal-back,
.legal-contact {
  color: var(--color-ink-2);
  text-decoration-color: var(--color-rule);
  text-underline-offset: var(--space-2xs);
  white-space: nowrap;
}

.legal-footer a:focus-visible,
.legal-back:focus-visible,
.legal-contact:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@media (hover: hover) and (pointer: fine) {
  .legal-footer a:hover,
  .legal-back:hover,
  .legal-contact:hover {
    color: var(--color-accent-deep);
  }
}

.legal-page {
  min-height: 100dvh;
  overflow-x: clip;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
}

.legal-page main {
  width: min(100%, 52rem);
  margin-inline: auto;
  padding: var(--space-xl) var(--page-gutter) var(--space-3xl);
}

.legal-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
  border-bottom: var(--rule-hair) solid var(--color-rule);
}

.legal-brand {
  display: block;
  width: min(15rem, 72vw);
}

.legal-brand img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

.legal-document {
  padding-top: var(--space-2xl);
}

.legal-document h1,
.legal-document h2 {
  overflow-wrap: anywhere;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.legal-document h1 {
  margin: 0;
  font-size: clamp(2.35rem, 8vw, 4.5rem);
  line-height: 1.06;
}

.legal-document h2 {
  margin: var(--space-xl) 0 var(--space-sm);
  font-size: var(--text-xl);
}

.legal-meta,
.legal-document p,
.legal-document li {
  max-width: 68ch;
  color: var(--color-ink-2);
  font-size: var(--text-base);
  line-height: 1.7;
}

.legal-meta {
  margin: var(--space-md) 0 0;
  color: var(--color-muted);
}

.legal-document ul {
  display: grid;
  gap: var(--space-xs);
  padding-inline-start: var(--space-lg);
}

.legal-callout {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-card);
  background: var(--color-paper-2);
  color: var(--color-ink-2);
}

.legal-end {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: var(--rule-hair) solid var(--color-rule);
}

@media (min-width: 40rem) {
  .legal-footer {
    justify-content: space-between;
  }
}
