/* Neutral instrument styling — polished pass. Paper/ink, one accent, soft depth. */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,560;9..144,640&family=Inter:wght@400;500;600&display=swap');

:root {
  --paper: #F9F7F2; --panel: #F0ECE6; --ink: #35312F; --stone: #857E76;
  --accent: #B7573A; --accent-deep: #9C4227; --line: #E3DDD2; --good: #4A7A5A;
  --shadow: 0 1px 2px rgba(53,49,47,.05), 0 6px 18px rgba(53,49,47,.06);
  --shadow-lift: 0 2px 4px rgba(53,49,47,.06), 0 12px 28px rgba(53,49,47,.10);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink);
  background: linear-gradient(180deg, #FBF9F5 0%, var(--paper) 240px);
  font: 16px/1.55 Inter, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 760px; margin: 0 auto; padding: 28px 20px 90px; }
.wrap.wide { max-width: 1020px; }
h1 { font-family: Fraunces, Georgia, serif; font-weight: 640; font-size: 2rem; line-height: 1.15; margin: .4em 0 .5em; letter-spacing: -.01em; }
h2 { font-family: Fraunces, Georgia, serif; font-weight: 560; font-size: 1.3rem; margin: 1.8em 0 .6em; }
h3 { font-size: 1rem; margin: 1.4em 0 .4em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
em { font-style: normal; color: var(--accent); }
.dim { color: var(--stone); font-weight: 400; }
code { background: var(--panel); padding: 1px 5px; border-radius: 4px; font-size: .85em; }

/* ---------- console chrome ---------- */
.topbar { display: flex; align-items: center; gap: 16px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); margin-bottom: 18px; }
.brand { font-family: Fraunces, Georgia, serif; font-weight: 640; font-size: 1.1rem; letter-spacing: .01em; }
.crumbs { flex: 1; font-size: .9rem; color: var(--stone); }
.crumbs .sep { margin: 0 4px; color: var(--line); }
.logout { margin: 0; }
.foot { margin-top: 60px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--stone); }
.wrap.wide h2 { border-bottom: 1px solid var(--line); padding-bottom: .3em; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 18px 0; }
.card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; color: var(--ink); box-shadow: var(--shadow); transition: box-shadow .18s, transform .18s, border-color .18s; }
.card:hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.card h3 { margin: 0 0 4px; }
.card p { margin: 0; color: var(--stone); font-size: .88rem; }

input[type=text], input[type=password], input:not([type]), select, textarea {
  font: inherit; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink); width: 100%; max-width: 420px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(183,87,58,.14); }
