/* noto-sans-thai-thai-400-normal */
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(./fonts/noto-sans-thai-thai-400-normal.woff2?v=57776453076ebf0f) format('woff2'), url(./fonts/noto-sans-thai-thai-400-normal.woff?v=e601a5a91e1b567f) format('woff');
}/* noto-sans-thai-latin-400-normal */
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(./fonts/noto-sans-thai-latin-400-normal.woff2?v=fde3c93cfbfd8c97) format('woff2'), url(./fonts/noto-sans-thai-latin-400-normal.woff?v=85016d5c37b7fba1) format('woff');
}/* noto-sans-thai-thai-600-normal */
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(./fonts/noto-sans-thai-thai-600-normal.woff2?v=8690b63cc8c70904) format('woff2'), url(./fonts/noto-sans-thai-thai-600-normal.woff?v=d99e288d30c02989) format('woff');
}/* noto-sans-thai-latin-600-normal */
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(./fonts/noto-sans-thai-latin-600-normal.woff2?v=351530d6156ff829) format('woff2'), url(./fonts/noto-sans-thai-latin-600-normal.woff?v=9211a24c1abf8833) format('woff');
}/* noto-sans-thai-thai-700-normal */
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(./fonts/noto-sans-thai-thai-700-normal.woff2?v=fa4acaf9f20aa6d9) format('woff2'), url(./fonts/noto-sans-thai-thai-700-normal.woff?v=fb4f163023f0564a) format('woff');
}/* noto-sans-thai-latin-700-normal */
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(./fonts/noto-sans-thai-latin-700-normal.woff2?v=af79e77ba9fd0823) format('woff2'), url(./fonts/noto-sans-thai-latin-700-normal.woff?v=fb5086fb04025abb) format('woff');
}
:root {
  --ink: #10233b;
  --muted: #5d6b7d;
  --navy: #092646;
  --navy-2: #123d66;
  --teal: #008f95;
  --teal-dark: #006f76;
  --ice: #edf7f7;
  --line: #d8e1e8;
  --paper: #ffffff;
  --canvas: #f4f7f9;
  --amber: #9a5b00;
  --amber-bg: #fff5dc;
  --danger: #a92d38;
  --danger-bg: #fff0f1;
  --shadow: 0 18px 50px rgba(22, 43, 66, .08);
  --radius: 18px;
  font-family: "Noto Sans Thai", "Leelawadee UI", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font-size: 16px; line-height: 1.6; }
