/* Charcoal / copper, aligned with the restaurant report reference. Layout and native controls only; business actions live in pilot.js. */
:root {
  color-scheme: dark;
  --bg: #111110;
  --panel: #191917;
  --raised: #21211e;
  --input: #151514;
  --text: #f0eee7;
  --muted: #b0afa4;
  --gold: #ed945d;
  --gold-dark: #cf7845;
  --line: #353530;
  --soft-line: #2b2b27;
  --good: #77c59d;
  --bad: #f48080;
  --warn: #edb478;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { min-width: 0; scroll-padding: 24px; background: var(--bg); }
body {
  margin: 0;
  min-width: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: var(--gold); text-underline-offset: 4px; }
a:hover { color: #f4b68e; }
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  max-width: 100%;
  padding: 10px 17px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--raised);
  font-weight: 500;
  line-height: 1.45;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
button:hover { background: #2a2a26; border-color: #77705b; }
button:active { background: #32322c; }
button:disabled { opacity: .46; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
button.primary, .primary { background: var(--gold); border-color: var(--gold); color: #211810; font-weight: 650; }
button.primary:hover, .primary:hover { background: #f3ab7d; border-color: #f3ab7d; color: #211810; }
button.primary:active { background: #d77f48; }
button.danger { color: var(--bad); border-color: #745143; background: #362820; }
button.danger:hover { background: #473027; border-color: #ab7665; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.35; letter-spacing: -.025em; font-weight: 600; }
h1 { font-size: clamp(28px, 3.5vw, 44px); margin-bottom: 10px; }
h2 { font-size: 22px; margin-bottom: 14px; }
h3 { font-size: 17px; margin-bottom: 12px; }
h4 { font-size: 15px; }
p:last-child { margin-bottom: 0; }
small, .small { font-size: 12px; line-height: 1.6; }
.muted { color: var(--muted); }
.eyebrow { color: var(--gold); font-size: 11px; font-weight: 650; letter-spacing: .12em; margin-bottom: 8px; }
.full { width: 100%; }
.shell { min-height: 100dvh; }
.topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
  min-height: 76px;
  padding: 20px max(28px, calc((100vw - 1280px) / 2));
  border-bottom: 1px solid var(--line);
  background: #111110;
}
.brand { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; gap: 19px; color: var(--text); text-decoration: none; }
.brand img {
  display: block;
  width: 100px;
  max-width: 100%;
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
  filter: invert(1);
  mix-blend-mode: screen;
}
.product-name { padding-left: 19px; border-left: 1px solid #353530; font-size: 15px; font-weight: 550; letter-spacing: .06em; }
.product-name small { display: block; color: var(--muted); font-weight: 400; font-size: 10px; letter-spacing: .08em; }
.nav { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
.nav button, .nav a { border-color: transparent; background: transparent; color: var(--muted); text-decoration: none; padding: 9px 13px; border-radius: 8px; }
.nav button:hover, .nav a:hover { color: var(--text); background: #21211e; }
.nav button.active, .nav a.active, .nav [aria-current="page"] { color: var(--gold); border-color: #6e4b34; background: #282019; }
.account { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-left: auto; min-width: 0; color: var(--muted); font-size: 12px; }
.account button { min-height: 34px; padding: 7px 11px; font-size: 12px; }
.workspace { width: min(1280px, calc(100% - 56px)); margin: 0 auto; padding: 52px 0 72px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 26px; }
.page-head > div { min-width: 0; }
.page-head p { color: var(--muted); max-width: 700px; margin-bottom: 0; }
.card { min-width: 0; padding: 26px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: none; }
.card > :last-child { margin-bottom: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 20px; min-width: 0; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid > * { min-width: 0; }
.grid > .card { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 0; margin-bottom: 40px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { min-width: 0; padding: 24px 28px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--muted); }
.stat b, .stat strong { display: block; font-size: 44px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.3; color: var(--text); margin: 6px 0; }
.stat span, .stat label { color: var(--muted); font-size: 12px; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; }
.spread { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; min-width: 0; }
.row > *, .spread > * { min-width: 0; }
form label, .fieldgrid label { display: block; color: #ddd7c9; font-size: 13px; margin-bottom: 14px; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-top: 7px;
  padding: 12px 13px;
  border: 1px solid #45453f;
  border-radius: 9px;
  background: var(--input);
  color: var(--text);
  line-height: 1.5;
}
select { min-height: 46px; padding-right: 30px; }
select option { color: var(--text); background: var(--panel); }
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #8d8c81; opacity: 1; }
input:disabled, select:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; accent-color: var(--gold); flex-shrink: 0; vertical-align: middle; }
input[type="file"] { font-size: 12px; padding: 8px; overflow: hidden; }
input::file-selector-button { padding: 8px 10px; margin-right: 10px; border: 1px solid #68604b; border-radius: 6px; background: #353225; color: var(--gold); cursor: pointer; }
.fieldgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; }
.fieldgrid .full { grid-column: 1 / -1; }
.note, .warning, .error, .success { padding: 14px 17px; margin: 16px 0; border: 1px solid; border-radius: 9px; line-height: 1.7; font-size: 13px; }
.note { background: #29291f; border-color: #514d39; color: #d6cbb1; }
.warning { background: #342e1e; border-color: #6f5b31; color: var(--warn); }
.error { background: #392821; border-color: #755044; color: var(--bad); }
.success { background: #263022; border-color: #526346; color: var(--good); }
.tablewrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 11px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th, td { padding: 15px 16px; border-bottom: 1px solid var(--soft-line); vertical-align: top; }
th { white-space: nowrap; color: #c4b99f; background: #21211e; font-size: 12px; font-weight: 500; }
td { min-width: 88px; color: #e0dccf; }
td button { min-height: 34px; padding: 7px 11px; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #ffffff03; }
.survey-steps { display: flex; gap: 8px; max-width: 100%; overflow-x: auto; padding: 2px 1px 16px; margin-bottom: 12px; scrollbar-width: thin; scrollbar-color: #6a614b transparent; }
.survey-steps button { flex: 0 0 auto; white-space: nowrap; color: var(--muted); background: #191917; font-size: 12px; padding: 10px 14px; }
.survey-steps button b { margin-right: 7px; }
.survey-steps button.active { color: #231f16; border-color: var(--gold); background: var(--gold); font-weight: 650; }
.survey-controls { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 16px 0 max(16px, env(safe-area-inset-bottom)); margin-top: 20px; border-top: 1px solid var(--line); background: #191917f5; }
/* SurveyCore injects its base styles with each render. These scoped selectors override them. */
.sv-root { min-width: 0; color: var(--text); }
.sv-root .sv-banner { color: #d9cfb9; background: #2a291e; border: 1px solid #514b35; border-radius: 11px; padding: 16px 18px; font-size: 13px; line-height: 1.8; }
.sv-root .sv-question { border-bottom: 1px solid var(--line); padding: 26px 0; scroll-margin-top: 24px; }
.sv-root .sv-question h3 { color: var(--text); margin-bottom: 12px; line-height: 1.6; font-size: 17px; font-weight: 550; }
.sv-root .sv-number { color: var(--gold); margin-right: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.sv-root .sv-note, .sv-root .sv-hint { color: var(--muted); font-size: 13px; line-height: 1.8; }
.sv-root .sv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 20px; min-width: 0; }
.sv-root .sv-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; margin: 0; color: #d9d5c9; font-size: 13px; }
.sv-root .sv-field input, .sv-root .sv-field select, .sv-root .sv-field textarea,
.sv-root .sv-photo input, .sv-root .sv-photo select { width: 100%; min-width: 0; max-width: 100%; margin: 0; padding: 12px; color: var(--text); background: var(--input); border: 1px solid #45453f; border-radius: 8px; font: inherit; line-height: 1.5; }
.sv-root .sv-field input:focus-visible, .sv-root .sv-field select:focus-visible, .sv-root .sv-field textarea:focus-visible,
.sv-root .sv-photo input:focus-visible, .sv-root .sv-photo select:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.sv-root .sv-field textarea { min-height: 98px; resize: vertical; }
.sv-root .sv-field:has(textarea), .sv-root .sv-evidence { grid-column: 1 / -1; }
.sv-root .sv-options { min-width: 0; padding: 7px 0; margin: 0; border: 0; grid-column: 1 / -1; }
.sv-root .sv-options legend { color: #d9d5c9; font-size: 13px; margin-bottom: 8px; }
.sv-root .sv-check { display: inline-flex; align-items: flex-start; gap: 9px; margin: 5px 20px 8px 0; color: #ddd9cb; font-size: 14px; line-height: 1.6; cursor: pointer; }
.sv-root .sv-check input { margin: 3px 0 0; accent-color: var(--gold); flex: 0 0 17px; }
.sv-root .sv-dish { padding: 18px; margin: 16px 0; border: 1px solid #404033; border-radius: 12px; background: #21211e; }
.sv-root .sv-dish h4 { margin-bottom: 16px; color: var(--gold); font-size: 14px; line-height: 1.6; }
.sv-root .sv-thumbnails { display: flex; flex-wrap: wrap; gap: 12px; min-width: 0; margin-top: 12px; }
.sv-root .sv-photo { width: 178px; max-width: 100%; padding: 10px; gap: 8px; border: 1px solid #494736; border-radius: 10px; background: #21211e; color: #d2ccbc; }
.sv-root .sv-photo img { display: block; width: 100%; max-width: 100%; height: 112px; object-fit: cover; border-radius: 6px; }
.sv-root .sv-photo label { margin: 0; font-size: 12px; }
.sv-root .sv-photo span { overflow-wrap: anywhere; }
.sv-root .sv-photo input, .sv-root .sv-photo select { margin-top: 5px; padding: 9px; }
.sv-root .sv-dishes button, .sv-root .sv-photo button { color: var(--gold); border: 1px solid #655b43; background: #322f23; padding: 9px 13px; border-radius: 8px; }
.sv-root .sv-dishes button:hover, .sv-root .sv-photo button:hover { background: #423a28; border-color: var(--gold); }
.sv-root .sv-file-status { color: var(--warn); line-height: 1.7; font-size: 13px; }
.sv-root .sv-reason-hint { color: var(--warn); font-size: 13px; line-height: 1.7; margin: 0; grid-column: 1 / -1; }
.sv-root .sv-dish > .sv-reason-hint { margin-top: 12px; }
.sv-root .sv-error, .survey-field-error { color: var(--bad); background: #392821; border: 1px solid #755044; padding: 12px 14px; border-radius: 8px; font-size: 13px; grid-column: 1 / -1; }
.survey-error-link { display: block; border: 0; background: transparent; color: var(--bad); padding: 5px 0; min-height: 32px; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.survey-error-link:hover { background: transparent; color: #ffcebd; }
.sv-root [aria-invalid="true"], .fieldgrid [aria-invalid="true"] { border-color: #cd927d; box-shadow: 0 0 0 2px #cd927d26; }
#surveyFields { scroll-margin-top: 24px; min-width: 0; }
.login-shell { display: grid; place-items: center; min-height: 100dvh; padding: 36px 20px; }
.login-card { width: min(100%, 430px); padding: 38px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: none; }
.login-card .brand { margin-bottom: 36px; }
.login-card .brand img { width: 126px; }
.login-card h1 { font-size: 28px; margin-bottom: 12px; }
.login-card .muted { margin-bottom: 26px; }
.login-card label { display: block; margin: 18px 0; font-size: 13px; color: #ddd7c9; }
.login-card .primary { width: 100%; margin-top: 10px; min-height: 46px; }
.report-frame { display: block; width: 100%; min-width: 0; overflow: hidden; min-height: 620px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.report-frame iframe, iframe.report-frame { display: block; width: 100%; height: 82vh; min-height: 620px; border: 0; }
#toast { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; z-index: 100; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 13px 20px; border: 1px solid #776747; border-radius: 10px; color: var(--text); background: #343022; box-shadow: 0 8px 28px #00000045; pointer-events: none; }
#toast:empty { display: none; }
#toast.hidden { display: none; }
noscript { display: block; padding: 24px; text-align: center; color: var(--warn); }
@media (max-width: 900px) {
  .topbar { padding: 19px 24px; gap: 16px; }
  .topbar .nav { order: 3; flex-basis: 100%; }
  .workspace { width: calc(100% - 40px); padding-top: 28px; }
  .grid.two { grid-template-columns: minmax(0, 1fr); }
  .page-head { gap: 18px; }
}
@media (max-width: 600px) {
  .topbar { padding: 17px 16px 13px; gap: 14px; }
  .brand { gap: 12px; }
  .brand img { width: 100px; }
  .product-name { padding-left: 12px; font-size: 13px; letter-spacing: .02em; }
  .account { font-size: 11px; gap: 7px; }
  .nav { gap: 5px; }
  .nav button, .nav a { font-size: 12px; padding: 8px 11px; min-height: 38px; }
  .workspace { width: calc(100% - 28px); padding: 24px 0 38px; }
  .page-head { display: block; margin-bottom: 20px; }
  .page-head > .row, .page-head > button { margin-top: 16px; }
  h1 { font-size: 25px; }
  h2 { font-size: 20px; }
  .card { padding: 19px 16px; border-radius: 13px; margin-bottom: 16px; }
  .grid { gap: 16px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
  .stat { padding: 15px; }
  .stat b, .stat strong { font-size: 26px; }
  .fieldgrid, .sv-root .sv-grid { grid-template-columns: minmax(0, 1fr); }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; }
  .sv-root .sv-field input, .sv-root .sv-field select, .sv-root .sv-field textarea { font-size: 16px; }
  .sv-root .sv-question { padding: 22px 0; }
  .sv-root .sv-question h3 { font-size: 16px; }
  .sv-root .sv-dish { padding: 14px 12px; }
  .sv-root .sv-banner { padding: 13px 14px; }
  .sv-root .sv-photo { width: min(100%, 170px); }
  .sv-root .sv-check { margin-right: 14px; }
  .survey-controls { gap: 8px; padding-top: 13px; }
  .survey-controls button { flex: 1 1 auto; padding: 10px 11px; font-size: 13px; }
  .login-card { padding: 28px 23px; border-radius: 16px; }
  .login-card .brand { margin-bottom: 28px; }
  .report-frame, .report-frame iframe, iframe.report-frame { min-height: 560px; }
  th, td { padding: 13px; }
}
@media (max-width: 360px) {
  .topbar { gap: 12px; }
  .account { justify-content: flex-start; margin-left: 0; flex-basis: 100%; }
  .workspace { width: calc(100% - 24px); }
  .card { padding: 17px 13px; }
  .stat { padding: 12px; }
  .survey-controls button { flex-basis: calc(50% - 8px); }
  .login-shell { padding: 24px 14px; }
  .login-card { padding: 24px 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
/* Pilot view classes: task history, account rows, audit evidence and page footer. */
.topbar button.brand { padding: 0; border: 0; border-radius: 4px; background: transparent; min-height: 36px; }
.topbar button.brand:hover { background: transparent; opacity: .82; }
.hero { padding: 22px 0 40px; margin-bottom: 0; border: 0; border-radius: 0; background: transparent; }
.hero h2 { font-size: clamp(25px, 3.6vw, 39px); line-height: 1.35; letter-spacing: -.035em; margin: 14px 0; }
.hero p { color: #bbb5a5; margin-bottom: 24px; }
.survey-shell { width: 100%; max-width: 900px; min-width: 0; margin: 0 auto; }
.summaryline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding: 13px 0; border-bottom: 1px solid var(--soft-line); color: #dbd6c7; }
.summaryline > * { min-width: 0; }
.summaryline:last-child { border-bottom: 0; }
.summaryline > :last-child { color: var(--muted); font-size: 12px; }
.answer-detail { min-width: 0; padding: 13px 15px; margin-top: 10px; border: 1px solid var(--line); border-radius: 9px; background: #191917; }
summary { cursor: pointer; color: #d8c7a6; font-size: 13px; line-height: 1.7; }
details > p { margin-top: 12px; }
.answer-detail summary { color: var(--text); font-weight: 500; }
.answer-detail[open] summary { margin-bottom: 15px; color: var(--gold); }
.answer-detail p { margin-bottom: 9px; font-size: 13px; line-height: 1.8; }
.answer-detail .sv-thumbnails { display: flex; flex-wrap: wrap; gap: 12px; min-width: 0; }
.answer-detail .sv-thumbnails figure { width: 170px; max-width: 100%; min-width: 0; margin: 0; padding: 8px; border: 1px solid #494736; border-radius: 8px; background: #151514; }
.answer-detail .sv-thumbnails img { display: block; width: 100%; height: auto; max-height: 220px; object-fit: contain; border-radius: 5px; }
.answer-detail figcaption { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
form label.check { display: flex; align-items: flex-start; gap: 9px; line-height: 1.7; }
form label.check input { margin: 3px 0 0; }
.error-link { display: block; width: 100%; min-height: 34px; padding: 6px 0; border: 0; border-radius: 3px; text-align: left; justify-content: flex-start; color: var(--bad); background: transparent; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.error-link:hover { color: #ffcfbd; background: #ffffff06; }
td > small { display: block; margin-top: 5px; color: var(--muted); }
.row + .report-frame { margin-top: 20px; }
.footer { padding: 20px 24px max(24px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: #979587; font-size: 11px; line-height: 1.9; text-align: center; }
@media (max-width: 600px) {
  .hero { padding: 24px 20px; border-radius: 13px; }
  .hero .row button { flex: 1 1 auto; }
  .answer-detail { padding: 12px; }
  .footer { padding-left: 18px; padding-right: 18px; }
}

.reauth-layer{position:fixed;inset:0;z-index:50;background:#000b;display:grid;place-items:center;padding:20px}.reauth-layer>.card{width:min(460px,100%)}

.stat:last-child { border-right: 0; }
#projectForm > button { justify-self: start; }
@media (max-width:600px) { .stats .stat { padding: 16px 10px; font-size: 11px; } .hero { padding: 16px 0 28px; } }
