:root {
  color-scheme: light;
  --page: #f4eae0;
  --paper: #fffaf5;
  --tint: #f9efe6;
  --ink: #31231b;
  --muted: #6d5447;
  --line: #dcc7b9;
  --accent: #783d2a;
  --accent-dark: #653121;
  --success: #315640;
  --error: #903824;
  --serif: Georgia, 'Times New Roman', serif;
  font: 100%/1.5 system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box }
body { margin: 0 }
h1, h2, h3, p, blockquote { margin: 0 }
h1 { font: 700 clamp(2rem, 4vw, 3rem)/1.1 var(--serif); overflow-wrap: anywhere }
h2 { font-size: 1.25rem; line-height: 1.25 }
h3 { font-size: 1rem; line-height: 1.3 }
a { color: var(--accent); text-underline-offset: .2em }
a:hover { color: var(--accent-dark) }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px }
button, .button, input, select, textarea { font: inherit; color: inherit }
button, .button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: .46rem .82rem; border: 1px solid var(--line);
  border-radius: 9px; background: var(--paper); color: var(--ink);
  text-decoration: none; text-align: center; cursor: pointer;
}
button:hover, .button:hover { background: var(--tint); color: var(--ink) }
button:disabled { opacity: .45; cursor: default }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: white; font-weight: 650 }
button.primary:hover, .button.primary:hover { background: var(--accent-dark); color: white }
button.subtle { border-color: transparent }
input:not([type="checkbox"]):not([type="radio"]), textarea, select {
  width: 100%; min-width: 0; max-width: 100%; min-height: 44px;
  padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 9px; background: var(--paper);
}
input[readonly] { background: var(--tint) !important }
textarea { resize: vertical }
select {
  appearance: none; padding-right: 1.85rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23783d2a' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .65rem center; background-size: .7rem;
}
label { display: grid; gap: .32rem; min-width: 0; font-size: .92rem; font-weight: 550 }
label input, label textarea, label select { font-size: 1rem; font-weight: 400 }
input[type=checkbox], input[type=radio] { accent-color: var(--accent) }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0 }
legend { font-weight: 650; margin-bottom: .32rem }
.check { display: flex; min-height: 40px; align-items: center; gap: .6rem }
.check input { width: 1.12rem; height: 1.12rem; flex: 0 0 auto; margin: 0 }
.site-header { background: var(--paper); border-bottom: 1px solid var(--line) }
.topbar { margin: auto; max-width: 1240px; min-height: 66px; padding: .65rem clamp(.8rem, 3vw, 2rem); display: flex; align-items: center; gap: .45rem 1.2rem; flex-wrap: wrap }
.brand { font: 700 1.55rem/1.15 var(--serif); color: var(--accent); white-space: nowrap; text-decoration: none }
nav, .row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap }
nav a { display: inline-flex; min-height: 44px; align-items: center; padding: .45rem .68rem; border-radius: 8px; color: var(--ink); text-decoration: none }
nav a[aria-current=page] { background: var(--tint); color: var(--accent); font-weight: 650 }
.account { margin-left: auto; display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .88rem }
.workspace { max-width: 1240px; margin: auto; padding: clamp(.9rem, 3vw, 2rem) clamp(.75rem, 3vw, 2rem) 3rem }
.page-header { display: flex; gap: .75rem 1rem; align-items: end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1.05rem }
.page-header p, .page-header .row { margin-top: .35rem }
.page-header p, .muted { color: var(--muted) }
.breadcrumb { display: inline-block; margin-bottom: .4rem; font-size: .93rem }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: clamp(.85rem, 2vw, 1.35rem) }
.stack { display: grid; gap: .85rem; align-content: start; min-width: 0 }
.spread { justify-content: space-between }
.spaced { margin-top: 1rem }
.spaced-small { margin-block: .55rem }
.survey-actions { display: grid; gap: .65rem; margin-bottom: 1rem }
.share { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .55rem; max-width: 730px }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem }
.filters label:first-child { flex: 1 1 220px }
.filters label { flex: 1 1 135px }
.editor-grid, .work-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .75fr); gap: 1rem; align-items: start }
.work-grid { grid-template-columns: minmax(270px, .8fr) minmax(0, 1.2fr) }
.materials-grid, .report-grid { grid-template-columns: minmax(280px, .74fr) minmax(0, 1.26fr) }
.date-grid, .metrics { display: grid; gap: .7rem; grid-template-columns: repeat(2, minmax(0, 1fr)) }
.date-grid input { padding-inline: .4rem }
.metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)) }
.question-card { border: 1px solid var(--line); border-radius: 12px; padding: .8rem; min-width: 0 }
.question-card.selected { border-color: var(--accent) }
.question-card legend { padding: 0 .35rem; margin: 0 }
.drag-handle { color: var(--muted); font-size: .88rem; cursor: grab; padding-right: .35rem }
.rule-grid { display: grid; gap: .6rem; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: .6rem; background: var(--tint); border-radius: 8px }
.rule-grid button { justify-self: start; grid-column: 1 / -1 }
summary { cursor: pointer }
.preview-side { position: sticky; top: 1rem }
.table-scroll { overflow-x: auto; width: 100% }
table { width: 100%; border-collapse: collapse; font-size: .92rem; text-align: left }
th, td { padding: .62rem .45rem; border-bottom: 1px solid var(--line); vertical-align: top }
thead th { color: var(--muted); font-weight: 600 }
td { overflow-wrap: anywhere }
tbody tr:last-child > * { border-bottom: 0 }
.badge { display: inline-block; border-radius: 99px; padding: .19rem .55rem; background: var(--tint); color: var(--muted); font-size: .84rem; font-weight: 650 }
.state-active { background: #e3eee4; color: var(--success) }
.state-paused, .state-scheduled { background: #f3e4c8; color: #704c26 }
.notice { padding: .65rem .85rem; margin-bottom: .8rem; background: var(--tint); border: 1px solid var(--line); border-radius: 9px }
.notice.error { color: var(--error); background: #fff0e9; border-color: #e8beb0 }
.notice.success { color: var(--success); background: #edf4ec; border-color: #c5d5c5 }
.empty { color: var(--muted); padding: 1.2rem }
.centered, .customer-wrap { width: min(100%, 475px); margin: clamp(1rem, 7vh, 5rem) auto; padding: 0 .75rem }
.auth { display: grid; gap: 1.05rem }
.customer { border-top: 4px solid var(--accent); display: grid; gap: 1rem; overflow-wrap: anywhere }
.customer h1, .customer h3 { font: 700 clamp(1.55rem, 5vw, 2rem)/1.14 var(--serif) }
.customer-header { display: grid; gap: .22rem; border-bottom: 1px solid var(--line); padding-bottom: .8rem }
.customer progress { width: 100%; height: 8px; accent-color: var(--accent) }
.customer button { min-height: 48px }
.score-grid { display: grid; grid-template-columns: repeat(5, minmax(42px, 1fr)); gap: 5px }
.score-grid.recommend { grid-template-columns: repeat(6, minmax(42px, 1fr)) }
.score { position: relative; display: block }
.score input { position: absolute; width: 1px; height: 1px; opacity: 0 }
.score span { display: grid; place-items: center; min-height: 48px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 1.1rem }
.score input:checked + span { background: var(--accent); color: white; border-color: var(--accent) }
.score input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px }
.choice { border: 1px solid var(--line); border-radius: 9px; padding: .6rem .72rem; min-height: 48px; overflow-wrap: anywhere }
.scale-labels { margin-top: .45rem; font-size: .84rem }
.public-buttons { display: flex; gap: .5rem }
.public-buttons .primary { flex: 1 }
.honey { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none }
.preview { container-type: inline-size }
@container (max-width: 280px) {
  .preview .score-grid.recommend { grid-template-columns: repeat(4, minmax(42px, 1fr)) }
}
.number { display: block; margin: .35rem 0; color: var(--accent); font: 700 2.2rem/1.15 var(--serif) }
.checks { border-top: 1px solid var(--line); gap: .25rem }
.checks legend { padding-right: .35rem }
.results-block { border-top: 1px solid var(--line); padding-top: .75rem }
.result-row { display: flex; justify-content: space-between; gap: .55rem; padding: .35rem 0; overflow-wrap: anywhere }
.result-row strong { white-space: nowrap }
blockquote { padding: .25rem 0 .25rem .65rem; border-left: 2px solid var(--line) }
meter { display: block; width: 100%; height: .6rem; accent-color: var(--accent) }
.tent-preview { border-radius: 12px; background: var(--tint); padding: clamp(.45rem, 2vw, 1.3rem) }
.tent-layout { border-top: .42rem solid #9e522f; background: #fcf4e8; display: grid; grid-template-columns: 1.68fr 1fr; box-shadow: 0 3px 10px #3f2c2425; min-height: 205px }
.tent-main, .tent-qr { display: flex; flex-direction: column; justify-content: center; padding: clamp(.55rem, 2vw, 1.25rem); min-width: 0; gap: .45rem; overflow-wrap: anywhere }
.tent-main .brand { font-size: clamp(.85rem, 2vw, 1.1rem) }
.tent-main strong { font: 700 clamp(1.05rem, 3vw, 2.05rem)/1.08 var(--serif) }
.tent-main span:last-child, .tent-qr span, .tent-qr strong { font-size: clamp(.75rem, 1.25vw, .9rem) }
.tent-qr { background: #f2dfc9; align-items: center; text-align: center; gap: .2rem }
.tent-qr img { display: block; width: min(100%, 165px); aspect-ratio: 1; background: white }
.points-checklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr)); gap: .1rem .6rem; max-height: 18rem; overflow-y: auto }
.narrow { max-width: 620px }
@media (max-width: 760px) {
  .editor-grid, .work-grid { grid-template-columns: minmax(0, 1fr) }
  .preview-side { position: static }
  .topbar nav { order: 1; width: 100% }
}
@media (max-width: 400px) {
  .rule-grid { grid-template-columns: minmax(0, 1fr) }
  .customer-wrap { margin-top: .72rem; padding: 0 .45rem }
  .score-grid.recommend { grid-template-columns: repeat(4, minmax(44px, 1fr)) }
}
