:root {
  --blue: #b5c0d0;
  --green: #ccd3ca;
  --cream: #f5e8dd;
  --rose: #eed3d9;
  --ink: #38404c;
  --muted: #747b84;
  --surface: rgba(255, 252, 248, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(56, 64, 76, 0.14);
  --safe: #a8b8a5;
  --high: #d1b08f;
  --critical: #c78799;
  --risk-color: var(--safe);
  --shadow: 0 22px 48px rgba(74, 73, 84, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(181, 192, 208, 0.28), transparent 36%),
    linear-gradient(240deg, rgba(238, 211, 217, 0.34), transparent 38%),
    linear-gradient(180deg, #fffaf6 0%, var(--cream) 100%);
}

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

button {
  cursor: pointer;
}

.app-frame {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px;
}

.app-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 14px 0 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 6px;
  box-shadow: inset 0 0 0 1px var(--line);
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0;
  line-height: 1.05;
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  max-width: 820px;
}

h3 {
  font-size: 1.35rem;
}

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

.eyebrow,
.page-kicker {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.step-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.step-link,
.segment {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  font-weight: 800;
}

.step-link.is-active,
.segment.is-selected {
  color: var(--ink);
  background: var(--blue);
}

.icon-text-btn,
.primary-btn,
.secondary-btn {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 18px;
  font-weight: 800;
}

.primary-btn {
  color: var(--ink);
  background: var(--blue);
  border-color: rgba(56, 64, 76, 0.08);
}

.secondary-btn,
.icon-text-btn {
  color: var(--ink);
  background: var(--surface-strong);
}

.page {
  min-height: calc(100vh - 112px);
}

.page-intro {
  display: grid;
  gap: 14px;
  margin: 12px 0 28px;
}

.page-intro p {
  max-width: 660px;
  font-size: 1.04rem;
}

.surface,
.setup-panel,
.assistant-panel,
.activity-panel,
.codeword-actions {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.access-form {
  max-width: 760px;
  padding: 22px;
  border-radius: 8px;
}

.segmented {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  margin-bottom: 20px;
}

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

.field {
  display: grid;
  gap: 8px;
  color: #67594f;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(56, 64, 76, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  padding: 15px 16px;
  outline: 0;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(181, 192, 208, 0.32);
}

.otp-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: end;
  margin-top: 16px;
}

.notice {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(204, 211, 202, 0.42);
  color: var(--ink);
  font-weight: 700;
}

.form-footer {
  margin-top: 18px;
}

.setup-layout {
  display: grid;
  gap: 18px;
  padding-bottom: 90px;
}

.setup-panel {
  border-radius: 8px;
  padding: 22px;
}

.panel-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.setup-index {
  display: inline-flex;
  min-width: 38px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--green);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.codeword-panel {
  background: rgba(255, 250, 246, 0.88);
}

.codeword-field {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  color: #67594f;
  font-size: 1.05rem;
  font-weight: 700;
}

.codeword-field input {
  min-height: 82px;
  border-radius: 22px;
  font-size: 1.35rem;
  color: #686868;
  background: rgba(255, 255, 255, 0.78);
}

.codeword-field.green input {
  border-color: rgba(204, 211, 202, 0.9);
}

.codeword-field.yellow input {
  border-color: rgba(245, 232, 221, 1);
}

.codeword-field.red input {
  border-color: rgba(238, 211, 217, 1);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.contact-chip small {
  color: var(--muted);
}

.contact-chip button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: var(--rose);
  color: var(--ink);
}

.address-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: end;
}

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

.trigger-level {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.trigger-level legend {
  padding: 0 6px;
  font-weight: 900;
}

.trigger-level label {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
  color: var(--muted);
}

.trigger-level input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.sticky-actions {
  position: sticky;
  bottom: 18px;
  display: flex;
  justify-content: flex-end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(18px);
}

.aria-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin: 12px 0 24px;
}

.aria-hero h2 {
  font-size: clamp(4rem, 14vw, 9rem);
}

.aria-status {
  min-width: 164px;
  border-radius: 8px;
  padding: 16px;
  background: var(--risk-color);
  color: var(--ink);
}

.aria-status span {
  display: block;
  font-weight: 900;
}

.aria-status strong {
  display: block;
  font-size: 3rem;
  line-height: 1;
}

.aria-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.assistant-panel,
.activity-panel,
.codeword-actions {
  border-radius: 8px;
  padding: 22px;
}

.assistant-orb {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--blue), var(--rose));
  margin-bottom: 20px;
}

.assistant-orb img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.call-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.codeword-actions {
  display: grid;
  gap: 12px;
}

.codeword-action {
  min-height: 100px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  text-align: left;
  color: var(--ink);
}

.codeword-action span,
.codeword-action strong {
  display: block;
}

.codeword-action span {
  font-weight: 900;
}

.codeword-action strong {
  margin-top: 8px;
  font-size: 1.1rem;
}

.codeword-action.green {
  background: rgba(204, 211, 202, 0.64);
}

.codeword-action.yellow {
  background: rgba(245, 232, 221, 0.82);
}

.codeword-action.red {
  background: rgba(238, 211, 217, 0.82);
}

.activity-panel {
  grid-column: 1 / -1;
}

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

.activity-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.activity-item p {
  margin-top: 4px;
}

.activity-item time,
.empty-text {
  color: var(--muted);
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100vw - 44px));
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--ink);
  background: var(--blue);
  box-shadow: var(--shadow);
  font-weight: 900;
  z-index: 20;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .app-header,
  .aria-hero {
    grid-template-columns: 1fr;
    display: grid;
  }

  .step-nav {
    overflow-x: auto;
    justify-content: start;
  }

  .field-grid,
  .otp-row,
  .address-grid,
  .trigger-levels,
  .aria-layout {
    grid-template-columns: 1fr;
  }

  .location-btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .app-frame {
    padding: 16px;
  }

  h2 {
    font-size: 2.4rem;
  }

  .brand-logo {
    width: 52px;
    height: 52px;
  }

  .codeword-field input {
    min-height: 72px;
    font-size: 1.14rem;
  }

  .activity-item {
    grid-template-columns: 1fr;
  }
}
