:root {
  --navy-950: #071a2f;
  --navy-900: #102848;
  --navy-800: #193858;
  --cyan-500: #17aebe;
  --cyan-100: #dcf6f8;
  --blue-50: #f3f8fc;
  --slate-900: #182532;
  --slate-700: #405365;
  --slate-500: #718091;
  --slate-300: #cbd5df;
  --slate-200: #dce4eb;
  --slate-100: #edf2f6;
  --white: #ffffff;
  --danger: #b53c45;
  --warning: #946200;
  --shadow: 0 18px 48px rgba(21, 43, 66, 0.14);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  color: var(--slate-900);
  background: var(--blue-50);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100vh; font-size: 16px; line-height: 1.55; }
button, input, select { font: inherit; }
button, a, input, select { outline-offset: 3px; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
[hidden] { display: none !important; }
.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; }

.setup-shell {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(23,174,190,.08) 0 1px, transparent 1px 36px),
    radial-gradient(circle at 12% 16%, rgba(23,174,190,.15), transparent 28%),
    var(--blue-50);
  background-size: 36px 36px, auto, auto;
}
.brand-strip { min-height: 104px; padding: 22px clamp(20px, 5vw, 72px); background: var(--navy-900); color: white; display: flex; align-items: center; gap: 16px; }
.brand-strip h1 { font-size: clamp(1.3rem, 2.6vw, 1.8rem); margin: 0; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; color: var(--navy-900); background: var(--cyan-100); font-size: 1.6rem; flex: 0 0 auto; }
.brand-mark.small { width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; }
.eyebrow { margin: 0 0 4px; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 800; color: var(--cyan-500); }
.brand-strip .eyebrow { color: #81e4eb; }
.local-badge { margin-left: auto; border: 1px solid rgba(255,255,255,.25); border-radius: 99px; padding: 7px 12px; font-size: .82rem; color: #dcecf4; }
.setup-grid { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: clamp(28px, 6vw, 72px) 0; display: grid; grid-template-columns: .88fr 1.12fr; gap: 28px; align-items: stretch; }
.setup-card { background: rgba(255,255,255,.96); border: 1px solid var(--slate-200); border-radius: 20px; padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow); }
.intro-card { background: var(--navy-900); color: white; position: relative; overflow: hidden; }
.intro-card::after { content: ""; position: absolute; width: 240px; height: 240px; border: 38px solid rgba(39,199,216,.08); border-radius: 50%; right: -105px; bottom: -105px; }
.step-number { font: 800 4rem/1 Georgia, serif; color: rgba(129,228,235,.22); }
.setup-card h2 { margin: 6px 0 12px; font-size: clamp(1.35rem, 2.4vw, 2rem); line-height: 1.2; }
.intro-card > p:not(.eyebrow) { color: #c8d7e4; max-width: 40ch; }
.guardrails { list-style: none; margin: 28px 0; padding: 0; display: grid; gap: 12px; }
.guardrails li { display: flex; gap: 10px; align-items: flex-start; }
.guardrails li::before { content: "✓"; color: #81e4eb; font-weight: 800; }
.flow-map { margin-top: 38px; display: flex; align-items: center; gap: 10px; font-size: .82rem; color: #c8d7e4; }
.flow-map i { height: 1px; flex: 1; background: rgba(255,255,255,.28); }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 24px 0; }
.field { display: grid; gap: 7px; font-size: .92rem; font-weight: 700; }
.field.span-2 { grid-column: span 2; }
.field input, .field select { width: 100%; min-height: 46px; padding: 9px 12px; border: 1px solid var(--slate-300); border-radius: 9px; color: var(--slate-900); background: white; }
.field input:focus, .field select:focus, .search-box:focus-within { border-color: var(--cyan-500); box-shadow: 0 0 0 3px rgba(23,174,190,.14); }
.field small, .microcopy { color: var(--slate-500); font-size: .78rem; font-weight: 400; }
.consent-check { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 1px solid var(--slate-200); background: var(--blue-50); border-radius: 10px; font-size: .85rem; color: var(--slate-700); }
.consent-check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--navy-900); }
.primary-button, .secondary-button, .text-button, .icon-button, .compose-button, .action-button { border: 0; border-radius: 9px; min-height: 42px; padding: 9px 16px; font-weight: 750; }
.primary-button { background: var(--navy-900); color: white; }
.primary-button:hover { background: var(--navy-800); }
.primary-button.wide { width: 100%; margin-top: 18px; min-height: 50px; }
.secondary-button { border: 1px solid var(--slate-300); background: white; color: var(--navy-900); }
.text-button { padding: 4px; min-height: auto; background: transparent; color: var(--navy-800); }
.text-button.danger { color: var(--danger); margin-top: 12px; }
.microcopy { text-align: center; margin: 10px 0 0; }

.mail-app { min-height: 100vh; background: var(--white); }
.app-header { height: 70px; padding: 0 24px; display: grid; grid-template-columns: 220px minmax(240px, 620px) 1fr; gap: 24px; align-items: center; background: var(--navy-900); color: white; }
.app-brand { color: white; text-decoration: none; display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.08rem; }
.search-box { min-width: 0; min-height: 42px; padding: 0 14px; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); border-radius: 10px; }
.search-box input { width: 100%; border: 0; outline: 0; color: white; background: transparent; }
.search-box input::placeholder { color: #bfd0dc; }
.session-chip { justify-self: end; display: flex; align-items: center; gap: 9px; min-width: 0; max-width: 260px; font-size: .84rem; color: #d9e6ef; }
.session-identity { min-width: 0; }
.session-identity small { display: block; font-size: .66rem; color: #b9d0e1; }
.session-identity strong { display: block; color: white; line-height: 1.3; overflow-wrap: anywhere; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; background: var(--cyan-100); color: var(--navy-900); border-radius: 50%; font-weight: 800; }
.identity-avatar { flex-shrink: 0; background: #d5e7fa; color: #204e7d; letter-spacing: .02em; }
.notice-bar { min-height: 40px; padding: 8px 24px; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--cyan-100); color: #174a53; font-size: .84rem; border-bottom: 1px solid #b7e8ec; }
.app-grid { height: calc(100vh - 110px); min-height: 620px; display: grid; grid-template-columns: 220px minmax(330px, 420px) minmax(420px, 1fr); }
.sidebar { padding: 22px 14px; background: var(--blue-50); border-right: 1px solid var(--slate-200); display: flex; flex-direction: column; }
.compose-button { margin: 0 8px 20px; background: var(--cyan-500); color: var(--navy-950); }
.nav-item { min-height: 42px; padding: 9px 12px; display: flex; align-items: center; gap: 12px; border-radius: 8px; text-decoration: none; color: var(--slate-700); }
.nav-item.active { background: #dcebf6; color: var(--navy-900); font-weight: 800; }
.nav-item strong { margin-left: auto; }
.nav-item.muted { opacity: .65; }
.sidebar-footer { margin-top: auto; padding: 18px 12px 4px; border-top: 1px solid var(--slate-200); font-size: .8rem; color: var(--slate-500); }
.progress-track { height: 6px; margin: 9px 0; background: var(--slate-200); border-radius: 99px; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--cyan-500); transition: width .2s ease; }
.sidebar-footer strong { color: var(--slate-700); }
.inbox-panel { min-width: 0; border-right: 1px solid var(--slate-200); display: flex; flex-direction: column; }
.inbox-toolbar { min-height: 94px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--slate-200); }
.inbox-toolbar h1 { font-size: 1.35rem; margin: 0; }
.toolbar-actions { display: flex; gap: 8px; }
.icon-button { width: 40px; padding: 0; border: 1px solid var(--slate-200); background: white; color: var(--slate-700); }
.mail-list { overflow-y: auto; }
.mail-row { width: 100%; min-height: 92px; padding: 14px 18px; display: grid; grid-template-columns: 38px 1fr auto; column-gap: 12px; text-align: left; color: inherit; background: white; border: 0; border-bottom: 1px solid var(--slate-100); position: relative; }
.mail-row::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: transparent; }
.mail-row.unread { background: #f8fbfd; }
.mail-row.unread::before { background: var(--cyan-500); }
.mail-row:hover, .mail-row.selected { background: #edf6fa; }
.sender-avatar { grid-row: span 2; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--slate-100); color: var(--navy-800); font-size: .84rem; font-weight: 800; }
.mail-sender { font-size: .88rem; font-weight: 800; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mail-time { font-size: .76rem; color: var(--slate-500); }
.mail-subject { grid-column: 2 / 4; min-width: 0; display: flex; align-items: baseline; font-size: .86rem; font-weight: 700; }
.mail-subject-text { min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mail-preview { grid-column: 2 / 4; font-size: .78rem; color: var(--slate-500); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mail-state { flex: none; margin-left: 8px; padding: 1px 5px; border-radius: 4px; color: var(--slate-700); background: var(--slate-100); font-size: .72rem; font-weight: 500; white-space: nowrap; }
.reading-pane { min-width: 0; overflow-y: auto; background: white; }
.blank-reading { height: 100%; min-height: 320px; display: grid; place-content: center; justify-items: center; color: var(--slate-500); text-align: center; }
.blank-reading h2 { margin: 14px 0 2px; color: var(--slate-700); }
.blank-reading p { margin: 0; }
.blank-icon { width: 72px; height: 72px; display: grid; place-items: center; border: 1px solid var(--slate-200); border-radius: 50%; font-size: 2rem; color: var(--cyan-500); }
.message-header { padding: 26px 30px 20px; border-bottom: 1px solid var(--slate-200); }
.message-header h2 { margin: 0 0 18px; font-size: clamp(1.3rem, 2vw, 1.8rem); line-height: 1.3; }
.sender-line { display: flex; align-items: center; gap: 12px; }
.sender-info { min-width: 0; }
.sender-info strong, .sender-info span { display: block; overflow-wrap: anywhere; }
.sender-info span { color: var(--slate-500); font-size: .8rem; }
.message-time { margin-left: auto; color: var(--slate-500); font-size: .8rem; white-space: nowrap; }
.message-body { padding: 30px; color: #2b3947; line-height: 1.8; }
.message-body p { max-width: 64ch; }
.mail-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 10px 0 18px; padding: 10px 19px; background: var(--navy-900); color: white; text-decoration: none; border-radius: 8px; font-weight: 800; }
.mail-signature { color: var(--slate-500); white-space: pre-line; }
.message-actions { position: sticky; bottom: 0; padding: 14px 30px; display: flex; flex-wrap: wrap; gap: 9px; background: rgba(255,255,255,.97); border-top: 1px solid var(--slate-200); }
.action-button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; border: 1px solid var(--slate-300); background: white; color: var(--navy-900); }
.action-button:hover { background: var(--blue-50); }
.action-button.report { color: var(--danger); }
.action-button.done { background: var(--slate-100); color: var(--slate-500); }
.empty-state { margin: 40px 20px; padding: 28px; display: grid; justify-items: center; color: var(--slate-500); border: 1px dashed var(--slate-300); border-radius: 12px; }

.dialog-card { width: min(480px, calc(100% - 32px)); padding: 30px; border: 0; border-radius: 18px; box-shadow: var(--shadow); }
.dialog-card::backdrop { background: rgba(7,26,47,.58); backdrop-filter: blur(3px); }
.dialog-card h2 { margin: 6px 0 12px; }
.dialog-close { float: right; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--slate-100); font-size: 1.4rem; }
.safe-note { padding: 12px; border-left: 4px solid var(--cyan-500); background: var(--cyan-100); color: #174a53; }
.complete-card { text-align: center; }
.complete-symbol { margin: 0 auto 14px; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--cyan-100); color: #087481; font-size: 1.8rem; font-weight: 900; }
.export-row { display: flex; justify-content: center; gap: 10px; margin: 22px 0; }
.complete-card details { border-top: 1px solid var(--slate-200); padding-top: 14px; color: var(--slate-500); font-size: .85rem; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 30; display: grid; gap: 8px; }
.toast { width: min(340px, calc(100vw - 40px)); padding: 12px 14px; border-radius: 9px; background: var(--navy-950); color: white; box-shadow: var(--shadow); font-size: .85rem; animation: toast-in .18s ease-out; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 980px) {
  .setup-grid { grid-template-columns: 1fr; max-width: 720px; }
  .app-header { grid-template-columns: auto minmax(0,1fr) auto; }
  .app-brand span:last-child { display: none; }
  .session-chip { max-width: 42vw; }
  .app-grid { grid-template-columns: 72px minmax(300px, 380px) 1fr; }
  .sidebar { padding-inline: 8px; }
  .compose-button { width: 48px; padding: 0; margin-inline: 4px; font-size: 0; }
  .compose-button::first-letter { font-size: 1.3rem; }
  .nav-item { justify-content: center; font-size: 0; }
  .nav-item span, .nav-item strong { font-size: 1rem; margin: 0; }
  .sidebar-footer { display: none; }
}

@media (max-width: 720px) {
  .brand-strip { padding: 18px 20px; }
  .local-badge { display: none; }
  .setup-grid { width: min(100% - 24px, 620px); padding: 18px 0; }
  .setup-card { padding: 22px; border-radius: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .flow-map { display: none; }
  .app-header { height: 64px; padding: 0 14px; gap: 10px; }
  .notice-bar { min-height: 50px; padding: 7px 14px; text-align: left; justify-content: flex-start; }
  .app-grid { height: calc(100vh - 114px); min-height: 520px; display: block; }
  .sidebar { display: none; }
  .inbox-panel { height: 100%; border-right: 0; }
  .reading-pane { position: fixed; inset: 114px 0 0; z-index: 10; transform: translateX(100%); transition: transform .18s ease-out; }
  .reading-pane.mobile-open { transform: translateX(0); }
  .message-header, .message-body { padding-inline: 20px; }
  .message-actions { padding: 12px 20px; }
  .message-header::before { content: "‹ 返回收件箱"; display: inline-block; margin-bottom: 18px; color: var(--navy-800); font-weight: 800; cursor: pointer; }
  .search-box { min-width: 0; }
}

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

/* Participant flow, using the same visual language as the existing inbox. */
body { background: #f4f6f8; }
textarea { font: inherit; resize: vertical; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #15939f; outline-offset: 4px; }
.study-header { min-height: 82px; padding: 18px max(24px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; gap: 20px; background: white; border-bottom: 1px solid var(--slate-200); }
.study-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy-900); font-weight: 800; font-size: 1.15rem; }
.brand-subtitle { display: block; font-size: .72rem; color: var(--slate-500); font-weight: 500; letter-spacing: .04em; }
.study-tag { margin-left: auto; padding: 6px 12px; border: 1px solid var(--slate-200); border-radius: 6px; font-size: .78rem; color: var(--slate-700); background: var(--blue-50); }
.study-layout { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 370px minmax(0, 1fr); gap: 48px; padding: 42px 24px 64px; align-items: start; }
.study-context { position: sticky; top: 30px; background: var(--navy-900); color: white; border-radius: 18px; padding: 34px 30px; overflow: hidden; }
.context-kicker { color: #82d8de; font-size: .77rem; letter-spacing: .08em; }
.study-context h1 { margin: 18px 0; font-size: 2rem; line-height: 1.5; font-weight: 650; }
.study-context > p { color: #c4d3df; font-size: .88rem; line-height: 1.9; }
.study-steps { list-style: none; padding: 0; margin: 32px 0; display: grid; gap: 23px; }
.study-steps li { display: flex; gap: 14px; align-items: center; color: #a7bbce; }
.study-steps li > span { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #3e526c; display: grid; place-items: center; font-size: .78rem; }
.study-steps .current { color: white; }
.study-steps .current > span { background: #8fe3e5; color: var(--navy-900); border-color: transparent; }
.study-steps strong { display: block; font-size: .9rem; font-weight: 600; }
.study-steps small { display: block; font-size: .73rem; margin-top: 3px; font-weight: 400; }
.context-note { padding-top: 20px; border-top: 1px solid #314861; display: flex; align-items: center; gap: 14px; color: #b7cdda; font-size: .77rem; }
.context-note p { margin: 0; line-height: 1.8; }
.context-link { display: inline-block; margin-top: 26px; color: #90dade; font-size: .78rem; text-decoration: none; }
.survey-card { background: white; padding: 34px 36px; border: 1px solid var(--slate-200); border-radius: 18px; box-shadow: 0 4px 24px rgba(22,46,64,.035); min-width: 0; }
.survey-card h2, .survey-card h1 { margin: 7px 0 12px; font-size: 1.7rem; line-height: 1.45; font-weight: 700; }
.survey-card h2[tabindex="-1"]:focus { outline: none; }
.survey-description { font-size: .87rem; line-height: 1.9; color: var(--slate-700); margin-bottom: 22px; }
.study-facts { display: flex; flex-wrap: wrap; gap: 9px; margin: 23px 0 27px; }
.study-facts span { padding: 5px 9px; font-size: .74rem; color: #31606a; background: #edf6f5; border-radius: 5px; }
.question { border: 0; padding: 0 0 24px; margin: 0 0 24px; min-width: 0; border-bottom: 1px solid var(--slate-100); }
.question legend { position: relative; width: 100%; padding: 0 0 0 34px; margin: 0 0 12px; font-size: 1.25rem; font-weight: 700; line-height: 1.55; color: var(--navy-900); overflow-wrap: anywhere; }
.question-number { position: absolute; left: 0; top: .2em; font-size: .875rem; font-weight: 600; color: #6a8298; font-variant-numeric: tabular-nums; }
.answer-options { display: flex; flex-wrap: wrap; gap: 10px; }
.answer-option { display: flex; align-items: center; gap: 10px; padding: 11px 15px; min-height: 48px; max-width: 100%; border: 1px solid var(--slate-200); border-radius: 10px; background: #fff; font-size: 1rem; line-height: 1.55; color: #30465b; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.answer-option span { min-width: 0; overflow-wrap: anywhere; }
.answer-option:hover { border-color: #8db9c0; background: #f7fbfc; }
.answer-option:has(input:checked) { border-color: #168d98; background: #edf8f8; color: #0b636d; box-shadow: inset 0 0 0 1px #168d98; }
.answer-option:has(input:focus-visible) { outline: 3px solid rgba(21,147,159,.3); outline-offset: 2px; }
.answer-option input { width: 18px; height: 18px; margin: 0; accent-color: #168d98; flex-shrink: 0; }
.survey-actions { margin-top: 26px; padding-top: 23px; border-top: 1px solid var(--slate-200); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.subtle { font-size: .74rem; color: var(--slate-500); }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 22px 0 0; }
.button-link { display: inline-flex; text-decoration: none; justify-content: center; align-items: center; }
.consent-copy, .debrief-copy { font-size: .85rem; line-height: 1.9; color: var(--slate-700); }
.consent-copy h3, .debrief-copy h3 { color: var(--navy-900); font-size: .98rem; margin: 24px 0 8px; }
.consent-copy { margin-bottom: 25px; }
.form-error { padding: 12px; border-radius: 7px; background: #fff1f1; color: #ad3038; font-size: .84rem; overflow-wrap: anywhere; }
.questionnaire-progress { margin-bottom: 22px; }
.questionnaire-progress > div:first-child { display: flex; justify-content: space-between; gap: 15px; flex-wrap: wrap; font-size: .72rem; color: var(--slate-500); }
.nickname-card { display: grid; grid-template-columns: 56px minmax(0,1fr) auto; align-items: center; gap: 10px 14px; padding: 20px; border: 1px solid #c9def3; border-left: 4px solid #4d84bb; background: #eef5fd; border-radius: 10px; margin-bottom: 24px; }
.nickname-card .identity-label { grid-column: 1 / -1; margin: 0 0 3px; font-size: .8rem; font-weight: 650; color: #3f6387; }
.nickname-card .identity-avatar { width: 56px; height: 56px; font-size: 1.15rem; }
.nickname-card #system-nickname { display: block; font-size: clamp(1.3rem,2vw,1.65rem); line-height: 1.25; color: var(--navy-900); overflow-wrap: anywhere; }
.nickname-card button { justify-self: end; font-size: .74rem; font-weight: 500; color: #4d6680; min-height: 36px; padding: 6px; }
.nickname-card button:hover:not(:disabled) { text-decoration: underline; }
.nickname-card .identity-reminder { grid-column: 2 / -1; margin: 0; font-size: .81rem; line-height: 1.65; color: #2c4f71; }
.nickname-card .identity-note { grid-column: 2 / -1; margin: 0; font-size: .72rem; line-height: 1.65; color: #546b82; }
.identity-pending { font-size: .8rem; color: var(--slate-700); margin: 0 0 22px; }
.question textarea { width: 100%; padding: 12px; border: 1px solid var(--slate-300); border-radius: 8px; font-size: 1rem; line-height: 1.6; }
.optional-tag { font-size: .7rem; font-weight: 400; margin-left: 10px; color: var(--slate-500); }
.question-help { color: #627386; font-size: .9rem; line-height: 1.65; margin: 0 0 12px; }
.answer-options + .question-help { margin: 10px 0 0; }
.scenario-question .question-help { color: var(--slate-700); font-size: 1rem; line-height: 1.75; margin: 0 0 12px; padding: 12px 15px; border-left: 3px solid #c6dde7; border-radius: 0 8px 8px 0; background: #f5f8fb; }
.rating-control { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: .95rem; }
.rating-control input[type="number"] { width: 80px; min-height: 42px; border: 1px solid var(--slate-300); border-radius: 7px; padding: 8px; }
.rating-control input[type="range"] { flex: 1; min-width: 100px; accent-color: #168d98; min-height: 35px; }
.rating-ends { display: flex; justify-content: space-between; gap: 10px; font-size: .85rem; color: #627386; margin-top: 8px; }
.review-mail { border: 1px solid var(--slate-200); border-radius: 10px; background: #fafcfd; margin-bottom: 24px; overflow: hidden; }
summary { cursor: pointer; }
.review-mail summary { padding: 15px 18px; font-size: .82rem; color: var(--navy-900); font-weight: 650; }
.review-mail .message-header { padding: 15px 20px; }
.review-mail .message-header h2 { font-size: 1.1rem; }
.review-mail .message-body { font-size: .85rem; padding: 16px 20px; }
.review-button { opacity: .75; cursor: default; }
.section-heading { padding: 25px 0 8px; border-top: 2px solid var(--slate-200); margin-top: 20px; }
.section-heading h3 { margin: 0; }
.section-heading > p:last-child { font-size: .8rem; color: var(--slate-500); }
.completion-badge { display: flex; gap: 13px; align-items: center; padding: 18px; background: #edf8f5; color: #257663; border-radius: 8px; margin: 23px 0; }
.completion-badge > span { font-size: 1.6rem; }
.completion-badge strong, .completion-badge small { display: block; }
.completion-badge small { font-size: .72rem; margin-top: 4px; }
.withdrawal-card { margin: 25px 0; padding: 20px; background: var(--blue-50); border: 1px solid var(--slate-200); border-radius: 10px; }
.withdrawal-card h3 { font-size: 1rem; margin-top: 0; }
.withdrawal-card code { display: block; letter-spacing: .09em; color: var(--navy-900); font-size: .9rem; overflow-wrap: anywhere; }
.withdrawal-card p, .withdraw-confirm { font-size: .8rem; color: var(--slate-700); }
.withdraw-confirm { margin-bottom: 20px; }
.support-note { background: #fff7e9; border: 1px solid #edd8ac; color: #825b11; border-radius: 8px; padding: 16px; font-size: .83rem; }
.standalone-shell { max-width: 650px; margin: 9vh auto; padding: 0 20px; text-align: center; }
.standalone-shell p { color: var(--slate-700); }
.standalone-shell .button-link { margin-top: 20px; }
.sidebar .nav-item { width: 100%; border: 0; background: transparent; text-align: left; font-weight: 500; }
.sidebar .nav-item.active { background: #dcebf6; font-weight: 800; }
.notice-bar { justify-content: space-between; }
.notice-bar .text-button { font-size: .78rem; }
.app-grid { min-height: 0; grid-template-columns: 196px minmax(330px, 410px) minmax(0, 1fr); }
.mail-list { min-height: 0; flex: 1; }
.task-bottom { padding: 16px 18px; border-top: 1px solid var(--slate-200); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: white; margin-top: auto; }
.task-bottom span { font-size: .7rem; color: var(--slate-500); }
.task-bottom .microcopy { text-align: left; margin-top: 6px; }
.task-bottom button { min-height: 40px; font-size: .81rem; }
.back-inbox { margin: 18px 30px 0; min-height: 32px; font-size: .82rem; }
.reading-pane .message-header::before { display: none; }
.mobile-folders { display: none; }
.mail-app { height: 100dvh; min-height: 0; display: flex; flex-direction: column; }
.app-header, .notice-bar { flex-shrink: 0; }
.app-grid { flex: 1; height: auto; min-height: 0; }
.inbox-panel, .reading-pane, .sidebar { min-height: 0; }
.admin-layout { max-width: 1480px; margin: 0 auto; padding: 32px 24px; }
#admin-login { max-width: 540px; margin: 50px auto; }
.admin-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-title h1 { margin: 0; }
.admin-title p { color: var(--slate-500); font-size: .85rem; }
.stat-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 12px; margin: 24px 0; }
.stat-card { padding: 20px; background: white; border: 1px solid var(--slate-200); border-radius: 10px; }
.stat-card span { font-size: .76rem; color: var(--slate-500); }
.stat-card strong { display: block; font-size: 2rem; margin-top: 8px; font-weight: 650; }
.admin-layout .survey-card { margin-bottom: 24px; }
.export-grid { display: flex; flex-wrap: wrap; gap: 12px; margin: 25px 0; }
.admin-layout p { font-size: .85rem; color: var(--slate-700); }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .78rem; white-space: nowrap; }
.admin-table th { text-align: left; background: #f4f7f9; color: var(--slate-700); font-weight: 600; }
.admin-table td, .admin-table th { padding: 14px; border-bottom: 1px solid var(--slate-200); }
.support-flag { color: #a67115; }
pre { overflow-wrap: anywhere; white-space: pre-wrap; font-size: .75rem; }
@media (max-width: 1100px) {
  .study-layout { grid-template-columns: 290px minmax(0,1fr); gap: 26px; }
  .study-context { padding: 28px 24px; }
  .study-context h1 { font-size: 1.6rem; }
  .survey-card { padding: 28px; }
  .app-grid { grid-template-columns: 72px minmax(285px,350px) minmax(0,1fr); }
  .stat-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 800px) {
  .study-layout { display: block; max-width: 720px; padding: 22px 18px; }
  .study-context { position: static; margin-bottom: 20px; padding: 20px 24px; }
  .study-context h1, .study-context > p, .context-note, .context-kicker { display: none; }
  .study-steps { display: flex; justify-content: space-between; gap: 10px; margin: 0; }
  .study-steps li { flex-direction: column; gap: 7px; text-align: center; }
  .study-steps small { display: none; }
  .study-steps strong { font-size: .74rem; }
  .context-link { display: block; text-align: center; margin-top: 16px; }
  .study-header { padding: 16px 20px; min-height: 74px; gap: 12px; }
}
@media (max-width: 720px) {
  .study-tag { font-size: .7rem; }
  .study-header .text-button { font-size: .75rem; }
  .survey-card { padding: 25px 20px; border-radius: 12px; }
  .survey-card h2 { font-size: 1.4rem; }
  .survey-actions { align-items: stretch; flex-direction: column; }
  .survey-actions > button { width: 100%; }
  .question { padding-bottom: 20px; margin-bottom: 20px; }
  .question legend { font-size: 1.125rem; padding-left: 30px; margin-bottom: 10px; }
  .question-number { font-size: .8125rem; }
  .answer-options { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .answer-option { min-width: 0; padding: 10px 12px; font-size: 1rem; }
  .answer-option:only-child { grid-column: 1 / -1; }
  .study-layout { padding: 16px 12px 32px; }
  .app-grid { display: block; height: calc(100dvh - 114px); min-height: 0; }
  .reading-pane { inset: 114px 0 0; transition: none; }
  .mobile-folders { display: block; padding: 8px 15px; font-size: .76rem; border-bottom: 1px solid var(--slate-200); }
  .mobile-folders select { border: 0; color: var(--slate-700); background: var(--blue-50); padding: 4px 10px; border-radius: 6px; }
  .mail-row { min-height: 87px; }
  .back-inbox { margin: 15px 20px 0; }
  .message-header { padding-top: 18px; }
  .message-time { display: none; }
  .task-bottom { padding: 12px 15px; }
  .admin-title { align-items: start; flex-direction: column; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-layout { padding: 24px 12px; }
}
/* Researcher workflow controls */
.ranked-options {padding-left:24px;}
.ranked-options li {margin:10px 0;padding:10px 0;}
.ranked-options li span {display:block;margin-bottom:8px;}
.ranked-options button {margin-right:8px;padding:6px 12px;}
.workflow-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 20px;margin:18px 0;}
.workflow-fields .consent-check {margin:0;padding:10px;}
.workflow-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;}
.field select {width:100%;padding:12px;border:1px solid #dce2ec;border-radius:8px;background:white;color:inherit;font:inherit;}
.admin-layout form {margin-bottom:24px;}
.admin-layout .field {margin:12px 0;}
.admin-layout .field textarea {width:100%;padding:12px;border:1px solid var(--slate-300);border-radius:9px;font:inherit;resize:vertical;}
@media(max-width:720px) {.workflow-fields,.workflow-grid {grid-template-columns:1fr;}}
.language-control select,.question select {font:inherit;border:1px solid var(--slate-300);border-radius:8px;background:white;color:var(--slate-900);padding:9px 12px;max-width:100%;}
.question select {width:100%;margin-top:0;font-size:1rem;min-height:46px;}
.language-control {margin-left:auto;}
.study-header {gap:12px;flex-wrap:wrap;}
@media(max-width:720px){.language-control select{padding:7px 9px;}.study-header .study-tag{display:none;}}
@media(max-width:480px) {
  .nickname-card { grid-template-columns: 44px minmax(0,1fr); gap: 10px 12px; padding: 16px; }
  .nickname-card .identity-avatar { width: 44px; height: 44px; font-size: 1rem; }
  .nickname-card button { grid-column: 2; }
  .nickname-card .identity-reminder, .nickname-card .identity-note { grid-column: 1 / -1; }
  .session-chip { gap: 7px; font-size: .76rem; }
  .session-identity small { font-size: .6rem; }
}
/* The original corpus is text, never executable email HTML. */
.source-mail-text { overflow-wrap: anywhere; line-height: 1.8; }
.message-body p, .source-mail-text p { margin: 0 0 1em; }
.message-body ul, .message-body ol { padding-left: 1.6em; margin: .7em 0 1.2em; }
.message-body li + li { margin-top: .45em; }
.mail-section-title { margin-top: 1.4em !important; }
.admin-shell { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 28px; align-items: start; }
.admin-sidebar { position: sticky; top: 24px; max-height: calc(100dvh - 48px); overflow-y: auto; padding: 22px 12px; border: 1px solid var(--slate-200); border-radius: 14px; background: white; }
.admin-layout .admin-nav-caption { color: var(--navy-900); font-size: .95rem; font-weight: 700; margin: 0 12px 24px; }
.admin-nav-group + .admin-nav-group { margin-top: 22px; }
.admin-layout .admin-nav-group > p { font-size: .72rem; color: var(--slate-500); margin: 0 12px 6px; }
.admin-navigation a { display: block; padding: 10px 12px; margin: 3px 0; border-radius: 8px; color: var(--slate-700); text-decoration: none; font-size: .86rem; border-left: 3px solid transparent; }
.admin-navigation a:hover { background: var(--blue-50); }
.admin-navigation a[aria-current="page"] { background: var(--cyan-100); color: var(--navy-900); border-left-color: var(--cyan-500); font-weight: 700; }
.admin-participant-link { display: block; padding: 18px 12px 0; margin-top: 22px; border-top: 1px solid var(--slate-200); color: var(--slate-500); font-size: .78rem; text-decoration: none; }
.admin-main, .admin-main > * { min-width: 0; }
.admin-main .admin-title { align-items: flex-start; margin: 0 0 28px; }
.admin-title h1 { font-size: 1.7rem; line-height: 1.4; }
.admin-title .eyebrow { margin: 0 0 6px; font-size: .7rem; }
.admin-layout #admin-page-description { margin: 8px 0 0; }
.admin-title .button-row { flex-shrink: 0; }
.admin-layout .admin-mobile-navigation { display: none; }
.admin-main .survey-card { padding: 28px; box-shadow: 0 4px 20px rgba(21,43,66,.04); }
.admin-main .survey-card h2 { font-size: 1.15rem; }
.admin-main .stat-grid { grid-template-columns: repeat(4,minmax(0,1fr)); margin: 0 0 24px; }
.admin-main .stat-card { padding: 16px; }
.admin-main .stat-card strong { font-size: 1.6rem; }
.overview-readiness, .admin-shortcuts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.readiness-item { min-width: 0; padding: 16px; border-radius: 10px; border: 1px solid var(--slate-200); background: #f8fafc; }
.readiness-item > span, .readiness-item > strong { display: block; }
.readiness-item > span { color: var(--slate-500); font-size: .76rem; margin-bottom: 7px; }
.readiness-item > strong { font-size: 1rem; color: var(--navy-900); }
.readiness-item.pending > strong { color: var(--warning); }
.admin-layout .readiness-item p { margin: 8px 0; font-size: .76rem; }
.readiness-item a { color: #126795; font-size: .78rem; }
.admin-shortcuts a { display: block; padding: 18px; border: 1px solid var(--slate-200); border-radius: 10px; color: var(--navy-900); text-decoration: none; }
.admin-shortcuts a:hover { background: var(--blue-50); border-color: var(--cyan-500); }
.admin-shortcuts strong, .admin-shortcuts span { display: block; }
.admin-shortcuts strong { font-size: .85rem; }
.admin-shortcuts span { color: var(--slate-500); font-size: .76rem; margin-top: 8px; }
.admin-help { border-top: 1px solid var(--slate-200); margin: 20px 0; padding-top: 16px; }
.admin-help > summary, .material-editor > summary { cursor: pointer; color: var(--navy-900); font-size: .85rem; font-weight: 600; }
.material-editor { margin: 20px 0; padding: 16px; border: 1px solid var(--slate-200); border-radius: 10px; background: #fbfdff; }
.material-editor[open] { background: white; border-color: #9ecbd0; }
.material-editor > summary { scroll-margin-top: 24px; }
.admin-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.admin-pagination > span { color: var(--slate-500); font-size: .78rem; }
.admin-main .admin-table td:nth-child(3) { white-space: normal; min-width: 180px; max-width: 340px; overflow-wrap: anywhere; }
.admin-main .workflow-grid > * { min-width: 0; }
.admin-main #workflow-form > h3:not(:first-child) { border-top: 1px solid var(--slate-200); padding-top: 24px; margin-top: 28px; }
.questionnaire-toolbar { display: flex; gap: 16px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.questionnaire-editor { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 28px; margin-top: 24px; align-items: start; }
.questionnaire-editor > * { min-width: 0; }
.questionnaire-sidebar { position: sticky; top: 16px; }
.question-list { display: grid; gap: 8px; max-height: 65vh; overflow-y: auto; margin-top: 16px; }
.question-list-item { text-align: left; border: 1px solid var(--slate-300); border-radius: 8px; padding: 12px; background: white; font: inherit; cursor: pointer; }
.question-list-item span { display: block; font-size: .75rem; color: var(--slate-500); margin-bottom: 5px; }
.question-list-item strong { font-size: .85rem; line-height: 1.6; }
.question-list-item { overflow-wrap: anywhere; }
.question-list-item.selected { border-color: var(--teal-600, #0a8a96); background: #eefafb; }
.question-options-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .85rem; }
.question-options-table th { text-align: left; }
.question-options-table td, .question-options-table th { padding: 6px; vertical-align: top; }
.question-options-table input { width: 100%; min-width: 130px; padding: 9px; border: 1px solid var(--slate-300); border-radius: 5px; font: inherit; }
.question-options-table .option-code { min-width: 65px; width: 75px; }
.question-preview { margin-top: 24px; padding: 20px; border: 1px solid var(--slate-300); border-radius: 12px; background: #f8fafc; }
.sample-results { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; margin: 24px 0; }
.sample-mail-card { min-width: 0; border: 1px solid var(--slate-300); border-radius: 12px; padding: 24px; overflow-wrap: anywhere; }
.sample-mail-card h3 { margin-top: 8px; line-height: 1.5; }
.sample-mail-card .message-body { padding: 16px 0; }
.sample-history { display: flex; flex-wrap: wrap; gap: 8px; }
.sample-counts { border: 1px solid var(--slate-200); border-radius: 10px; padding: 18px; margin: 20px 0; background: #f8fafc; min-width: 0; }
.sample-counts legend { font-weight: 700; color: var(--navy-900); padding: 0 6px; }
.admin-layout .sample-counts > p { margin: 4px 0 12px; }
.sample-counts #sample-call-count { color: var(--navy-900); margin: 12px 0 0; }
.admin-layout .sample-type-badge { display: inline-block; font-size: .76rem; font-weight: 700; margin: 0 0 10px; padding: 5px 10px; border-radius: 6px; background: var(--slate-100); }
.admin-layout .sample-type-phishing { color: #943440; background: #fff0f2; }
.admin-layout .sample-type-normal { color: #126d68; background: #e7f6f2; }
.admin-layout .sample-type-spam { color: #875b13; background: #fff5df; }
.material-reason-editor { margin: 20px 0; padding: 16px; border: 1px solid var(--slate-300); border-radius: 10px; background: #f8fafc; }
.material-disabled-list { display: grid; gap: 12px; }
.material-disabled-card { padding: 14px; border: 1px solid var(--slate-300); border-radius: 8px; overflow-wrap: anywhere; }
.material-disabled-card summary { cursor: pointer; font-weight: 600; }
.material-disabled-card p { text-align: left; white-space: pre-wrap; }
.date-evidence { padding-left: 12px; border-left: 3px solid #a8d5da; }
#sample-profile { margin-top: 20px; }
#sample-profile .question { padding-top: 20px; }
@media (max-width: 800px) {
  .questionnaire-editor, .sample-results { grid-template-columns: minmax(0,1fr); }
  .questionnaire-sidebar { position: static; }
  .question-list { max-height: 260px; }
  .questionnaire-toolbar .button-row { width: 100%; }
}
@media (max-width: 1180px) {
  .admin-main .questionnaire-editor { grid-template-columns: minmax(0,1fr); }
  .admin-main .questionnaire-sidebar { position: static; }
  .admin-main .question-list { max-height: 240px; }
  .overview-readiness, .admin-shortcuts { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 960px) {
  .admin-shell { display: block; }
  .admin-sidebar { display: none; }
  .admin-layout .admin-mobile-navigation { display: grid; margin: 0 0 24px; }
}
@media (max-width: 600px) {
  .admin-main .survey-card { padding: 20px 16px; }
  .admin-title h1 { font-size: 1.4rem; }
  .admin-main .admin-title { gap: 16px; }
  .admin-main .admin-title .button-row { width: 100%; }
  .admin-main .admin-title .button-row > button { flex: 1; }
  .admin-main .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-pagination { justify-content: space-between; gap: 8px; }
  .admin-pagination > button { padding: 10px 12px; }
  .material-editor { padding: 12px; }
}
.source-link { color: #126795; text-decoration: underline; overflow-wrap: anywhere; }
.source-url { margin: 16px 0; }
.source-sender { margin: 12px 0; color: #637285; font-size: 13px; overflow-wrap: anywhere; }
.mail-attachments { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.attachment-link { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; padding: 12px 16px; border: 1px solid #ccd7e2; border-radius: 8px; background: #f6f8fb; text-decoration: none; }
.attachment-link:hover, .attachment-link:focus-visible { background: #edf4fa; border-color: #6999ba; }
.attachment-name { min-width: 0; overflow-wrap: anywhere; }
.attachment-icon, .attachment-type { flex: 0 0 auto; }
.attachment-type { font-size: 11px; font-weight: 600; color: #556273; }
.mail-attachment-indicator { flex: 0 0 auto; font-size: 12px; }
.source-destination { overflow-wrap: anywhere; white-space: pre-wrap; }
.country-combobox { position: relative; margin: 0; }
.country-combobox > input { width: 100%; min-height: 46px; padding: 10px 44px 10px 12px; border: 1px solid var(--slate-300); border-radius: 8px; background: white; color: var(--slate-900); font: inherit; }
.country-combobox > input:focus { border-color: var(--cyan-500); outline: 2px solid rgba(23,174,190,.2); }
.country-toggle { position: absolute; right: 2px; top: 2px; width: 40px; height: 42px; border: 0; border-radius: 6px; background: transparent; color: var(--slate-700); font: inherit; cursor: pointer; }
.country-popup { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 10; padding: 6px; border: 1px solid var(--slate-300); border-radius: 8px; background: white; box-shadow: 0 8px 24px rgba(16,40,72,.12); }
.country-search-status { margin: 4px 8px 8px; font-size: .8rem; color: var(--slate-500); }
.country-popup [role=listbox] { max-height: 230px; overflow-y: auto; overscroll-behavior: contain; }
.country-popup [role=option] { display: block; width: 100%; border: 0; border-radius: 5px; padding: 10px 12px; background: white; color: var(--slate-900); text-align: left; font: inherit; cursor: pointer; }
.country-popup [role=option]:hover, .country-popup [role=option].highlighted, .country-popup [role=option][aria-selected=true] { background: var(--blue-50); }

/* Researcher generation settings and exact-request previews. */
.generation-fieldset { border: 1px solid var(--line, #d7deea); border-radius: 10px; margin: 16px 0; padding: 16px; min-width: 0; }
.generation-fieldset legend { padding: 0 8px; font-weight: 650; }
#generation-editor details > summary { cursor: pointer; padding: 10px 0; font-weight: 650; }
#generation-editor .field { margin-top: 12px; }
#sample-preview-requests pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 600px; overflow-y: auto; padding: 14px; background: #f3f6fa; border-radius: 8px; }
#sample-preview-requests details { margin: 12px 0; }
#generation-history { max-width: 100%; }
#generation-active, #generation-draft-status, #sample-source-note, #sample-preview-panel p { overflow-wrap: anywhere; }
#generation-editor textarea { font-weight: 400; line-height: 1.5; }

/* Independent columns for researcher material metadata. */
.material-library-toolbar { display: grid; grid-template-columns: minmax(230px, 1fr) minmax(280px, 2fr); gap: 18px; align-items: end; margin-top: 24px; }
.admin-layout .material-library-toolbar .field { margin: 0; }
.material-list-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 12px; }
.admin-layout .material-list-summary p { margin: 0; font-size: .76rem; color: var(--slate-500); }
.material-list-summary .button-row { margin: 0; }
.admin-layout .material-table-hint { margin: 0 0 10px; font-size: .72rem; color: var(--slate-500); }
.material-table-scroll { border: 1px solid var(--slate-200); border-radius: 10px; max-height: min(72vh, 780px); overscroll-behavior-x: contain; }
.material-table-scroll:focus-visible { outline: 2px solid var(--cyan-500); outline-offset: 3px; }
.admin-main .material-table { min-width: 1464px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.material-table .material-col-id { width: 168px; }
.material-table .material-col-subject { width: 260px; }
.material-table .material-col-category { width: 90px; }
.material-table .material-col-scene { width: 190px; }
.material-table .material-col-source { width: 170px; }
.material-table .material-col-language { width: 70px; }
.material-table .material-col-domain { width: 180px; }
.material-table .material-col-classification { width: 92px; }
.material-table .material-col-review, .material-table .material-col-enabled { width: 76px; }
.material-table .material-col-action { width: 72px; }
.admin-main .material-table td, .admin-main .material-table th { padding: 15px 12px; vertical-align: middle; line-height: 1.5; }
.admin-main .material-table td, .admin-main .material-table td:nth-child(3) { white-space: normal; min-width: 0; max-width: none; overflow-wrap: anywhere; background: white; }
.admin-main .material-table th { position: sticky; top: 0; z-index: 2; white-space: nowrap; background: #f4f7f9; font-size: .74rem; }
.admin-main .material-table td:first-child, .admin-main .material-table th:first-child { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--slate-200); }
.admin-main .material-table td:last-child, .admin-main .material-table th:last-child { position: sticky; right: 0; z-index: 1; box-shadow: -1px 0 0 var(--slate-200); text-align: center; }
.admin-main .material-table th:first-child, .admin-main .material-table th:last-child { z-index: 3; }
.admin-main .material-table tbody tr:hover td { background: #f8fbfd; }
.material-table .material-id { font-family: ui-monospace, Consolas, monospace; font-size: .71rem; white-space: nowrap; color: var(--slate-700); }
.material-subject { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; color: var(--navy-900); }
.material-table .material-source, .material-table .material-domain { font-size: .73rem; color: var(--slate-700); }
.material-table .material-language, .material-table .material-review { font-size: .74rem; color: var(--slate-700); }
.material-badge { display: inline-block; max-width: 100%; padding: 4px 7px; border-radius: 6px; font-size: .71rem; font-weight: 600; line-height: 1.5; white-space: nowrap; background: #f0f3f7; color: #526276; }
.material-kind-phishing { color: #943440; background: #fff0f2; }
.material-kind-normal, .material-classification-classified { color: #126d68; background: #e7f6f2; }
.material-kind-spam, .material-classification-review { color: #875b13; background: #fff5df; }
.material-scene { white-space: normal; text-align: left; color: #315779; background: #edf4fc; font-weight: 500; }
.material-availability { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; font-size: .73rem; color: var(--slate-500); }
.material-availability::before { content: ''; flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: #a2aebc; }
.material-availability.is-enabled { color: #126d68; }
.material-availability.is-enabled::before { background: #279c87; }
.material-empty { color: #a2aebc; }
.material-table .material-empty-state { padding: 40px 20px; text-align: center; color: var(--slate-500); }
@media (max-width: 700px) {
  .material-library-toolbar { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .admin-main .material-table td:first-child, .admin-main .material-table th:first-child { position: static; box-shadow: none; }
}

.admin-layout:has(#admin-page-materials:not([hidden])) { max-width: 1800px; }
@media (max-width: 1280px) {
  .admin-layout:has(#admin-page-materials:not([hidden])) .admin-shell { display: block; }
  .admin-layout:has(#admin-page-materials:not([hidden])) .admin-sidebar { display: none; }
  .admin-layout:has(#admin-page-materials:not([hidden])) .admin-mobile-navigation { display: grid; margin: 0 0 24px; }
}

/* The destination document is deliberately quiet and independent of the survey layout. */
.detail-page { background: #f6f7f9; color: #263241; }
.detail-topbar { background: #fff; border-bottom: 1px solid #e5e8ed; }
.detail-topbar-inner { width: min(100% - 48px, 960px); min-height: 64px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.detail-brand { min-width: 0; font-size: .93rem; font-weight: 600; overflow-wrap: anywhere; }
.detail-back { flex-shrink: 0; color: #627083; text-decoration: none; font-size: .82rem; }
.detail-back:hover { color: #263241; text-decoration: underline; }
.detail-shell { width: min(100% - 48px, 760px); margin: 48px auto 72px; }
.detail-breadcrumb { margin: 0 0 14px; color: #7a8594; font-size: .78rem; }
.detail-card { padding: 32px 36px 36px; border: 1px solid #e1e5eb; border-radius: 10px; background: #fff; }
.detail-heading { margin-bottom: 24px; }
.detail-heading h1 { margin: 0; font-size: clamp(1.25rem, 2.6vw, 1.65rem); line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.detail-sender { margin: 10px 0 0; font-size: .8rem; color: #7a8594; overflow-wrap: anywhere; }
.detail-content { font-size: .94rem; line-height: 1.95; color: #4b5868; overflow-wrap: anywhere; }
.detail-content p { margin: 0 0 18px; white-space: pre-wrap; }
.detail-content p:last-child { margin-bottom: 0; }
.detail-actions { margin-top: 28px; }
.detail-actions .primary-button { min-height: 46px; min-width: 160px; padding: 11px 24px; }
.detail-retry { margin-top: 24px; }
.detail-retry .secondary-button { min-height: 36px; padding: 6px 14px; font-size: .83rem; font-weight: 500; }
@media (max-width: 520px) {
  .detail-topbar-inner { width: calc(100% - 32px); min-height: 58px; gap: 16px; }
  .detail-shell { width: calc(100% - 32px); margin: 28px auto 48px; }
  .detail-card { padding: 24px 22px 28px; }
  .detail-actions .primary-button { width: 100%; }
}
