/* Plain styles; no external resources. Contrast: dark text on white, links and buttons above 4.5:1. */
body { font-family: system-ui, sans-serif; margin: 0; color: #1f2933; background: #fff; line-height: 1.55; }
header { display: flex; gap: 1rem; align-items: center; padding: .6rem 1rem; background: #0b3d2e; color: #fff; }
header .brand { color: #fff; font-weight: 700; text-decoration: none; margin-right: auto; }
header .who { font-size: .9rem; }
header .navlink { color: #fff; font-size: .9rem; }
main { max-width: 56rem; margin: 1.5rem auto; padding: 0 1rem; }
footer { max-width: 56rem; margin: 2rem auto; padding: 0 1rem; color: #52606d; font-size: .85rem; }
a { color: #0b5cab; }
h1, h2, h3 { line-height: 1.25; }
h2 { margin-top: 2rem; border-bottom: 1px solid #ddd; padding-bottom: .2rem; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { border: 1px solid #ccc; padding: .35rem .5rem; text-align: left; vertical-align: top; }
th { background: #f5f7fa; }
.stack { display: grid; gap: .8rem; max-width: 40rem; }
label { display: grid; gap: .25rem; font-weight: 600; }
input, select, textarea { font: inherit; padding: .45rem; border: 1px solid #7b8794; border-radius: 4px; min-height: 2.5rem; }
button { font: inherit; padding: .5rem 1rem; min-height: 2.5rem; background: #0b3d2e; color: #fff; border: 0; border-radius: 4px; cursor: pointer; }
button.link { background: none; color: #fff; text-decoration: underline; padding: 0; min-height: 0; }
form.inline { display: inline; }
.error { background: #fde8e8; border-left: 4px solid #b42318; padding: .6rem .8rem; }
.note { background: #f5f7fa; border-left: 4px solid #7b8794; padding: .6rem .8rem; }
.job { padding: .5rem .8rem; border-left: 4px solid #7b8794; background: #f5f7fa; }
.job.failed { border-color: #b42318; background: #fde8e8; }
.job.done { border-color: #1a7f37; }
.quote { white-space: pre-wrap; background: #f5f7fa; padding: .6rem .8rem; border-radius: 4px; }
.meta { color: #52606d; font-size: .9rem; }
.ref { font-family: ui-monospace, monospace; font-size: .85rem; color: #3e4c59; }
pre { white-space: pre-wrap; background: #f5f7fa; padding: .6rem .8rem; overflow-x: auto; font-size: .82rem; }

/* Step 2: decision boards */
.steps { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.steps a, .steps span { padding: .25rem .7rem; border: 1px solid #7b8794; border-radius: 1rem; font-size: .9rem; text-decoration: none; color: #1f2933; background: #fff; }
.steps .done { background: #e3f4e8; border-color: #1a7f37; }
.steps .now { border-color: #0b3d2e; font-weight: 700; }
.option { border: 1px solid #ccd2d9; border-left-width: 6px; border-radius: 4px; padding: .5rem .9rem; margin: .8rem 0; }
.option.accepted { border-left-color: #1a7f37; }
.option.rejected { border-left-color: #b42318; background: #fafafa; opacity: .85; }
.option.combined { border-left-color: #7b8794; background: #fafafa; }
.option.open { border-left-color: #b7791f; }
.option h4 { margin: .2rem 0 .4rem; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .05rem .5rem; border-radius: 1rem; background: #e4e7eb; color: #1f2933; vertical-align: middle; }
.badge.accepted { background: #d7f0df; color: #14532d; }
.badge.rejected { background: #fde8e8; color: #7a1c14; }
.badge.workbook { background: #e0ecff; color: #0b3b7a; }
.actions { display: flex; gap: .5rem; margin: .5rem 0; }
button.secondary { background: #fff; color: #1f2933; border: 1px solid #7b8794; }
button:disabled { opacity: .45; cursor: default; }
details { margin: .4rem 0; }
summary { cursor: pointer; font-weight: 600; }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
label.check input { min-height: 0; }
.refs { font-size: .9rem; }
@media print { header, footer, .noprint { display: none; } main { margin: 0; max-width: none; } body { font-size: 11pt; } a { color: #000; text-decoration: none; } }

/* Wide tables (link check) scroll inside their box and long addresses wrap, so the page itself never scrolls sideways. */
.scroll { overflow-x: auto; }
td.url { overflow-wrap: anywhere; }

/* Concept sketches (phase P4): a row of small figures; the delete button sits beside the caption. */
.sketches { display: flex; flex-wrap: wrap; gap: 1rem; margin: .5rem 0; }
.sketches figure, figure { margin: 0; max-width: 256px; }
figure img { max-width: 100%; height: auto; border: 1px solid #ccc; }
figcaption { font-size: .85em; color: #555; }
form.inline { display: inline; }

/* Main menu, dashboard cards, filters and page bar. */
header { flex-wrap: wrap; }
header nav { display: flex; flex: 1 1 0; min-width: 0; flex-wrap: wrap; gap: .2rem .9rem; align-items: center; }   /* the menu shrinks and wraps by itself, so the user box stays on the first row */
header .brand { margin-right: 1.5rem; }
header .userbox { margin-left: auto; display: flex; gap: .8rem; align-items: center; white-space: nowrap; }
header .navlink.on { text-decoration: underline; font-weight: 700; }
header .navsep { opacity: .5; }
header .count { display: inline-block; min-width: 1.2rem; padding: 0 .3rem; border-radius: 1rem; background: #f5c542; color: #1f2933; font-size: .75rem; font-weight: 700; text-align: center; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; margin: 1rem 0; }
.card { border: 1px solid #ccd2d9; border-radius: 6px; padding: .6rem 1rem; background: #fff; }
.card h2 { margin: .2rem 0 .4rem; font-size: 1.05rem; border: 0; }
.card ul { margin: .3rem 0; padding-left: 1.1rem; }
.stat { font-size: 1.8rem; font-weight: 700; margin: .1rem 0; }
.ok { color: #14532d; }
.warn { color: #7a4a00; font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: end; margin: .8rem 0; }
.filters label { display: flex; flex-direction: column; font-size: .9rem; }
.pager { display: flex; flex-wrap: wrap; gap: .3rem; margin: .8rem 0; }
.pager a, .pager .current, .pager .gap { padding: .15rem .6rem; border: 1px solid #ccd2d9; border-radius: 4px; text-decoration: none; }
.pager .current { background: #0b3d2e; color: #fff; border-color: #0b3d2e; }
.pager .gap { border-color: transparent; }

/* On a phone a wide table scrolls inside its own box instead of pushing the whole page sideways. */
@media (max-width: 700px) { main table { display: block; overflow-x: auto; max-width: 100%; } header .brand { margin-right: 0; } }

/* Waiting for a concept sketch: a shimmering canvas with strokes being drawn and a spinning ring, an indeterminate bar and a running clock.
   All motion stops for people who ask their system for reduced motion (the text still says what is happening). */
.sketch-wait { margin: 0; max-width: 256px; }
.sketch-canvas { position: relative; width: 256px; height: 256px; max-width: 100%; border: 1px dashed #7b8794; border-radius: 4px; overflow: hidden;
  background: linear-gradient(110deg, #eef1f4 30%, #fafbfc 50%, #eef1f4 70%); background-size: 200% 100%; animation: sketch-shimmer 1.8s linear infinite; }
.sketch-canvas .ring { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border: 4px solid #cbd2d9; border-top-color: #0b3d2e; border-radius: 50%;
  animation: sketch-spin .9s linear infinite; }
.sketch-canvas .stroke { position: absolute; left: 14%; height: 3px; border-radius: 2px; background: #9aa5b1; transform-origin: left center; transform: scaleX(0); animation: sketch-draw 2.6s ease-in-out infinite; }
.sketch-canvas .s1 { top: 26%; width: 70%; }
.sketch-canvas .s2 { top: 72%; width: 55%; animation-delay: .8s; }
.sketch-canvas .s3 { top: 84%; width: 40%; animation-delay: 1.6s; }
.sketch-bar { position: relative; height: 4px; margin-top: .3rem; border-radius: 2px; background: #e4e7eb; overflow: hidden; }
.sketch-bar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; background: #0b3d2e; border-radius: 2px; animation: sketch-slide 1.4s ease-in-out infinite; }
.sketch-wait .elapsed { font-variant-numeric: tabular-nums; color: #3e4c59; }
button.busy { position: relative; padding-left: 2.1rem; cursor: progress; }
button.busy::before { content: ""; position: absolute; left: .75rem; top: 50%; width: .9rem; height: .9rem; margin-top: -.45rem; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: sketch-spin .8s linear infinite; }
@keyframes sketch-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes sketch-spin { to { transform: rotate(360deg); } }
@keyframes sketch-draw { 0% { transform: scaleX(0); opacity: 1; } 55% { transform: scaleX(1); opacity: 1; } 85% { transform: scaleX(1); opacity: 0; } 100% { transform: scaleX(0); opacity: 0; } }
@keyframes sketch-slide { 0% { left: -35%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .sketch-canvas, .sketch-canvas .ring, .sketch-canvas .stroke, .sketch-bar::after, button.busy::before { animation: none; }
  .sketch-canvas .stroke { transform: scaleX(1); }
  .sketch-bar::after { width: 100%; opacity: .35; }
}
