:root { color-scheme: light; --paper: #c7c7c7; --ink: #111; --muted: #505050; --line: #00000026; --soft: #dadada; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 14px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
button, a, textarea, input, select { outline-offset: 5px; }
:focus-visible { outline: 2px solid var(--ink); }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.site-header { max-width: 1224px; padding: 26px 32px; margin: auto; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.wordmark { font-size: 19px; letter-spacing: -.06em; font-weight: 650; }
.back-link { font-size: 12px; color: var(--muted); }
.back-link span { margin-left: 12px; }
main { max-width: 1224px; padding: 48px 32px 24px; margin: auto; }
.page-heading { display: flex; gap: 24px; align-items: end; justify-content: space-between; margin-bottom: 40px; }
.eyebrow { font-size: 10px; letter-spacing: .17em; margin: 0 0 12px; color: var(--muted); }
h1 { font-size: clamp(32px, 4vw, 46px); line-height: 1.2; letter-spacing: -.065em; margin: 0; font-weight: 500; }
.intro { color: var(--muted); margin: 18px 0 0; font-size: 14px; }
.session-label { white-space: nowrap; font-size: 11px; color: var(--muted); padding-bottom: 3px; }
.workspace { display: grid; grid-template-columns: minmax(310px, .9fr) minmax(0, 1.1fr); border-top: 1px solid var(--line); }
.input-panel { padding: 24px 32px 36px 0; border-right: 1px solid var(--line); min-width: 0; }
.result-panel { padding: 24px 0 36px 36px; min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
h2 { font-size: 15px; font-weight: 550; margin: 0; }
.text-button { background: none; border: 0; padding: 4px 0; color: var(--muted); font-size: 12px; }
.text-button:hover { color: var(--ink); text-decoration: underline; }
.drop-zone { border: 1px dashed #0000004d; border-radius: 6px; position: relative; text-align: center; padding: 27px 15px 22px; transition: background .15s; }
.drop-zone.is-dragging, .drop-zone:focus-within { background: var(--soft); border-color: var(--ink); }
.drop-zone.is-busy { opacity: .55; }
.file-input { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.file-label { cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.file-label strong { font-weight: 550; }
.file-label > span:last-child { color: var(--muted); }
.upload-mark { font-size: 20px; line-height: 1; margin-right: 4px; }
.file-types { font-size: 11px; color: var(--muted); margin: 11px 0 0; }
.file-name { margin: 16px 0 10px; overflow-wrap: anywhere; font-size: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.orientation-panel { padding: 0; margin: 16px 0 0; border: 0; min-width: 0; }
.orientation-panel legend { padding: 0; margin-bottom: 10px; font-size: 12px; font-weight: 550; }
.orientation-panel legend span { color: var(--muted); font-weight: 400; font-size: 11px; margin-left: 5px; }
.orientation-grid { display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; grid-template-areas: ". top ." "left preview right" ". bottom ."; gap: 7px; align-items: center; }
.orientation-marker { display: block; justify-self: center; }
.orientation-top { grid-area: top; }
.orientation-left { grid-area: left; }
.orientation-right { grid-area: right; }
.orientation-bottom { grid-area: bottom; }
.orientation-marker select { width: 52px; min-height: 38px; padding: 5px 4px; border: 1px solid #00000035; border-radius: 5px; background: #ffffff26; font-size: 13px; text-align: center; }
.orientation-marker select:disabled { opacity: .45; cursor: not-allowed; }
.orientation-grid > .preview-grid { grid-area: preview; min-width: 0; }
.preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.preview-grid:has(figure:only-child) { grid-template-columns: minmax(0, 1fr); }
.preview-grid figure { margin: 0; min-width: 0; }
.preview-grid img, .preview-grid video { width: 100%; max-height: 350px; object-fit: contain; background: #111; border-radius: 4px; display: block; }
.preview-grid figure:not(:only-child) img { height: 135px; }
.preview-grid figcaption { font-size: 11px; color: var(--muted); text-align: center; margin-top: 4px; }
.field-note { font-size: 11px; color: var(--muted); line-height: 1.75; margin: 9px 0 0; }
.model-fieldset { margin: 27px 0 0; padding: 0; border: 0; min-width: 0; }
.model-fieldset legend { padding: 0; font-size: 13px; font-weight: 550; margin-bottom: 12px; }
.provider-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.provider-button { border: 1px solid var(--line); background: transparent; border-radius: 5px; padding: 11px 6px; text-align: center; min-width: 0; }
.provider-button strong { font-weight: 550; display: block; font-size: 13px; }
.provider-button span { display: block; color: var(--muted); font-size: 10px; margin-top: 1px; overflow-wrap: anywhere; }
.provider-button[aria-pressed="true"] { border-color: var(--ink); background: var(--soft); }
.question-label { display: block; font-size: 13px; font-weight: 550; margin: 25px 0 10px; }
.question-label span { color: var(--muted); font-weight: 400; font-size: 11px; margin-left: 4px; }
textarea { resize: vertical; width: 100%; min-height: 112px; border: 1px solid #00000030; border-radius: 5px; padding: 12px; background: #ffffff17; line-height: 1.75; font-size: 13px; }
textarea::placeholder { color: #626262; }
textarea:focus { background: #ffffff26; }
.analyze-button { margin-top: 24px; padding: 13px 17px; border: 1px solid var(--ink); border-radius: 5px; background: var(--ink); color: #eee; width: 100%; font-size: 13px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.status { font-size: 11px; color: var(--muted); margin: 12px 0 0; min-height: 19px; }
.error { border: 1px solid #00000042; background: #ffffff21; border-radius: 5px; padding: 12px; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.error-diagnostic { margin-top: 9px; font-size: 11px; }
.error-diagnostic summary { cursor: pointer; }
.error-diagnostic pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.error-diagnostic button { font-size: 11px; padding: 4px 8px; background: transparent; border: 1px solid var(--line); border-radius: 4px; }
.empty-result { display: flex; flex-direction: column; justify-content: center; min-height: 365px; max-width: 330px; margin: auto; }
.empty-result .empty-mark { font-size: 29px; margin: 0 0 18px; }
.empty-result h2 { font-size: 20px; letter-spacing: -.045em; line-height: 1.5; font-weight: 450; }
.empty-result p { color: var(--muted); font-size: 12px; margin: 13px 0 0; line-height: 1.9; }
.result-kicker { color: var(--muted); font-size: 10px; letter-spacing: .08em; margin: 0 0 8px; }
.result-model { margin: 8px 0 0; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.result-prompt { font-size: 12px; padding-left: 12px; border-left: 2px solid #00000035; color: var(--muted); margin: 20px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.result-orientation { color: var(--muted); font-size: 11px; margin: 12px 0 0; line-height: 1.8; overflow-wrap: anywhere; }
.result-summary { font-size: 17px; line-height: 1.95; letter-spacing: -.015em; margin: 24px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.findings-title { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-top: 28px; }
.finding { padding: 19px 0; border-bottom: 1px solid var(--line); }
.finding h3 { font-size: 14px; font-weight: 550; margin: 0 0 7px; overflow-wrap: anywhere; }
.finding p { font-size: 13px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; }
.finding .finding-location { color: var(--muted); font-size: 11px; }
.finding .finding-interpretation { color: var(--muted); }
.limitations { margin-top: 25px; font-size: 12px; }
.limitations summary { cursor: pointer; color: var(--muted); }
.limitations ul { padding-left: 18px; color: var(--muted); line-height: 1.9; }
.limitations li { margin-top: 8px; overflow-wrap: anywhere; }
.privacy-note { border-top: 1px solid var(--line); padding-top: 20px; color: var(--muted); font-size: 10px; max-width: 100%; }
.privacy-note p { margin: 0 0 5px; line-height: 1.9; }
@media (max-width: 740px) {
  .site-header { padding: 20px; }
  main { padding: 32px 20px 22px; }
  .page-heading { align-items: start; flex-direction: column; gap: 15px; margin-bottom: 28px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .input-panel { padding: 22px 0 28px; border-right: 0; }
  .result-panel { padding: 26px 0 32px; border-top: 1px solid var(--line); }
  .empty-result { min-height: 180px; max-width: none; margin: 0; }
  .empty-result .empty-mark { display: none; }
  .result-summary { font-size: 16px; }
}


/* Wide responsive layout for embedded KNUH imaging page */
.site-header,
main {
  max-width: none;
  width: min(1680px, calc(100vw - clamp(32px, 4vw, 72px)));
  margin-left: auto;
  margin-right: auto;
}

.site-header {
  padding-left: 0;
  padding-right: 0;
}

main {
  padding-left: 0;
  padding-right: 0;
}

.workspace {
  width: 100%;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

.input-panel,
.result-panel {
  min-width: 0;
}

.input-panel {
  padding-right: clamp(28px, 3vw, 48px);
}

.result-panel {
  padding-left: clamp(28px, 3vw, 48px);
}

.empty-result {
  max-width: 620px;
}

@media (min-width: 1400px) {
  .workspace {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }

  .preview-grid img,
  .preview-grid video {
    max-height: 520px;
  }
}

@media (max-width: 899px) {
  .site-header,
  main {
    width: min(100%, calc(100vw - 40px));
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .input-panel {
    padding: 22px 0 28px;
    border-right: 0;
  }

  .result-panel {
    padding: 26px 0 32px;
    border-top: 1px solid var(--line);
  }

  .empty-result {
    min-height: 220px;
    max-width: none;
    margin: 0;
  }
}

@media (max-width: 520px) {
  .site-header,
  main {
    width: min(100%, calc(100vw - 28px));
  }

  .provider-options {
    grid-template-columns: 1fr;
  }
}
