/* Amaanat test day. Morning Letter look: cream paper, ink, walnut, a gold accent. Light only. */
:root {
  --bg: #f6f4f2;
  --surface: #ffffff;
  --ink: #211d19;
  --ink2: #3a332c;
  --muted: #5c554d;
  --line: #e2ddd6;
  --line-strong: #cfc8be;
  --walnut: #3b271b;
  --walnut-hover: #2c1d14;
  --gold: #a88a4e;
  --gold-tint: #f3eddf;
  --ok: #1f5e3a;
  --stop: #8e2f25;
  --radius: 8px;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums lining-nums;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--walnut);
  line-height: 1.2;
  margin: 0;
}
h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.6rem;
  margin-bottom: 12px;
}
h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}
h4 {
  font-size: 1.08rem;
  margin: 20px 0 6px;
}

p {
  margin: 0 0 12px;
}

a {
  color: var(--walnut);
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.top {
  padding: 28px 0 8px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.lede {
  color: var(--ink2);
  margin-top: 6px;
}
.who-bar {
  margin: 6px 0 0;
  color: var(--ink2);
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 8px 0 12px;
  font-size: 0.95rem;
}
.toc a {
  display: inline-block;
  padding: 8px 0;
}

main > section {
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}
main > section:last-child {
  border-bottom: 0;
}

.steps {
  margin: 0 0 12px;
  padding-left: 1.4em;
}
.steps li {
  margin: 0 0 8px;
  padding-left: 4px;
}
.steps b {
  font-weight: 700;
  color: var(--ink);
}

.note,
.hint,
.aside {
  color: var(--muted);
  font-size: 0.95rem;
}
.note {
  margin: 0 0 6px;
}
.hint {
  margin: 2px 0 8px;
}
.label {
  font-weight: 700;
}
.numbers {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}

/* Role switcher: three radios, panels shown by CSS. Works without JavaScript. */
.switch > input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  margin: 16px 0 4px;
}
.tabs label {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 600;
  color: var(--ink2);
  cursor: pointer;
  padding: 6px 4px;
  border-right: 1px solid var(--line-strong);
}
.tabs label:last-child {
  border-right: 0;
}
#role-seller:checked ~ .tabs label[for="role-seller"],
#role-buyer:checked ~ .tabs label[for="role-buyer"],
#role-new:checked ~ .tabs label[for="role-new"] {
  background: var(--walnut);
  color: #fff;
}
#role-seller:focus-visible ~ .tabs label[for="role-seller"],
#role-buyer:focus-visible ~ .tabs label[for="role-buyer"],
#role-new:focus-visible ~ .tabs label[for="role-new"] {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}
.panel {
  display: none;
}
#role-seller:checked ~ .panel-seller,
#role-buyer:checked ~ .panel-buyer,
#role-new:checked ~ .panel-new {
  display: block;
}

.files {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.files li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 12px;
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}
.files a {
  display: inline-block;
  padding: 10px 0;
  font-weight: 600;
}
.who {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Forms */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}
.field {
  margin: 0 0 16px;
}
label,
legend {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}
.optional {
  font-weight: 400;
  color: var(--muted);
}
input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  min-height: 48px;
}
textarea {
  resize: vertical;
}
input[readonly] {
  background: var(--bg);
  font-size: 0.9rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  color: var(--walnut);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}
.button:hover {
  border-color: var(--walnut);
}
.button.primary {
  background: var(--walnut);
  border-color: var(--walnut);
  color: #fff;
}
.button.primary:hover {
  background: var(--walnut-hover);
}
.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.linklike {
  background: none;
  border: 0;
  padding: 8px 0;
  font: inherit;
  color: var(--walnut);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.status {
  margin: 10px 0 0;
  min-height: 1.5em;
  font-size: 0.95rem;
  color: var(--ink2);
}
.status.ok {
  color: var(--ok);
}
.status.error {
  color: var(--stop);
}
.notice {
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

/* Review questions */
.qsection {
  padding: 24px 0 8px;
  border-top: 1px solid var(--line);
}
fieldset {
  border: 0;
  margin: 0 0 16px;
  padding: 0;
  min-width: 0;
}
.opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.opt {
  position: relative;
  margin: 0;
  font-weight: 400;
}
.opt input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.opt span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.opt input:checked + span {
  background: var(--walnut);
  border-color: var(--walnut);
  color: #fff;
  font-weight: 600;
}
.opt input:focus-visible + span {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.scale .opts {
  gap: 6px;
}
.scale .opt span {
  min-width: 44px;
  padding: 8px 6px;
}
.scale .opt.skip span {
  padding: 8px 12px;
  font-size: 0.95rem;
  color: var(--muted);
}
.scale .opt.skip input:checked + span {
  color: #fff;
}

.actions {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 8px 0 14px;
  margin-top: 16px;
}
.actions .status {
  margin: 0;
}

.foot {
  padding-top: 8px;
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Admin */
.admin section {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
}
th,
td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th[scope="row"] {
  font-weight: 400;
}
.num {
  text-align: right;
  white-space: nowrap;
}
.counts {
  list-style: none;
  margin: 0;
  padding: 0;
}
.counts li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
}
.notes {
  list-style: none;
  margin: 0;
  padding: 0;
}
.notes li {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 4px;
}
.pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.response {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 16px;
}
.response dl {
  margin: 8px 0 0;
}
.response dt {
  font-weight: 600;
  margin-top: 10px;
}
.response dd {
  margin: 2px 0 0;
}

@media (min-width: 720px) {
  h1 {
    font-size: 2.4rem;
  }
  .top {
    padding-top: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
