:root {
  --ink: #18232D;
  --ivory: #F7F4EE;
  --gold: #C5A46D;
  --terracotta: #B87862;
  --green: #718C7A;
  --gray: #5E6266;
  --white: #FFFFFF;
  --line: #DED8CE;
  --soft-gold: #EFE5D4;
  --soft-green: #E8EEE9;
  --soft-red: #F3E6E1;
  --danger: #955454;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--ivory);
  color: var(--ink);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

body {
  padding-bottom: 90px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;

  padding:
    calc(env(safe-area-inset-top) + 16px)
    20px
    14px;

  background: rgba(247,244,238,.96);

  border-bottom: 1px solid var(--line);
}

.eyebrow {
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
}

.brand {
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 700;
}

.status {
  padding: 7px 10px;
  border-radius: 999px;

  font-size: 11px;
  font-weight: 800;
}

.status.neutral {
  background: var(--soft-gold);
}

.status.good {
  background: var(--soft-green);
}

.status.warn {
  background: var(--soft-red);
  color: var(--danger);
}

#screen {
  max-width: 720px;
  margin: auto;

  padding: 24px 20px 40px;
}

.hero {
  padding: 18px 0 5px;
}

.hero h1 {
  margin: 5px 0 12px;

  font-family: Georgia, serif;
  font-size: 38px;
  line-height: 1.05;
}

.hero p {
  margin: 0;

  color: var(--gray);
  font-size: 17px;
  line-height: 1.55;
}

.card {
  margin: 16px 0;
  padding: 20px;

  background: var(--white);

  border: 1px solid var(--line);
  border-radius: 24px;

  box-shadow:
    0 10px 35px
    rgba(24,35,45,.08);
}

.card.accent {
  border-color: var(--gold);
}

.card h2 {
  margin: 0 0 10px;

  font-family: Georgia, serif;
  font-size: 25px;
}

.card p {
  color: var(--gray);
  line-height: 1.55;
}

.code {
  color: var(--gold);

  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
}

.module-title {
  margin: 4px 0;

  font-size: 17px;
  font-weight: 800;
}

.note {
  color: var(--gray);

  font-size: 13px;
  line-height: 1.5;
}

.field {
  margin: 14px 0;
}

.field label {
  display: block;

  margin-bottom: 7px;

  color: var(--gray);

  font-size: 12px;
  font-weight: 800;
}

.input,
.textarea {
  width: 100%;

  padding: 13px 14px;

  color: var(--ink);

  background: var(--ivory);

  border: 1px solid var(--line);
  border-radius: 14px;
}

.textarea {
  min-height: 120px;
}

.btn {
  width: 100%;
  min-height: 50px;

  margin-top: 10px;
  padding: 12px 16px;

  border: 0;
  border-radius: 16px;

  font-weight: 800;
}

.btn.primary {
  background: var(--ink);
  color: white;
}

.btn.secondary {
  background: var(--soft-gold);
  color: var(--ink);
}

.btn.danger {
  background: var(--danger);
  color: white;
}

.row {
  display: flex;

  justify-content: space-between;
  align-items: center;

  gap: 12px;
}

.session-grid {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 10px;

  margin-top: 14px;
}

.kpi {
  padding: 12px;

  background: var(--ivory);

  border-radius: 14px;
}

.kpi strong {
  display: block;

  font-size: 19px;
}

.kpi small {
  color: var(--gray);
}

.alert {
  margin-top: 12px;
  padding: 12px;

  border-radius: 14px;

  font-size: 13px;
}

.alert.ok {
  background: var(--soft-green);
}

.alert.error {
  background: var(--soft-red);
  color: var(--danger);
}

.nav {
  position: fixed;

  left: 0;
  right: 0;
  bottom: 0;

  z-index: 30;

  display: grid;

  grid-template-columns:
    repeat(5, 1fr);

  padding:
    8px
    6px
    calc(8px + env(safe-area-inset-bottom));

  background:
    rgba(255,255,255,.97);

  border-top:
    1px solid var(--line);
}

.nav button {
  display: flex;

  flex-direction: column;
  align-items: center;

  gap: 3px;

  padding: 6px 2px;

  color: var(--gray);

  background: transparent;

  border: 0;
}

.nav button.active {
  color: var(--ink);
}

.nav strong {
  font-size: 20px;
}

.nav span {
  font-size: 10px;
  font-weight: 700;
}

hr {
  border: 0;

  border-top:
    1px solid var(--line);

  margin: 18px 0;
}
