/* ==========================================================================
   Competitions — used by the public site and BookFinder.
   cf-*  the application form (must look the same in both places)
   cp-*  public pages and shared pieces
   bld-* the staff form builder
   ========================================================================== */

/* ---------- application form ---------- */
.cf-form { display: grid; gap: 24px; }
.cf-fields { display: grid; gap: 22px; }
.cf-field { margin: 0; padding: 0; border: 0; min-width: 0; }
.cf-field legend { padding: 0; margin-bottom: 8px; }
.cf-field legend + .hint { margin: -4px 0 8px; }
.cf-error, .field .cf-error { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 13px; line-height: 1.4; color: var(--danger); }
.cf-error::before { content: "!"; flex: none; display: grid; place-items: center; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; background: var(--danger); color: #fff; font: 700 11px/1 var(--f-sans); }
.cf-age { font-size: 13px; line-height: 1.4; font-weight: 500; color: var(--leaf); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(168, 50, 31, .12); }

.cf-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; border-radius: var(--r-sm); }
.cf-choices.is-invalid { box-shadow: 0 0 0 3px rgba(168, 50, 31, .22); }
.cf-choice { position: relative; display: block; cursor: pointer; }
.cf-choice input { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin: -9px 0 0; accent-color: var(--saffron); cursor: pointer; }
.cf-choice span {
  display: flex; align-items: center; min-height: 46px; padding: 11px 14px 11px 44px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface);
  font-size: 15px; line-height: 1.3; transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.cf-choice:hover span { border-color: var(--faint); }
.cf-choice input:checked + span { border-color: var(--saffron); background: var(--saffron-wash); }
.cf-choice input:focus-visible + span { outline: 2px solid var(--saffron); outline-offset: 2px; }

.cf-consent { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); font-size: 15px; line-height: 1.45; cursor: pointer; }
.cf-consent input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--saffron); cursor: pointer; }
.cf-consent.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(168, 50, 31, .12); }

