:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #172033;
  --muted: #64748b;
  --line: #dfe6ef;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf1ff;
  --teal: #0f766e;
  --teal-soft: #e8f7f3;
  --amber: #a16207;
  --amber-soft: #fff7df;
  --red: #b42318;
  --red-soft: #fff0ee;
  --shadow: 0 8px 28px rgba(30, 50, 80, 0.055);
  --radius: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; line-height: 1.65; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.22); outline-offset: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 30px; line-height: 1.3; letter-spacing: -0.025em; }
h2 { margin-bottom: 6px; font-size: 18px; line-height: 1.45; }
h3 { font-size: 15px; }
.muted { color: var(--muted); }
.eyebrow { margin-bottom: 8px; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.admin-body { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; flex-direction: column; width: 232px; padding: 24px 16px 16px; border-right: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; color: var(--ink); }
.brand-symbol { display: inline-grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: var(--primary); font-size: 12px; font-weight: 850; letter-spacing: .03em; }
.brand-symbol.large { width: 50px; height: 50px; border-radius: 15px; font-size: 15px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { color: var(--muted); font-size: 10px; }
.main-nav { display: grid; gap: 6px; margin-top: 38px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 13px; border-radius: 10px; color: #475569; font-weight: 650; }
.nav-item:hover { background: var(--surface-soft); }
.nav-item.active { color: var(--primary); background: var(--primary-soft); }
.nav-dot { width: 8px; height: 8px; border: 2px solid currentColor; border-radius: 50%; }
.nav-item.active .nav-dot { background: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.1); }
.sidebar-note { margin: auto 4px 18px; padding: 14px; border: 1px solid #d9e5f8; border-radius: 12px; background: #f5f8ff; font-size: 11px; }
.sidebar-note strong { color: var(--primary); }
.sidebar-note p { margin: 5px 0 0; color: var(--muted); line-height: 1.6; }
.sidebar-user { display: flex; align-items: center; gap: 9px; padding: 13px 6px 0; border-top: 1px solid var(--line); }
.sidebar-user .avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--primary); background: var(--primary-soft); font-weight: 800; }
.sidebar-user strong, .sidebar-user small { display: block; line-height: 1.4; }
.sidebar-user strong { font-size: 12px; }
.sidebar-user small { color: var(--muted); font-size: 10px; }
.icon-btn { min-height: 36px; margin-left: auto; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; }
.icon-btn:hover { color: var(--primary); }
.admin-main { min-height: 100vh; margin-left: 232px; padding: 32px clamp(22px, 3vw, 42px) 56px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-header p { margin-bottom: 0; color: var(--muted); }
.page-header h1 { margin-top: 4px; }
.header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.back-link { display: inline-block; margin-bottom: 9px; color: var(--muted); font-size: 12px; }
.back-link::before { content: "←"; margin-right: 6px; }
.title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 17px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 13px; line-height: 1.3; transition: background .15s, border-color .15s, transform .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .58; cursor: not-allowed; transform: none; }
.btn.primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.secondary { color: #334155; background: var(--surface); border-color: var(--line); }
.btn.secondary:hover { color: var(--primary); border-color: #b8cdf4; }
.btn.block { width: 100%; }
.btn.small-btn { min-height: 36px; padding: 7px 12px; font-size: 12px; }
.text-btn { min-height: 34px; padding: 3px 5px; border: 0; color: var(--primary); background: transparent; cursor: pointer; font-weight: 650; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .panel-heading p { margin-bottom: 0; }
.panel-heading p { color: var(--muted); font-size: 12px; }
.metric-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.metric-strip > div { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.metric-strip span { color: var(--muted); }
.metric-strip strong { font-size: 23px; }
.table-scroll { overflow: auto; width: 100%; }
.data-table { width: 100%; border-collapse: collapse; min-width: 820px; font-size: 12px; }
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid #edf1f5; text-align: left; vertical-align: middle; }
.data-table th { color: #64748b; background: #fafbfd; font-size: 11px; font-weight: 750; white-space: nowrap; }
.data-table tbody tr:hover { background: #fbfdff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.survey-name { display: block; max-width: 260px; color: var(--ink); font-size: 13px; font-weight: 750; }
.survey-name:hover { color: var(--primary); }
.survey-description { display: block; max-width: 240px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; cursor: help; }
#save-input-draft-btn { margin-bottom: 10px; }
.status { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.status.draft { color: var(--amber); background: var(--amber-soft); }
.status.published { color: var(--teal); background: var(--teal-soft); }
.status.closed { color: var(--muted); background: #edf1f5; }
.row-actions { display: flex; align-items: center; justify-content: flex-start; flex-wrap: nowrap; gap: 12px; white-space: nowrap; }
.survey-table td:last-child { min-width: 150px; text-align: left; }
.empty-state { padding: 58px 24px; text-align: center; }
.empty-state h3 { margin: 12px 0 7px; font-size: 18px; }
.empty-state p { max-width: 520px; margin: 0 auto 20px; color: var(--muted); }
.empty-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: var(--primary); background: var(--primary-soft); font-weight: 800; }
.toast { position: fixed; right: 26px; bottom: 26px; z-index: 100; max-width: 420px; padding: 12px 17px; border: 1px solid #bfddd4; border-radius: 11px; color: #135e54; background: #effaf6; box-shadow: 0 12px 32px rgba(30,50,80,.14); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { color: var(--red); border-color: #f3c7c1; background: #fff5f3; }
.alert { padding: 11px 13px; border-radius: 9px; font-size: 12px; }
.alert.error { color: var(--red); background: var(--red-soft); }
.stack-form { display: grid; gap: 16px; }
.stack-form label, .form-grid label, .report-toolbar label { display: grid; gap: 7px; color: #334155; font-size: 12px; font-weight: 700; }
input, textarea, select { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #d8e1ec; border-radius: 9px; color: var(--ink); background: #fff; transition: border .15s, box-shadow .15s; }
textarea { resize: vertical; line-height: 1.7; }
input::placeholder, textarea::placeholder { color: #9aa8ba; }
input:focus, textarea:focus, select:focus { border-color: #8eb0f3; box-shadow: 0 0 0 3px rgba(37,99,235,.08); outline: 0; }
.password-field { position: relative; }
.password-field input { padding-right: 62px; }
.password-toggle { position: absolute; top: 50%; right: 7px; min-width: 46px; min-height: 30px; transform: translateY(-50%); border: 0; border-radius: 6px; color: var(--primary); background: var(--primary-soft); cursor: pointer; font-size: 11px; font-weight: 750; }
.account-card { max-width: 560px; padding: 26px; }
.account-card .preview-action-status { margin: 12px 0; }
label em { margin-left: 5px; color: var(--muted); font-size: 10px; font-style: normal; font-weight: 500; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: #f2f6fc; }
.login-shell { display: grid; grid-template-columns: 1.1fr .9fr; overflow: hidden; width: min(960px, 100%); min-height: 580px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 22px 60px rgba(30,50,80,.1); }
.login-intro { display: flex; flex-direction: column; justify-content: center; padding: 60px; background: #f3f7ff; }
.login-intro .eyebrow { margin-top: 32px; }
.login-intro h1 { margin: 8px 0 20px; font-size: 39px; line-height: 1.35; }
.login-intro > p:not(.eyebrow) { max-width: 420px; color: var(--muted); font-size: 15px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.trust-row span { padding: 5px 10px; border: 1px solid #d6e2f6; border-radius: 999px; color: #496180; background: rgba(255,255,255,.7); font-size: 10px; }
.login-card { display: flex; flex-direction: column; justify-content: center; gap: 25px; padding: 54px 48px; }
.login-card h2 { margin-bottom: 5px; font-size: 26px; }
.login-foot { margin: 0; color: var(--muted); text-align: center; font-size: 10px; }
.create-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; }
.create-main { display: grid; gap: 18px; }
.form-section { padding: 24px; }
.step-title { display: flex; gap: 12px; margin-bottom: 21px; }
.step-title > span { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px; color: var(--primary); background: var(--primary-soft); font-size: 12px; font-weight: 800; }
.step-title h2, .step-title p { margin-bottom: 0; }
.step-title p { color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-grid .full { grid-column: 1 / -1; }
.upload-box { position: relative; min-height: 112px; place-items: center; padding: 20px; border: 1px dashed #b9cbe5; border-radius: 12px; background: #fafcff; text-align: center; cursor: pointer; }
.upload-box:hover { border-color: var(--primary); }
.upload-box:focus-within { border-color: var(--primary); outline: 3px solid rgba(37, 99, 235, 0.22); outline-offset: 2px; }
.upload-box input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.upload-box span { display: block; }
.upload-title { color: var(--primary); font-size: 14px; }
.sticky-card { position: sticky; top: 22px; padding: 22px; }
.process-list { margin: 18px 0; padding-left: 20px; color: #475569; font-size: 12px; }
.process-list li { margin: 10px 0; padding-left: 4px; }
.safe-note { margin: 18px 0; padding: 13px; border-radius: 10px; color: #70510a; background: var(--amber-soft); font-size: 11px; }
.safe-note p { margin: 4px 0 0; }
.form-hint { margin: 11px 0 0; color: var(--muted); text-align: center; font-size: 10px; }
.survey-meta-panel { margin-bottom: 18px; padding: 20px 22px; }
.editor-save-status { margin-top: 10px; font-size: 12px; font-weight: 650; }
.editor-save-status.saved { color: var(--teal); }
.editor-save-status.dirty { color: var(--amber); }
.editor-save-status.testing { color: var(--primary); }
.editor-save-status.failure { color: var(--red); white-space: pre-wrap; }
.mobile-save-bar { display: none; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 20px; align-items: start; }
.editor-panel { min-width: 0; }
.question-list { display: grid; gap: 13px; padding: 18px; }
.question-card { border: 1px solid var(--line); border-radius: 13px; background: #fbfcfe; }
.question-card-head { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.question-number { color: var(--primary); font-size: 12px; font-weight: 800; }
.question-card-head .question-actions { display: flex; gap: 3px; margin-left: auto; }
.question-actions button { min-width: 32px; min-height: 32px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.question-actions button:hover { color: var(--primary); background: var(--primary-soft); }
.question-actions button.delete:hover { color: var(--red); background: var(--red-soft); }
.question-card-body { display: grid; gap: 13px; padding: 15px; }
.question-inline { display: grid; grid-template-columns: 1fr 150px; gap: 12px; }
.checkbox-label { display: flex !important; align-items: center; gap: 8px !important; min-height: 42px; font-size: 12px; }
.checkbox-label input { width: 18px; min-height: 18px; height: 18px; padding: 0; }
.logic-box { padding: 12px; border-radius: 10px; background: #f1f5fa; }
.logic-box summary { color: #475569; cursor: pointer; font-size: 12px; font-weight: 700; }
.logic-fields { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 9px; margin-top: 12px; }
.preview-column { position: sticky; top: 20px; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.preview-heading h2, .preview-heading p { margin: 0; }
.preview-heading p { color: var(--muted); font-size: 11px; }
.preview-badge { padding: 3px 9px; border-radius: 999px; color: var(--amber); background: var(--amber-soft); font-size: 10px; }
.phone-frame { position: relative; width: 330px; max-width: 100%; margin: 0 auto; padding: 24px 10px 12px; border: 6px solid #dce4ef; border-radius: 32px; background: #f8fafc; box-shadow: 0 15px 35px rgba(30,50,80,.09); }
.phone-speaker { position: absolute; top: 9px; left: 50%; width: 54px; height: 5px; border-radius: 5px; background: #d2dce9; transform: translateX(-50%); }
.phone-screen { overflow-y: auto; height: 600px; padding: 18px 14px; border-radius: 18px; background: #f5f7fb; }
.preview-survey-title { margin-bottom: 8px; font-size: 20px; }
.preview-survey-desc { margin-bottom: 18px; color: var(--muted); font-size: 11px; }
.preview-question { margin-bottom: 10px; padding: 13px; border: 1px solid #e5eaf1; border-radius: 12px; background: #fff; }
.preview-question strong { display: block; margin-bottom: 9px; font-size: 12px; }
.preview-option { display: flex; align-items: center; gap: 7px; min-height: 30px; color: #475569; font-size: 11px; }
.preview-option input { width: 14px; min-height: 14px; height: 14px; padding: 0; }
.preview-input { min-height: 34px; padding: 7px 9px; font-size: 11px; }
.modal { position: relative; width: min(440px, calc(100% - 32px)); padding: 30px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: #fff; box-shadow: 0 24px 70px rgba(30,50,80,.2); text-align: center; }
.modal::backdrop { background: rgba(23,32,51,.38); backdrop-filter: blur(3px); }
.modal-icon { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 16px; border-radius: 50%; color: var(--primary); background: var(--primary-soft); font-weight: 800; }
.modal-icon.success { color: var(--teal); background: var(--teal-soft); }
.modal p { color: var(--muted); }
.modal-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.url-input { text-align: center; font-size: 12px; }
.modal-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; font-size: 24px; line-height: 1; }
.modal-close:hover { color: var(--ink); background: var(--surface-soft); }
.copy-status { min-height: 20px; margin: 8px 0 0; font-size: 11px; line-height: 1.7; }
.copy-status.success { color: var(--teal); }
.copy-status.failure { color: var(--red); }
#copy-published[data-state="success"] { background: var(--teal); border-color: var(--teal); }
.url-dialog-footer { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 480px) { .url-dialog-actions, .url-dialog-footer { flex-wrap: wrap; } .url-dialog-actions .btn, .url-dialog-footer .btn { flex: 1 1 40%; } }
.response-table { min-width: max-content; }
.response-table th { max-width: 320px; white-space: normal; }
.response-table td { max-width: 320px; min-width: 140px; white-space: pre-wrap; word-break: break-word; }
.response-table .sticky-col { position: sticky; left: 0; z-index: 2; min-width: 170px; background: #fff; box-shadow: 1px 0 0 var(--line); }
.response-table th.sticky-col { z-index: 3; background: #fafbfd; }
.column-type { display: inline-block; margin-right: 7px; padding: 2px 5px; border-radius: 4px; color: var(--primary); background: var(--primary-soft); font-size: 9px; }
.response-table th em { margin-left: 5px; color: var(--red); font-size: 9px; font-style: normal; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 18px; border-top: 1px solid var(--line); }
.report-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding: 18px 22px; }
.report-toolbar label { width: min(480px, 100%); }
.report-meta { display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 11px; }
.report-meta strong { display: block; color: var(--ink); }
.report-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; margin-bottom: 20px; }
.report-summary { padding: 28px; }
.report-section-label { margin-bottom: 9px; color: var(--primary); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.report-summary > p { color: #334155; font-size: 15px; line-height: 1.9; }
.recommendation-list { padding-left: 20px; color: #475569; }
.recommendation-list li { margin: 9px 0; padding-left: 4px; }
.method-note { margin-top: 20px; padding: 12px; border-radius: 9px; color: var(--muted); background: var(--surface-soft); font-size: 11px; }
.report-info { padding: 23px; }
.report-info dl { margin: 18px 0; }
.report-info dt { margin-top: 12px; color: var(--muted); font-size: 10px; }
.report-info dd { margin: 2px 0; font-weight: 650; word-break: break-word; }
.report-questions { display: grid; gap: 15px; }
.question-report { padding: 24px; }
.question-report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.question-report-head > div { display: flex; align-items: flex-start; gap: 11px; }
.question-report-head h2 { font-size: 16px; }
.question-index { color: var(--primary); font-size: 12px; font-weight: 800; }
.distribution { display: grid; gap: 11px; margin-top: 20px; }
.distribution-row { display: grid; grid-template-columns: minmax(100px, 180px) minmax(120px, 1fr) 115px; align-items: center; gap: 13px; font-size: 12px; }
.distribution-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { overflow: hidden; height: 9px; border-radius: 999px; background: #edf1f6; }
.bar-fill { min-width: 2px; height: 100%; border-radius: inherit; background: var(--primary); }
.distribution-value { color: var(--muted); text-align: right; font-size: 11px; }
.text-answers { margin-top: 18px; padding: 15px; border-radius: 10px; background: var(--surface-soft); }
.text-answers p { margin: 8px 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); color: #475569; }
.text-answers p:last-child { border-bottom: 0; }
@media (max-width: 1120px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .phone-frame { width: 290px; }
  .report-grid { grid-template-columns: 1fr; }
  .report-info { display: none; }
}
@media (max-width: 900px) {
  .sidebar { position: static; width: auto; min-height: auto; padding: 12px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; }
  .brand small, .sidebar-note { display: none; }
  .main-nav { display: flex; flex-wrap: wrap; margin: 12px 0 0; }
  .nav-item { min-height: 38px; padding: 7px 12px; white-space: nowrap; }
  .sidebar-user { display: flex; margin-top: 10px; padding: 10px 0 0; }
  .sidebar-user .avatar { flex: 0 0 auto; }
  .sidebar-user #logout-btn { min-width: 52px; min-height: 42px; }
  .admin-main { margin-left: 0; padding: 24px 18px 45px; }
  .create-layout, .editor-layout { grid-template-columns: 1fr; }
  .create-aside, .preview-column, .sticky-card { position: static; }
  .preview-column { display: none; }
  .mobile-save-bar { position: fixed; inset: auto 0 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.97); box-shadow: 0 -8px 24px rgba(30,50,80,.1); }
  .mobile-save-bar span { color: var(--muted); font-size: 11px; }
  .mobile-save-bar .btn { flex: 0 0 auto; }
  .editor-layout { margin-bottom: 72px; }
  .page-header { flex-direction: column; }
  .header-actions { justify-content: flex-start; }
  .report-toolbar { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 640px) {
  h1 { font-size: 25px; }
  .admin-main { padding: 20px 12px 40px; }
  .metric-strip { grid-template-columns: 1fr; }
  .metric-strip > div { padding: 12px 16px; }
  .form-grid, .question-inline, .logic-fields { grid-template-columns: 1fr; }
  .login-body { padding: 14px; }
  .login-shell { grid-template-columns: 1fr; min-height: auto; }
  .login-card { order: 1; gap: 18px; padding: 24px 30px; }
  .login-intro { order: 2; padding: 24px 30px; }
  .login-intro .brand-symbol.large { width: 40px; height: 40px; }
  .login-intro .eyebrow { margin-top: 16px; }
  .login-intro h1 { font-size: 24px; }
  .trust-row { margin-top: 16px; }
  .distribution-row { grid-template-columns: 90px 1fr; }
  .distribution-value { grid-column: 1 / -1; text-align: left; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .header-actions .btn { flex: 1 1 auto; }
}
.matrix-report-rows { margin-top: 18px; padding: 12px 14px; border-radius: 10px; background: #f6f8fb; }
.matrix-report-rows h3 { margin-bottom: 8px; }
.matrix-report-rows p { display: flex; justify-content: space-between; gap: 15px; margin: 5px 0; color: var(--muted); font-size: 12px; }
.matrix-report-rows strong { color: var(--primary); }
.intent-confirm-modal { width: min(860px, calc(100% - 32px)); max-width: 860px; max-height: 92vh; padding: 0; text-align: left; }
.intent-confirm-note { margin: 8px 26px 16px; padding: 10px 12px; border-radius: 9px; color: #8a5a00; background: #fff7df; font-size: 12px; }
.intent-structured-content { max-height: 56vh; overflow-y: auto; padding: 2px 26px 20px; }
.intent-question { margin-bottom: 12px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; }
.intent-question h3 { margin-bottom: 8px; font-size: 14px; line-height: 1.65; }
.intent-description, .intent-visibility, .intent-rules, .intent-rating { margin: 5px 0; color: var(--muted); font-size: 12px; }
.intent-visibility { color: var(--primary); }
.intent-options { display: grid; gap: 5px; margin: 9px 0 0; padding: 0; list-style: none; color: #334155; font-size: 13px; }
.intent-options li { padding-left: 5px; }
.intent-effect { color: var(--primary); }
.draft-preview-questions .option-list { display: grid; gap: 8px; margin-top: 12px; }
.draft-preview-questions .option-item { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 9px 11px; border: 1px solid #e1e7ef; border-radius: 9px; background: #fff; cursor: pointer; }
.draft-preview-questions .option-item input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.draft-preview-questions .option-item:has(input:checked) { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.draft-preview-questions .rating-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 12px; }
.draft-preview-questions .rating-item input { position: absolute; opacity: 0; }
.draft-preview-questions .rating-item span { display: grid; place-items: center; min-height: 38px; border: 1px solid #dce5ef; border-radius: 8px; background: #fff; cursor: pointer; font-weight: 750; }
.draft-preview-questions .rating-item input:checked + span { color: #fff; background: var(--primary); border-color: var(--primary); }
.draft-preview-questions .matrix-list { display: grid; gap: 10px; margin-top: 12px; }
.draft-preview-questions .matrix-row { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #f6f8fb; }
.draft-preview-questions .matrix-row-title { color: #475569; font-size: 12px; font-weight: 700; }
.draft-preview-questions .consent-item { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px; border: 1px solid #c8dcff; border-radius: 9px; color: var(--primary); background: #f0f5ff; cursor: pointer; }
.draft-preview-questions .consent-item input { width: 19px; height: 19px; margin: 0; accent-color: var(--primary); }
.draft-preview-questions .text-input { width: 100%; min-height: 42px; margin-top: 12px; padding: 10px 11px; border: 1px solid #dce4ed; border-radius: 9px; background: #fff; }
.draft-preview-questions textarea.text-input { min-height: 95px; resize: vertical; }
.draft-preview-question[hidden] { display: none; }
.preview-validation-button { margin-right: auto; }
.draft-preview-modal { width: min(900px, calc(100% - 32px)); max-width: 900px; height: 92vh; max-height: 92vh; overflow: hidden; padding: 0; text-align: left; }
.draft-preview-modal[open] { display: flex; flex-direction: column; }
.draft-preview-modal .preview-modal-head, .draft-preview-modal .preview-modal-footer, .draft-preview-modal .preview-modal-description, .draft-preview-modal .preview-action-status { flex-shrink: 0; }
.preview-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 26px 10px; }
.preview-modal-head h2, .preview-modal-head p { margin-bottom: 0; }
.preview-modal-description { margin: 6px 26px 16px; color: var(--muted); white-space: pre-wrap; }
.draft-preview-questions { flex: 1; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; padding: 4px 26px 22px; }
.draft-preview-question { margin-bottom: 12px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.draft-preview-question-head { display: flex; align-items: flex-start; gap: 9px; }
.draft-preview-question-head strong { flex: 1; line-height: 1.6; }
.question-type-pill { flex: 0 0 auto; padding: 2px 7px; border-radius: 6px; color: var(--primary); background: var(--primary-soft); font-size: 10px; }
.preview-option-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.preview-option-tags span { padding: 5px 10px; border: 1px solid #dce5f0; border-radius: 8px; color: #475569; background: #fff; font-size: 12px; }
.preview-rating-scale { margin-top: 12px; padding: 10px; border-radius: 8px; color: var(--primary); background: var(--primary-soft); letter-spacing: .3em; text-align: center; font-weight: 800; }
.preview-matrix { display: grid; gap: 6px; margin-top: 12px; }
.preview-matrix div { padding: 8px 10px; border-radius: 7px; background: #edf2f8; color: #475569; font-size: 12px; }
.preview-consent { margin-top: 12px; padding: 12px; border: 1px solid #c8dcff; border-radius: 9px; color: var(--primary); background: #f0f5ff; font-weight: 700; }
.preview-text-placeholder { margin-top: 12px; padding: 14px; border: 1px dashed #cbd5e1; border-radius: 8px; color: #94a3b8; font-size: 12px; }
.preview-rule-line { margin: 9px 0 0; color: var(--muted); font-size: 11px; }
.preview-modal-footer { position: static; display: flex; flex-shrink: 0; justify-content: flex-end; gap: 10px; padding: 16px 26px; border-top: 1px solid var(--line); background: #fff; }
.preview-action-status { margin: 10px 26px; padding: 10px 12px; border-radius: 8px; font-size: 12px; line-height: 1.6; }
.regenerate-modal .preview-action-status { margin: 10px 0; }
.preview-action-status.testing { color: var(--primary); background: #edf4ff; }
.preview-action-status.success { color: #116149; background: #ebf9f3; }
.preview-action-status.failure { color: #a32d39; background: #fff1f2; white-space: pre-wrap; }
.regenerate-modal { width: min(610px, calc(100% - 32px)); max-width: 610px; padding: 0 0 22px; text-align: left; }
.regenerate-modal > p, .regenerate-modal > form { margin-left: 26px; margin-right: 26px; }
@media (max-width: 680px) { .preview-modal-footer { flex-wrap: wrap; } .preview-modal-footer .btn { flex: 1; min-width: 30%; } .preview-modal-head { padding: 20px 18px 8px; } .draft-preview-questions { padding: 4px 18px 18px; } .preview-modal-description { margin-left: 18px; margin-right: 18px; } }
#preflight-btn { margin-bottom: 10px; }
#generate-btn { margin-top: 10px; }
.generate-status { margin-top: 14px; padding: 11px 12px; border-radius: 9px; font-size: 11px; line-height: 1.65; }
.generate-status.testing { color: var(--primary); background: #edf4ff; }
.generate-status.success { color: #116149; background: #ebf9f3; }
.generate-status.failure { color: #a32d39; background: #fff1f2; white-space: pre-wrap; }
.success-modal { max-width: 520px; }
.success-mark { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 18px; border-radius: 50%; color: #fff; background: var(--teal); font-size: 28px; font-weight: 800; }
.created-provider { color: var(--primary); font-weight: 700; }
.success-detail { display: grid; gap: 5px; margin: 20px 0; padding: 13px 14px; border-radius: 10px; background: #f5f7fb; }
.success-detail span { color: var(--muted); font-size: 12px; line-height: 1.7; }
.connection-result { margin-bottom: 18px; padding: 15px 18px; border-radius: 12px; font-size: 13px; line-height: 1.7; }
.connection-result.testing { color: var(--primary); background: #edf4ff; border: 1px solid #c8dcff; }
.connection-result.success { color: #116149; background: #ebf9f3; border: 1px solid #b9e7d3; }
.connection-result.failure { color: #a32d39; background: #fff1f2; border: 1px solid #f5c3ca; white-space: pre-wrap; }
.settings-notice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.settings-notice > div { padding: 16px 18px; border: 1px solid #d9e5f8; border-radius: 12px; background: #f5f8ff; }
.settings-notice strong { color: var(--primary); }
.settings-notice p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.builtin-model-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 18px 22px; }
.builtin-model-card > div { display: flex; align-items: center; gap: 14px; }
.builtin-model-card h2, .builtin-model-card p { margin-bottom: 0; }
.builtin-model-card p { color: var(--muted); font-size: 12px; }
.model-provider-mark { display: grid; place-items: center; width: 52px; height: 38px; border-radius: 10px; color: var(--teal); background: var(--teal-soft); font-size: 10px; font-weight: 850; }
.llm-table code { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.default-badge { color: var(--primary); font-weight: 750; }
.key-hint { padding: 3px 7px; border-radius: 6px; color: #475569; background: #edf1f5; font-family: Consolas, monospace; letter-spacing: .04em; }
.endpoint-cell { max-width: 260px; overflow-wrap: anywhere; }
.danger-text { color: var(--red); }
.llm-modal { width: min(570px, calc(100% - 32px)); max-height: 90vh; overflow-y: auto; text-align: left; }
.modal-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.modal-title-row h2, .modal-title-row p { margin-bottom: 0; }
.llm-modal label small { color: var(--muted); font-size: 10px; font-weight: 500; }
.compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.config-checks { display: flex; flex-wrap: wrap; gap: 22px; }
.config-checks .checkbox-label { display: flex !important; }
.model-field { display: grid; gap: 7px; margin-bottom: 7px; color: #334155; font-size: 12px; font-weight: 700; }
.settings-link { display: inline-block; margin-bottom: 18px; font-size: 11px; }
.process-heading { padding-top: 17px; border-top: 1px solid var(--line); }
@media (max-width: 680px) {
  .settings-notice { grid-template-columns: 1fr; }
  .builtin-model-card { align-items: flex-start; }
  .compact-grid { grid-template-columns: 1fr; }
}
.danger-text { color: var(--red); }
.btn.danger { color: #fff; background: var(--red); border-color: var(--red); }
.dashboard-body { height: 100vh; height: 100dvh; overflow: hidden; }
.dashboard-body .admin-main { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; padding-bottom: 24px; }
.dashboard-body .page-header, .dashboard-body .metric-strip { flex: 0 0 auto; }
.survey-list-panel { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow: hidden; }
.survey-list-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.survey-table { border-collapse: separate; border-spacing: 0; }
.survey-table .text-btn, .survey-table .row-actions a { white-space: nowrap; }
.survey-list-scroll .survey-table thead th { position: sticky; top: 0; z-index: 3; border-bottom: 1px solid var(--line); background: #fafbfd; }
.survey-list-pagination { flex: 0 0 auto; justify-content: space-between; margin: 0; background: #fff; }
.survey-list-pagination .disabled { opacity: .45; pointer-events: none; }
.delete-survey-modal { width: min(500px, calc(100% - 32px)); text-align: left; }
@media (max-width: 900px) {
  .dashboard-body .admin-main { padding-top: 16px; padding-bottom: 12px; }
  .dashboard-body .page-header { margin-bottom: 12px; }
  .dashboard-body .metric-strip { margin-bottom: 12px; }
  .dashboard-body .metric-strip > div { padding: 10px 12px; }
  .survey-list-pagination { padding: 12px 10px; gap: 8px; }
  .survey-list-pagination span { font-size: 11px; text-align: center; }
}
.create-body { position: fixed; inset: 0; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; }
html:has(.create-body), html:has(.dashboard-body) { height: 100%; overflow: hidden; }
.create-body .admin-main { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; padding-bottom: 24px; }
.create-body .page-header { flex: 0 0 auto; }
.create-body .create-layout { flex: 1; min-height: 0; overflow: hidden; }
.create-body .create-main { min-height: 0; align-content: start; overflow-y: auto; overscroll-behavior: contain; padding-right: 5px; }
.create-body .create-aside { min-height: 0; }
.create-body .sticky-card { position: static; max-height: 100%; }
.cover-preview { display: block; width: min(100%, 420px); max-height: 180px; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; object-fit: cover; }
.preview-cover { display: block; width: 100%; max-height: 130px; margin-bottom: 12px; border-radius: 9px; object-fit: cover; }
.component-draft-link { display: block; margin-top: 9px; font-weight: 750; }
.requirement-description-label { font-weight: 400 !important; }
.requirement-image-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.requirement-image-tools .form-hint { margin: 0; }
.requirement-image-list { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }
.requirement-image-item { position: relative; width: 132px; margin: 0; }
.requirement-image-item img { display: block; width: 132px; height: 88px; border: 1px solid var(--line); border-radius: 9px; object-fit: cover; }
.requirement-image-item button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: rgba(20,35,60,.78); cursor: pointer; }
@media (max-width: 900px) {
  .create-body .admin-main { padding-top: 16px; padding-bottom: 12px; }
  .create-body .create-layout { grid-template-rows: minmax(0, 1fr) auto; }
  .create-body .create-aside .sticky-card { padding: 12px; }
  .create-body .create-aside .process-list, .create-body .create-aside .process-heading { display: none; }
}
@media print {
  .sidebar, .page-header .header-actions, .report-toolbar, .btn { display: none !important; }
  .admin-main { margin: 0; padding: 0; }
  body { background: #fff; }
  .panel { box-shadow: none; break-inside: avoid; }
}

/* Component definitions use a locked viewport with an internally scrolling card list. */
html:has(.component-body), body.component-body { height: 100%; min-height: 0; overflow: hidden; }
body.component-body { inset: 0; position: fixed; width: 100%; }
.component-body .admin-main { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
