:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --panel: #111111;
  --panel-raised: #1a1a1a;
  --line: #34302a;
  --text: #ddd7cd;
  --muted: #a9a197;
  --accent: #ff8a00;
  --accent-soft: #2a1b0a;
  font-family: Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
button, input { font: inherit; }
button { cursor: pointer; }
.shell { width: min(100% - 48px, 1040px); margin: 0 auto; }
.topbar { border-bottom: 1px solid #2a2a2a; background: #000; }
.topbar-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { position: relative; display: block; flex: none; width: 220px; height: 62px; overflow: hidden; }
.brand img { position: absolute; top: 50%; left: 50%; display: block; width: 280px; max-width: none; height: auto; transform: translate(-50%, -50%); }
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.topbar-note, .eyebrow, .field-label, .panel-head, .upload-action, .journal-os, .form-footer, .metric-label, .category-title small, th, .results-head small, .results-head a, .roll-settings summary, .copy, .recipes summary, .footer { font-size: 11px; font-weight: 600; letter-spacing: .065em; }
.topbar-note { color: #b0a69a; white-space: nowrap; }
.topbar-note span, .eyebrow span, .footer span { color: var(--accent); padding: 0 8px; }
main.shell { padding-top: 45px; padding-bottom: 88px; }
.intro { margin-bottom: 27px; }
.eyebrow { color: var(--accent); }
h1 { margin: 7px 0 8px; font-size: clamp(30px, 4vw, 39px); font-weight: 600; line-height: 1.12; letter-spacing: -.025em; }
.intro p { max-width: 630px; margin: 0; color: var(--muted); font-size: 14px; }
.planner { border: 1px solid var(--line); background: var(--panel); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 39px; padding: 0 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel-raised); color: var(--accent); }
.panel-head:first-child { border-top: 0; }
.panel-head > span:last-child { color: #928a80; }
.panel-head small { margin-left: 11px; color: #928a80; font-size: 10px; font-weight: 400; }
.form-section { padding: 22px 24px 24px; }
.field-label { display: block; margin-bottom: 9px; color: #bdb3a8; }
.url-input { display: block; width: 100%; height: 46px; padding: 0 14px; border: 1px solid #514538; border-radius: 0; outline: 0; background: #0b0b0b; color: var(--text); }
.url-input::placeholder { color: #77716b; }
.url-input:focus, .roll-grid input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.field-help { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.upload { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; padding: 12px 15px; border: 1px dashed #65513b; background: #0c0c0c; cursor: pointer; }
.upload:hover, .upload:focus-within { border-color: var(--accent); background: #16120e; }
.upload-text { display: block; min-width: 0; }
.upload strong { display: block; font-size: 14px; font-weight: 600; }
.upload small { display: block; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.upload-action { flex: none; padding: 8px 10px; border: 1px solid #6d4b25; color: var(--accent); }
.upload-action span { margin-left: 10px; }
#journal-files { position: absolute; width: 1px; height: 1px; opacity: 0; }
.journal-location { display: grid; grid-template-columns: 1fr; gap: 4px; margin-top: 14px; padding: 0 0 0 12px; border-left: 2px solid #75501f; }
.journal-os { color: var(--muted); font-size: 10px; }
.journal-location code { color: #d5b587; font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
.roll-settings { border-top: 1px solid var(--line); padding: 0 24px; }
.roll-settings summary { display: flex; align-items: center; gap: 12px; min-height: 48px; color: var(--text); list-style: none; cursor: pointer; }
.roll-settings summary::-webkit-details-marker { display: none; }
.roll-settings summary::before { content: '+'; color: var(--accent); font-size: 19px; font-weight: 400; line-height: 1; }
.roll-settings[open] summary::before { content: '−'; }
.roll-settings summary span { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 400; }
.roll-settings p { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.auto-roll-toggle { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 15px; color: var(--text); font-size: 11px; font-weight: 600; letter-spacing: .04em; cursor: pointer; }
.auto-roll-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.roll-grid { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 18px; }
.roll-grid label { display: flex; align-items: center; gap: 8px; padding-left: 9px; border: 1px solid #44403b; color: var(--muted); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.roll-grid input { width: 45px; height: 34px; border: 0; border-left: 1px solid #44403b; border-radius: 0; outline: 0; background: #0c0c0c; color: var(--text); text-align: center; }
.roll-grid label.inactive { border-color: #302e2a; color: #77716b; opacity: .45; }
.roll-grid label.auto-controlled { opacity: .58; }
.roll-grid input:disabled { color: #827d76; cursor: not-allowed; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 65px; padding: 10px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.form-footer button { display: inline-flex; align-items: center; justify-content: space-between; gap: 23px; min-width: 148px; height: 40px; padding: 0 13px; border: 1px solid var(--accent); border-radius: 0; background: var(--accent); color: #17100a; font-size: 11px; font-weight: 700; letter-spacing: .07em; }
.form-footer button:hover { background: #ff9c24; }
.form-footer button:disabled { opacity: .6; cursor: wait; }
.form-footer button span { font-size: 17px; font-weight: 400; }
.message { margin-top: 18px; padding: 13px 16px; border: 1px solid #a45540; background: #251613; color: #ffc8b7; }
.results { margin-top: 52px; }
.results-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding-bottom: 14px; border-bottom: 2px solid var(--accent); }
.results-head small { color: var(--accent); }
.results-head h2 { margin: 4px 0 0; font-size: clamp(24px, 3vw, 30px); font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.results-head a { padding-bottom: 4px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.results-head a:hover { text-decoration: underline; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0 17px; border: 1px solid var(--line); background: var(--panel); }
.metric { min-height: 79px; padding: 13px 17px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.metric strong { font: 600 26px Arial, Helvetica, sans-serif; }
.metric strong.accent { color: var(--accent); }
.result-note { margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.access-alert { margin: 0 0 20px; padding: 16px 18px 13px; border: 1px solid #8d4d48; border-left: 3px solid #e57b72; background: #211615; box-shadow: 0 0 0 0 rgba(229, 123, 114, .2); animation: access-pulse 2.8s ease-in-out infinite; }
.access-heading { display: flex; align-items: flex-start; gap: 12px; }
.access-icon { display: grid; flex: none; place-items: center; width: 25px; height: 25px; border: 1px solid #e57b72; border-radius: 50%; color: #ffaea5; font-size: 16px; font-weight: 700; line-height: 1; }
.access-heading strong { color: #ffaea5; font-size: 12px; letter-spacing: .06em; }
.access-heading p, .access-foot { margin: 4px 0 0; color: #d1aca7; font-size: 12px; }
.access-alert ul { margin: 14px 0 0; padding: 0; list-style: none; }
.access-alert li { display: grid; grid-template-columns: minmax(140px, 210px) 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid #553331; }
.access-module strong, .access-module span { display: block; }
.access-module strong { color: #f1d5d0; font-size: 12px; }
.access-module span { color: #c49d98; font-size: 11px; }
.access-engineers { display: flex; flex-wrap: wrap; gap: 7px 14px; }
.access-engineers > span { display: inline-flex; flex-direction: column; }
.access-engineers a { color: #ffb3a9; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }
.access-engineers small { color: #c49d98; font-size: 10px; }
.access-foot { margin-top: 10px; }
@keyframes access-pulse { 50% { box-shadow: 0 0 0 5px rgba(229, 123, 114, .11); } }
.category { margin-top: 12px; border: 1px solid var(--line); background: var(--panel); }
.category-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 39px; padding: 0 14px; border-bottom: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--panel-raised); }
.category-title h3 { margin: 0; color: var(--accent); font-size: 13px; font-weight: 600; }
.category-title small { color: var(--muted); font-size: 10px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 13px; border-bottom: 1px solid #292622; text-align: left; }
th { background: #151515; color: #bdb2a6; font-size: 10px; }
td { font-size: 12px; }
tbody tr:nth-child(even) { background: #16130f; }
tbody tr:hover { background: var(--accent-soft); }
tbody tr:last-child td { border-bottom: 0; }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.need { color: var(--accent); font-weight: 700; }
.grade { margin-left: 8px; padding: 1px 4px; border: 1px solid #4b4137; color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.empty { padding: 15px; color: var(--muted); font-size: 12px; }
.results-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.copy { padding: 9px 12px; border: 1px solid #80613d; border-radius: 0; background: transparent; color: var(--accent); }
.copy:hover { border-color: var(--accent); background: var(--accent-soft); }
.recipes { margin-top: 25px; border-top: 1px solid var(--line); }
.recipes summary { padding-top: 16px; color: var(--muted); cursor: pointer; }
.recipes summary span { margin-left: 5px; color: var(--accent); }
.recipes-list { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; }
.tag { padding: 5px 7px; border: 1px solid #43382d; color: #cfc3b6; background: #15120e; font-size: 11px; }
.tag strong { font-weight: 600; }
.tag small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.tag-blocked { border-color: #8d4d48; background: #211615; }
.tag-blocked small { color: #ffaea5; }
.footer { padding: 20px 0; border-top: 1px solid #292929; color: #807b74; font-size: 10px; }
@media (prefers-reduced-motion: reduce) { .access-alert { animation: none; } }
@media (max-width: 700px) {
  .shell { width: min(100% - 28px, 1040px); }
  .topbar-inner { min-height: 62px; }
  .topbar-note { display: none; }
  main.shell { padding-top: 32px; padding-bottom: 58px; }
  .intro p { font-size: 13px; }
  .panel-head, .form-section, .roll-settings, .form-footer { padding-left: 15px; padding-right: 15px; }
  .upload-action { display: none; }
  .form-footer > span { display: none; }
  .form-footer button { width: 100%; }
  .results { margin-top: 39px; }
  .results-head { display: block; }
  .results-head a { display: inline-block; margin-top: 9px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  th, td { padding: 8px 9px; }
  .result-note { font-size: 11px; }
  .access-alert li { grid-template-columns: 1fr; gap: 5px; }
}