.cf-drop { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; transition: border-color .2s var(--ease), background-color .2s var(--ease); }
.cf-drop:hover, .cf-drop.is-over { border-color: var(--saffron); background: var(--saffron-wash); }
.cf-drop:focus-within { border-color: var(--saffron); box-shadow: 0 0 0 4px rgba(219, 146, 0, .18); }
.cf-drop.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(168, 50, 31, .12); }
.cf-drop input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.cf-drop__icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.cf-drop__text { display: grid; min-width: 0; line-height: 1.35; }
.cf-drop__text b { overflow: hidden; font-size: 14.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.cf-drop__text small { font-size: 12.5px; color: var(--muted); }
.cf-submit { justify-self: start; margin-top: 4px; }
/* comp_render_form() isn't always a direct child of .cf-form's own gap (the public apply
   page nests it inside .cp-panel__body instead), so give .cf-fields its own spacing there
   rather than relying on a grid gap that may not be the fields' actual parent */
.cp-panel__body > .cf-fields { margin-bottom: 24px; }

/* ---------- shared bits ---------- */
.btn--danger { --btn-bg: var(--danger); --btn-fg: #fff; }
.btn--danger:hover { --btn-bg: #8c2715; --btn-fg: #fff; }
.notice { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r-sm); font-size: 14.5px; line-height: 1.5; }
.notice .icon { margin-top: 3px; }
.notice--error { background: var(--danger-wash); color: var(--danger); }
.notice--ok { background: var(--leaf-wash); color: var(--leaf); }
.notice--info { background: var(--saffron-wash); color: var(--saffron-ink); }
.notice b { font-weight: 600; }
.notice--block { display: grid; gap: 4px; }

.cp-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.cp-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.cp-chip--open { background: var(--leaf-wash); color: var(--leaf); }
.cp-chip--upcoming { background: var(--saffron-wash); color: var(--saffron-ink); }
.cp-chip--closed { background: var(--surface-2); color: var(--muted); }
.cp-chip--submitted { background: var(--saffron-wash); color: var(--saffron-ink); }
.cp-chip--accepted { background: var(--leaf-wash); color: var(--leaf); }
.cp-chip--rejected { background: var(--danger-wash); color: var(--danger); }

.cp-meter { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.cp-meter__row { display: flex; justify-content: space-between; gap: 12px; }
.cp-meter__row b { font-weight: 600; color: var(--text); }
.cp-meter__track { display: block; height: 6px; overflow: hidden; border-radius: 3px; background: var(--surface-2); }
.cp-meter__fill { display: block; height: 100%; width: var(--w); border-radius: 3px; background: var(--saffron); }
.cp-meter__fill.is-full { background: var(--danger); }

.cp-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: 0 40px 80px -24px rgba(0, 0, 0, .55); }
.cp-dialog::backdrop { background: rgba(12, 10, 8, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.cp-dialog--small { width: min(440px, calc(100vw - 32px)); padding: 24px; }
.cp-dialog__msg { font-size: 16px; line-height: 1.5; }
.cp-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.cp-dialog__head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.cp-dialog__head h2 { font-family: var(--f-display); font-size: 25px; font-weight: 400; line-height: 1.1; }
.cp-dialog__head p { margin-top: 2px; font-size: 13px; color: var(--muted); }
.cp-dialog__body { display: grid; gap: 16px; padding: 22px 24px 26px; }
.cp-dialog__close { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-strong); }
.cp-dialog__close:hover { background: var(--surface-2); }

/* ---------- public pages ---------- */
.cp-page { padding: clamp(32px, 5vw, 64px) 0 clamp(72px, 9vw, 120px); }
.cp-stack { display: grid; gap: clamp(28px, 4vw, 48px); }

.cp-account { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding: 12px 18px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-1); font-size: 14px; color: var(--muted); }
.cp-account > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.cp-account b { font-weight: 600; color: var(--text); }
.cp-account__links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
.cp-account__links .link { font-size: 14px; }

.cp-group { display: grid; gap: 18px; }
.cp-group__head { display: flex; align-items: center; gap: 14px; font: 500 12px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cp-group__head::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.cp-mains { display: grid; gap: 16px; }

.cp-main {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: stretch;
  padding: clamp(20px, 3vw, 32px); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.cp-main:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.cp-main__copy { display: grid; align-content: space-between; gap: 22px; min-width: 0; }
.cp-main__top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cp-main__title { margin-top: 14px; font-family: var(--f-display); font-size: clamp(1.9rem, 3.4vw, 3rem); font-weight: 400; line-height: 1.04; letter-spacing: -.015em; overflow-wrap: anywhere; }
.cp-main__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.cp-main__facts { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; color: var(--muted); }
.cp-main__facts span { display: inline-flex; align-items: center; gap: 8px; }
.cp-main__go { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.cp-main__go .icon { transition: transform .3s var(--ease); }
.cp-main:hover .cp-main__go .icon { transform: translateX(4px); }
.cp-main__art { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 6px; height: 220px; overflow: hidden; border-radius: var(--r); background: var(--surface-2); color: var(--faint); }
.cp-main__art img { width: 100%; height: 100%; object-fit: cover; }
.cp-main__art img:only-child { grid-column: 1 / -1; grid-row: 1 / -1; }
.cp-main__art img:first-child:nth-last-child(3) { grid-row: span 2; }
.cp-main__art .icon { grid-column: 1 / -1; align-self: center; justify-self: center; width: 36px; height: 36px; }
@media (max-width: 760px) { .cp-main { grid-template-columns: minmax(0, 1fr); } .cp-main__art { order: -1; height: 170px; } }

.cp-empty { display: grid; justify-items: center; gap: 10px; padding: clamp(48px, 8vw, 96px) 24px; border-radius: var(--r-lg); border: 1px dashed var(--line-strong); text-align: center; color: var(--muted); }
.cp-empty h2 { font-family: var(--f-display); font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 400; color: var(--text); }
.cp-empty > .icon { width: 34px; height: 34px; color: var(--saffron); }

.cp-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.cp-fact { display: grid; gap: 4px; padding: 12px 18px; border-radius: var(--r); background: rgba(245, 240, 230, .07); box-shadow: inset 0 0 0 1px var(--line-dark); }
.cp-fact small { font: 500 10.5px/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark-muted); }
.cp-fact b { font-size: 15px; font-weight: 500; color: var(--on-dark); }

.cp-subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.cp-sub { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.cp-sub:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.cp-sub__art { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.cp-sub__art img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.cp-sub:hover .cp-sub__art img { transform: scale(1.04); }
.cp-sub__age { position: absolute; left: 12px; top: 12px; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 500 12px/1.2 var(--f-mono); }
.cp-sub__body { display: grid; flex: 1; align-content: start; gap: 12px; padding: 20px 22px 22px; }
.cp-sub__title { font-family: var(--f-display); font-size: 1.7rem; font-weight: 400; line-height: 1.1; overflow-wrap: anywhere; }
.cp-sub__desc { font-size: 14.5px; line-height: 1.55; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cp-sub__foot { display: grid; gap: 14px; margin-top: auto; padding-top: 8px; }
.cp-sub__state { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 500; color: var(--muted); text-align: center; }
.cp-sub__state.is-done { background: var(--leaf-wash); color: var(--leaf); }

.cp-sub__when { display: flex; align-items: center; gap: 8px; margin-top: -4px; font-size: 13.5px; font-weight: 500; color: var(--saffron-ink); }
.cp-sub__when .icon { flex: none; width: 16px; height: 16px; }

/* ---------- tabs (comp_tabs()) ---------- */
.cp-tabs-wrap { display: grid; gap: 20px; min-width: 0; }
.cp-tabbar { display: flex; gap: 4px; justify-self: start; max-width: 100%; padding: 4px; overflow-x: auto; border-radius: 999px; background: var(--surface-2); scrollbar-width: none; }
.cp-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 18px; border-radius: 999px; font-size: 14.5px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: background-color .2s, color .2s, box-shadow .2s; }
.cp-tab .icon { width: 17px; height: 17px; }
.cp-tab:hover { color: var(--text); }
.cp-tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.cp-tab:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; }
.cp-tab__count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); font: 500 12px/1.5 var(--f-mono); text-align: center; color: var(--muted); }
.cp-tab[aria-selected="true"] .cp-tab__count { background: var(--saffron-wash); color: var(--saffron-ink); }
.cp-tabpanel { min-width: 0; }
.cp-tabpanel:focus-visible { outline: 2px solid var(--saffron); outline-offset: 6px; border-radius: var(--r); }
/* without JavaScript the tab bar can't switch, so every panel is shown in turn */
html:not(.js) .cp-tabbar { display: none; }
html:not(.js) .cp-tabpanel[hidden] { display: block !important; }

/* ---------- timetable (comp_render_timetable()) ---------- */
.cp-tt { display: grid; gap: 28px; }
.cp-tt__day { display: grid; gap: 12px; }
.cp-tt__date { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-family: var(--f-display); font-size: clamp(1.35rem, 2.2vw, 1.7rem); font-weight: 400; line-height: 1.2; }
.cp-tt__date .icon { flex: none; width: 20px; height: 20px; color: var(--saffron); }
.cp-tt__date small { font: 500 11px/1.3 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cp-tt__list { position: relative; display: grid; gap: 8px; }
/* the line that joins one start time to the next */
.cp-tt__list::before { content: ""; position: absolute; left: 96px; top: 18px; bottom: 18px; width: 2px; border-radius: 1px; background: var(--line-strong); }
.cp-tt__item { position: relative; display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; align-items: center; gap: 8px 32px; padding: 14px 18px 14px 0; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-1); }
.cp-tt__item::before { content: ""; position: absolute; left: 91px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--saffron); box-shadow: 0 0 0 4px var(--surface); }
.cp-tt__time { justify-self: end; font: 500 20px/1 var(--f-mono); letter-spacing: -.02em; color: var(--text); white-space: nowrap; }
.cp-tt__time small { margin-left: 3px; font-size: 11px; letter-spacing: .06em; color: var(--muted); }
.cp-tt__time.is-tba { font-size: 14px; letter-spacing: .1em; color: var(--faint); }
.cp-tt__item:has(.is-tba)::before { background: var(--line-strong); }
.cp-tt__body { display: grid; gap: 6px; min-width: 0; }
.cp-tt__body b { font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.cp-tt__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--muted); }
.cp-tt__actions { display: flex; flex-wrap: wrap; gap: 2px; }
.cp-tt-empty { display: grid; justify-items: center; gap: 8px; padding: 48px 20px; border: 1.5px dashed var(--line-strong); border-radius: var(--r); text-align: center; color: var(--muted); }
.cp-tt-empty .icon { width: 28px; height: 28px; color: var(--saffron); }
.cp-tt-empty b { font-family: var(--f-display); font-size: 24px; font-weight: 400; color: var(--text); }
.card .cp-tt__item { background: var(--surface-2); box-shadow: none; }
.card .cp-tt__item::before { box-shadow: 0 0 0 4px var(--surface-2); }
.card .cp-tt__item .tag { background: var(--surface); }
@media (max-width: 640px) {
  .cp-tt__list::before { left: 70px; }
  .cp-tt__item { grid-template-columns: 58px minmax(0, 1fr); gap: 8px 26px; padding-right: 14px; }
  .cp-tt__item::before { left: 65px; }
  .cp-tt__time { font-size: 16px; }
  .cp-tt__time small { display: block; margin: 4px 0 0; text-align: right; }
  .cp-tt__actions { grid-column: 2; }
}

.tag .icon { flex: none; width: 13px; height: 13px; }
.tag--warn { background: var(--saffron-wash); color: var(--saffron-ink); }

.cp-pick-list { display: grid; gap: 10px; margin-bottom: 22px; }
.cp-pick { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: var(--r); background: var(--surface-2); cursor: pointer; }
.cp-pick input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--saffron); flex-shrink: 0; }
.cp-pick input:disabled { cursor: not-allowed; }
.cp-pick.is-blocked { opacity: .65; cursor: default; }
.cp-pick__body { display: grid; gap: 2px; min-width: 0; }
.cp-pick__name { font-weight: 500; font-size: 14.5px; }
.cp-pick__name small { font-weight: 400; color: var(--muted); }
.cp-pick__reason { font-size: 13px; color: var(--danger); }
.cp-pick__when { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.cp-pick__when .icon { flex: none; width: 14px; height: 14px; }
.cp-pick-intro { margin-bottom: 14px; }
.cp-pick-intro + [data-quota-status] { margin: -4px 0 14px; }
.cf-field .input[readonly] { background: var(--surface-2); color: var(--muted); cursor: default; }
.cf-field .input[readonly]:focus { box-shadow: none; border-color: var(--line-strong); }

.cp-panel { min-width: 0; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.cp-panel__head { padding: clamp(20px, 3vw, 30px) clamp(20px, 3vw, 32px) 0; }
.cp-panel__title { font-family: var(--f-display); font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 400; line-height: 1.1; }
.cp-panel__title--sub { font-size: 1.3rem; margin: 26px 0 14px; }
.cp-panel__title--sub:first-child { margin-top: 0; }
.cp-panel__sub { margin-top: 6px; font-size: 14px; color: var(--muted); }
.cp-panel__body { padding: 22px clamp(20px, 3vw, 32px) clamp(22px, 3vw, 32px); }
#apply { margin-top: 24px; }
.cp-dl { display: grid; gap: 0; font-size: 14px; }
.cp-dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid var(--line); }
.cp-dl dt { color: var(--muted); }
.cp-dl dd { font-weight: 500; text-align: right; }

.cp-lookup__status { margin-top: 8px; font-size: 13.5px; color: var(--leaf); }
.cp-lookup__status.is-error { color: var(--danger); }

.cp-auth { display: grid; gap: 18px; width: 100%; max-width: 560px; margin-inline: auto; }
.cp-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.cp-tabs a { flex: 1; padding: 10px 16px; border-radius: 999px; font-size: 14.5px; font-weight: 500; text-align: center; color: var(--muted); transition: background-color .2s, color .2s; }
.cp-tabs a[aria-current] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.cp-form { display: grid; gap: 18px; }
.cp-form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 560px) { .cp-form__row { grid-template-columns: minmax(0, 1fr); } }
.cp-form .pw { position: relative; }
.cp-note { font-size: 13.5px; color: var(--muted); text-align: center; }
.cp-note a { font-weight: 500; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

.cp-account-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 980px) { .cp-account-grid { grid-template-columns: minmax(0, 1fr); } }
.cp-apps { display: grid; }
.cp-apps li { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.cp-apps li:first-child { border-top: 0; }
.cp-apps img { width: 60px; height: 60px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-2); }
.cp-apps b { display: block; font-weight: 500; overflow-wrap: anywhere; }
.cp-apps small { font-size: 13px; color: var(--muted); }
@media (max-width: 520px) { .cp-apps li { grid-template-columns: 48px minmax(0, 1fr); } .cp-apps img { width: 48px; height: 48px; } .cp-apps .cp-chip { grid-column: 2; justify-self: start; } }

