@font-face { font-family: "Bricolage Grotesque"; src: url("/assets/fonts/bricolage-grotesque-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-02BA, U+1E00-1E9F; }
@font-face { font-family: "Bricolage Grotesque"; src: url("/assets/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2190-2199; }
:root {
  color-scheme: light;
  --ink: #1c1640; --text: #1c1640; --muted: #5e5a78;
  --bg: #f6f4fb; --card: #fff; --field: #fff; --line: #e2def0; --field-line: #b9b3d1;
  --accent: #ff5a36; --accent-hover: #ff7655; --accent-ink: #fff; --accent-soft: #ffe7df;
  --lilac: #ece8f7; --hover: #f3f0fb;
  --danger: #b4231b; --warn-bg: #fff3d6; --warn-ink: #6b4a00; --ok-bg: #def3e6; --err-bg: #fde6e2;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15.5px/1.55 "Bricolage Grotesque", system-ui, sans-serif; }
h1 { font-size: 1.9rem; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 18px; font-weight: 700; }
h2 { font-size: 1.1rem; margin: 0 0 12px; letter-spacing: -.01em; font-weight: 650; }
a { color: inherit; text-underline-offset: 3px; }
code { font-size: .9em; background: var(--lilac); padding: 1px 5px; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 9px; }
.mark { width: 32px; height: 32px; display: block; flex: none; }
.mark-bubble { fill: var(--accent); }
.mark-q { stroke: #fff; }
.mark-dot { fill: #fff; }
.logo-word { font-weight: 750; font-size: 1.32rem; letter-spacing: -.035em; line-height: 1; white-space: nowrap; }

/* Horní lišta */
.topbar { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 11px 22px; background: var(--ink); color: #fff; }
.brand { text-decoration: none; color: inherit; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.topbar nav a { padding: 6px 12px; border-radius: 7px; text-decoration: none; font-weight: 550; }
.topbar nav a:hover { background: #2f2766; }
.topbar nav a.active { background: #fff; color: var(--ink); }
.logout { display: flex; gap: 10px; align-items: center; color: #c9c3e6; font-size: .9rem; margin: 0; flex-wrap: wrap; }
.area { color: #fff; font-weight: 700; }
.logout-btn { font: inherit; font-weight: 600; color: #fff; background: transparent; border: 1px solid #5d5591; border-radius: 7px; padding: 5px 12px; cursor: pointer; }
.logout-btn:hover { background: #2f2766; }
.impersonation { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; background: var(--warn-bg); color: var(--warn-ink); padding: 8px 22px; font-weight: 500; }
.impersonation p, .impersonation form { margin: 0; }

.page { max-width: 1200px; margin: 0 auto; padding: 28px 22px 80px; }
.flash { padding: 10px 14px; border-radius: 8px; margin: 0 0 18px; }
.flash ul { margin: 6px 0 0; padding-left: 20px; }
.flash.ok { background: var(--ok-bg); }
.flash.err { background: var(--err-bg); color: var(--danger); }
.head { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head h1 { margin: 0; }
.head .btn { margin-left: auto; }
.count { color: var(--muted); font-weight: 500; }
.crumb { margin: 0 0 8px; color: var(--muted); }
.section-title { margin: 26px 0 12px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.panel > :last-child { margin-bottom: 0; }
.stack { display: grid; gap: 14px; align-content: start; }
.stack > .panel { margin: 0; }
.panel.stack, .stack-tight { display: grid; gap: 12px; align-content: start; }
.panel.stack-tight > *, .stack-tight > * { margin: 0; }
.medium { max-width: 820px; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.columns.even { grid-template-columns: 1fr 1fr; }
.columns > *, .stack > * { min-width: 0; }
.plain li, .history li { overflow-wrap: anywhere; }
@media (max-width: 920px) { .columns, .columns.even { grid-template-columns: 1fr; } }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Formulářové prvky */
label { display: grid; gap: 5px; font-weight: 550; font-size: .93rem; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--text); background: var(--field); border: 1px solid var(--field-line); border-radius: 7px; padding: 8px 11px; width: 100%; }
input:hover, select:hover, textarea:hover { border-color: var(--ink); }
input:disabled { background: var(--bg); color: var(--muted); }
textarea { resize: vertical; }
select { appearance: none; padding-right: 32px; background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231c1640' stroke-width='1.7'/%3E%3C/svg%3E") no-repeat right 11px center; }
select:hover, select:focus { background-color: var(--hover); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
.check { display: flex; flex-direction: row; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; }
.big-input { font-size: 1.2rem; font-weight: 650; }
.prefixed { display: flex; align-items: stretch; border: 1px solid var(--field-line); border-radius: 7px; background: var(--field); overflow: hidden; }
.prefixed span { padding: 8px 0 8px 11px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.prefixed input { border: 0; padding-left: 1px; border-radius: 0; }
.prefixed:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.prefixed input:focus-visible { outline: 0; }
.field-err { color: var(--danger); font-weight: 500; font-size: .88rem; }
.ok-text { color: #1d7a45; font-weight: 550; }
.stack-form { display: grid; gap: 14px; margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 650; padding: 8px 15px; border-radius: 8px; border: 1px solid var(--ink); background: #fff; color: var(--text); cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.small { padding: 4px 10px; font-size: .88rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; }
.danger { color: var(--danger); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions.vertical { display: grid; }
.hint { color: var(--muted); font-size: .88rem; font-weight: 400; margin: 6px 0; }
.warn { background: var(--warn-bg); color: var(--warn-ink); padding: 8px 11px; border-radius: 7px; font-size: .92rem; margin: 8px 0; display: block; }
.empty { color: var(--muted); padding: 22px 0; }
.url { word-break: break-all; font-weight: 550; margin: 6px 0; }
.pre { white-space: pre-wrap; }
.plain, .history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .93rem; }

/* Tabulky */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input { width: auto; min-width: 200px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.table-wrap.flat { border: 0; margin: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 13px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
td.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
th { font-size: .82rem; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--hover); }
tr.muted { opacity: .55; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; }
.badge { font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; white-space: nowrap; background: var(--lilac); color: var(--text); vertical-align: middle; }
.badge.published { background: var(--accent-soft); color: #a3290e; }
.badge.closed { background: var(--err-bg); color: var(--danger); }

/* Přehled */
.stats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stats a, .stats span { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; height: 100%; }
.stats a:hover { background: var(--hover); }
.stats strong { display: block; font-size: 2.2rem; letter-spacing: -.03em; line-height: 1.1; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cards .panel { margin: 0; }
.form-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.form-card { margin: 0; }
.form-card-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.form-card h2 { margin: 0; font-size: 1.2rem; }
.form-card h2 a { text-decoration: none; }
.form-card h2 a:hover { text-decoration: underline; }
.form-card-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 10px 0 0; }
.form-card-foot .btn { margin-left: auto; }
.welcome { background: var(--accent-soft); border-color: transparent; }
.meter-label { display: flex; justify-content: space-between; gap: 8px; font-size: .92rem; }
.meter-bar { height: 8px; background: var(--lilac); border-radius: 99px; margin-top: 5px; overflow: hidden; }
.meter-bar span { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.meter.full .meter-bar span { background: var(--danger); }
.meter.full strong { color: var(--danger); }
.answers { display: grid; grid-template-columns: minmax(140px, 32%) 1fr; gap: 12px 18px; margin: 0; }
.answers dt { font-weight: 600; color: var(--muted); }
.answers dd { margin: 0; }
@media (max-width: 600px) { .answers { grid-template-columns: 1fr; gap: 2px; } .answers dd { margin-bottom: 12px; } }

/* Editor */
.fields-edit { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.field-edit { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; display: grid; gap: 10px; }
.field-edit:focus-within { border-color: var(--field-line); box-shadow: 0 2px 14px rgba(28, 22, 64, .07); }
.field-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.field-no { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--lilac); font-weight: 700; font-size: .88rem; }
.type-pick select { width: auto; min-width: 220px; }
.spacer { flex: 1; }
.icon { width: 34px; height: 34px; font: inherit; border: 1px solid var(--field-line); border-radius: 7px; background: var(--field); color: var(--text); cursor: pointer; }
.icon:hover { background: var(--hover); }
.icon.danger:hover { background: var(--err-bg); }
.add-field { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.add-field select { width: auto; min-width: 240px; }
.side { position: sticky; top: 16px; }
@media (max-width: 920px) { .side { position: static; } }

/* Samostatné stránky (přihlášení, registrace) */
body.boxed { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; background: var(--bg); }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 30px; width: min(440px, 100%); display: grid; gap: 14px; }
.box.wide { width: min(560px, 100%); }
.box h1 { margin: 0; font-size: 1.55rem; }
.box p { margin: 0; }
.box-logo { text-decoration: none; justify-self: start; margin-bottom: 6px; }
.code-input { font-size: 1.6rem; letter-spacing: .3em; text-align: center; font-weight: 650; }