button, select, input, textarea { font: inherit; }
button, select, input[type="file"] { min-height: 44px; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a, button, select, input, textarea, [tabindex]:focus { outline-offset: 3px; }
:focus-visible { outline: 3px solid #f6a500; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 99; padding: 10px 14px; background: white; color: var(--navy); transform: translateY(-140%); }
.skip-link:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

.site-header { color: white; background: linear-gradient(120deg, #071d36 0%, #0d3559 65%, #087b82 150%); border-bottom: 1px solid rgba(255,255,255,.14); }
.header-inner { width: min(1180px, calc(100% - 40px)); margin: 0 auto; min-height: 216px; padding: 38px 0 34px; display: flex; justify-content: space-between; gap: 28px; align-items: center; }
.brand-lockup { display: flex; gap: 18px; align-items: flex-start; }
.brand-mark { width: 54px; height: 54px; border: 1px solid rgba(255,255,255,.65); display: grid; place-items: center; color: #89e5e2; font-weight: 800; letter-spacing: .08em; flex: 0 0 auto; }
h1 { margin: 3px 0 8px; font-size: clamp(1.65rem, 3vw, 2.55rem); line-height: 1.16; letter-spacing: -.03em; }
.subtitle { margin: 0; color: #d5e3ee; font-size: 1rem; }
.header-note { margin: 6px 0 0; color: #a9c3d5; font-size: .88rem; }
.eyebrow { margin: 0; color: var(--teal); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.site-header .eyebrow { color: #75d9d8; }
.header-actions { display: grid; justify-items: end; gap: 14px; flex: 0 0 auto; }
.privacy-chip { padding: 6px 11px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; color: #cfe7ee; font-size: .82rem; }
.language-toggle { display: flex; padding: 3px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.23); border-radius: 10px; }
.lang-button { min-height: 38px; min-width: 48px; border: 0; border-radius: 7px; background: transparent; color: #d8e7ef; font-weight: 800; }
.lang-button.active { background: white; color: var(--navy); }

.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 56px; }
.intro-strip { display: grid; grid-template-columns: 120px 1fr; gap: 30px; align-items: center; margin: 26px 0; padding: 12px 18px; color: var(--muted); font-size: .82rem; }
.intro-strip > p { margin: 0; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.intro-strip ol { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0; }
.intro-strip li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.intro-strip li:not(:last-child)::after { content: ""; height: 1px; background: var(--line); flex: 1; margin: 0 10px; }
.intro-strip li span { color: var(--teal-dark); font-weight: 800; }
.intro-strip li strong { color: var(--ink); font-size: .83rem; white-space: nowrap; }

.academic-scope { position: relative; display: grid; grid-template-columns: 1fr 1.25fr; gap: 34px; margin: 0 0 26px; padding: 26px 30px; overflow: hidden; border: 1px solid #bfd5dc; border-top: 4px solid var(--teal-dark); border-radius: 14px; background: linear-gradient(135deg, #fff 0%, #f5fbfb 100%); box-shadow: 0 10px 28px rgba(22,43,66,.05); }
.academic-scope h2 { margin: 4px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; line-height: 1.3; letter-spacing: -.01em; }
.scope-lead { margin: 0; max-width: 54ch; color: var(--muted); }
.scope-index { position: absolute; top: -18px; right: 18px; color: rgba(0,111,118,.07); font: 900 7rem/1 Georgia, serif; }
.scope-points { position: relative; display: grid; gap: 0; }
.scope-points p { margin: 0; padding: 9px 0 9px 24px; border-bottom: 1px solid #dce9ec; color: #334a60; font-size: .9rem; }
.scope-points p:last-child { border-bottom: 0; }
.scope-points p::before { content: "✓"; position: absolute; margin-left: -24px; color: var(--teal-dark); font-weight: 900; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { display: grid; grid-template-columns: 150px 1fr; gap: 30px; padding: 30px 34px 24px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .section-heading h2 { margin: 0 0 5px; font-size: clamp(1.45rem, 2.5vw, 2rem); line-height: 1.3; }
.panel-heading p, .section-heading p { margin: 0; color: var(--muted); }
.step-kicker { display: flex; align-items: center; gap: 12px; color: var(--teal-dark); font-size: .78rem; font-weight: 800; letter-spacing: .14em; }
.step-kicker span:first-child { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: white; letter-spacing: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; padding: 30px 34px 18px; }
.field-stack { min-width: 0; }
.field-stack > label { display: block; margin-bottom: 9px; font-weight: 750; }
.field-stack > label span { color: var(--danger); }
select { width: 100%; padding: 0 44px 0 14px; border: 1px solid #bac7d1; border-radius: 9px; color: var(--ink); background: white; }
.field-help { min-height: 50px; margin: 8px 0 0; color: var(--muted); font-size: .9rem; }
.profile-preview { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 12px; padding: 9px 12px; background: var(--ice); border-left: 3px solid var(--teal); font-size: .82rem; }
.profile-preview span { color: var(--muted); }
.profile-preview code { color: var(--navy); font-weight: 700; word-break: break-all; }
.poster-mode-field { grid-column: 1 / -1; margin: 4px 0 0; padding: 20px; border: 1px solid #b9dbe2; border-radius: 14px; background: linear-gradient(135deg, #f4fbfc, #eef6fb); }
.poster-mode-field legend { padding: 0 8px; color: var(--navy); font-weight: 800; }
.mode-segment { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mode-segment label { position: relative; display: flex; min-height: 54px; align-items: center; justify-content: center; padding: 12px 16px; border: 1px solid #a9c7d1; border-radius: 11px; background: #fff; color: var(--navy); font-weight: 750; text-align: center; cursor: pointer; transition: border-color .18s, box-shadow .18s, background .18s; }
.mode-segment input { position: absolute; opacity: 0; pointer-events: none; }
.mode-segment label:has(input:checked) { border-color: var(--teal); background: #e6f7f7; box-shadow: 0 0 0 3px rgba(0, 166, 166, .15); }
.mode-segment label:has(input:focus-visible) { outline: 3px solid rgba(11, 39, 72, .28); outline-offset: 2px; }
.mode-explanation { min-height: 3em; margin: 14px 0 8px; color: var(--muted); line-height: 1.7; }
.poster-guidance { margin-top: 12px; border-top: 1px solid #c8dfe5; padding-top: 12px; }
.poster-guidance summary { color: var(--navy); font-weight: 800; cursor: pointer; }
.poster-guidance ul { margin: 12px 0 0; padding-left: 22px; color: var(--muted); line-height: 1.65; }
@media (max-width: 680px) { .mode-segment { grid-template-columns: 1fr; } .poster-mode-field { padding: 16px; } }
.system-status { margin: 24px 0; padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.system-status summary { color: var(--navy); font-weight: 800; cursor: pointer; }
.system-status p { color: var(--muted); }
.system-status ol { columns: 2; margin-bottom: 0; padding-left: 24px; }
.system-status li { break-inside: avoid; margin: 7px 0; }
@media (max-width: 680px) { .system-status ol { columns: 1; } }
.dropzone { min-height: 150px; padding: 24px; display: flex; gap: 18px; align-items: center; border: 1.5px dashed #91a8b8; border-radius: 12px; background: #f9fbfc; transition: .15s ease; }
.dropzone:hover, .dropzone.dragging { border-color: var(--teal); background: var(--ice); }
.drop-icon { width: 54px; height: 64px; display: grid; place-items: center; flex: 0 0 auto; border: 2px solid var(--teal-dark); border-radius: 4px 10px 4px 4px; color: var(--teal-dark); font-size: .78rem; font-weight: 900; }
.dropzone strong { display: block; font-size: 1rem; }
.dropzone p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.file-summary { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-top: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; }
.file-summary strong { display: block; word-break: break-word; }
.file-summary span { color: var(--muted); font-size: .84rem; }
.error-text { min-height: 24px; margin: 6px 0 0; color: var(--danger); font-weight: 650; font-size: .9rem; }
.action-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 10px 34px 32px; }
.primary-button, .secondary-button { border-radius: 9px; padding: 10px 17px; font-weight: 750; border: 1px solid transparent; }
.primary-button { color: white; background: var(--teal-dark); box-shadow: 0 8px 20px rgba(0,111,118,.16); }
.primary-button:hover:not(:disabled) { background: #005f64; }
.primary-button.full { width: 100%; margin-top: auto; }
.secondary-button { color: var(--navy); background: white; border-color: #aebdca; }
.secondary-button:hover:not(:disabled) { border-color: var(--teal-dark); color: var(--teal-dark); background: #f7fbfb; }
.secondary-button.full { width: 100%; margin-top: auto; }
.text-button { min-height: 36px; padding: 4px 2px; border: 0; background: transparent; color: var(--teal-dark); font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.text-button.danger { color: var(--danger); }
.status-text { color: var(--teal-dark); font-weight: 700; font-size: .9rem; }
.notice { padding: 12px 14px; border-left: 3px solid var(--amber); background: var(--amber-bg); color: #714500; }
.notice.amber { margin: 0 34px 8px; }
.notice.compact { margin: 14px 0 0; font-size: .88rem; }

.next-steps { margin-top: 48px; }
.section-heading { margin: 0 0 20px; }
.workflow-panel + .workflow-panel { margin-top: 24px; }
.workflow-tasks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.workflow-task { min-width: 0; padding: 26px 34px; background: white; }
.workflow-task-wide { grid-column: 1 / -1; }
.workflow-task h3 { margin: 0 0 8px; font-size: 1.08rem; }
.workflow-task > p { color: var(--muted); }
.workflow-upload-body { padding: 24px 34px 30px; }
.steps-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.step-card { position: relative; min-height: 270px; display: flex; flex-direction: column; align-items: flex-start; padding: 28px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(22,43,66,.04); }
.step-card-wide { grid-column: span 2; min-height: 0; }
.step-number { position: absolute; top: 18px; right: 22px; color: #dce7eb; font-size: 2.5rem; font-weight: 900; line-height: 1; }
.step-card h3 { max-width: calc(100% - 55px); margin: 0 0 10px; font-size: 1.15rem; }
.step-card > p { color: var(--muted); }
.inline-note { margin: 7px 0 0; color: var(--amber) !important; font-size: .85rem; }
.file-pair { width: 100%; margin: 12px 0 0; }
.file-pair div { display: grid; grid-template-columns: 58px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.file-pair dt { color: var(--muted); font-size: .8rem; font-weight: 800; }
.file-pair dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .82rem; word-break: break-all; }
.prompt-action-row { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; padding-right: 62px; }
.prompt-disclosure { min-width: 0; }
.prompt-disclosure summary { display: flex; gap: 10px; align-items: center; min-height: 42px; cursor: pointer; color: var(--navy); font-size: 1.15rem; font-weight: 800; list-style: none; }
.prompt-disclosure summary::-webkit-details-marker { display: none; }
.prompt-disclosure summary::before { content: "+"; width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #9db1bf; border-radius: 50%; color: var(--teal-dark); font-size: 1rem; line-height: 1; }
.prompt-disclosure[open] summary::before { content: "−"; }
.prompt-copy-actions { min-height: 42px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.prompt-box { width: 100%; max-height: 370px; overflow: auto; margin: 14px 0 0; padding: 20px; border-radius: 10px; background: #07192d; color: #d6e9ef; white-space: pre-wrap; font: .84rem/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; }
.result-upload { width: 100%; margin: 10px 0; padding: 18px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; border: 1px dashed #91a8b8; border-radius: 10px; color: var(--navy); font-weight: 750; }
.result-upload input { max-width: 100%; }
.paste-fallback { width: 100%; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.paste-fallback summary, .setup-note summary { cursor: pointer; color: var(--teal-dark); font-weight: 750; }
.paste-fallback textarea { width: 100%; margin: 12px 0; padding: 12px; resize: vertical; border: 1px solid #b6c5d0; border-radius: 8px; font: .85rem/1.5 ui-monospace, Consolas, monospace; }
.validation-error { width: 100%; margin-top: 14px; padding: 14px; border: 1px solid #e7b5ba; border-left: 4px solid var(--danger); border-radius: 8px; background: var(--danger-bg); color: #7e2029; }
.validation-error details { margin-top: 8px; }
.validation-error pre { overflow: auto; white-space: pre-wrap; }

.results-section { margin-top: 52px; padding: 32px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.results-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.results-title-group { display: flex; gap: 18px; align-items: flex-start; }
.results-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: flex-end; }
.meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; margin: 20px 0; border: 1px solid var(--line); background: var(--line); border-radius: 10px; }
.meta-item { min-width: 0; padding: 12px 14px; background: white; }
.meta-item span { display: block; color: var(--muted); font-size: .76rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.meta-item strong { display: block; margin-top: 3px; word-break: break-word; font-size: .9rem; }
.count-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.count-badge { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: #f8fafb; color: var(--ink); font-size: .83rem; font-weight: 750; }
.cards-list { display: grid; gap: 12px; }
.comment-card, .limitation-card { overflow: hidden; border: 1px solid var(--line); border-left-width: 5px; border-radius: 10px; background: white; }
.comment-card.critical { border-left-color: #a51f2e; }
.comment-card.major { border-left-color: #cb641a; }
.comment-card.minor { border-left-color: #1f6f91; }
.comment-card.editorial { border-left-color: #6e7885; }
.comment-card summary, .limitation-card summary { list-style: none; cursor: pointer; padding: 17px 18px; }
.comment-card summary::-webkit-details-marker, .limitation-card summary::-webkit-details-marker { display: none; }
.card-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card-head strong { margin-right: 4px; font-family: ui-monospace, Consolas, monospace; }
.badge { padding: 3px 8px; border-radius: 999px; background: #edf1f4; color: #33475c; font-size: .73rem; font-weight: 850; letter-spacing: .03em; }
.badge.priority-critical { background: #fde8ea; color: #8e1926; }
.badge.priority-major { background: #fff0e4; color: #9a4308; }
.badge.priority-minor { background: #e9f3f8; color: #175b79; }
.badge.priority-editorial { background: #eef0f2; color: #4d5965; }
.card-category { width: 100%; margin-top: 5px; color: var(--muted); font-size: .84rem; }
.card-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; padding: 0 18px 20px; border-top: 1px solid var(--line); }
.card-field { padding-top: 15px; min-width: 0; }
.card-field.wide { grid-column: span 2; }
.card-field h4 { margin: 0 0 4px; color: var(--muted); font-size: .78rem; letter-spacing: .03em; text-transform: uppercase; }
.card-field p, .card-field ul { margin: 0; overflow-wrap: anywhere; }
.card-field ul { padding-left: 20px; }
.source-card { margin-top: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; }
.source-card p { margin: 3px 0; }
.source-card a { color: var(--teal-dark); }
.limitations-heading { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; margin: 34px 0 14px; padding-top: 24px; border-top: 1px solid var(--line); }
.limitations-heading h3 { margin: 0; font-size: 1.25rem; }
.limitations-heading span { color: var(--muted); font-size: .85rem; }
.limitation-card { border-left-color: #706ca8; }
.empty-state { padding: 24px; border: 1px dashed #b9c5ce; border-radius: 10px; color: var(--muted); background: #fafcfd; }
.setup-note { margin-top: 24px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.setup-note p { color: var(--muted); }

footer { padding: 28px 20px 38px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }
footer p { margin: 3px 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 14px; }
.footer-links a, .policy-page a { color: var(--teal-dark); text-underline-offset: 3px; }
.policy-page { width: min(100% - 32px, 860px); margin: 0 auto; padding: 52px 0 72px; }
.policy-page .policy-header { margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.policy-page .back-link { display: inline-block; margin-bottom: 24px; font-weight: 750; }
.policy-page h1 { margin: 0 0 8px; color: var(--navy); font: 750 clamp(2rem, 5vw, 3.2rem)/1.08 Georgia, "Times New Roman", serif; }
.policy-page h2 { margin: 30px 0 9px; color: var(--navy); font-size: 1.25rem; }
.policy-page p, .policy-page li { color: #33475c; line-height: 1.75; }
.policy-page ul { padding-left: 24px; }
.policy-meta { color: var(--muted); font-size: .9rem; }
.policy-callout { margin: 26px 0; padding: 18px 20px; border-left: 4px solid var(--teal); background: #eef8f8; border-radius: 0 10px 10px 0; }

@media (max-width: 820px) {
  .header-inner { min-height: 0; align-items: flex-start; }
  .header-actions { justify-items: end; }
  .privacy-chip { display: none; }
  .intro-strip { grid-template-columns: 1fr; gap: 8px; padding-left: 0; padding-right: 0; }
  .intro-strip ol { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .intro-strip li::after { display: none; }
  .academic-scope { grid-template-columns: 1fr; gap: 18px; }
  .panel-heading { grid-template-columns: 1fr; gap: 14px; }
  .workflow-tasks { grid-template-columns: 1fr; }
  .workflow-task-wide { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .step-card-wide { grid-column: span 1; }
  .prompt-action-row { grid-template-columns: 1fr; padding-right: 48px; }
  .meta-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .header-inner, .shell { width: min(100% - 24px, 1180px); }
  .header-inner { display: grid; padding: 24px 0; }
  .brand-mark { width: 44px; height: 44px; }
  .header-actions { position: absolute; top: 16px; right: 12px; }
  .brand-lockup { padding-top: 46px; gap: 12px; }
  .intro-strip ol { grid-template-columns: 1fr; }
  .panel-heading, .form-grid, .workflow-task, .workflow-upload-body { padding-left: 20px; padding-right: 20px; }
  .action-row { padding: 10px 20px 24px; }
  .notice.amber { margin-left: 20px; margin-right: 20px; }
  .primary-button, .secondary-button { width: 100%; }
  .prompt-action-row { padding-right: 38px; }
  .prompt-copy-actions { width: 100%; }
  .dropzone { align-items: flex-start; padding: 18px; }
  .step-card { padding: 22px 20px; }
  .results-section { padding: 22px 16px; }
  .meta-grid { grid-template-columns: 1fr; }
  .card-body { grid-template-columns: 1fr; }
  .card-field.wide { grid-column: span 1; }
  .results-heading { align-items: flex-start; }
  .results-title-group { width: 100%; flex-direction: column; }
  .results-actions { width: 100%; justify-content: flex-start; }
}

@media print {
  @page { size: A4; margin: 15mm; }
  body { background: white; color: #111; font-size: 10.5pt; }
  .site-header, .intro-strip, .academic-scope, .request-panel, .next-steps, footer, .results-actions { display: none !important; }
  .shell { width: 100%; padding: 0; }
  .results-section { display: block !important; margin: 0; padding: 0; border: 0; box-shadow: none; }
  .results-section::before { content: "Independent Paper Reviewer CS/IT/CPE"; display: block; margin-bottom: 4mm; color: #092646; font: 700 18pt/1.25 Georgia, serif; }
  .comment-card, .limitation-card, .meta-grid, .source-card { break-inside: avoid; box-shadow: none; }
  .comment-card details, .limitation-card details { display: block; }
  .comment-card:not([open]) .card-body, .limitation-card:not([open]) .card-body { display: grid !important; }
  a { color: #111; text-decoration: none; }
}

.review-section { margin: 1.25rem 0; padding: 1.15rem; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.review-section > h3 { margin-top: 0; color: var(--ink); }
.section-note { color: var(--muted); margin-top: -.35rem; }
.dual-synthesis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.identity-blocked { margin: 1.25rem 0; padding: 1.25rem; border: 2px solid #b7791f; border-radius: 18px; background: #fff8e8; }
.identity-blocked h3 { margin-top: 0; color: #7a4b00; }
.audit-card,.evidence-card,.search-card,.calibration-card,.revision-card { margin: .75rem 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: clip; }
.audit-card summary,.evidence-card summary,.search-card summary,.calibration-card summary,.revision-card summary { padding: .85rem 1rem; cursor: pointer; }
.audit-filters { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .75rem; margin: 1rem 0; }
.audit-filters label { display: grid; gap: .35rem; color: var(--muted); font-size: .9rem; }
.audit-filters select { min-width: 0; padding: .65rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.status-pass { background: #e8f4f2; color: #155e55; }
.status-fail { background: #fff0f0; color: #9b1c1c; }
.status-uncertain { background: #fff8e6; color: #825800; }
.status-not-checkable,.status-not-applicable { background: #eef1f5; color: #465568; }
.trace-group { margin: .8rem 0; }
.trace-item,.risk-card { padding: .8rem; margin: .55rem 0; border-left: 3px solid var(--teal); background: #f7fafc; border-radius: 8px; }
.ref-links a { display: inline-block; color: #075985; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.raw-json { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 32rem; overflow: auto; padding: 1rem; background: #0b1728; color: #e8f0f8; border-radius: 12px; font-size: .82rem; }
@media (max-width: 800px) {
  .dual-synthesis,.audit-filters { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Accessible evidence detail and printed audit records. */
.card-field h4, .badge, .count-badge { font-size: .875rem; }
.novelty-panel { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.novelty-panel summary { cursor: pointer; font-weight: 700; }
.novelty-panel .card-body { margin-top: 12px; padding: 12px 0 0; }
#audit-panel .card-body { padding: 16px 0 0; }
@media print { #audit-panel .card-body, .novelty-panel .card-body { display: grid !important; } }

/* Academic workbench: restrained colour, clear hierarchy, compact workflow. */
:root { --navy: #163451; --navy-2: #244a6d; --teal: #315e87; --teal-dark: #244f78; --ice: #f1f5f9; --line: #d9e1e8; --canvas: #f5f7fa; --muted: #526276; --radius: 8px; --shadow: none; }
.site-header { background: #fff; color: var(--ink); border-top: 4px solid var(--navy); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 0; padding: 24px 0; align-items: center; }
.brand-lockup { gap: 16px; align-items: center; }
.brand-mark { width: 46px; height: 52px; border: 1px solid var(--line); border-radius: 4px; background: var(--navy); color: #fff; }
h1 { font-size: clamp(1.25rem, 2.4vw, 1.85rem); line-height: 1.35; letter-spacing: -.025em; margin: 3px 0; font-weight: 650; }
.site-header .eyebrow { color: var(--muted); font-size: .75rem; letter-spacing: .08em; }
.subtitle { color: var(--muted); font-size: .875rem; }
.header-note { display: none; }
.privacy-chip { border: 0; padding: 0; color: var(--muted); font-size: .75rem; }
.language-toggle { background: #f3f6f9; border: 1px solid var(--line); border-radius: 5px; }
.lang-button { color: var(--muted); border-radius: 3px; min-height: 34px; min-width: 42px; font-size: .875rem; }
.lang-button.active { background: var(--navy); color: #fff; }
.shell, .header-inner { width: min(1120px, calc(100% - 48px)); }
.intro-strip { grid-template-columns: 1fr; gap: 0; margin: 22px 0 16px; padding: 0; }
.intro-strip > p { display: none; }
.intro-strip ol { gap: 12px; }
.intro-strip li { padding: 10px 0; border-bottom: 2px solid var(--line); gap: 10px; }
.intro-strip li.is-current { border-bottom-color: var(--navy); }
.intro-strip li.is-complete { border-bottom-color: #8ba5bc; }
.intro-strip li::after { display: none; }
.intro-strip li strong { white-space: normal; font-size: .875rem; font-weight: 600; }
.intro-strip li span { font-size: .875rem; }
.academic-scope { display: block; padding: 0; margin: 0 0 8px; border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
.academic-scope summary { cursor: pointer; color: var(--muted); font-size: .875rem; font-weight: 600; padding: 6px 0; }
.academic-scope[open] { padding: 0 0 16px; border-bottom: 1px solid var(--line); }
.scope-points p { padding: 8px 0; border: 0; font-size: .875rem; }
.scope-points p::before { content: none; }
.scope-lead { max-width: none; font-size: .875rem; }
.use-note { color: var(--muted); font-size: .875rem; margin: 0 0 22px; }
h2, h3, h4 { font-weight: 650; }
.panel { border-radius: 8px; box-shadow: none; }
.panel-heading { grid-template-columns: 84px minmax(0,1fr); gap: 22px; padding: 24px 28px 20px; background: #fff; }
.panel-heading h2, .section-heading h2 { font-size: 1.375rem; }
.panel-heading p, .section-heading p { font-size: .9375rem; }
.step-kicker { flex-direction: column; align-items: flex-start; gap: 5px; font-size: .75rem; letter-spacing: .06em; }
.step-kicker span:first-child { width: 32px; height: 32px; border-radius: 4px; font-size: .875rem; }
.form-grid { padding: 24px 28px 12px; gap: 32px; }
.field-help { min-height: 0; font-size: .875rem; }
.dropzone { min-height: 124px; border-radius: 5px; background: #fafbfd; padding: 20px; }
.drop-icon { width: 42px; height: 50px; border-width: 1px; border-radius: 3px; }
select, .primary-button, .secondary-button { border-radius: 5px; }
.primary-button { background: var(--navy); box-shadow: none; font-weight: 600; }
.primary-button:hover:not(:disabled) { background: #244a6d; }
.secondary-button { font-weight: 600; border-color: #9eafbe; }
.action-row { padding: 12px 28px 24px; border-top: 1px solid #edf1f5; }
.poster-mode-field { background: #f5f8fb; border-color: var(--line); border-radius: 6px; }
.system-status, .review-section { border-radius: 6px; }
.system-status summary { font-weight: 600; }
.next-steps { margin-top: 28px; }
.workflow-task { padding: 22px 28px; }
.workflow-upload-body { padding: 22px 28px; }
.prompt-action-row { padding-right: 0; }
.prompt-disclosure summary { font-size: 1rem; font-weight: 600; }
.prompt-disclosure summary::before { border-radius: 3px; width: 22px; height: 22px; }
.results-section { margin-top: 32px; padding: 28px; border-radius: 8px; }
.results-heading { align-items: flex-start; flex-wrap: wrap; }
.results-title-group .step-kicker { flex-direction: row; align-items: center; }
.results-title-group .step-kicker > span:last-child { display: none; }
.results-actions { gap: 8px; }
.results-actions .secondary-button { font-size: .875rem; }
#download-pdf { background: var(--navy); color: #fff; border-color: var(--navy); }
.export-help { font-size: .875rem; color: var(--muted); margin: 12px 0; }
.report-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.report-nav a { font-size: .875rem; color: var(--navy); text-underline-offset: 4px; }
.meta-grid { border-radius: 4px; }
.meta-item span { text-transform: none; letter-spacing: 0; font-size: .75rem; }
.meta-item strong { font-size: .875rem; font-weight: 600; }
.review-section { padding: 20px 0; border: 0; border-top: 1px solid var(--line); }
.review-section > h3 { font-size: 1.2rem; margin-bottom: 16px; }
.card-body { gap: 12px 24px; }
.card-field h4 { text-transform: none; letter-spacing: 0; color: var(--navy); font-size: .875rem; }
.card-field p, .card-field ul { line-height: 1.8; }
.audit-card, .evidence-card, .search-card, .calibration-card, .revision-card, .comment-card, .limitation-card { border-radius: 5px; overflow: visible; }
.card-head { padding-right: 16px; }
.card-preview { margin: 8px 0 0; font-weight: 600; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.audit-card summary, .evidence-card summary, .search-card summary, .calibration-card summary, .revision-card summary, .comment-card summary, .limitation-card summary { position: relative; padding: 16px 36px 16px 16px; list-style: none; }
.audit-card summary::after, .evidence-card summary::after, .search-card summary::after, .calibration-card summary::after, .revision-card summary::after, .comment-card summary::after, .limitation-card summary::after { content: "+"; position: absolute; top: 16px; right: 16px; color: var(--muted); }
details[open] > summary::after { content: "−"; }
.badge { font-weight: 600; border-radius: 3px; letter-spacing: 0; }
.count-badge { border-radius: 4px; font-weight: 600; }
.trace-item, .risk-card { border-radius: 3px; }
:focus-visible { outline: 3px solid #276ca5; outline-offset: 3px; }
[id] { scroll-margin-top: 20px; }
.report-print { display: none; }
@media (max-width: 820px) {
  .header-inner { align-items: flex-start; }
  .panel-heading { grid-template-columns: 48px minmax(0,1fr); gap: 12px; }
  .step-kicker > span:last-child { display: none; }
  .results-heading { display: block; }
  .results-actions { justify-content: flex-start; margin-top: 16px; }
  .dual-synthesis { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 560px) {
  .shell, .header-inner { width: calc(100% - 32px); }
  .header-inner { display: flex; padding: 20px 0; gap: 10px; }
  .header-actions { position: static; }
  .brand-lockup { padding-top: 0; gap: 10px; align-items: flex-start; }
  .brand-mark { display: none; }
  .subtitle { font-size: .875rem; }
  .site-header .eyebrow { font-size: .75rem; letter-spacing: 0; }
  .intro-strip ol { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 16px; }
  .panel-heading, .form-grid, .workflow-task, .workflow-upload-body { padding-left: 18px; padding-right: 18px; }
  .action-row { padding: 16px 18px 20px; }
  .prompt-action-row { padding-right: 0; }
  .results-section { padding: 20px 16px; }
  .results-title-group { flex-direction: row; gap: 12px; }
  .results-title-group h2 { font-size: 1.25rem; }
  .report-nav { gap: 10px 18px; }
  .mode-segment label { text-align: left; }
}
@media print {
  @page { size: A4; margin: 18mm 16mm 20mm; @bottom-left { content: "Independent Paper Reviewer · AI-assisted preliminary review"; font: 8pt Arial, sans-serif; color: #526276; } @bottom-right { content: counter(page) " / " counter(pages); font: 8pt Arial, sans-serif; color: #526276; } }
  body { font-size: 10.5pt; line-height: 1.65; background: #fff; }
  body.report-prepared > :not(.report-print) { display: none !important; }
  body.report-prepared > .report-print { display: block !important; }
  .report-print { color: #172c40; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .report-cover { break-after: page; padding-top: 18mm; }
  .report-cover .eyebrow { font-size: 9pt; color: #526276; }
  .report-cover h1 { font: 600 27pt/1.3 Georgia, "Noto Sans Thai", serif; margin: 8mm 0 4mm; color: #163451; }
  .report-cover .report-manuscript { font-size: 13pt; margin: 0 0 10mm; overflow-wrap: anywhere; }
  .report-cover .meta-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .report-cover .meta-item { padding: 3mm; }
  .report-note { border-top: 1px solid #d9e1e8; margin-top: 8mm; padding-top: 5mm; font-size: 10pt; color: #526276; }
  .report-contents { display: grid; grid-template-columns: 1fr 1fr; gap: 2mm 8mm; margin-top: 7mm; padding: 0; list-style: none; font-size: 10pt; }
  .report-contents a { color: #163451; }
  .report-chapter { break-before: auto; margin-top: 9mm; }
  .report-chapter:nth-child(2) { margin-top: 0; }
  #report-detailed-audit, #report-comments { break-before: page; margin-top: 0; }
  .report-chapter > h2 { font-size: 17pt; color: #163451; border-bottom: 2px solid #163451; margin: 0 0 6mm; padding-bottom: 3mm; break-after: avoid; }
  .report-print .review-section { margin: 0; padding: 0; border: 0; }
  .report-print .review-section > h3 { display: none; }
  .report-print .dual-synthesis { display: block; }
  .report-print .audit-filters, .report-print .raw-json { display: none !important; }
  .report-print details { display: block; }
  .report-print details > summary { display: block; cursor: default; break-after: avoid; padding: 3mm; }
  .report-print details > summary::after { display: none; }
  .report-print .card-body { display: block !important; border-top: 1px solid #d9e1e8; padding: 0 3mm 4mm; }
  .report-print .card-field { padding-top: 3mm; }
  .report-print .card-field h4 { font-size: 9pt; margin-bottom: 1mm; break-after: avoid; }
  .report-print .card-field p, .report-print .card-field ul { font-size: 10.5pt; line-height: 1.65; }
  .report-print .comment-card, .report-print .limitation-card, .report-print .audit-card, .report-print .evidence-card, .report-print .search-card, .report-print .revision-card, .report-print .calibration-card, .report-print .source-card { break-inside: auto; overflow: visible; border-radius: 0; margin: 0 0 5mm; box-shadow: none; }
  .report-print h3, .report-print h4, .report-print .card-head { break-after: avoid; }
  .report-print p, .report-print li { orphans: 3; widows: 3; overflow-wrap: anywhere; }
  .report-print .badge { font-size: 8pt; border: 1px solid #d9e1e8; }
  .report-print .card-preview { font-size: 11pt; }
  .report-print .identity-blocked { border-radius: 0; margin: 0; }
  .report-print a { text-decoration: none; color: #244f78; }
}

.gate-table { width: 100%; border-collapse: collapse; grid-column: 1 / -1; font-size: .875rem; margin-top: 16px; }
.gate-table caption { text-align: left; font-weight: 600; padding-bottom: 8px; color: var(--navy); }
.gate-table th, .gate-table td { padding: 7px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.gate-table th { background: #f1f5f9; font-weight: 600; }
@media print {
  html { background: #fff; }
  .report-print .system-status { background: #fff; padding: 0; border: 0; border-radius: 0; margin: 0; }
  .report-print .gate-table { font-size: 9pt; break-inside: avoid; }
  .report-print .gate-table th, .report-print .gate-table td { padding: 1.5mm 3mm; }
}
@media print {
  .report-cover { padding-top: 10mm; }
  .report-cover h1 { margin-top: 6mm; }
  .report-cover .report-manuscript { margin-bottom: 8mm; }
  .report-cover .meta-item { padding: 2.5mm 3mm; }
  .report-cover .meta-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .report-cover .report-note { margin-top: 5mm; padding-top: 4mm; }
  .report-cover .report-contents { margin-top: 5mm; font-size: 9pt; line-height: 1.5; }
  .report-cover .report-identity .card-field { padding-top: 2mm; }
}

#pdf-download-status { font-size: .88rem; color: var(--muted); flex-basis: 100%; }

.feedback-panel { display: grid; grid-template-columns: minmax(220px,.65fr) minmax(0,1fr); gap: 3rem; padding: 2rem; margin-top: 2rem; }
.feedback-intro h2 { font-size: 1.4rem; margin: .4rem 0 1rem; }
.feedback-intro p { color: var(--muted); line-height: 1.8; }
.feedback-panel fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.feedback-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.3rem; }
.feedback-panel label { display: block; font-size: 1rem; margin-bottom: .5rem; }
.feedback-panel input[type=text], .feedback-panel input[type=email], .feedback-panel textarea { width: 100%; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 6px; background: white; font: inherit; }
.feedback-panel textarea { min-height: 160px; resize: vertical; }
.feedback-panel input:focus-visible, .feedback-panel textarea:focus-visible { outline: 2px solid var(--teal-dark); outline-offset: 2px; }
.feedback-message-label { display: flex; justify-content: space-between; gap: 1rem; }
#feedback-count, #feedback-note { font-size: .9rem; color: var(--muted); }
.feedback-panel .feedback-consent { display: flex; align-items: flex-start; gap: .7rem; margin: 1rem 0; cursor: pointer; }
.feedback-consent input { margin-top: .3rem; width: 18px; height: 18px; flex-shrink: 0; }
.feedback-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
#feedback-status { margin: .7rem 0 0; overflow-wrap: anywhere; }
.feedback-panel button:disabled { opacity: .65; cursor: wait; }
@media (max-width: 760px) { .feedback-panel { grid-template-columns: 1fr; gap: 1.2rem; padding: 1.3rem; } .feedback-contact { grid-template-columns: 1fr; gap: 1rem; } }
@media print { .feedback-panel { display: none !important; } }

.language-warning { margin: 0 0 1.5rem; padding: 1rem 1.2rem; background: var(--ice); border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 8px; overflow-wrap: anywhere; }
.language-warning p { margin: .5rem 0; }
.language-warning li { font-size: .88rem; }

/* Mobile handoff uses a native link and a selectable clipboard fallback. */
#open-chat { display: block; text-align: center; text-decoration: none; min-height: 44px; }
.mobile-handoff { margin-top: 1rem; font-size: 1rem; overflow-wrap: anywhere; }
.mobile-handoff summary { cursor: pointer; padding: .5rem 0; }
.mobile-handoff ol { padding-left: 1.5rem; }
.mobile-handoff li { margin: .7rem 0; line-height: 1.7; }
.mobile-handoff p { font-size: .9rem; }
.manual-prompt { width: 100%; min-width: 0; font-size: 16px; padding: .75rem; border: 1px solid var(--line); border-radius: 5px; }
@media (max-width: 560px) { input, select, textarea { font-size: 16px; } .prompt-copy-actions { min-width: 0; } }
