/* FUN TECH LAB: photographic evidence and an editorial experiment record. */
:root {
  color-scheme: light;
  --paper: #fff;
  --wash: #f4f5f3;
  --ink: #191919;
  --muted: #727570;
  --rule: #dedfda;
  --accent: #d9362b;
  --image-bg: #222422;
  --font-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Consolas", "SFMono-Regular", monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; letter-spacing: 0; }
html, body { width: 100%; height: 100%; }
body { display: flex; flex-direction: column; overflow: hidden; background: var(--paper); color: var(--ink); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, label[for] { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: wait; }
button, a, input, textarea, select, label { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); }
[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); }
.eyebrow { font-size: 10px; font-weight: 600; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
svg.lucide { width: 17px; height: 17px; flex-shrink: 0; stroke-width: 1.6; }
.app-header { min-height: 80px; padding: 12px 28px; display: flex; align-items: center; gap: 26px; border-bottom: 1px solid var(--ink); flex-shrink: 0; }
.brand { display: flex; flex-shrink: 0; }
.brand img { width: 89px; height: 52px; object-fit: contain; }
.brand-title { min-width: 0; padding-left: 26px; border-left: 1px solid var(--rule); }
.brand-title h1 { margin-top: 3px; font-size: 27px; line-height: 1.2; font-weight: 700; }
.brand-title h1 span { font-size: 15px; font-weight: 500; margin-left: 10px; }
.header-status { margin-left: auto; display: flex; align-items: center; gap: 18px; min-width: 0; }
.workspace-actions { display: flex; align-items: center; gap: 18px; min-width: 0; }
.license-status { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.license-status::before { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.license-status.active { color: #2a684e; }
.activation-gate { display: grid; grid-template-columns: 1.08fr 1fr; flex: 1; min-height: 0; overflow: auto; }
.activation-intro { display: flex; flex-direction: column; background: var(--wash); padding: clamp(50px, 9vh, 110px) 10% 30px; border-right: 1px solid var(--rule); }
.activation-intro h2 { font-size: clamp(36px, 4.1vw, 64px); line-height: 1.4; font-weight: 600; margin-top: 55px; }
.activation-intro>p { font-size: 13px; color: var(--muted); margin-top: 23px; }
.activation-signature { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: auto; padding-top: 90px; font: 10px var(--font-mono); color: var(--muted); }
.activation-entry { width: min(410px, calc(100% - 64px)); margin: auto; padding: 50px 0; }
.activation-entry h2 { font-size: 28px; font-weight: 600; margin-top: 20px; }
.activation-description { font-size: 12px; line-height: 1.9; color: var(--muted); margin: 15px 0 36px; }
#activation-form label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 12px; }
#activation-form label span { font-size: 10px; color: var(--muted); }
#activation-sn { width: 100%; height: 48px; padding: 12px; border: 1px solid var(--rule); background: white; color: var(--ink); border-radius: 0; font: 14px var(--font-mono); text-transform: uppercase; }
#activation-sn::placeholder { font-size: 12px; color: #9a9d97; }
.activation-message { min-height: 39px; padding: 10px 0; font-size: 12px; line-height: 1.7; color: var(--muted); }
.activation-message.error { color: #b52e25; }
#activate-submit { width: 100%; min-height: 46px; justify-content: space-between; background: var(--accent); }
#activate-submit:hover:not(:disabled) { background: #b62c23; }
.activation-help { margin-top: 30px; border-top: 1px solid var(--rule); padding-top: 18px; color: var(--muted); font-size: 11px; line-height: 1.9; }
.activation-help p+p { margin-top: 7px; }
.activation-retry { background: none; border: 0; text-decoration: underline; text-underline-offset: 4px; font-size: 12px; padding: 14px 0 0; color: var(--ink); }
@media (max-width: 760px) {
  .activation-gate { grid-template-columns: 1fr; }
  .activation-intro { padding: 28px 24px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .activation-intro h2 { font-size: 32px; margin-top: 22px; }
  .activation-intro>p { margin-top: 12px; }
  .activation-signature { display: none; }
  .activation-entry { width: calc(100% - 48px); padding: 32px 0; }
  .workspace-actions { gap: 7px; }
  .header-status { gap: 10px; }
}
.session-status { display: flex; flex-direction: column; gap: 4px; font-size: 10px; color: var(--muted); }
.session-status .mono { font-size: 12px; color: var(--ink); }
.model-button { display: flex; align-items: center; gap: 9px; min-width: 36px; max-width: 220px; min-height: 36px; background: none; border: 0; color: var(--ink); font-size: 11px; }
.model-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; border-radius: 3px; color: inherit; cursor: pointer; flex-shrink: 0; }
.icon-button:hover, .model-button:hover { background: var(--wash); }
.danger:hover { color: var(--accent); }
.workbench { display: grid; grid-template-columns: minmax(350px, .86fr) minmax(0, 1.14fr); flex: 1; min-height: 0; }
.viewport-panel, .dossier-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.viewport-panel { border-right: 1px solid var(--rule); background: var(--wash); }
.dossier-panel { background: var(--paper); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 51px; flex-shrink: 0; padding: 12px 28px; border-bottom: 1px solid var(--rule); }
.panel-title { display: flex; align-items: center; gap: 13px; }
.section-number { font: 12px var(--font-mono); color: var(--accent); }
.panel-title h2 { font-size: 14px; font-weight: 600; }
.badge, .report-state { font-size: 11px; color: var(--muted); }
.badge.ready { color: #2a684e; }
.report-state { display: inline-flex; align-items: center; gap: 6px; }
.report-state::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.viewport-stage { flex: 1; min-height: 0; display: flex; position: relative; background: var(--wash); }
.viewport-stage.dragover { outline: 2px dashed var(--accent); outline-offset: -10px; }
.empty-drop { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 36px 24px; min-width: 0; }
svg.empty-image-icon { width: 38px; height: 38px; color: #989c95; stroke-width: 1; margin-bottom: 25px; }
.empty-drop h3 { font-size: 22px; font-weight: 500; margin-bottom: 26px; }
.upload-btn { display: inline-flex; align-items: center; gap: 10px; color: #fff; background: var(--ink); padding: 12px 22px; border-radius: 3px; font-size: 13px; cursor: pointer; }
.upload-btn:hover { background: #383a36; }
.upload-btn:has(+ input:focus-visible), .change-btn:has(+ input:focus-visible) { outline: 2px solid var(--accent); }
.format-hint { font-size: 10px; color: var(--muted); margin-top: 18px; text-align: center; line-height: 1.7; }
.image-viewer { flex: 1; width: 100%; height: 100%; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; background: var(--image-bg); overflow: hidden; }
.image-viewer img { width: 100%; height: 100%; object-fit: contain; display: block; }
.image-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 22px; min-height: 44px; border-bottom: 1px solid var(--rule); background: #fff; flex-shrink: 0; }
.image-index { font-size: 10px; color: var(--muted); line-height: 1.5; }
.viewer-actions { display: flex; gap: 3px; align-items: center; }
.filmstrip { display: flex; gap: 9px; overflow-x: auto; padding: 10px 28px; background: var(--wash); flex-shrink: 0; border-bottom: 1px solid var(--rule); }
.film-frame { position: relative; flex: 0 0 70px; width: 70px; height: 52px; padding: 0; background: var(--image-bg); border: 2px solid transparent; }
.film-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.film-frame.active { border-color: var(--accent); }
.film-index { position: absolute; left: 3px; bottom: 3px; font-size: 9px; background: #222c; color: #fff; padding: 2px 4px; }
.quick-probes { padding: 12px 28px; flex-shrink: 0; }
.probe-label { display: flex; align-items: baseline; justify-content: space-between; font-size: 11px; font-weight: 500; margin-bottom: 8px; }
.probe-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.probe-chip { display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 8px 0; font-size: 12px; font-weight: 500; border: 0; border-top: 1px solid var(--rule); background: none; color: var(--ink); text-align: left; }
.probe-chip:hover { color: var(--accent); }
.probe-chip svg { color: var(--muted); width: 15px; height: 15px; }
.probe-chip[aria-pressed="true"] { color: var(--accent); }
.lab-signature { display: flex; justify-content: space-between; gap: 16px; padding: 8px 28px; font-size: 9px; color: var(--muted); background: var(--wash); border-top: 1px solid var(--rule); flex-shrink: 0; }
.lab-signature span:first-child { color: var(--ink); font-weight: 700; }
.dossier-stream { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 36px; scrollbar-width: thin; scrollbar-color: #ccc transparent; }
.stream-placeholder { margin: 36px 0 0; }
.stream-placeholder h2 { font-size: 30px; line-height: 1.5; font-weight: 500; margin: 15px 0 40px; }
.editorial-dot { color: var(--accent); }
.empty-document { display: flex; flex-direction: column; gap: 12px; padding: 27px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.empty-document span:first-child { font-size: 12px; font-weight: 700; }
.empty-document span:last-child { font-size: 12px; color: var(--muted); }
.message-entry { margin: 0 0 30px; max-width: 960px; }
.user-bubble { border-left: 2px solid var(--rule); padding: 2px 0 2px 14px; font-size: 12px; line-height: 1.8; color: #565b54; overflow-wrap: anywhere; }
.user-meta { color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.dossier-report { padding: 0; }
.dossier-badge-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 2px solid var(--ink); padding: 13px 0; margin-bottom: 16px; font-size: 10px; }
.dossier-label { color: var(--accent); font-weight: 600; }
.dossier-time { font-family: var(--font-mono); color: var(--muted); }
.report-content { font-size: 14px; line-height: 1.85; color: #32362f; overflow-wrap: anywhere; }
.report-content h1 { font-size: 24px; line-height: 1.5; margin: 24px 0 15px; color: var(--ink); font-weight: 600; }
.report-content h2 { font-size: 19px; line-height: 1.6; margin: 29px 0 14px; color: var(--ink); font-weight: 600; }
.report-content h3 { font-size: 15px; line-height: 1.8; margin: 22px 0 9px; color: var(--ink); font-weight: 600; }
.report-content > :first-child { margin-top: 0; }
.report-content > :last-child { margin-bottom: 0; }
.report-content p { margin: 12px 0; }
.report-content strong { color: var(--ink); font-weight: 600; }
.report-content ul, .report-content ol { margin: 12px 0 12px 20px; }
.report-content li { margin-bottom: 9px; }
.report-content a { color: var(--accent); text-underline-offset: 4px; }
.report-content blockquote { border-left: 2px solid var(--accent); padding: 1px 16px; margin: 20px 0; color: #555950; }
.report-content table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 12px; line-height: 1.8; table-layout: fixed; }
.report-content th, .report-content td { text-align: left; vertical-align: top; padding: 12px 9px; border-bottom: 1px solid var(--rule); }
.report-content th { color: var(--ink); border-top: 1px solid var(--ink); font-weight: 600; }
.report-content th:first-child, .report-content td:first-child { padding-left: 0; }
.report-content th:last-child, .report-content td:last-child { padding-right: 0; }
.report-table-wrap { max-width: 100%; overflow-x: auto; }
.report-table-wrap th:first-child { width: 19%; }
.report-table-wrap th:nth-child(2) { width: 28%; }
.report-table-wrap th:nth-child(3) { width: 15%; }
.report-table-wrap th:last-child { width: 38%; }
.report-content code { background: var(--wash); font-family: var(--font-mono); font-size: 11px; padding: 2px 5px; }
.report-content pre { padding: 15px; background: var(--wash); white-space: pre-wrap; overflow-wrap: anywhere; }
.report-content pre code { display: block; background: none; padding: 0; }
.report-content hr { border: 0; border-top: 1px solid var(--rule); margin: 26px 0; }
.report-content .region-link-unavailable { color: inherit; text-decoration: none; cursor: default; }
.report-content .region-label-cell { min-width: 105px; width: 23%; }
.region-warning { color: #96600c; font-size: 11px; }
.intake-form h3 { font-size: 23px; line-height: 1.5; color: var(--ink); margin: 0; font-weight: 600; }
.intake-form > p { color: var(--muted); font-size: 12px; margin-top: 8px; }
.intake-table-wrap { min-width: 0; }
.report-content .intake-table { margin: 25px 0 18px; }
.report-content .intake-table th { width: 28%; min-width: 100px; border-top: 0; padding: 15px 14px 15px 0; }
.report-content .intake-table td { padding: 11px 0; }
.intake-field-tag { display: block; font-size: 10px; font-weight: 400; color: var(--muted); margin-top: 5px; }
.intake-image-thumbnail { display: block; width: 84px; height: 62px; object-fit: contain; margin-top: 8px; border: 1px solid #d5d8d0; background: var(--wash); }
.intake-control { width: 100%; min-width: 0; padding: 9px 11px; background: var(--paper); border: 1px solid #d5d8d0; border-radius: 3px; color: var(--ink); font-size: 12px; line-height: 1.7; }
.intake-control-shell { position: relative; }
.intake-history-menu { position: absolute; z-index: 5; top: calc(100% + 3px); left: 0; right: 0; max-height: 190px; overflow: auto; padding: 7px; background: var(--paper); border: 1px solid #d5d8d0; border-radius: 4px; box-shadow: 0 8px 22px rgba(17, 24, 20, .14); }
.intake-history-option { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 3px; background: transparent; color: var(--ink); text-align: left; font: inherit; line-height: 1.45; cursor: pointer; }
.intake-history-option:hover, .intake-history-option:focus-visible { background: var(--wash); outline: 0; }
.intake-history-menu[hidden] { display: none; }
.intake-history-option { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.intake-history-clear { margin-top: 5px; padding: 7px 10px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 10px; cursor: pointer; }
.intake-control:disabled { background: var(--wash); color: #656960; }
textarea.intake-control { min-height: 66px; resize: vertical; }
.intake-help { display: block; font-size: 10px; color: var(--muted); line-height: 1.7; margin-top: 5px; }
.intake-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 8px 0 16px; }
.intake-status { font-size: 10px; color: var(--muted); }
.intake-footer .btn-execute { white-space: normal; }
.console-box { border-top: 1px solid var(--rule); background: var(--paper); padding: 18px 36px 20px; flex-shrink: 0; }
.composer-label { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 10px; font-size: 11px; }
.composer-label label { font-weight: 600; }
.composer-label #img-indicator { font-size: 10px; color: var(--muted); text-align: right; }
.input-wrapper textarea { display: block; width: 100%; min-height: 66px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 3px; background: var(--wash); font-size: 12px; color: var(--ink); line-height: 1.8; resize: none; }
textarea::placeholder, input::placeholder { color: #83877e; }
.console-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 12px; }
.composer-context { font-size: 10px; color: var(--muted); }
.btn-execute, .btn-secondary, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 10px 17px; min-height: 38px; border-radius: 3px; font-size: 12px; font-weight: 500; border: 1px solid transparent; }
.btn-execute { background: var(--accent); color: #fff; }
.btn-execute:hover:not(:disabled) { background: #bf2b22; }
.btn-secondary { background: none; border-color: var(--rule); color: var(--ink); }
.btn-ghost { background: none; padding-left: 0; padding-right: 0; color: var(--muted); }
.btn-secondary:hover, .btn-ghost:hover { color: var(--ink); }
.region-overlay { position: absolute; pointer-events: none; z-index: 2; overflow: visible; }
.region-overlay polygon { fill: #ffffff1c; stroke: #fff; stroke-width: 2; stroke-dasharray: 7 3; }
.region-status { position: absolute; top: 15px; left: 15px; right: 15px; width: fit-content; max-width: calc(100% - 30px); padding: 6px 9px; color: #fff; background: #181a18e8; font-size: 10px; line-height: 1.8; z-index: 3; pointer-events: none; }
.region-controls { position: absolute; top: 62px; left: 15px; display: flex; gap: 5px; flex-wrap: wrap; max-width: calc(100% - 30px); z-index: 3; }
.region-chip { color: #fff; border: 1px solid #ffffff80; background: #222e; border-radius: 2px; padding: 5px 10px; font-size: 11px; }
.region-chip:hover, .region-chip.active { background: #fff; color: #222; }
dialog { margin: auto; color: var(--ink); }
.llm-dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 32px); border: 1px solid var(--rule); border-radius: 6px; padding: 0; background: #fff; }
dialog::backdrop { background: #151715a8; }
.llm-win-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px 0 28px; }
.llm-card { padding: 8px 28px 26px; }
.llm-head h2 { font-size: 24px; font-weight: 600; margin: 8px 0; }
.llm-desc { color: var(--muted); font-size: 12px; line-height: 1.8; }
.llm-privacy { margin-bottom: 0; }
.llm-body { display: flex; flex-direction: column; gap: 20px; margin: 24px 0; }
.llm-field { display: flex; flex-direction: column; gap: 8px; }
.llm-field label { font-size: 12px; font-weight: 500; }
.llm-field label span { font-size: 10px; color: var(--muted); margin-left: 8px; }
.llm-field input { width: 100%; min-height: 42px; border: 1px solid var(--rule); border-radius: 3px; padding: 10px 12px; font: 12px var(--font-mono); }
.llm-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--rule); padding-top: 20px; }
.llm-action-right { display: flex; gap: 8px; }
.lightbox-modal { background: var(--image-bg); border: 0; width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; padding: 0; }
.lightbox-inner { width: 100%; height: 100%; padding: 50px 24px 24px; position: relative; display: flex; align-items: center; justify-content: center; }
.lightbox-inner img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-close-btn { position: absolute; top: 12px; right: 18px; color: #fff; z-index: 4; }
.lightbox-close-btn:hover { background: #444; }
.lightbox-inner .region-status { top: 12px; max-width: calc(100% - 75px); }
@media (min-width: 1600px) {
  .workbench { grid-template-columns: minmax(400px, .95fr) minmax(0, 1.05fr); }
  .dossier-stream, .console-box { padding-left: 48px; padding-right: 48px; }
  .report-content { font-size: 14px; }
}
@media (max-width: 1050px) {
  .app-header { padding-left: 22px; padding-right: 22px; gap: 20px; }
  .brand-title { padding-left: 20px; }
  .brand-title h1 span { display: block; margin: 3px 0 0; font-size: 12px; }
  .session-status { display: none; }
  .model-button { max-width: 170px; }
  .workbench { grid-template-columns: minmax(320px, .82fr) minmax(0, 1.18fr); }
  .dossier-stream, .console-box { padding-left: 24px; padding-right: 24px; }
  .panel-header { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 760px) {
  body { height: auto; min-height: 100dvh; overflow: auto; }
  .app-header { min-height: 82px; padding: 14px 18px; gap: 16px; }
  .brand img { width: 76px; height: 45px; }
  .brand-title { padding-left: 16px; }
  .brand-title h1 { font-size: 22px; }
  .brand-title .eyebrow { font-size: 8px; }
  .brand-title h1 span { font-size: 10px; }
  .header-status { gap: 3px; }
  .model-button { padding: 0; width: 34px; justify-content: center; }
  .model-name { display: none; }
  .workbench { display: flex; flex-direction: column; }
  .viewport-panel { border-right: 0; border-bottom: 1px solid var(--ink); }
  .viewport-stage { flex: none; height: 290px; }
  .panel-header { min-height: 54px; padding: 13px 20px; }
  .empty-drop h3 { font-size: 21px; }
  .quick-probes { padding: 12px 20px; }
  .filmstrip { padding: 10px 20px; }
  .lab-signature { display: none; }
  .image-tools { padding-left: 16px; padding-right: 16px; }
  .dossier-stream { overflow: visible; flex: none; padding: 24px 20px; }
  .stream-placeholder { margin: 16px 0 35px; }
  .stream-placeholder h2 { font-size: 25px; }
  .console-box { padding: 18px 20px 24px; }
  .report-content h1 { font-size: 22px; }
  .report-content h2 { font-size: 18px; }
  .report-content .region-label-cell { min-width: 75px; }
  .report-content table { font-size: 12px; }
  .report-table-wrap table { min-width: 620px; }
  .report-content th, .report-content td { padding: 10px 6px; }
  .intake-form h3 { font-size: 21px; }
  .report-content .intake-table th { min-width: 85px; width: 28%; padding-right: 12px; }
  .llm-card { padding-left: 22px; padding-right: 22px; }
  .llm-actions { flex-wrap: wrap; }
  .llm-head h2 { font-size: 22px; }
}
@media (max-width: 370px) {
  .app-header { gap: 12px; padding-left: 12px; padding-right: 12px; }
  .brand-title { padding-left: 12px; }
  .brand-title h1 { font-size: 20px; }
  .brand img { width: 65px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
