:root {
  --ink: #1f2933;
  --muted: #6b7785;
  --line: #dfe5ea;
  --surface: #ffffff;
  --background: #f3f6f8;
  --navy: #1d3749;
  --blue: #2f6f8f;
  --blue-soft: #eaf3f7;
  --orange: #e18b4f;
  --orange-soft: #fff4e9;
  --danger: #b95050;
  --shadow: 0 12px 32px rgba(28, 54, 70, .08);
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background: var(--background);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--background); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.topbar { background: var(--navy); color: #fff; padding: 30px max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.topbar h1 { margin: 5px 0 7px; font-size: clamp(1.6rem, 3vw, 2.35rem); letter-spacing: -.02em; }
.subtitle { margin: 0; color: #c7d6de; font-size: .95rem; }
.eyebrow { margin: 0; color: var(--orange); font-weight: 750; font-size: .7rem; letter-spacing: .13em; }
.top-actions { display: flex; gap: 10px; }
.page-shell { width: min(1180px, calc(100% - 36px)); margin: 24px auto 56px; display: grid; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.run-card { padding: 21px 24px 23px; }
.section-heading, .zone-toolbar, .dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.run-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
h2, h3 { margin: 4px 0 0; letter-spacing: -.02em; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.05rem; }
.save-state, .muted { color: var(--muted); font-size: .82rem; }
.save-state { background: #f2f5f6; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.run-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.history-box { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; color: var(--navy); font-size: .82rem; }
.history-box summary { cursor: pointer; font-weight: 700; }
.history-list { display: grid; gap: 7px; margin-top: 11px; }
.history-item { display: flex; justify-content: space-between; gap: 12px; border-radius: 8px; background: #f7f9fa; padding: 9px 11px; color: var(--muted); }
.history-item strong { color: var(--ink); font-weight: 700; }
label { display: grid; gap: 7px; color: #4c5b67; font-size: .8rem; font-weight: 650; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; color: var(--ink); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,111,143,.12); }
.button { border: 0; border-radius: 9px; padding: 10px 14px; font-weight: 700; font-size: .84rem; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--blue); color: #fff; }
.button.primary:hover { background: #275e7a; }
.button.ghost { background: #eef2f4; color: var(--navy); }
.topbar .button.ghost { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.zone-card { overflow: hidden; }
.zone-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.zone-tab { border: 0; background: #f8fafb; padding: 17px 22px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; font-weight: 700; text-align: left; }
.zone-tab + .zone-tab { border-left: 1px solid var(--line); }
.zone-tab.active { color: var(--navy); background: #fff; box-shadow: inset 0 -3px 0 var(--orange); }
.zone-tab strong { font-size: .75rem; color: var(--muted); font-weight: 600; }
.zone-toolbar { padding: 23px 24px 19px; align-items: center; }
.zone-toolbar h2 { margin-bottom: 4px; }
.zone-toolbar .muted { margin: 0; }
.zone-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.report-status { margin: 0 24px 18px; padding: 12px 15px; border-radius: 8px; background: var(--orange-soft); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .84rem; }
.report-status.success { background: #eaf6ee; color: #2f7356; }
dialog.report-dialog { width: min(1040px, calc(100% - 24px)); max-height: 90vh; }
.report-preview { padding: 18px; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; margin: 14px 0; }
.report-preview img { max-width: 100% !important; height: auto; }
.report-dialog .report-status { margin: 12px 0; }
.report-dialog .dialog-actions { position: sticky; bottom: -23px; padding: 14px 0; background: #fff; }
.machine-list { padding: 0 24px 24px; display: grid; gap: 14px; }
.machine-card { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fff; }
.machine-header { padding: 15px 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fbfcfc; border-bottom: 1px solid var(--line); }
.machine-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.machine-title h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.machine-status { font-size: .72rem; color: var(--muted); background: #eef2f4; border-radius: 999px; padding: 5px 8px; white-space: nowrap; }
.machine-status.ready { color: #2f7356; background: #eaf6ee; }
.machine-actions { display: flex; align-items: center; gap: 4px; }
.icon-button { border: 0; background: transparent; color: var(--muted); border-radius: 7px; min-width: 32px; min-height: 32px; font-size: 1.2rem; }
.icon-button:hover { background: #edf2f4; color: var(--navy); }
.icon-button.danger:hover { color: var(--danger); background: #fff0f0; }
.evidence-grid { padding: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.evidence-slot { border: 1px dashed #c9d3d9; border-radius: 11px; min-height: 190px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: #fcfdfd; }
.evidence-slot h4 { margin: 0; font-size: .8rem; color: var(--navy); }
.slot-instruction { color: var(--muted); font-size: .74rem; line-height: 1.45; }
.slot-instruction kbd { color: var(--navy); background: #edf2f4; border: 1px solid #dce5e9; border-radius: 4px; padding: 1px 4px; }
.image-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 7px; }
.image-thumb { position: relative; border-radius: 7px; overflow: hidden; border: 1px solid #d3dde1; aspect-ratio: 1.35; background: #eef2f4; }
.image-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.image-thumb .remove-image { position: absolute; top: 3px; right: 3px; border: 0; border-radius: 50%; width: 20px; height: 20px; line-height: 15px; color: #fff; background: rgba(31,41,51,.72); }
.image-thumb .move-image { position: absolute; bottom: 3px; border: 0; border-radius: 4px; width: 20px; height: 20px; line-height: 15px; color: #fff; background: rgba(31,41,51,.72); }
.image-thumb .move-image.up { left: 3px; }
.image-thumb .move-image.down { left: 27px; }
.paste-zone { margin-top: auto; min-height: 57px; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: .73rem; border-radius: 8px; background: var(--blue-soft); cursor: text; }
.paste-zone:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.paste-zone.has-images { min-height: 35px; background: #f1f7f3; color: #3c725b; }
.notes { padding: 0 16px 16px; }
.notes textarea { resize: vertical; min-height: 60px; font-size: .8rem; }
.notes label { font-size: .75rem; }
.not-applicable { display: flex; align-items: center; gap: 7px; font-weight: 500; margin-top: 8px; color: var(--muted); }
.not-applicable input { width: 15px; height: 15px; accent-color: var(--blue); }
.empty-state { padding: 42px 24px 52px; text-align: center; color: var(--muted); }
.empty-icon { display: grid; place-items: center; margin: 0 auto 11px; width: 46px; height: 46px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 1.8rem; }
.empty-state p { margin: 5px 0 17px; font-size: .84rem; }
.dialog { width: min(460px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 16px; padding: 23px; box-shadow: 0 25px 70px rgba(0,0,0,.2); }
.dialog::backdrop { background: rgba(17,34,44,.42); backdrop-filter: blur(2px); }
.dialog form { display: grid; gap: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
.form-error { min-height: 17px; margin: -8px 0 0; color: var(--danger); font-size: .78rem; }
.image-dialog { width: min(1000px, calc(100% - 32px)); }
.image-dialog img { display: block; max-width: 100%; max-height: 72vh; margin: 16px auto 0; object-fit: contain; border-radius: 8px; background: #f3f6f8; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: .83rem; transition: opacity .2s, transform .2s; z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 760px) {
  .topbar { padding: 23px 18px; flex-direction: column; }
  .top-actions { width: 100%; }
  .top-actions .button { flex: 1; }
  .page-shell { width: min(100% - 22px, 1180px); margin-top: 11px; }
  .run-fields, .evidence-grid { grid-template-columns: 1fr; }
  .zone-toolbar, .machine-header { align-items: flex-start; flex-direction: column; }
  .section-heading { flex-direction: column; }
  .run-actions { width: 100%; justify-content: space-between; }
  .machine-actions { align-self: flex-end; }
  .zone-tab { flex-direction: column; gap: 3px; padding: 14px 13px; }
  .machine-list, .evidence-grid { padding-left: 13px; padding-right: 13px; }
  .zone-toolbar, .run-card { padding-left: 16px; padding-right: 16px; }
}