/* ---------- staff pages ---------- */
.ad-subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; padding: 18px 24px 24px; }
.ad-sub { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-1); }
.ad-sub__art { aspect-ratio: 16 / 9; background: var(--surface-2); }
.ad-sub__art img { width: 100%; height: 100%; object-fit: cover; }
.ad-sub__body { display: grid; flex: 1; align-content: start; gap: 10px; padding: 14px 16px; }
.ad-sub__body h3 { font-family: var(--f-display); font-size: 22px; font-weight: 400; line-height: 1.15; overflow-wrap: anywhere; }
.ad-sub__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-sub__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 8px 10px; border-top: 1px solid var(--line); }
.ad-sub__actions form { display: contents; }
.rowbtn--danger:hover { background: var(--danger-wash); color: var(--danger); }
.ad-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 18px 24px 22px; }
.ad-stats > div { display: grid; gap: 6px; padding-left: 18px; border-left: 1px solid var(--line); }
.ad-stats > div:first-child { padding-left: 0; border-left: 0; }
.ad-stats small { font: 500 10.5px/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ad-stats b { font-size: 16px; font-weight: 500; }
@media (max-width: 760px) { .ad-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } .ad-stats > div:nth-child(odd) { padding-left: 0; border-left: 0; } }
.ad-answers { display: grid; }
.ad-answers > div { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 6px 24px; padding: 14px 0; border-top: 1px solid var(--line); }
.ad-answers > div:first-child { border-top: 0; }
.ad-answers dt { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.ad-answers dd { overflow-wrap: anywhere; }
.ad-answers .muted { color: var(--faint); }
@media (max-width: 640px) { .ad-answers > div { grid-template-columns: minmax(0, 1fr); } }
.ad-2col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .ad-2col { grid-template-columns: minmax(0, 1fr); } }

