.survey-ui * { box-sizing: border-box; }
.survey-ui [hidden] { display: none !important; }
.survey-ui {
  color-scheme: light;
  --ink: #172e44;
  --muted: #4b6176;
  --line: #d9e3ec;
  --paper: #fff;
  --canvas: #f3f6fa;
  --accent: #086e74;
  --accent-hover: #075b60;
  font: 16px/1.55 system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
body.survey-ui { margin: 0; }
.survey-ui .survey-header { background: #112941; color: #e6f0f6; }
.survey-ui .survey-wrap { width: min(100% - 36px, 940px); margin-inline: auto; }
.survey-ui #content { padding-block: clamp(26px, 5vw, 56px) 48px; }
.survey-ui .header-inner { min-height: 58px; display: flex; align-items: center; gap: 18px; }
.survey-ui .brand { color: #fff; font-weight: 800; letter-spacing: .02em; text-decoration: none; }
.survey-ui #workspace { font-size: .9rem; }
.survey-ui .skip { position: absolute; top: 6px; left: 6px; padding: 8px 12px; background: var(--paper); transform: translateY(-150%); }
.survey-ui .skip:focus { transform: none; }
.survey-ui :is(h1, h2, h3, p) { margin: 0; }
.survey-ui h1 { font-size: clamp(1.65rem, 4.7vw, 2.5rem); line-height: 1.17; letter-spacing: -.025em; overflow-wrap: anywhere; }
.survey-ui h2 { font-size: 1.25rem; line-height: 1.3; }
.survey-ui h3 { font-size: 1rem; }
.survey-ui p { color: var(--muted); max-width: 70ch; }
.survey-ui p + p { margin-top: .5rem; }
.survey-ui a { color: var(--accent); text-underline-offset: .18em; }
.survey-ui :is(.survey-surface > header, .section-top, .row, .actions) { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.survey-ui :is(.survey-surface > header, .section-top, .row) { justify-content: space-between; }
.survey-ui .survey-surface > header { margin-bottom: 18px; }
.survey-ui :is(.survey-surface > header p, .section-top + p) { margin-top: .4rem; }
.survey-ui .back { display: inline-block; margin-bottom: 12px; }
.survey-ui .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: clamp(15px, 3.2vw, 24px); margin-bottom: 14px; }
.survey-ui .list { padding-block: 0; }
.survey-ui .row { padding-block: 15px; }
.survey-ui .row + .row { border-top: 1px solid var(--line); }
.survey-ui .row > div { min-width: 0; overflow-wrap: anywhere; }
.survey-ui .row small { color: var(--muted); }
.survey-ui :is(.button, button) {
  font: inherit; font-size: .92rem; font-weight: 650; min-height: 44px; display: inline-flex; align-items: center;
  justify-content: center; padding: 8px 15px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); color: var(--ink); cursor: pointer; text-decoration: none;
}
.survey-ui :is(.button:hover, button:hover) { border-color: var(--accent); }
.survey-ui .primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.survey-ui .primary:hover { background: var(--accent-hover); }
.survey-ui button:disabled { opacity: .6; cursor: wait; }
.survey-ui :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.survey-ui h1[tabindex="-1"]:focus { outline: none; }
.survey-ui ::selection { color: #112941; background: #b9e6e4; }
.survey-ui .notice { padding: 11px 15px; margin-bottom: 14px; border: 1px solid #abcfcf; border-radius: 8px; color: #12464a; background: #eef9f8; }
.survey-ui .notice[data-error] { color: #832929; border-color: #e2b1b1; background: #fff4f4; }
.survey-ui .grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.survey-ui .stack { display: grid; gap: 14px; }
.survey-ui label.field { display: grid; gap: 5px; color: var(--ink); font-weight: 620; }
.survey-ui :is(input:not([type=checkbox],[type=radio]), textarea, select) {
  width: 100%; min-width: 0; min-height: 44px; padding: 9px 11px; border: 1px solid #b9cbd9;
  border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; font-weight: 400;
}
.survey-ui textarea { resize: vertical; }
.survey-ui fieldset { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.survey-ui legend { padding-inline: 5px; font-weight: 650; overflow-wrap: anywhere; max-width: 100%; }
.survey-ui :is(.check, .choice) { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.survey-ui :is(input[type=checkbox], input[type=radio]) { accent-color: var(--accent); }
.survey-ui .question { margin-block: 10px; }
.survey-ui :is(.question .actions, .panel > .actions) { margin-top: 13px; }
.survey-ui .results { display: grid; gap: 13px; margin-top: 14px; }
.survey-ui :is(.results li, .results h3) { overflow-wrap: anywhere; }
.survey-ui .buckets { display: flex; flex-wrap: wrap; padding: 0; margin: 6px 0 0; list-style: none; gap: 6px; }
.survey-ui .buckets li { padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }
.survey-ui .scale { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 5px; }
.survey-ui .scale label { display: grid; justify-items: center; gap: 4px; padding: 6px 2px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.survey-ui .scale label:has(:checked) { background: #e7f6f5; border-color: var(--accent); }
.survey-ui .scale-key { display: flex; justify-content: space-between; gap: 10px; margin-top: 5px; color: var(--muted); }
.survey-ui dl { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.survey-ui dt { font-size: .86rem; color: var(--muted); }
.survey-ui dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.survey-ui .respondent { max-width: 670px; margin-inline: auto; }
@media (max-width: 580px) { .survey-ui .grid { grid-template-columns: 1fr; } .survey-ui .survey-wrap { width: calc(100% - 26px); } }

.survey-embedded { padding: 24px 27px; background: transparent; font-family: inherit; }
.survey-embedded .survey-surface > header h1 { font-size: clamp(1.65rem, 3vw, 2rem); }
.survey-ui .question-score { margin-top: 4px; }
@media (max-width: 580px) { .survey-embedded { padding: 18px 14px; } }

.survey-ui .question-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.survey-ui .drag-handle { font-size: 1.35rem; cursor: grab; padding-inline: 8px; color: var(--muted); }
.survey-ui .dragging { opacity: .65; border-color: var(--accent); }
.survey-ui .option-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.survey-ui .cover-editor { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.survey-ui .cover-editor > summary { cursor: pointer; font-weight: 650; }
.survey-ui .cover-editor[open] > summary { margin-bottom: 12px; }
.survey-ui .survey-unit-result { border-top: 1px solid var(--line); }
.survey-ui .survey-unit-result summary { cursor: pointer; padding-block: 12px; }
.survey-ui .survey-unit-result-line { display: inline-flex; flex-wrap: wrap; vertical-align: middle; width: calc(100% - 22px); align-items: center; justify-content: space-between; gap: 6px 18px; }
.survey-ui .survey-unit-result-line small { display: block; color: var(--muted); }
.survey-ui .survey-unit-score { font-variant-numeric: tabular-nums; }
.survey-ui .survey-unit-result > p { margin: 0 0 12px 22px; }
.survey-ui #survey-unit-share .field { max-width: 100%; min-width: 0; }
.survey-ui #survey-unit-share select, .survey-ui #survey-unit-filter select, .survey-ui #survey-unit-grant select { max-width: 100%; }
.survey-ui .survey-cover { display: block; max-width: 100%; max-height: 340px; width: 100%; object-fit: contain; background: var(--paper); border-radius: 10px; margin: 0 0 14px; }
.survey-ui .distribution { padding: 0; margin: 10px 0; list-style: none; display: grid; gap: 6px; }
.survey-ui .distribution li { display: grid; align-items: center; grid-template-columns: minmax(0, 1fr) minmax(70px, 2fr) max-content; gap: 8px; overflow-wrap: anywhere; }
.survey-ui .distribution li strong { font-size: .85rem; font-variant-numeric: tabular-nums; }
.survey-ui .score-comparison li { grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) max-content; padding-block: 6px; }
.survey-ui .distribution meter { width: 100%; height: .9rem; appearance: none; }
.survey-ui .distribution meter::-webkit-meter-bar { background: #dfeaf0; border: 0; }
.survey-ui .distribution meter::-webkit-meter-optimum-value { background: var(--accent); }
.survey-ui .distribution meter::-moz-meter-bar { background: var(--accent); }
.survey-ui .results > div + div { border-top: 1px solid var(--line); padding-top: 14px; }
.survey-ui .survey-print-frame { position: fixed; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }
.survey-ui .survey-print { padding: 1rem; }
.survey-ui .survey-print header { margin-bottom: 1rem; }
.survey-ui .survey-print [name=score_view] { display: none; }
@page { size: A4; margin: 13mm; }
@media print {
  .survey-ui.survey-print { padding: 0; font-size: 10pt; print-color-adjust: exact; }
  .survey-ui.survey-print h1 { font-size: 19pt; }
  .survey-ui.survey-print .panel { padding: 8px 0; border: 0; }
  .survey-ui.survey-print .results > div { break-inside: avoid; }
  .survey-ui.survey-print .section-top > label, .survey-ui.survey-print details { display: none; }
}

.survey-ui .survey-tools { margin-bottom: 14px; }
.survey-ui .survey-filters { gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.survey-ui .survey-filters button[aria-pressed="true"] { background: #e7f6f5; border-color: var(--accent); color: #075b60; }
.survey-ui .survey-search { margin-block: 14px 10px; align-items: end; }
.survey-ui .survey-search .field { flex: 1 1 235px; max-width: 390px; }
.survey-ui .survey-list-total { font-size: .88rem; margin-bottom: 5px; }
.survey-ui .survey-list-row { gap: 7px 15px; }
.survey-ui .survey-list-row > div { flex: 1 1 240px; }
.survey-ui .survey-status { display: inline-block; color: #344f67; background: #eaf0f6; border-radius: 20px; padding: 3px 10px; font-size: .82rem; font-weight: 650; }
.survey-ui .survey-status[data-state="published"] { color: #085955; background: #e0f4ed; }
.survey-ui .survey-status[data-state="draft"] { color: #684b15; background: #faf0d9; }
.survey-ui button.survey-danger { color: #842c30; border-color: #debfc0; }
.survey-ui button.survey-danger:hover { background: #fff2f2; border-color: #842c30; }
.survey-ui #invitations { margin-top: 14px; }
.survey-ui #invitations .actions { margin-block: 10px; }
.survey-ui .survey-qr { max-width: 390px; border-top: 1px solid var(--line); padding-block: 12px; }
.survey-ui .survey-qr canvas { width: min(100%, 300px); height: auto; border: 1px solid var(--line); }

.survey-ui .analysis-block { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.survey-ui .analysis-block h3 { margin-bottom: 4px; }
.survey-ui .analysis-table-wrap { overflow-x: auto; }
.survey-ui .survey-analysis-table { width: 100%; border-collapse: collapse; margin-top: 8px; text-align: left; }
.survey-ui .survey-analysis-table caption { text-align: left; font-weight: 650; margin-bottom: 5px; }
.survey-ui .survey-analysis-table :is(th,td) { border-bottom: 1px solid var(--line); padding: 7px 8px; font-size: .9rem; }
.survey-ui .survey-analysis-table tbody th { font-weight: 500; overflow-wrap: anywhere; }
.survey-ui .survey-analysis-table td { text-align: right; font-variant-numeric: tabular-nums; }
@media print { .survey-ui.survey-print .analysis-block { break-inside: avoid; } }

.survey-ui .survey-analysis-table { min-width: 0; table-layout: fixed; }
.survey-ui .survey-analysis-table th { color: var(--ink); white-space: normal; }
.survey-ui .survey-analysis-table thead th:last-child { width: 104px; text-align: right; }
@media screen and (max-width: 580px) {
  .survey-ui .analysis-block .distribution li { grid-template-columns: minmax(0,1fr) auto; margin-block: 5px; }
  .survey-ui .analysis-block .distribution meter { grid-column: 1/-1; grid-row: 2; }
  .survey-ui .analysis-block .distribution li strong { grid-column: 2; grid-row: 1; }
  .survey-ui .analysis-block .distribution span:empty { display: none; }
}
