/* TradeBrief: one stylesheet for every page. No external fonts or images. */
:root {
  --ink: #1d232a;
  --muted: #55606b;
  --line: #d5dbe1;
  --bg: #f5f6f8;
  --card: #ffffff;
  --accent: #1f5f8b;
  --accent-ink: #ffffff;
  --warn-bg: #fff4d6;
  --warn-ink: #5e4200;
  --err-bg: #fde8e8;
  --err-ink: #8a1c1c;
  --ok-bg: #e5f5ea;
  --ok-ink: #1d5c33;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--accent); }
code { font-size: 0.95em; background: #eef1f4; padding: 0 0.25em; border-radius: 3px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1rem; }
.wrap.narrow { max-width: 720px; }

.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 3.25rem; }
.brand { font-weight: 700; text-decoration: none; color: var(--ink); font-size: 1.1rem; }
.site-header nav a { margin-left: 1rem; }

.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.25rem 0; color: var(--muted); font-size: 0.9rem; }

.hero { padding: 2rem 0 1rem; }
.hero h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); line-height: 1.2; margin: 0 0 0.5rem; }
.hero .sub { font-size: 1.1rem; color: var(--muted); margin: 0; max-width: 46rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1.25rem; margin: 1rem 0; }
.card h2 { margin-top: 0; font-size: 1.2rem; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .workspace { grid-template-columns: 1fr; } }

.field { margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.req, .opt { font-weight: 400; font-size: 0.8rem; color: var(--muted); margin-left: 0.25rem; }
.req { color: var(--err-ink); }
input[type="text"], input[type="email"], input[type="number"], textarea, select {
  width: 100%;
  font: inherit;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint { font-size: 0.85rem; color: var(--muted); margin: 0.25rem 0 0; }
.small { font-size: 0.85rem; color: var(--muted); }

.button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: #eef5fa; }
.button.primary { background: var(--accent); color: var(--accent-ink); }
.button.primary:hover { background: #184c70; }
.button.quiet { border-color: var(--line); color: var(--muted); }
.button[disabled] { opacity: 0.6; cursor: wait; }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 1rem 0 0.5rem; }
.toolbar h2 { margin: 0 auto 0 0; font-size: 1.2rem; }

.status { min-height: 1.5em; margin: 0.5rem 0; padding: 0.4rem 0.6rem; border-radius: 6px; font-size: 0.92rem; }
.status:empty { padding: 0; }
.status.ok { background: var(--ok-bg); color: var(--ok-ink); }
.status.error { background: var(--err-bg); color: var(--err-ink); }
.status.warn { background: var(--warn-bg); color: var(--warn-ink); }
.warning { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid #e8cf86; border-radius: 6px; padding: 0.6rem 0.75rem; font-weight: 600; }
.warning .small { font-weight: 400; color: var(--warn-ink); }

/* Brief preview: sized like a printed page's text area. */
.brief {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.6in 0.6in;
  font-size: 10pt;
  line-height: 1.3;
  min-height: 6in;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.brief-title { font-size: 16pt; margin: 0 0 0.6em; line-height: 1.2; }
.brief-section h2 { font-size: 11pt; margin: 0.9em 0 0.25em; text-transform: uppercase; letter-spacing: 0.03em; color: #2b3540; }
.brief-section p { margin: 0.2em 0; }
.brief-section ul { margin: 0.2em 0 0.2em 1.2em; padding: 0; }
.brief-section li { margin: 0.1em 0; }
.brief-footer { margin-top: 1.2em; font-size: 8.5pt; color: var(--muted); border-top: 1px solid var(--line); padding-top: 0.4em; }
.brief-blocked { color: var(--muted); }
.brief-errors { color: var(--err-ink); }

.unlock { border-color: var(--accent); }
.disclaimer { color: var(--muted); font-size: 0.9rem; margin-top: 1.5rem; }

/* Honeypot: off-screen for people, still in the form for bots. */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.file-list { list-style: none; padding: 0; }
.file-list li { padding: 0.4rem 0; border-bottom: 1px solid var(--line); }

.results { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; margin: 0; }
.results dt { font-weight: 600; }
.results dd { margin: 0; font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; color: var(--muted); }
.floor-label { font-weight: 700; background: var(--warn-bg); color: var(--warn-ink); padding: 0.5rem 0.7rem; border-radius: 6px; }

@page { size: auto; margin: 0.6in; }

@media print {
  .no-print, .site-header, .site-footer, .hero, form, .toolbar, .unlock, .disclaimer { display: none !important; }
  html, body { background: #fff; color: #000; }
  main.wrap, .workspace, .preview-col { display: block; max-width: none; margin: 0; padding: 0; }
  .brief {
    border: 0;
    box-shadow: none;
    padding: 0;
    min-height: 0;
    font-size: 10pt;
    line-height: 1.3;
  }
  .brief-section h2 { break-after: avoid; page-break-after: avoid; color: #000; }
  .brief-section li { break-inside: avoid; }
  .brief-footer { color: #333; }
  a { color: #000; text-decoration: none; }
  .print-page { display: block !important; }
}
