:root {
  --ink: #17272b;
  --muted: #607177;
  --navy: #15363a;
  --navy-2: #22494e;
  --teal: #2f726d;
  --teal-soft: #e6f1ef;
  --gold: #b98a3d;
  --paper: #f6f7f5;
  --white: #ffffff;
  --line: #d8dfdd;
  --danger: #9f3f36;
  --danger-soft: #f9ebe8;
  --warning: #8d650e;
  --warning-soft: #fbf3dc;
  --success: #2c6c4b;
  --shadow: 0 12px 30px rgba(18, 45, 49, .09);
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { outline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #68b3aa; }
a { color: var(--teal); }
.skip-link { position: fixed; left: 12px; top: -100px; z-index: 100; background: white; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.loading { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, 1.05fr) minmax(340px, .95fr); }
.login-hero { background: linear-gradient(145deg, #102f34, #23545a); color: white; padding: clamp(36px, 7vw, 100px); display: flex; flex-direction: column; justify-content: space-between; }
.brand-lockup { display: flex; gap: 12px; align-items: center; font-weight: 750; letter-spacing: .02em; }
.brand-mark { width: 38px; height: 38px; border-radius: 50% 50% 10% 50%; background: linear-gradient(145deg, #6bb1a8, #d4b366); transform: rotate(-12deg); box-shadow: inset 0 0 0 5px rgba(255,255,255,.12); }
.login-hero h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 5vw, 68px); line-height: 1.02; max-width: 700px; margin: 50px 0 20px; font-weight: 500; }
.login-hero p { color: #d8e6e5; font-size: 18px; line-height: 1.65; max-width: 650px; }
.trust-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 46px; }
.trust-item { border-top: 1px solid rgba(255,255,255,.24); padding-top: 14px; color: #d8e6e5; font-size: 13px; }
.login-panel { background: white; display: grid; place-items: center; padding: 30px; }
.login-card { width: min(440px, 100%); }
.eyebrow { color: var(--teal); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h2 { font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 500; line-height: 1.15; }
h3 { font-size: 17px; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label, .label { font-size: 13px; font-weight: 700; color: #33484d; }
.field small { color: var(--muted); }
input, select, textarea { width: 100%; border: 1px solid #b9c7c4; border-radius: 8px; padding: 11px 12px; background: white; color: var(--ink); }
textarea { min-height: 110px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 19px; height: 19px; accent-color: var(--teal); }
.btn { border: 0; border-radius: 8px; padding: 11px 16px; font-weight: 750; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; justify-content: center; text-decoration: none; transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .62; cursor: wait; transform: none; }
.btn-primary { background: var(--navy); color: white; }
.btn-primary:hover { background: #234d53; }
.btn-secondary { background: var(--teal-soft); color: #17524e; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-block { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.demo-details { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); font-size: 13px; }
.demo-details summary { cursor: pointer; color: var(--ink); font-weight: 700; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 256px minmax(0, 1fr); }
.sidebar { background: var(--navy); color: white; padding: 22px 14px; position: sticky; height: 100vh; top: 0; overflow-y: auto; }
.sidebar .brand-lockup { padding: 0 8px 22px; }
.sidebar .brand-mark { width: 30px; height: 30px; }
.case-chip { background: rgba(255,255,255,.08); margin: 0 4px 18px; padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; }
.case-chip strong { display: block; font-size: 12px; margin-bottom: 4px; }
.case-chip span { display: block; color: #b9cecd; font-size: 11px; }
.nav { display: grid; gap: 2px; }
.nav button { border: 0; background: transparent; color: #d5e2e1; text-align: left; border-radius: 7px; padding: 9px 11px; cursor: pointer; font-size: 13px; }
.nav button:hover, .nav button.active { color: white; background: rgba(255,255,255,.1); }
.nav .nav-section { color: #8fb0ae; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; font-size: 9px; padding: 16px 11px 5px; }
.main-area { min-width: 0; }
.topbar { min-height: 68px; background: white; border-bottom: 1px solid var(--line); padding: 12px clamp(18px, 3vw, 40px); display: flex; align-items: center; justify-content: space-between; gap: 20px; position: sticky; top: 0; z-index: 10; }
.topbar-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); font-weight: 800; }
.mobile-menu { display: none; }
.content { padding: clamp(22px, 4vw, 48px); max-width: 1500px; margin: 0 auto; }
.page-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 26px; }
.page-header p { color: var(--muted); max-width: 780px; line-height: 1.55; }
.page-header h2 { margin-bottom: 8px; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 750; background: #edf1f0; color: #3d5358; }
.badge.success { background: #e5f2e9; color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: 0 4px 13px rgba(18,45,49,.04); }
.kpi .value { font-family: Georgia, "Times New Roman", serif; font-size: 38px; color: var(--navy); line-height: 1; }
.kpi .name { color: var(--muted); font-size: 12px; margin-top: 8px; }
.kpi .context { border-top: 1px solid var(--line); padding-top: 9px; margin-top: 11px; font-size: 11px; color: #42585d; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 4px 13px rgba(18,45,49,.035); min-width: 0; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.card-header h3 { margin: 0; }
.card-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.notice { border-left: 4px solid var(--gold); background: var(--warning-soft); padding: 14px 16px; border-radius: 0 8px 8px 0; color: #694e16; font-size: 13px; line-height: 1.5; margin: 16px 0; }
.notice.danger { border-left-color: var(--danger); background: var(--danger-soft); color: #73312b; }
.notice.info { border-left-color: var(--teal); background: var(--teal-soft); color: #245b57; }
.observer-link-ready { border: 2px solid var(--teal); background: var(--teal-soft); margin-bottom: 18px; }
.observer-link-ready input[readonly] { background: #fff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.participant-links-ready { border: 2px solid var(--teal); background: var(--teal-soft); margin-bottom: 18px; }
.participant-links-ready input[readonly] { background: #fff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.participant-link-management { margin-bottom: 18px; }
.participant-link-list { display: grid; gap: 12px; margin: 16px 0; }
.link-action-field { display: flex; align-items: end; padding-bottom: 16px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; background: white; }
th { text-align: left; background: #eef2f1; color: #3c5257; font-weight: 800; white-space: nowrap; position: sticky; top: 0; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
#participants-table th:first-child { position: sticky; left: 0; z-index: 4; }
#participants-table .jury-selection-cell { position: sticky; left: 0; z-index: 3; background: white; min-width: 155px; box-shadow: 1px 0 0 var(--line); }
#participants-table .jury-selection-cell .btn { width: 100%; white-space: nowrap; }
.bar-list { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(140px, 2fr) auto; align-items: center; gap: 12px; font-size: 12px; }
.bar-track { height: 10px; background: #e7ecea; border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), #74aaa5); border-radius: 99px; }
.question-card { padding: 16px 0; border-top: 1px solid var(--line); }
.question-card:first-child { border-top: 0; padding-top: 0; }
.question-card h3 { margin-bottom: 6px; }
.question-meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 11px; margin-bottom: 12px; }
.questionnaire-question-editor { margin-bottom: 16px; border-left: 4px solid #a8c9c5; }
.questionnaire-question-editor .compact-textarea { min-height: 72px; }
.answer-options-editor { background: #f7faf9; border: 1px solid var(--line); border-radius: 9px; padding: 14px; }
.answer-options-editor[hidden] { display: none; }
.question-option-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 10px; margin-top: 9px; }
.questionnaire-editor-actions { position: sticky; bottom: 12px; z-index: 5; margin-top: 18px; box-shadow: 0 12px 36px rgba(18,45,49,.18); }
.matrix td:first-child, .matrix th:first-child { position: sticky; left: 0; background: white; z-index: 2; }
.matrix th:first-child { background: #eef2f1; }
.matrix td { min-width: 110px; }
.timeline { border-left: 2px solid var(--line); margin-left: 7px; padding-left: 20px; display: grid; gap: 15px; }
.timeline-item { position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -27px; top: 4px; width: 11px; height: 11px; background: var(--teal); border: 3px solid white; box-shadow: 0 0 0 1px var(--teal); border-radius: 50%; }
.timeline-item strong { display: block; font-size: 12px; }
.timeline-item span { color: var(--muted); font-size: 11px; }
.option { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 11px; margin: 8px 0; cursor: pointer; }
.option:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.screen-shell { min-height: 100vh; background: var(--paper); padding: 0 16px 60px; overflow-x: hidden; }
.screen-header { max-width: 780px; margin: 0 auto 24px; padding: 26px 0 30px; color: white; background: var(--navy); box-shadow: 0 0 0 100vmax var(--navy); clip-path: inset(0 -100vmax); }
.screen-header h1 { font-family: Georgia, "Times New Roman", serif; font-size: 38px; font-weight: 500; margin: 42px 0 8px; }
.screen-header p { color: #d8e6e5; line-height: 1.5; }
.screen-card { max-width: 780px; margin: 0 auto; background: white; border-radius: 14px; box-shadow: var(--shadow); padding: clamp(20px, 5vw, 44px); }
.screen-section { padding: 24px 0 10px; border-top: 1px solid var(--line); margin-top: 18px; }
.screen-section h2 { font-size: 25px; }
.question-block { margin: 24px 0; }
.question-block legend { font-weight: 750; line-height: 1.45; margin-bottom: 9px; }
.question-block fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.required { color: var(--danger); }
.participant-shell { min-height: 100vh; display: grid; place-items: center; padding: 18px; background: linear-gradient(145deg, #15363a, #2f6665); }
.participant-card { width: min(680px, 100%); background: white; border-radius: 16px; box-shadow: var(--shadow); padding: clamp(24px, 6vw, 52px); }
.participant-card .status-dot { width: 11px; height: 11px; border-radius: 50%; background: #45a66f; display: inline-block; box-shadow: 0 0 0 4px #e3f4e9; }
.waiting { text-align: center; padding: 40px 0; }
.waiting .pulse { width: 48px; height: 48px; margin: 0 auto 20px; border-radius: 50%; border: 4px solid #d8e5e3; border-top-color: var(--teal); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; }
.toast { background: #142f33; color: white; border-radius: 8px; padding: 12px 16px; box-shadow: var(--shadow); max-width: 360px; font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 30px; }
.search-row { display: flex; gap: 10px; margin-bottom: 14px; }
.search-row input { max-width: 360px; }
.applicant-detail { margin-bottom: 20px; border-color: #9fc5c0; box-shadow: 0 12px 30px rgba(18,45,49,.10); }
.applicant-detail .kpi .value { font-size: 25px; overflow-wrap: anywhere; }
.response-list { margin-top: 22px; display: grid; gap: 22px; }
.response-list > section { border-top: 1px solid var(--line); padding-top: 18px; }
.response-pair { display: grid; grid-template-columns: minmax(220px, .9fr) minmax(260px, 1.4fr); gap: 18px; padding: 11px 0; border-top: 1px solid #edf1f0; font-size: 12px; line-height: 1.5; }
.response-pair strong { color: #33484d; }
.response-pair span { white-space: pre-wrap; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 1050px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-hero { min-height: 480px; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; width: 270px; transform: translateX(-101%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 50px rgba(0,0,0,.25); }
  .mobile-menu { display: inline-flex; }
  .topbar { position: sticky; }
  .topbar-meta .user-name { display: none; }
  .grid-2, .grid-3, .kpi-grid { grid-template-columns: 1fr; }
  .page-header { display: block; }
  .page-header .button-row { margin-top: 15px; }
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .login-hero { min-height: 390px; padding: 30px; }
  .login-hero h1 { margin-top: 40px; }
  .trust-list { grid-template-columns: 1fr; }
  .login-panel { padding: 36px 20px; }
  .response-pair { grid-template-columns: 1fr; gap: 5px; }
  .question-option-row { grid-template-columns: 1fr; }
  .questionnaire-editor-actions { position: static; }
}
@media print {
  .sidebar, .topbar, .button-row, .mobile-menu { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
}