textarea { max-width: 100%; width: 100%; }
button { font: inherit; font-weight: 600; cursor: pointer; border-radius: 9px; padding: 10px 20px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); transition: transform .15s, box-shadow .15s, background .15s; }
button:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
button.primary { background: linear-gradient(180deg, #C4664A, var(--accent-deep)); border-color: var(--accent-deep); box-shadow: 0 2px 8px rgba(183,87,58,.28); }
button.primary:hover { box-shadow: 0 4px 14px rgba(183,87,58,.36); }
button.ghost { background: transparent; color: var(--ink); border-color: var(--line); box-shadow: none; }
.inline-form { display: flex; gap: 10px; margin: 14px 0; align-items: center; flex-wrap: wrap; }
.stack-form { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; align-items: flex-start; }
form.inline { display: inline; }
.btn { display: inline-block; border: 1px solid var(--line); border-radius: 9px; padding: 9px 15px; background: #fff; margin-right: 6px; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.btn:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); text-decoration: none; }

.tbl { border-collapse: separate; border-spacing: 0; width: 100%; margin: 10px 0 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: .92rem; box-shadow: var(--shadow); }
.tbl th { text-align: left; background: var(--panel); font-weight: 600; }
.tbl th, .tbl td { padding: 9px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.link { font-size: .78rem; word-break: break-all; }
.texts { margin: 8px 0; padding-left: 20px; }
.texts li { margin: 6px 0; }

.pill { display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); }
.pill.done { background: #E4EFE7; border-color: var(--good); color: var(--good); }
.pill.part { background: #FBEFE9; border-color: var(--accent); color: var(--accent); }
.pill.closed { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- respondent survey ---------- */
.preview-banner { background: var(--ink); color: var(--paper); font-size: .82rem; font-weight: 600; padding: 9px 16px; border-radius: 9px; margin-bottom: 14px; text-align: center; }
.preview-banner a { color: #E8B99F; margin-left: 8px; }
.survey-head { text-align: center; padding-top: 14px; }
.survey-head .eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; font-weight: 600; color: var(--accent); margin: 0 0 6px; }
.survey-head h1 { margin: 0 0 8px; }
.survey-head .who { color: var(--stone); margin: 0 0 18px; }
.survey-head .intro { text-align: left; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 14px 18px; border-radius: 0 12px 12px 0; font-size: .92rem; box-shadow: var(--shadow); }

/* edge progress line — fixed to the top of the viewport, fills as they answer */
#progress-line { position: fixed; top: 0; left: 0; right: 0; height: 4px; background: rgba(53,49,47,.08); z-index: 50; }
#progress-line .fill { height: 100%; width: 0%; background: linear-gradient(90deg, #C4664A, var(--accent-deep)); box-shadow: 0 0 8px rgba(183,87,58,.45); transition: width .4s cubic-bezier(.4,0,.2,1); }
#counter-pill { position: fixed; right: 18px; bottom: 18px; z-index: 50; background: var(--ink); color: var(--paper); font-size: .78rem; font-weight: 600; padding: 8px 14px; border-radius: 99px; box-shadow: var(--shadow-lift); font-variant-numeric: tabular-nums; transition: background .3s; }
#counter-pill.complete { background: var(--good); }

.domain { margin: 44px 0; counter-increment: domain; }
.domain > h2 { text-align: center; margin: 0 0 4px; border: none; display: flex; align-items: center; justify-content: center; gap: 10px; }
.domain > h2::before { content: counter(domain, decimal-leading-zero); font-family: Inter, sans-serif; font-size: .68rem; font-weight: 600; letter-spacing: .08em; color: var(--paper); background: var(--ink); border-radius: 99px; padding: 3px 9px; }
form#survey { counter-reset: domain; }

.item { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 20px 22px 18px; margin: 14px 0; box-shadow: var(--shadow); transition: box-shadow .18s, border-color .18s; }
.item:hover { box-shadow: var(--shadow-lift); }
.item legend { float: left; width: 100%; text-align: center; font-weight: 600; font-size: 1.02rem; line-height: 1.4; padding: 0; margin: 0 0 14px; }
.item > * { clear: both; }
.opts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.opt { flex: 1 1 116px; max-width: 150px; display: flex; align-items: center; justify-content: center; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 11px 8px; font-size: .82rem; font-weight: 500; line-height: 1.25; cursor: pointer; background: var(--paper); position: relative; transition: border-color .15s, background .15s, transform .12s, box-shadow .15s, color .15s; }
.opt:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt:has(input:checked) { background: linear-gradient(180deg, #C4664A, var(--accent-deep)); border-color: var(--accent-deep); color: #fff; box-shadow: 0 3px 10px rgba(183,87,58,.32); transform: translateY(-1px); }
.opts.nps { flex-wrap: nowrap; gap: 6px; }
.opts.nps .opt.num { flex: 1 1 0; max-width: none; min-width: 0; padding: 10px 0; font-variant-numeric: tabular-nums; }
.nps-ends { display: flex; justify-content: space-between; font-size: .74rem; color: var(--stone); margin-top: 8px; }
.opt-note { font-weight: 400; color: var(--stone); font-size: .82em; }
.item textarea { border-radius: 10px; background: var(--paper); min-height: 130px; resize: vertical; padding-right: 54px; }
.ta-wrap { position: relative; }
.mic { position: absolute; right: 10px; bottom: 10px; width: 40px; height: 40px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 99px; background: #fff; color: var(--stone); border: 1px solid var(--line); box-shadow: var(--shadow); }
.mic:hover { color: var(--accent); border-color: var(--accent); transform: none; }
.mic.rec { background: linear-gradient(180deg, #C4664A, var(--accent-deep)); color: #fff; border-color: var(--accent-deep); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(183,87,58,.45); } 70% { box-shadow: 0 0 0 12px rgba(183,87,58,0); } 100% { box-shadow: 0 0 0 0 rgba(183,87,58,0); } }

.submit-row { margin: 40px 0 10px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.submit-row .primary { font-size: 1.05rem; padding: 14px 40px; border-radius: 12px; }
.save-note { color: var(--stone); font-size: .84rem; margin: 0; text-align: center; }

.msg-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 40px 34px; margin-top: 10vh; text-align: center; box-shadow: var(--shadow-lift); }
.msg-card h1 { margin-top: 0; }
.msg-card form { display: flex; flex-direction: column; gap: 12px; align-items: center; margin-top: 14px; }

@media (max-width: 560px) {
  .opts { gap: 6px; }
  .opt { flex: 1 1 100%; max-width: none; padding: 10px 8px; }
  .opts.nps .opt.num { padding: 8px 0; font-size: .76rem; }
  h1 { font-size: 1.6rem; }
}
