/* Shared styles for the application, recommendation and admin pages.
   Palette matches the landing page. */
:root {
  --ink: #12272e;
  --muted: #56696f;
  --teal: #22355c;
  --teal-dark: #16233f;
  --accent: #c8a55a;
  --paper: #fbf9f4;
  --card: #ffffff;
  --line: #ddd6c6;
  --error: #a4281b;
  --ok: #1d6b45;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1180px; }
[hidden] { display: none !important; }

header.top { background: var(--teal-dark); color: #fff; padding: 20px 0 26px; border-bottom: 4px solid var(--accent); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: #fff; text-decoration: none; }
.brand svg { width: 28px; height: 28px; flex: none; }
header.top h1 {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-weight: 500; font-size: clamp(28px, 5vw, 40px); line-height: 1.1; margin: 22px 0 6px;
}
header.top p { margin: 0; color: #cfe0e3; }

main { padding: 28px 0 60px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px 24px; margin-bottom: 20px;
}
.card h2 {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-weight: 500; font-size: 25px; line-height: 1.2; margin: 0 0 6px;
}
.card h3 { font-size: 17px; margin: 22px 0 8px; }
.card > p, .hint { margin: 0 0 16px; color: var(--muted); }
.hint { font-size: 14.5px; margin: 6px 0 0; }
.prompt {
  margin: 0 0 14px; padding: 14px 16px; background: #f3efe6;
  border-left: 3px solid var(--accent); border-radius: 6px; color: var(--ink);
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.full { grid-column: 1 / -1; }
label, .label { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 6px; }
label .opt { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%; font: inherit; color: inherit; background: #fff;
  border: 1px solid #b9c3c4; border-radius: 9px; padding: 11px 12px;
}
textarea { min-height: 110px; resize: vertical; }
textarea.tall { min-height: 300px; }
input[type="checkbox"], input[type="radio"] { width: auto; margin: 0 8px 0 0; }
input:disabled, select:disabled, textarea:disabled { background: #f1f3f2; color: #3d4f55; }
.check { display: flex; align-items: flex-start; gap: 4px; font-weight: 400; font-size: 16px; margin: 12px 0; }
.check input { margin-top: 5px; flex: none; }
.count { font-size: 13.5px; color: var(--muted); text-align: right; margin-top: 4px; }
.count.over { color: var(--error); font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: inline-block; cursor: pointer; background: var(--accent); color: #16233f;
  font: inherit; font-weight: 650; text-decoration: none; border: 0; border-radius: 10px; padding: 12px 22px;
}
.btn:hover { filter: brightness(1.06); }
.btn.quiet { background: #fff; color: var(--teal); border: 1px solid var(--teal); padding: 9px 16px; font-weight: 600; }
.btn.small { padding: 7px 12px; font-size: 14.5px; }
.btn[disabled] { opacity: .6; cursor: default; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid #e6c98a; outline-offset: 2px;
}
.actions { margin-top: 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.status { font-size: 15px; color: var(--error); min-height: 1.4em; }
.status.ok { color: var(--ok); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--teal); text-decoration: underline; cursor: pointer; }

.banner { border-radius: 12px; padding: 16px 18px; margin-bottom: 20px; border: 1px solid; }
.banner.ok { background: #e9f5ee; border-color: #b5d9c4; }
.banner.warn { background: #fdf1e7; border-color: #f0c9a6; }
.banner h2 { margin: 0 0 4px; font-size: 20px; font-family: inherit; font-weight: 700; }
.banner p { margin: 0; }
.missing { margin: 8px 0 0; padding-left: 20px; }
.missing li { margin: 2px 0; }

.pill { display: inline-block; font-size: 13px; font-weight: 650; border-radius: 999px; padding: 2px 10px; background: #e8ecec; color: #33474d; white-space: nowrap; }
.pill.started { background: #ececec; color: #555; }
.pill.submitted, .pill.requested { background: #fdebd9; color: #8a4208; }
.pill.complete, .pill.received { background: #dff1e6; color: #17603c; }
.pill.decided { background: #dde8f6; color: #1c4a80; }

.savebar {
  position: sticky; bottom: 0; background: rgba(246, 244, 239, .96); border-top: 1px solid var(--line);
  padding: 10px 0; font-size: 14.5px; color: var(--muted); z-index: 5;
}
.savebar .wrap { display: flex; justify-content: space-between; gap: 12px; align-items: center; }

.activity { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; }

footer { border-top: 1px solid var(--line); padding: 22px 0 36px; color: var(--muted); font-size: 14px; text-align: center; }

/* admin */
.tablewrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list th, table.list td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover { background: #f3f6f6; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; padding: 8px 10px; }
.toolbar .spacer { flex: 1; }
dl.facts { display: grid; grid-template-columns: 190px 1fr; gap: 6px 14px; margin: 0; font-size: 15.5px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.longtext { white-space: pre-wrap; overflow-wrap: anywhere; background: #f8faf9; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 0 0 4px; }
.note { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; margin: 0 0 12px; white-space: pre-wrap; }
.note small { color: var(--muted); display: block; }

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .card { padding: 22px 16px; }
  dl.facts { grid-template-columns: 1fr; gap: 0; }
  dl.facts dd { margin-bottom: 10px; }
}
