:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #637083;
  --line: #dce4ef;
  --blue: #2563eb;
  --cyan: #0891b2;
  --green: #15803d;
  --red: #dc2626;
  --amber: #b45309;
  --shadow: 0 18px 50px rgba(22, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  left: 0;
  padding: 14px 32px;
  position: sticky;
  right: 0;
  top: 0;
  z-index: 10;
}

.brand,
.nav,
.participant-chip {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand {
  font-weight: 800;
}

.brand-mark,
.module-icon {
  align-items: center;
  background: var(--ink);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.nav a {
  color: var(--muted);
  font-weight: 700;
}

.nav a:hover {
  color: var(--blue);
}

.participant-chip {
  background: #eef6ff;
  border: 1px solid #cfe4ff;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  padding: 8px 10px;
}

.participant-chip a {
  color: var(--blue);
}

.hero {
  display: grid;
  gap: 36px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  margin: 0 auto;
  max-width: 1180px;
  min-height: 520px;
  padding: 78px 32px 44px;
}

.hero-copy {
  align-self: center;
}

.eyebrow {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

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

h1 {
  font-size: 48px;
  line-height: 1.05;
  margin-bottom: 20px;
}

h2 {
  font-size: 28px;
}

p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.actions,
.answer-row,
.score-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button,
.case-button,
.icon-button {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.button {
  border-radius: 8px;
  display: inline-flex;
  justify-content: center;
  padding: 12px 18px;
}

.primary {
  background: var(--blue);
  color: #fff;
}

.ghost {
  background: #e8eef8;
  color: var(--ink);
}

.danger {
  background: #fee2e2;
  color: var(--red);
}

.safe {
  background: #dcfce7;
  color: var(--green);
}

.dashboard-preview,
.tool-panel,
.mail-panel,
.side-panel,
.question-card,
.summary {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dashboard-preview {
  align-self: center;
  display: grid;
  gap: 18px;
  min-height: 320px;
  padding: 28px;
}

.signal {
  border-radius: 999px;
  height: 16px;
  width: 16px;
}

.red {
  background: var(--red);
  box-shadow: 0 0 0 10px rgba(220, 38, 38, 0.1);
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.metric span {
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.metric strong {
  font-size: 24px;
}

.trace {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, 1fr);
  height: 90px;
}

.trace span {
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  border-radius: 6px 6px 0 0;
}

.trace span:nth-child(1) { height: 42%; }
.trace span:nth-child(2) { height: 75%; }
.trace span:nth-child(3) { height: 55%; }
.trace span:nth-child(4) { height: 90%; }

.section,
.page {
  margin: 0 auto;
  max-width: 1180px;
  padding: 36px 32px 56px;
}

.narrow {
  max-width: 780px;
}

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

.module-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 210px;
  padding: 22px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.module-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.module-card p {
  font-size: 15px;
}

.page-head {
  max-width: 760px;
}

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

.side-panel,
.mail-panel,
.tool-panel,
.summary {
  padding: 22px;
}

.side-panel h2 {
  font-size: 20px;
}

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

.case-button {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.case-button.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.case-button small {
  color: var(--muted);
  display: block;
  font-weight: 600;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.mail-header {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 16px;
}

.mail-header span,
.fake-link {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.fake-link {
  background: #eef6ff;
  border: 1px solid #cfe4ff;
  border-radius: 8px;
  margin: 18px 0;
  padding: 12px;
}

.result {
  border-radius: 8px;
  font-weight: 800;
  margin-top: 16px;
  padding: 14px;
}

.result.ok {
  background: #dcfce7;
  color: var(--green);
}

.result.bad {
  background: #fee2e2;
  color: var(--red);
}

.result.warn {
  background: #fef3c7;
  color: var(--amber);
}

.signal-list {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  padding-left: 20px;
}

.signal-list li + li {
  margin-top: 10px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span {
  color: var(--muted);
  font-weight: 800;
}

input[type="password"],
input[type="text"],
input[name="code"] {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 13px 14px;
  width: 100%;
}

.journal-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.journal-table {
  border-collapse: collapse;
  min-width: 820px;
  width: 100%;
}

.journal-table th,
.journal-table td {
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
  text-align: left;
}

.journal-table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.journal-table td {
  font-size: 17px;
}

.journal-table tr:last-child td {
  border-bottom: 0;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.strength {
  background: #e5e7eb;
  border-radius: 999px;
  height: 12px;
  margin: 8px 0 14px;
  overflow: hidden;
}

.strength div {
  background: var(--red);
  height: 100%;
  transition: width 0.18s ease, background 0.18s ease;
  width: 0;
}

.icon-button {
  background: #e8eef8;
  border-radius: 8px;
  color: var(--ink);
  height: 40px;
  width: 48px;
}

.quiz {
  display: grid;
  gap: 16px;
}

.question-card {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 20px;
}

.question-card legend {
  font-size: 18px;
  font-weight: 800;
  padding: 0 8px;
}

.question-card label {
  align-items: center;
  display: flex;
  gap: 10px;
}

.summary {
  margin-top: 22px;
}

.sms-toast {
  animation: toast-in 0.28s ease-out;
  background: #ffffff;
  border: 1px solid #bfdbfe;
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  bottom: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 16px 44px 16px 16px;
  position: fixed;
  right: 24px;
  z-index: 20;
}

.sms-toast.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sms-toast span,
.sms-toast small {
  color: var(--muted);
}

.sms-toast strong {
  font-size: 20px;
}

.sms-toast-close {
  align-items: center;
  background: #e8eef8;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font-size: 20px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 10px;
  top: 10px;
  width: 28px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 940px) {
  .hero,
  .workbench,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 38px;
  }
}

@media (max-width: 560px) {
  .topbar,
  .hero,
  .section,
  .page {
    padding-left: 18px;
    padding-right: 18px;
  }

  .nav {
    flex-wrap: wrap;
  }

  h1 {
    font-size: 32px;
  }

  .sms-toast {
    bottom: 16px;
    right: 16px;
  }
}
