:root {
  font: 16px/1.5 "Segoe UI", Arial, sans-serif;
  --ink: #132d2b;
  --muted: #435d5a;
  --accent: #14594f;
  --accent-dark: #0e463e;
  --wash: #dcebe5;
  --canvas: #edf2eb;
  --paper: #fcfdf9;
  --line: #c4d2c9;
  --error: #852f27;
  --error-fill: #fbefeb;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, input, textarea { font: inherit; }
button, .action { cursor: pointer; }
a { color: var(--accent-dark); }
:is(button, a, input, textarea):focus-visible { outline: 3px solid #197768; outline-offset: 3px; }
:disabled { cursor: wait; }
.layout {
  max-width: 1160px;
  margin: auto;
  padding: clamp(24px, 5vw, 56px) 32px max(34px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(250px, .75fr) minmax(0, 1.25fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}
.intro { padding-top: 21px; }
h1 {
  margin: 0 0 12px;
  font-size: clamp(2.6rem, 5vw, 4.65rem);
  line-height: 1.02;
  letter-spacing: -.06em;
  font-weight: 720;
}
.lead { color: var(--muted); font-size: 1.05rem; margin: 0; }
.tabs { margin-top: 31px; max-width: 330px; display: grid; gap: 5px; }
.tab {
  width: 100%;
  min-height: 43px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  text-align: start;
}
.tab::before {
  content: "";
  width: 11px;
  height: 11px;
  display: inline-block;
  margin-inline-end: 10px;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.tab[aria-current] { background: var(--wash); color: var(--ink); border-color: var(--line); font-weight: 650; }
.tab[aria-current]::before { background: var(--accent); box-shadow: inset 0 0 0 2px var(--wash); }
.tab:hover { border-color: var(--line); }
.frame {
  overflow: hidden;
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 16px 38px #1e3e3512;
}
.bot-head { background: var(--ink); color: white; display: flex; align-items: center; gap: 13px; padding: 15px 23px; }
.bot-head strong { display: block; font-size: 1rem; }
.bot-head small { display: block; color: #c2ded3; font-size: .8rem; direction: ltr; text-align: start; }
.mark { width: 42px; height: 42px; flex: none; position: relative; border: 1px solid #a7cbb7; border-radius: 8px; background: #254c43; }
.mark::before { content: ""; position: absolute; inset: 9px 10px 10px; border: 2px solid #d5efdc; border-radius: 3px 3px 0 0; }
.mark::after { content: ""; position: absolute; left: 16px; top: 16px; width: 3px; height: 3px; background: #d5efdc; box-shadow: 7px 0 #d5efdc, 0 6px #d5efdc, 7px 6px #d5efdc; }
.stage {
  min-height: 440px;
  padding: 27px 25px 24px;
  background-color: #e4eee6;
  background-image: repeating-linear-gradient(90deg, transparent, transparent 63px, #234a3510 63px, #234a3510 64px);
}
.screen, .status { max-width: 540px; margin-inline: auto; }
.message {
  border: 1px solid var(--line);
  border-start-start-radius: 4px;
  border-start-end-radius: 15px;
  border-end-start-radius: 15px;
  border-end-end-radius: 15px;
  background: var(--paper);
  padding: 19px 21px;
}
.packet + .packet { margin-top: 15px; }
.message h2 {
  margin: 0 0 9px;
  font-size: clamp(1.34rem, 3.1vw, 1.74rem);
  line-height: 1.19;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
.message h2:last-child { margin-bottom: 0; }
.message h2:focus { outline: none; }
.message p { margin: 0 0 9px; font-size: .94rem; white-space: pre-line; overflow-wrap: anywhere; }
.message p:last-child { margin-bottom: 0; }
.actions { display: grid; gap: 7px; margin-top: 9px; }
.row { display: flex; gap: 7px; }
.row > * { flex: 1; min-width: 0; }
.action {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: var(--paper);
  color: var(--accent-dark);
  font-size: .89rem;
  font-weight: 650;
  line-height: 1.25;
}
.action:hover { background: #f0f7f1; }
.action.primary { color: white; background: var(--accent); border-color: var(--accent); }
.action.primary:hover { background: var(--accent-dark); }
.action.compact { min-height: 42px; padding: 5px 10px; font-size: .8rem; }
.foot { border-top: 1px solid var(--line); font-size: .81rem; padding: 10px 23px; }
.foot a { color: var(--muted); text-underline-offset: .21em; }
.progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 10px; }
.progress span { height: 4px; background: var(--line); border-radius: 4px; }
.progress .done { background: var(--accent); }
.review { display: grid; margin: 0; }
.review-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  column-gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.review-row dt { color: var(--muted); font-size: .82rem; }
.review-row dd { grid-column: 1; margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.review-row .action { grid-column: 2; grid-row: 1 / span 2; }
.review-row .issue { grid-column: 1 / -1; margin-top: 5px; color: var(--error); font-size: .83rem; }
.status {
  margin-bottom: 9px;
  padding: 9px 11px;
  border-inline-start: 3px solid var(--error);
  border-radius: 5px;
  background: var(--error-fill);
  color: var(--error);
  font-size: .9rem;
}
.message .form-note {
  margin-top: 4px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .84rem;
}
.field { display: grid; gap: 6px; margin-top: 12px; }
.field label { font-size: .85rem; font-weight: 650; }
.field :is(input,textarea) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.field textarea { min-height: 108px; resize: vertical; }
.field .action { justify-self: stretch; }
.screen[aria-busy="true"] { opacity: .8; }

@media (max-width: 770px) {
  .layout { grid-template-columns: 1fr; gap: 17px; padding: max(14px, env(safe-area-inset-top)) 13px max(23px, env(safe-area-inset-bottom)); }
  .intro { padding-top: 0; }
  h1 { font-size: clamp(1.95rem, 7vw, 3rem); margin: 0 0 4px; }
  .lead { font-size: .88rem; }
  .tabs { display: flex; margin-top: 12px; max-width: none; }
  .tab { flex: 1; text-align: center; font-size: .79rem; padding: 5px 4px; line-height: 1.17; }
  .tab::before { display: none; }
  .stage { min-height: 340px; padding: 14px 11px 17px; }
  .bot-head { padding: 11px 13px; }
  .message { padding: 15px 14px; }
  .foot { padding: 8px 13px; }
}
@media (max-width: 345px) {
  .row { flex-wrap: wrap; }
  .row > * { min-width: 105px; }
}
