:root {
  color-scheme: light;
  --page: #f6f7fb;
  --surface: #fff;
  --surface-soft: #fbfbfd;
  --ink: #1d2433;
  --muted: #788092;
  --line: #e9ebf1;
  --accent: #6d5ce8;
  --accent-strong: #5543d1;
  --accent-soft: #f0edff;
  --green: #22a783;
  --sidebar: #202335;
  --shadow: 0 12px 32px rgb(34 38 60 / 6%);
  font-family: "DM Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); min-width: 320px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #a69bff; outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
#app { min-height: 100vh; }

.sidebar { position: fixed; inset: 0 auto 0 0; width: 244px; background: var(--sidebar); color: #fff; padding: 27px 17px 18px; display: flex; flex-direction: column; z-index: 4; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; font: 800 17px Manrope, sans-serif; letter-spacing: -.5px; }
.brand-mark { width: 30px; height: 30px; border-radius: 10px; display: inline-grid; place-items: center; color: white; background: linear-gradient(140deg, #927eff, #6956e4); font: 800 17px Manrope, sans-serif; box-shadow: 0 5px 15px #7260e655; }
.brand-light { font-weight: 500; color: #b6b9c9; }
.side-nav { display: grid; gap: 6px; margin-top: 49px; }
.nav-link { border: 0; border-radius: 10px; padding: 11px 12px; color: #b9bbca; background: transparent; text-align: left; font-size: 13px; font-weight: 600; transition: background .16s, color .16s; }
.nav-link:hover, .nav-link.active { color: #fff; background: #ffffff13; }
.nav-link.active { box-shadow: inset 3px 0 #9c8cff; }
.nav-icon { display: inline-grid; place-items: center; width: 25px; margin-right: 7px; color: #aaa5d8; font-size: 18px; vertical-align: -1px; }
.sidebar-bottom { margin-top: auto; }
.tip-card { border: 1px solid #ffffff14; border-radius: 13px; padding: 14px; margin: 0 4px 17px; background: #ffffff08; }
.tip-icon { display: block; color: #a898ff; margin-bottom: 8px; }
.tip-card strong { display: block; font-size: 12px; }
.tip-card p { color: #b7b9c8; font-size: 11px; line-height: 1.5; margin: 7px 0 0; }
.theme-toggle { width: 100%; margin-bottom: 13px; }
.profile-row { display: flex; gap: 10px; align-items: center; border-top: 1px solid #ffffff14; padding: 17px 8px 0; }
.avatar { width: 31px; height: 31px; display: grid; place-items: center; background: #8272ef; border-radius: 50%; font-weight: 700; font-size: 12px; }
.profile-row strong, .profile-row small { display: block; }
.profile-row strong { font-size: 11px; }
.profile-row small { margin-top: 3px; font-size: 10px; color: #aeb1c0; }
.main-area { margin-left: 244px; min-height: 100vh; }
.view { max-width: 1320px; margin: 0 auto; padding: 39px 48px 64px; }
.mobile-header { display: none; }

.eyebrow { color: var(--muted); font-weight: 700; letter-spacing: 1.25px; font-size: 10px; text-transform: uppercase; margin: 0 0 10px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Manrope, "Segoe UI", sans-serif; letter-spacing: -.7px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading h1 { font-size: clamp(26px, 3vw, 34px); margin: 0 0 7px; font-weight: 800; }
.page-heading p:not(.eyebrow) { color: var(--muted); margin: 0; font-size: 13px; }
.button { border: 0; border-radius: 9px; font-weight: 700; padding: 11px 16px; transition: transform .16s, background .16s, box-shadow .16s; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--accent); color: white; box-shadow: 0 5px 13px #6d5ce82b; }
.button-primary:hover { background: var(--accent-strong); }
.button-secondary { background: var(--accent-soft); color: var(--accent-strong); }
.button-quiet { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.button-danger { background: #fff0ef; color: #cb4a43; }
.button-small { padding: 8px 11px; font-size: 11px; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 9px; display: inline-grid; place-items: center; font-size: 15px; }
.text-button { padding: 0; border: 0; color: var(--accent); background: none; font-weight: 700; font-size: 12px; }
.button-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.search-box { position: relative; width: 100%; max-width: 340px; }
.search-box span { position: absolute; top: 50%; left: 13px; color: #9da2b0; transform: translateY(-50%); }
.search-box input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 0 13px 0 37px; background: var(--surface); color: var(--ink); font-size: 12px; }

.welcome-banner { background: linear-gradient(110deg, #eeeaff 0%, #f5f2ff 57%, #fff 100%); border: 1px solid #e8e2ff; border-radius: 17px; padding: 27px 31px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 30px; overflow: hidden; position: relative; }
.welcome-banner:after { content: "✳"; position: absolute; right: 180px; top: -34px; font-size: 172px; color: #8d7af1; opacity: .08; pointer-events: none; }
.welcome-banner h2 { font-size: 20px; margin: 0 0 6px; }
.welcome-banner p { color: #72728b; font-size: 12px; margin: 0; }
.welcome-banner .button { position: relative; z-index: 1; white-space: nowrap; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 14px; }
.section-heading h2 { font-size: 16px; margin: 0; }
.section-heading span { color: var(--muted); font-size: 11px; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.project-card { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 17px; min-width: 0; transition: box-shadow .2s, transform .2s; }
.project-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.project-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.project-symbol { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 16px; background: var(--accent-soft); color: var(--accent); }
.project-menu { position: relative; }
.project-menu summary { list-style: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); cursor: pointer; }
.project-menu summary::-webkit-details-marker { display: none; }
.project-menu summary:hover { background: var(--page); }
.menu-items { position: absolute; z-index: 2; right: 0; top: 30px; min-width: 130px; padding: 5px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.menu-items button { display: block; width: 100%; text-align: left; border: 0; border-radius: 5px; padding: 8px 9px; background: transparent; color: var(--ink); font-size: 11px; }
.menu-items button:hover { background: var(--page); }
.menu-items button[data-action="delete-project"] { color: #cb4a43; }
.project-card h3 { font-size: 14px; margin: 14px 0 5px; overflow-wrap: anywhere; }
.project-description { color: var(--muted); font-size: 11px; min-height: 30px; margin: 0; line-height: 1.5; }
.project-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 15px; color: var(--muted); font-size: 10px; }
.project-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-open { border: 0; padding: 0; color: var(--accent); font-weight: 700; background: transparent; font-size: 11px; }
.empty-state { text-align: center; padding: 44px 20px; border: 1px dashed #d9dce6; border-radius: 14px; background: var(--surface); }
.empty-state .empty-icon { font-size: 30px; margin-bottom: 9px; }
.empty-state h3 { font-size: 15px; margin: 0 0 7px; }
.empty-state p { color: var(--muted); font-size: 12px; margin: 0 0 15px; }

.template-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.template-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; transition: .18s ease; }
.template-card:hover { border-color: #c9c0ff; transform: translateY(-2px); box-shadow: var(--shadow); }
.template-emoji { font-size: 22px; display: block; margin-bottom: 12px; }
.template-card h3 { font-size: 13px; margin: 0 0 6px; }
.template-card p { font-size: 10px; line-height: 1.5; color: var(--muted); min-height: 31px; margin: 0 0 12px; }
.template-card button { font-size: 10px; padding: 7px 9px; }
.template-filter { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip { border: 1px solid var(--line); border-radius: 20px; color: var(--muted); background: var(--surface); padding: 7px 12px; font-size: 10px; }
.filter-chip.active { color: var(--accent-strong); background: var(--accent-soft); border-color: #ded8ff; }

.editor-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.back-link { color: var(--muted); border: 0; background: transparent; padding: 6px 0; font-size: 12px; }
.editor-header-title { flex: 1; min-width: 80px; }
.editor-header-title strong { display: block; font-size: 13px; }
.editor-header-title small { color: var(--green); font-size: 10px; }
.editor-actions { display: flex; gap: 7px; align-items: center; }
.editor-actions .button { padding: 9px 12px; font-size: 11px; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 235px; align-items: start; gap: 18px; }
.editor-main { min-width: 0; }
.form-cover { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 14px; box-shadow: 0 2px 6px #252a3d08; }
.form-cover-bar { height: 7px; background: var(--form-color, var(--accent)); }
.form-header-image { width: 100%; max-height: 190px; object-fit: cover; display: block; }
.button-pill { border-radius: 999px; }
.form-page-break { display: flex; align-items: center; gap: 10px; margin: 15px 0; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: 1px; }
.form-page-break:before, .form-page-break:after { content: ""; height: 1px; flex: 1; background: var(--line); }
.form-cover-content { padding: 20px 23px; }
.form-cover-content input, .form-cover-content textarea { display: block; border: 0; outline: 0; width: 100%; background: transparent; color: var(--ink); padding: 3px 0; }
.form-cover-content input:focus, .form-cover-content textarea:focus { box-shadow: 0 1px var(--accent); }
.form-cover-content input.title-input { font: 800 22px Manrope, sans-serif; letter-spacing: -.7px; }
.form-cover-content textarea { min-height: 41px; resize: vertical; font-size: 12px; line-height: 1.5; color: var(--muted); }
.form-cover-extras { border-top: 1px solid var(--line); padding-top: 13px; margin-top: 11px; }
.form-cover-extras input { font-size: 11px; color: var(--muted); }
.question-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; margin-bottom: 11px; padding: 16px 18px; transition: box-shadow .16s, border-color .16s; }
.question-card:hover { border-color: #d7d2f3; }
.question-card.dragging { opacity: .48; }
.question-card.drop-target { border-color: var(--accent); box-shadow: 0 0 0 2px #6d5ce822; }
.question-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.question-kind { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.drag-handle { cursor: grab; color: #a8adba; font-size: 16px; touch-action: none; }
.question-tools { display: flex; align-items: center; gap: 3px; }
.question-tools button { border: 0; color: var(--muted); background: transparent; border-radius: 6px; width: 27px; height: 27px; font-size: 12px; }
.question-tools button:hover { background: var(--page); color: var(--ink); }
.question-tools button.delete-question:hover { color: #cb4a43; background: #fff0ef; }
.field-label { display: block; color: var(--muted); font-size: 9px; font-weight: 700; margin-bottom: 5px; }
.question-title-input { width: 100%; min-height: 39px; border: 1px solid var(--line); background: var(--surface-soft); border-radius: 8px; padding: 9px 10px; color: var(--ink); font-weight: 600; font-size: 12px; }
.question-description-input { width: 100%; resize: vertical; min-height: 32px; border: 0; border-bottom: 1px solid var(--line); padding: 8px 0; margin: 5px 0 13px; color: var(--muted); background: transparent; font-size: 11px; }
.question-settings-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 15px; border-top: 1px solid var(--line); margin-top: 13px; padding-top: 12px; }
.question-settings-row label { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); }
.question-settings-row input[type="checkbox"] { accent-color: var(--accent); }
.question-settings-row input[type="number"] { width: 48px; border: 1px solid var(--line); border-radius: 6px; padding: 5px; color: var(--ink); background: var(--surface); }
.question-settings-row select, .question-type-select { border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; color: var(--ink); background: var(--surface); font-size: 10px; }
.question-type-select { font-size: 10px; }
.options-list { display: grid; gap: 7px; margin-top: 10px; }
.option-row { display: flex; align-items: center; gap: 8px; }
.option-row input[type="radio"], .option-row input[type="checkbox"] { accent-color: var(--accent); }
.option-row input[type="text"] { border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--ink); padding: 5px 0; flex: 1; min-width: 80px; font-size: 11px; }
.option-row input[type="text"]:focus { border-color: var(--accent); outline: 0; }
.option-row .option-remove { border: 0; background: transparent; color: #a3a8b4; font-size: 14px; padding: 2px 5px; }
.option-row .option-remove:hover { color: #cb4a43; }
.option-add { border: 0; background: transparent; color: var(--accent); font-size: 10px; font-weight: 700; text-align: left; padding: 7px 0 2px 24px; }
.answer-key { margin-top: 10px; }
.answer-key input, .answer-key select, .question-image-input, .explanation-input { width: 100%; border: 1px solid var(--line); background: var(--surface-soft); color: var(--ink); border-radius: 7px; padding: 8px 10px; font-size: 10px; }
.scale-setting-label { margin-top: 9px; }
.question-image-input { margin-top: 9px; }
.explanation-input { margin-top: 8px; }
.add-question-row { display: flex; gap: 9px; align-items: center; justify-content: center; background: var(--surface); border: 1px dashed #d7d3e9; border-radius: 12px; padding: 12px; margin: 13px 0; }
.add-question-row .button { font-size: 11px; padding: 9px 13px; }
.editor-panel { position: sticky; top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 15px; }
.editor-panel h3 { font-size: 12px; margin: 0 0 13px; }
.panel-group { border-top: 1px solid var(--line); padding: 12px 0; }
.panel-group:first-of-type { border-top: 0; padding-top: 0; }
.panel-group label { display: block; color: var(--muted); font-size: 10px; margin-bottom: 7px; }
.panel-group select, .panel-group input[type="text"], .panel-group input[type="url"], .panel-group input[type="number"] { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 8px; font-size: 10px; color: var(--ink); background: var(--surface); }
.panel-group .check-line { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 10px; margin: 9px 0 0; }
.panel-group input[type="checkbox"] { accent-color: var(--accent); }
.color-options { display: flex; gap: 8px; }
.color-swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid white; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.color-swatch.selected { box-shadow: 0 0 0 2px var(--accent); }
.panel-hint { color: var(--muted); font-size: 9px; line-height: 1.5; margin: 9px 0 0; }
.mobile-panel-toggle { display: none; }

.dialog { width: min(610px, calc(100vw - 28px)); max-height: min(85vh, 780px); border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: 0 24px 90px #171a2d40; }
.dialog::backdrop { background: #171a2d66; backdrop-filter: blur(2px); }
.dialog-content { padding: 22px; }
.dialog-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 17px; }
.dialog-heading h2 { font-size: 18px; margin: 0 0 5px; }
.dialog-heading p { color: var(--muted); font-size: 11px; margin: 0; }
.dialog-close { border: 0; color: var(--muted); background: transparent; font-size: 20px; padding: 0 4px; }
.preview-form { background: var(--page); border-radius: 11px; padding: 17px; max-height: 58vh; overflow-y: auto; }
.preview-form.layout-compact .preview-question { padding: 9px; margin: 6px 0; }
.preview-form h3 { font-size: 17px; margin: 0 0 7px; }
.preview-form > p { font-size: 11px; color: var(--muted); line-height: 1.5; margin-bottom: 15px; }
.preview-question { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 13px; margin: 9px 0; }
.preview-question label.question-label { display: block; font-size: 11px; font-weight: 700; margin-bottom: 9px; }
.required-mark { color: #d4534e; margin-left: 3px; }
.preview-answer-list { display: grid; gap: 7px; }
.preview-answer-list label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.preview-answer-list input { accent-color: var(--accent); }
.preview-answer-text, .preview-answer-select { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 9px; background: var(--surface); color: var(--ink); font-size: 11px; }
.preview-answer-text.long { min-height: 80px; resize: vertical; }
.preview-answer-range { width: 100%; accent-color: var(--accent); }
.preview-range-hints { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); }
.labeled-scale { padding: 8px 0 2px; }
.labeled-scale-options { display: grid; align-items: center; gap: 4px; position: relative; padding: 0 2px; }
.labeled-scale-options::before { content: ""; position: absolute; z-index: 0; left: 14px; right: 14px; top: 13px; height: 2px; background: var(--line); }
.labeled-scale-option { display: grid; justify-items: center; position: relative; z-index: 1; cursor: pointer; }
.labeled-scale-option input { position: absolute; width: 26px; height: 26px; margin: 0; opacity: 0; cursor: pointer; }
.labeled-scale-option span { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 10px; transition: background .15s, border-color .15s, color .15s; }
.labeled-scale-option input:checked + span { border-color: var(--accent); background: var(--accent); color: #fff; }
.labeled-scale-option input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.labeled-scale-labels { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; color: var(--muted); font-size: 10px; }
.labeled-scale-labels span:last-child { text-align: right; }
.preview-image { max-width: 100%; max-height: 200px; border-radius: 7px; margin: 8px 0; }
.question-step[hidden] { display: none !important; }
.question-navigation { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0; }
.question-navigation span { color: var(--muted); font-size: 11px; }
.response-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 14px; }
.metric-card { background: var(--page); border-radius: 9px; padding: 12px; }
.metric-card strong { font: 800 20px Manrope, sans-serif; display: block; }
.metric-card span { font-size: 9px; color: var(--muted); }
.response-list { display: grid; gap: 7px; max-height: 310px; overflow-y: auto; }
.response-item { text-align: left; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 11px; font-size: 10px; }
.response-item:hover { border-color: #c9c0ff; }
.response-detail { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; max-height: 35vh; overflow-y: auto; }
.response-detail-row { border-bottom: 1px solid var(--line); padding: 8px 0; }
.response-detail-row strong, .response-detail-row span { display: block; font-size: 10px; line-height: 1.5; }
.response-detail-row span { color: var(--muted); margin-top: 3px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(90px, 2fr) 32px; gap: 8px; align-items: center; margin: 8px 0; font-size: 10px; }
.bar-track { height: 8px; border-radius: 8px; background: var(--page); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--accent); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); z-index: 10; opacity: 0; pointer-events: none; background: #28283b; color: white; padding: 10px 15px; border-radius: 9px; font-size: 11px; box-shadow: var(--shadow); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.page-note { max-width: 760px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 12px; line-height: 1.7; }
.page-note strong { color: var(--ink); }
.welcome-screen { text-align: center; padding: 28px 12px; }
.welcome-screen .welcome-icon { font-size: 32px; }
.welcome-screen h2 { font-size: 21px; }
.welcome-screen p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.footer-note { color: var(--muted); font-size: 10px; margin: 14px 0 0; }
.notice { border: 1px solid #f1dfb7; border-radius: 9px; background: #fff8e9; color: #7e6330; padding: 11px; margin: 12px 0; font-size: 10px; line-height: 1.6; }
.public-mode .sidebar, .public-mode .mobile-header { display: none !important; }
.public-mode .main-area { margin-left: 0; }
.public-mode .view { max-width: 780px; padding-top: 26px; }
.public-shell { max-width: 690px; margin: 0 auto; }
.public-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; font: 800 14px Manrope, sans-serif; }
.public-brand .brand-light { color: var(--muted); }
.public-card { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 18px; box-shadow: var(--shadow); }
.public-card .preview-form { max-height: none; overflow: visible; padding: 4px; }
.public-card .preview-form > .form-header-image { border-radius: 9px; margin-bottom: 14px; }
.public-card > h1 { font-size: 21px; }
.public-card > p { font-size: 12px; color: var(--muted); }
.public-footnote { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 9px; }
body.dark .public-card { background: var(--surface); }

body.dark {
  color-scheme: dark;
  --page: #171925;
  --surface: #222536;
  --surface-soft: #25283a;
  --ink: #f0f0f6;
  --muted: #a1a5b8;
  --line: #36394d;
  --accent-soft: #342f58;
  --accent-strong: #b1a7ff;
  --shadow: 0 12px 32px rgb(0 0 0 / 22%);
}
body.dark .welcome-banner { background: linear-gradient(110deg, #2b2744, #29283a); border-color: #41395f; }
body.dark .welcome-banner p { color: #c2bfd7; }
body.dark .project-menu summary:hover, body.dark .menu-items button:hover, body.dark .question-tools button:hover { background: #2c3042; }
body.dark .button-danger { background: #4a2d35; color: #ffaaa1; }
body.dark .notice { background: #393324; border-color: #665738; color: #e9cf92; }

@media (max-width: 1080px) {
  .view { padding: 32px 28px 54px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .template-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .editor-layout { grid-template-columns: minmax(0, 1fr) 210px; gap: 12px; }
}
@media (max-width: 780px) {
  .sidebar { display: none; }
  .main-area { margin-left: 0; }
  .mobile-header { display: flex; align-items: center; justify-content: space-between; background: var(--surface); padding: 12px 18px; border-bottom: 1px solid var(--line); }
  .mobile-header .brand { padding: 0; color: var(--ink); font-size: 15px; }
  .mobile-header .brand-light { color: var(--muted); }
  .mobile-header .brand-mark { width: 27px; height: 27px; }
  .view { padding: 25px 19px 45px; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-panel { position: static; display: none; }
  .editor-panel.visible { display: block; }
  .mobile-panel-toggle { display: inline-flex; }
}
@media (max-width: 560px) {
  .view { padding: 22px 14px 36px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .page-heading > .button { width: 100%; }
  .welcome-banner { align-items: flex-start; flex-direction: column; padding: 21px; gap: 16px; }
  .welcome-banner:after { right: 10px; }
  .welcome-banner .button { width: 100%; }
  .project-grid, .template-grid { grid-template-columns: 1fr; }
  .project-card { padding: 15px; }
  .template-card { padding: 14px; }
  .template-card p { min-height: auto; }
  .editor-header { flex-wrap: wrap; }
  .editor-header-title { order: 2; flex-basis: calc(100% - 80px); }
  .editor-actions { order: 3; width: 100%; flex-wrap: wrap; }
  .editor-actions .button { flex: 1; }
  .form-cover-content { padding: 16px; }
  .form-cover-content input.title-input { font-size: 19px; }
  .question-card { padding: 13px; }
  .question-settings-row { gap: 9px; }
  .dialog-content { padding: 17px; }
  .response-summary { gap: 6px; }
  .metric-card { padding: 9px; }
  .metric-card strong { font-size: 17px; }
  .public-mode .view { padding: 18px 12px 30px; }
  .public-card { padding: 12px; }
}