/* ---------- form builder ---------- */
.bld { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.bld-start { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; align-items: end; padding: 16px 18px; border-radius: var(--r); background: var(--surface-2); }
.bld-start .field { min-width: 0; }
.bld-start__actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 860px) { .bld-start { grid-template-columns: minmax(0, 1fr); } }
.bld-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 18px; align-items: start; }
@media (max-width: 1180px) { .bld-grid { grid-template-columns: minmax(0, 1fr); } .bld-grid > :last-child { order: -1; } }
.bld-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.bld-bar__count { font: 500 12px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bld-bar__tools { display: flex; flex-wrap: wrap; gap: 8px; }
.bld-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.bld-fixed { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 10px 14px; border-radius: var(--r); background: var(--surface-2); }
.bld-fixed__icon { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--surface); color: var(--muted); }
.bld-fixed__icon .icon { width: 16px; height: 16px; }
.bld-fixed__text { display: grid; flex: 1; min-width: 0; line-height: 1.35; }
.bld-fixed__text b { font-size: 14.5px; font-weight: 500; }
.bld-fixed__text small { font-size: 12.5px; color: var(--muted); }
.bld-empty { display: grid; justify-items: center; gap: 8px; padding: 44px 20px; border: 1.5px dashed var(--line-strong); border-radius: var(--r); text-align: center; color: var(--muted); font-size: 14px; }
.bld-empty b { font-family: var(--f-display); font-size: 23px; font-weight: 400; color: var(--text); }
.bld-card { border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow .2s var(--ease), opacity .2s; }
.bld-card.is-open { box-shadow: inset 0 0 0 1.5px var(--saffron); }
.bld-card.is-dragging { opacity: .45; }
.bld-card.is-over { box-shadow: inset 0 0 0 2px var(--saffron), 0 -3px 0 var(--saffron); }
.bld-card__head { display: flex; align-items: center; gap: 2px; padding: 6px 8px 6px 4px; }
.bld-grip { display: grid; place-items: center; flex: none; width: 28px; height: 38px; color: var(--faint); cursor: grab; touch-action: none; }
.bld-grip:active { cursor: grabbing; }
.bld-grip svg { fill: currentColor; }
.bld-card__toggle { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; min-height: 40px; padding: 4px 8px; border-radius: 8px; text-align: left; }
.bld-card__toggle:hover { background: var(--surface-2); }
.bld-card__toggle > .icon { flex: none; margin-left: auto; color: var(--faint); }
.bld-card__no { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font: 500 11.5px/1 var(--f-mono); color: var(--muted); }
.bld-card__title { overflow: hidden; font-size: 14.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.bld-card__req { flex: none; font: 500 10px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--saffron-ink); }
.bld-card__tools { display: flex; flex: none; gap: 0; }
.bld-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); transition: background-color .2s, color .2s; }
.bld-icon:hover { background: var(--surface-2); color: var(--text); }
.bld-icon--danger:hover { background: var(--danger-wash); color: var(--danger); }
.bld-icon .icon { width: 16px; height: 16px; }
@media (max-width: 640px) { .bld-card__head { flex-wrap: wrap; } .bld-card__tools { width: 100%; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 4px; } .bld-card .tag { display: none; } }
.bld-card__body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 14px 16px 18px; border-top: 1px solid var(--line); }
.bld-card__body .span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .bld-card__body { grid-template-columns: minmax(0, 1fr); } }
.bld-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 46px; font-size: 14.5px; cursor: pointer; }
.bld-switch input { position: absolute; opacity: 0; }
.bld-switch__track { position: relative; flex: none; width: 40px; height: 22px; border-radius: 999px; background: var(--line-strong); transition: background-color .2s var(--ease); }
.bld-switch__track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .2s var(--ease); }
.bld-switch input:checked + .bld-switch__track { background: var(--saffron); }
.bld-switch input:checked + .bld-switch__track::after { transform: translateX(18px); }
.bld-switch input:focus-visible + .bld-switch__track { outline: 2px solid var(--saffron); outline-offset: 2px; }
.bld-palette { position: sticky; top: 100px; display: grid; gap: 10px; }
@media (max-width: 1180px) { .bld-palette { position: static; } }
.bld-palette h3 { font: 500 11px/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.bld-types { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
@media (max-width: 1180px) { .bld-types { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }
.bld-type { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); text-align: left; transition: background-color .2s, transform .2s var(--ease); }
.bld-type:hover { background: var(--saffron-wash); transform: translateX(2px); }
.bld-type__icon { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--surface); color: var(--saffron-ink); }
.bld-type__icon .icon { width: 16px; height: 16px; }
.bld-type b { display: block; font-size: 13.5px; font-weight: 500; line-height: 1.25; }
.bld-type small { display: block; font-size: 11.5px; line-height: 1.25; color: var(--muted); }

.drop--wide .drop__preview { width: 112px; height: 70px; border-radius: var(--r-sm); }
.drop.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(168, 50, 31, .12); }
