/* Shared styles for the "create a test from a file" pages (PDF, images, Excel, link)
   and the institution / teacher exam setup page. Brand colours come from the layout's
   --brand-* variables, so white-label institutions keep their own colours. */

.up-shell {
  --up-ink: var(--brand-text, #0f172a);
  --up-muted: #55657a;
  --up-line: #d9e2ee;
  --up-line-strong: #b9c7d8;
  --up-surface: var(--brand-surface, #ffffff);
  --up-soft: #f3f7fc;
  --up-primary: var(--brand-primary, #5099ff);
  --up-primary-rgb: var(--brand-primary-rgb, 80, 153, 255);
  --up-deep: var(--brand-secondary, #01112b);
  --up-danger: #b42318;
  --up-danger-soft: #fef3f2;
  --up-ok: #067647;
  --up-radius: 14px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 1.5rem max(16px, env(safe-area-inset-right, 0px)) 3rem max(16px, env(safe-area-inset-left, 0px));
  color: var(--up-ink);
}

/* Page header */
.up-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem 1.5rem; margin-bottom: 1.25rem; }
.up-header h1 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-weight: 700; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
.up-header p { margin: 0.35rem 0 0; color: var(--up-muted); max-width: 62ch; }
.up-crumb { font-size: 0.82rem; font-weight: 600; color: var(--up-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 0.35rem; margin-bottom: 0.4rem; }
.up-crumb:hover { color: var(--up-deep); }

/* Source switcher (PDF / Images / Excel / Link) */
.up-sources { display: flex; gap: 0.4rem; overflow-x: auto; padding: 0.3rem; margin: 0 0 1.25rem; background: var(--up-soft); border: 1px solid var(--up-line); border-radius: 12px; scrollbar-width: none; }
.up-sources::-webkit-scrollbar { display: none; }
@media (max-width: 420px) { .up-source i { display: none; } .up-source { padding-inline: 0.4rem; font-size: 0.85rem; } }
.up-source { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; padding: 0.55rem 0.9rem; border-radius: 9px; font-size: 0.9rem; font-weight: 600; color: var(--up-muted); text-decoration: none; white-space: nowrap; }
.up-source:hover { color: var(--up-deep); background: rgba(var(--up-primary-rgb), 0.08); }
.up-source[aria-current="page"] { background: var(--up-surface); color: var(--up-deep); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }

/* Two-column layout: form + side panel */
.up-grid { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 992px) {
  .up-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .up-aside { position: sticky; top: 88px; }
}

.up-card { background: var(--up-surface); border: 1px solid var(--up-line); border-radius: var(--up-radius); padding: 1.25rem; min-width: 0; }
@media (min-width: 576px) { .up-card { padding: 1.5rem; } }
.up-card + .up-card { margin-top: 1rem; }
.up-card h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.25rem; }
.up-card .up-card-sub { color: var(--up-muted); font-size: 0.9rem; margin: 0 0 1rem; }

/* Numbered steps (only where the order really is a sequence) */
.up-step-head { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 1rem; }
.up-step-num { flex: 0 0 auto; width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.85rem; font-weight: 700; color: #fff; background: var(--up-deep); }
.up-step-head h2 { margin: 0.1rem 0 0.15rem; }
.up-step-head p { margin: 0; color: var(--up-muted); font-size: 0.9rem; }
.up-optional { font-size: 0.75rem; font-weight: 600; color: var(--up-muted); background: var(--up-soft); border: 1px solid var(--up-line); border-radius: 999px; padding: 0.05rem 0.5rem; margin-left: 0.35rem; vertical-align: 2px; }

/* Form controls */
.up-shell .form-label { font-size: 0.86rem; font-weight: 600; color: var(--up-ink); margin-bottom: 0.35rem; }
.up-shell .form-control, .up-shell .form-select { border-color: var(--up-line-strong); border-radius: 10px; min-height: 44px; }
.up-shell textarea.form-control { min-height: 0; }
.up-shell .form-control:focus, .up-shell .form-select:focus { border-color: var(--up-primary); box-shadow: 0 0 0 0.2rem rgba(var(--up-primary-rgb), 0.18); }
.up-shell .form-text, .up-hint { font-size: 0.8rem; color: var(--up-muted); margin-top: 0.3rem; }
.up-shell .form-check-input { width: 1.1em; height: 1.1em; margin-top: 0.2em; }
.up-shell .form-check-label { font-size: 0.92rem; }

/* Drop zone */
.up-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0.35rem; padding: 1.6rem 1rem; border: 2px dashed var(--up-line-strong); border-radius: 12px; background: var(--up-soft); cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.up-drop:hover, .up-drop.is-dragging { border-color: var(--up-primary); background: rgba(var(--up-primary-rgb), 0.06); }
.up-drop:focus-within { outline: 3px solid rgba(var(--up-primary-rgb), 0.35); outline-offset: 2px; }
.up-drop.has-error { border-color: var(--up-danger); background: var(--up-danger-soft); }
.up-drop-icon { font-size: 1.6rem; color: var(--up-primary); line-height: 1; }
.up-drop-title { font-weight: 700; margin: 0; }
.up-drop-title u { text-decoration-color: rgba(var(--up-primary-rgb), 0.6); text-underline-offset: 3px; }
.up-drop-sub { margin: 0; color: var(--up-muted); font-size: 0.84rem; }
.up-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.up-files { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.up-files:empty { display: none; }
.up-file { display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 0.7rem; border: 1px solid var(--up-line); border-radius: 10px; background: var(--up-surface); min-width: 0; }
.up-file-icon { color: var(--up-primary); flex: 0 0 auto; }
.up-file-name { flex: 1 1 auto; min-width: 0; font-size: 0.9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-file-size { flex: 0 0 auto; font-size: 0.8rem; color: var(--up-muted); font-variant-numeric: tabular-nums; }
.up-file-remove { flex: 0 0 auto; border: 0; background: transparent; color: var(--up-muted); width: 2rem; height: 2rem; border-radius: 8px; display: grid; place-items: center; }
.up-file-remove:hover { color: var(--up-danger); background: var(--up-danger-soft); }
.up-file-remove:focus-visible { outline: 2px solid var(--up-primary); }

.up-error { display: flex; gap: 0.5rem; align-items: flex-start; margin-top: 0.6rem; padding: 0.6rem 0.75rem; border-radius: 10px; background: var(--up-danger-soft); color: var(--up-danger); font-size: 0.86rem; font-weight: 500; }
.up-error[hidden] { display: none; }

/* Buttons */
.up-actions { display: grid; gap: 0.65rem; grid-template-columns: 1fr; margin-top: 1.25rem; }
@media (min-width: 576px) { .up-actions.two { grid-template-columns: 1fr 1fr; } }
.up-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 48px; padding: 0.7rem 1.1rem; border-radius: 11px; font-weight: 700; font-size: 0.98rem; border: 1px solid transparent; text-decoration: none; cursor: pointer; transition: filter 0.15s ease, background 0.15s ease; }
.up-btn-primary { background: var(--brand-gradient, linear-gradient(135deg, #5099ff 0%, #01112b 100%)); color: #fff; }
.up-btn-primary:hover { color: #fff; filter: brightness(1.06); }
.up-btn-secondary { background: var(--up-surface); color: var(--up-deep); border-color: var(--up-line-strong); }
.up-btn-secondary:hover { background: var(--up-soft); color: var(--up-deep); }
.up-btn:disabled, .up-btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; filter: none; }
.up-btn:focus-visible { outline: 3px solid rgba(var(--up-primary-rgb), 0.45); outline-offset: 2px; }
.up-btn-sm { min-height: 36px; padding: 0.4rem 0.8rem; font-size: 0.86rem; border-radius: 9px; }
.up-actions-note { margin: 0.6rem 0 0; font-size: 0.82rem; color: var(--up-muted); }

/* Side panel */
.up-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.up-facts li { display: flex; gap: 0.65rem; font-size: 0.9rem; line-height: 1.45; }
.up-facts i { color: var(--up-primary); margin-top: 0.2rem; width: 1rem; text-align: center; flex: 0 0 auto; }
.up-note { margin-top: 1rem; padding: 0.75rem 0.85rem; border-radius: 10px; background: var(--up-soft); border: 1px solid var(--up-line); font-size: 0.86rem; color: var(--up-muted); }
.up-note strong { color: var(--up-ink); }

/* Collapsible "Advanced" sections */
.up-more { border-top: 1px solid var(--up-line); margin-top: 1.25rem; padding-top: 0.25rem; }
.up-more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.75rem 0; font-weight: 600; font-size: 0.92rem; color: var(--up-deep); }
.up-more > summary::-webkit-details-marker { display: none; }
.up-more > summary::after { content: "\F282"; font-family: "bootstrap-icons"; font-size: 0.85rem; transition: transform 0.15s ease; }
.up-more[open] > summary::after { transform: rotate(180deg); }
.up-more > summary:focus-visible { outline: 2px solid var(--up-primary); outline-offset: 2px; border-radius: 6px; }

/* Template chips */
.up-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.up-chip { border: 1px solid var(--up-line-strong); background: var(--up-surface); color: var(--up-ink); border-radius: 999px; padding: 0.4rem 0.85rem; font-size: 0.86rem; font-weight: 600; min-height: 36px; }
.up-chip:hover { border-color: var(--up-primary); color: var(--up-deep); }
.up-chip[aria-pressed="true"] { background: var(--up-deep); border-color: var(--up-deep); color: #fff; }
.up-chip:focus-visible { outline: 2px solid var(--up-primary); outline-offset: 2px; }

.up-status { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.75rem; font-size: 0.88rem; color: var(--up-muted); }
.up-status.is-ok { color: var(--up-ok); }
.up-status.is-error { color: var(--up-danger); }

/* Step list in the side panel */
.up-toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.up-toc a { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.5rem; border-radius: 8px; color: var(--up-ink); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.up-toc a:hover { background: var(--up-soft); }
.up-toc .up-step-num { width: 1.4rem; height: 1.4rem; font-size: 0.72rem; }

.up-meter { margin-top: 0.4rem; height: 6px; border-radius: 999px; background: var(--up-soft); border: 1px solid var(--up-line); overflow: hidden; }
.up-meter span { display: block; height: 100%; background: var(--up-primary); }
.up-usage { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.up-usage strong { font-size: 1.1rem; }

.up-list { list-style: none; margin: 0; padding: 0; }
.up-list a { display: block; padding: 0.55rem 0; border-top: 1px solid var(--up-line); color: var(--up-ink); text-decoration: none; }
.up-list li:first-child a { border-top: 0; }
.up-list a:hover .up-list-title { color: var(--up-primary); }
.up-list-title { font-weight: 600; font-size: 0.92rem; }
.up-list-meta { font-size: 0.8rem; color: var(--up-muted); }

/* Syllabus builder */
.up-syllabus { display: flex; flex-direction: column; gap: 0.75rem; }
.up-syllabus details { border: 1px solid var(--up-line); border-radius: 12px; background: var(--up-surface); overflow: hidden; }
.up-syllabus details details { border-radius: 10px; }
.up-syllabus summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.7rem 0.9rem; background: var(--up-soft); min-width: 0; }
.up-syllabus summary::-webkit-details-marker { display: none; }
.up-syllabus summary > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.up-syllabus details[open] > summary { border-bottom: 1px solid var(--up-line); }
.up-syllabus summary:focus-visible { outline: 2px solid var(--up-primary); outline-offset: -2px; }
.up-syllabus-panel { padding: 0.9rem; display: flex; flex-direction: column; gap: 0.75rem; }
.up-count { flex: 0 0 auto; font-size: 0.75rem; font-weight: 600; color: var(--up-muted); background: var(--up-surface); border: 1px solid var(--up-line); border-radius: 999px; padding: 0.1rem 0.55rem; white-space: nowrap; }
.up-row { display: grid; gap: 0.5rem; grid-template-columns: minmax(0, 1fr); padding: 0.75rem; border: 1px solid var(--up-line); border-radius: 10px; background: var(--up-soft); }
@media (min-width: 768px) {
  .up-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; }
}
.up-row .form-label { font-size: 0.78rem; margin-bottom: 0.2rem; }
.up-row .form-control { min-height: 38px; }
.up-inline-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.up-link-danger { color: var(--up-danger); border-color: #f4c7c3; }
.up-link-danger:hover { background: var(--up-danger-soft); color: var(--up-danger); }

/* Sticky submit bar on phones and tablets (the side panel holds it on desktop) */
.up-mobile-bar { position: sticky; bottom: 0; z-index: 20; margin: 1.25rem calc(-1 * max(16px, env(safe-area-inset-left, 0px))) 0; padding: 0.75rem max(16px, env(safe-area-inset-right, 0px)) calc(0.75rem + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: rgba(255, 255, 255, 0.96); border-top: 1px solid var(--up-line); backdrop-filter: blur(6px); }
.up-mobile-bar .up-btn { width: 100%; }
@media (min-width: 992px) { .up-mobile-bar { display: none; } }
.up-desktop-only { display: none; }
@media (min-width: 992px) { .up-desktop-only { display: block; } }

@media (prefers-reduced-motion: reduce) {
  .up-drop, .up-btn, .up-more > summary::after { transition: none; }
}

/* ======================================================================
   Single upload page (/questions/upload): file or link, then question count.
   Everything else sits in the collapsed "Add details" section.
   ====================================================================== */
.up-hub { position: relative; max-width: 760px; padding-top: 2.25rem; isolation: isolate; }
.up-hub [hidden] { display: none !important; }
/* Soft light behind the heading; closest-side keeps each gradient fading out inside the box */
.up-hub-glow { position: absolute; z-index: -1; inset: -24px 0 auto; height: 320px; pointer-events: none;
  background:
    radial-gradient(closest-side at 30% 45%, rgba(var(--up-primary-rgb), 0.16), transparent),
    radial-gradient(closest-side at 72% 30%, rgba(124, 92, 255, 0.10), transparent); }

.up-hub-head { text-align: center; margin: 0 auto 1.75rem; max-width: 600px; }
.up-eyebrow { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.75rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--up-deep); background: rgba(var(--up-primary-rgb), 0.10); border: 1px solid rgba(var(--up-primary-rgb), 0.22); }
.up-eyebrow i { color: var(--up-primary); }
.up-hub-head h1 { margin: 0.85rem 0 0.5rem; font-size: clamp(1.7rem, 4.2vw, 2.4rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance; }
.up-hub-head p { margin: 0 auto; color: var(--up-muted); font-size: 1rem; line-height: 1.55; text-wrap: pretty; }

.up-hub-card { background: var(--up-surface); border: 1px solid rgba(15, 23, 42, 0.07); border-radius: 24px; padding: 1.1rem; display: flex; flex-direction: column; gap: 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -8px rgba(15, 23, 42, 0.08), 0 32px 64px -32px rgba(15, 23, 42, 0.18); }
@media (min-width: 576px) { .up-hub-card { padding: 1.75rem; gap: 1.5rem; } }

.up-field-label { font-size: 0.88rem; font-weight: 650; color: var(--up-ink); margin-bottom: 0.4rem; }

/* File / link switch */
.up-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem; padding: 0.3rem; border-radius: 14px; background: var(--up-soft); border: 1px solid var(--up-line); }
.up-mode-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--up-muted); font-weight: 650; font-size: 0.93rem; transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease; }
.up-mode-btn:hover { color: var(--up-deep); }
.up-mode-btn[aria-pressed="true"] { background: var(--up-surface); color: var(--up-deep); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 4px 12px -4px rgba(15, 23, 42, 0.12); }
.up-mode-btn:focus-visible { outline: 2px solid var(--up-primary); outline-offset: 2px; }

/* Big drop area */
.up-hub-drop.up-drop { gap: 0.4rem; padding: 2.25rem 1.25rem 1.75rem; border-radius: 18px; border-width: 1.5px; border-color: rgba(var(--up-primary-rgb), 0.38);
  background: linear-gradient(180deg, rgba(var(--up-primary-rgb), 0.06) 0%, rgba(var(--up-primary-rgb), 0.02) 100%); transition: border-color 0.15s ease, background 0.15s ease, padding 0.2s ease; }
.up-hub-drop.up-drop:hover, .up-hub-drop.up-drop.is-dragging { border-color: var(--up-primary); background: linear-gradient(180deg, rgba(var(--up-primary-rgb), 0.11) 0%, rgba(var(--up-primary-rgb), 0.04) 100%); }
.up-hub-drop.up-drop.is-dragging .up-hub-drop-icon { transform: translateY(-3px) scale(1.04); }
.up-hub-drop-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 0.4rem; font-size: 1.6rem; color: #fff;
  background: var(--brand-gradient, linear-gradient(135deg, #5099ff 0%, #01112b 100%)); box-shadow: 0 10px 24px -6px rgba(var(--up-primary-rgb), 0.55); transition: transform 0.2s ease; }
.up-hub-drop-title { font-size: 1.08rem; font-weight: 700; color: var(--up-ink); }
.up-hub-drop-title u { color: var(--up-primary); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.up-hub-drop-sub { font-size: 0.87rem; color: var(--up-muted); }
.up-formats { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; margin-top: 0.75rem; }
.up-format { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.28rem 0.65rem; border-radius: 999px; background: var(--up-surface); border: 1px solid var(--up-line); font-size: 0.78rem; font-weight: 650; color: var(--up-ink); }
.up-format em { font-style: normal; font-weight: 500; color: var(--up-muted); }
.up-format.is-pdf i { color: #dc2626; }
.up-format.is-img i { color: #d97706; }
.up-format.is-xls i { color: #15803d; }
/* Once a file is in, the drop area shrinks to a compact add-or-replace row */
[data-dropzone].has-files .up-hub-drop.up-drop { flex-direction: row; gap: 0.75rem; padding: 0.85rem 1rem; }
[data-dropzone].has-files .up-hub-drop-icon { width: 38px; height: 38px; border-radius: 12px; font-size: 1.05rem; margin: 0; box-shadow: none; }
[data-dropzone].has-files .up-hub-drop-sub, [data-dropzone].has-files .up-formats { display: none; }
[data-dropzone].has-files .up-hub-drop-title { font-size: 0.93rem; }
.up-hub .up-file { padding: 0.65rem 0.8rem; border-radius: 12px; background: var(--up-soft); border-color: transparent; }
.up-kind-tip { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0.65rem 0 0; font-size: 0.84rem; color: var(--up-muted); }
.up-kind-tip i { color: #d97706; margin-top: 0.1rem; }

/* Link input */
.up-url { position: relative; }
.up-url i { position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--up-muted); pointer-events: none; }
.up-hub .up-url .form-control { min-height: 56px; padding-left: 2.6rem; font-size: 1rem; border-radius: 14px; }

/* Number of questions */
.up-qcount { padding: 1rem; border-radius: 16px; background: var(--up-soft); border: 1px solid var(--up-line); }
.up-qcount-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.7rem; }
.up-qcount-max { font-size: 0.8rem; color: var(--up-muted); font-variant-numeric: tabular-nums; }
.up-qcount-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.up-stepper { display: inline-flex; align-items: center; background: var(--up-surface); border: 1px solid var(--up-line-strong); border-radius: 14px; padding: 0.25rem; }
.up-stepper:focus-within { border-color: var(--up-primary); box-shadow: 0 0 0 0.2rem rgba(var(--up-primary-rgb), 0.16); }
.up-step-btn { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--up-deep); display: grid; place-items: center; font-size: 1rem; }
.up-step-btn:hover { background: var(--up-soft); }
.up-step-btn:focus-visible { outline: 2px solid var(--up-primary); outline-offset: 1px; }
.up-step-input { width: 4.2rem; border: 0; background: transparent; text-align: center; font-size: 1.35rem; font-weight: 700; color: var(--up-ink); font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.up-step-input:focus { outline: none; }
.up-step-input::-webkit-outer-spin-button, .up-step-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.up-presets { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.up-preset { min-width: 48px; height: 40px; padding: 0 0.8rem; border-radius: 999px; border: 1px solid var(--up-line-strong); background: var(--up-surface); color: var(--up-ink); font-weight: 650; font-size: 0.9rem; font-variant-numeric: tabular-nums; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
.up-preset:hover { border-color: var(--up-primary); }
.up-preset[aria-pressed="true"] { background: var(--up-deep); border-color: var(--up-deep); color: #fff; }
.up-preset:focus-visible { outline: 2px solid var(--up-primary); outline-offset: 2px; }
.up-qcount-note { margin: 0.7rem 0 0; font-size: 0.82rem; color: var(--up-muted); }

/* Optional details */
.up-extra { border: 1px solid var(--up-line); border-radius: 16px; background: var(--up-surface); overflow: hidden; }
.up-extra > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.85rem; padding: 0.9rem 1rem; }
.up-extra > summary::-webkit-details-marker { display: none; }
.up-extra > summary:hover { background: var(--up-soft); }
.up-extra > summary:focus-visible { outline: 2px solid var(--up-primary); outline-offset: -2px; border-radius: 16px; }
.up-extra-icon { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--up-soft); border: 1px solid var(--up-line); color: var(--up-deep); }
.up-extra-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.up-extra-title { font-weight: 700; font-size: 0.95rem; color: var(--up-ink); }
.up-extra-sub { font-size: 0.82rem; color: var(--up-muted); line-height: 1.4; }
.up-extra-chev { flex: 0 0 auto; color: var(--up-muted); transition: transform 0.2s ease; }
.up-extra[open] .up-extra-chev { transform: rotate(180deg); }
.up-extra[open] > summary { border-bottom: 1px solid var(--up-line); }
.up-extra-body { padding: 1rem; }
@media (min-width: 576px) { .up-extra-body { padding: 1.15rem 1.25rem 1.25rem; } }
.up-hub .up-extra .form-control { border-radius: 12px; }

.up-seg { display: inline-flex; gap: 0.25rem; padding: 0.25rem; border-radius: 12px; background: var(--up-soft); border: 1px solid var(--up-line); }
.up-seg-opt { min-width: 84px; padding: 0.45rem 0.9rem; border-radius: 9px; text-align: center; font-weight: 650; font-size: 0.88rem; color: var(--up-muted); cursor: pointer; margin: 0; }
.up-seg .btn-check:checked + .up-seg-opt { background: var(--up-surface); color: var(--up-deep); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 4px 10px -4px rgba(15, 23, 42, 0.14); }
.up-seg .btn-check:focus-visible + .up-seg-opt { outline: 2px solid var(--up-primary); outline-offset: 1px; }
.up-toggle { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.75rem 0.9rem; border-radius: 12px; background: var(--up-soft); }
.up-toggle .form-switch { padding-left: 3.2em; }
.up-toggle .form-switch .form-check-input { width: 2.4em; height: 1.3em; margin: 0.05em 0 0 -3.2em; }

/* Actions */
.up-hub-actions { display: flex; flex-direction: column; gap: 0.85rem; }
.up-btn-xl { width: 100%; min-height: 58px; border-radius: 16px; font-size: 1.05rem; letter-spacing: -0.005em; box-shadow: 0 12px 28px -10px rgba(var(--up-primary-rgb), 0.7); transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease; }
.up-btn-xl:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 16px 34px -10px rgba(var(--up-primary-rgb), 0.8); }
.up-alt-action { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.25rem 0.6rem; text-align: center; }
.up-link-btn { display: inline-flex; align-items: center; gap: 0.4rem; border: 0; background: transparent; padding: 0.35rem 0.5rem; border-radius: 8px; color: var(--up-deep); font-weight: 650; font-size: 0.92rem; text-decoration: none; }
.up-link-btn:hover { color: var(--up-primary); text-decoration: underline; text-underline-offset: 3px; }
.up-link-btn:disabled { opacity: 0.55; }
.up-link-btn:focus-visible { outline: 2px solid var(--up-primary); outline-offset: 2px; }
.up-alt-note { font-size: 0.8rem; color: var(--up-muted); }

/* What you get */
.up-perks { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .up-perks { grid-template-columns: repeat(3, 1fr); } }
.up-perks li { display: flex; align-items: flex-start; gap: 0.65rem; font-size: 0.85rem; line-height: 1.45; color: var(--up-muted); }
.up-perks strong { color: var(--up-ink); font-weight: 650; }
.up-perk-icon { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--up-primary-rgb), 0.10); color: var(--up-primary); }

@media (prefers-reduced-motion: reduce) {
  .up-hub-drop.up-drop, .up-hub-drop-icon, .up-mode-btn, .up-preset, .up-extra-chev, .up-btn-xl { transition: none; }
}
