/* Admin-specific styles. Layout, forms, tables and buttons come from Bootstrap. */

.thumb { width: 64px; height: 64px; object-fit: contain; border-radius: .5rem; background: var(--bs-tertiary-bg); flex: none; }
.thumb-empty { border: 1px dashed var(--bs-border-color); }
.media-card-img { height: 170px; object-fit: contain; background: var(--bs-tertiary-bg); border-radius: var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius) 0 0; }
.editor-nav { top: 4.5rem; }
/* One-line block headers: a long summary is cut with an ellipsis instead of pushing the buttons onto a second row. */
.card-header .block-toggle { flex: 1 1 12rem; min-width: 0; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; }

/* ---- radio pickers (colour swatches, media) ---- */
.swatches { display: flex; flex-wrap: wrap; gap: .4rem; }
.swatch-option { position: relative; cursor: pointer; margin: 0; }
.swatch-option input, .media-choice input { position: absolute; opacity: 0; inset: 0; }
.swatch { display: block; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--bs-border-color); }
.swatch-option input:checked + .swatch { border-color: var(--bs-body-color); box-shadow: 0 0 0 2px var(--bs-body-bg), 0 0 0 4px var(--bs-primary); }
.swatch-option input:focus-visible + .swatch { outline: 2px solid var(--bs-primary); outline-offset: 3px; }

.media-choices { display: flex; flex-wrap: wrap; gap: .5rem; max-height: 220px; overflow: auto; padding: .25rem; }
.media-choice { position: relative; width: 92px; height: 72px; display: grid; place-items: center; margin: 0; cursor: pointer;
  border: 2px solid var(--bs-border-color); border-radius: .5rem; background: var(--bs-tertiary-bg); overflow: hidden; }
.media-choice img { max-width: 100%; max-height: 100%; object-fit: contain; }
.media-choice-none { font-size: .8rem; color: var(--bs-secondary-color); }
.media-choice:has(input:checked) { border-color: var(--bs-primary); box-shadow: 0 0 0 2px var(--bs-primary); }
.media-choice:has(input:focus-visible) { outline: 2px solid var(--bs-primary); outline-offset: 2px; }

/* ---- phone preview (always light: the app is light) ---- */
.phone { width: 100%; max-width: 380px; border: 1px solid var(--bs-border-color); border-radius: 26px; overflow: hidden; background: #fff; color: #1d1b22; }
.phone-bar { padding: 12px 18px; font-weight: 700; background: #EBE2F2; }
.phone-chips { display: flex; gap: 6px; padding: 10px 14px 0; background: #fff; flex-wrap: wrap; }
.phone-chips.sub { padding-top: 6px; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 99px; border: 1px solid #c9b8d9; }
.chip.active { background: #BA9CD1; border-color: #BA9CD1; font-weight: 700; }
.phone-body { padding: 8px 16px 20px; max-height: 68vh; overflow: auto; font-family: Georgia, serif; }
.phone-body img { display: block; max-width: 100%; height: auto; }
.pv-h { font-size: 24px; font-weight: 700; margin: 10px 0 8px; font-family: system-ui, sans-serif; }
.pv-h-medium { font-size: 18px; }
.pv-p { white-space: pre-wrap; margin: 8px 0; font-size: 14.5px; line-height: 1.55; }
.pv-bullets { margin: 8px 0; padding-left: 20px; font-size: 14.5px; }
.pv-band { display: flex; gap: 14px; align-items: center; margin: 10px -16px; padding: 14px 22px; }
.pv-band-img { flex: 2; } .pv-band-text { flex: 3; font-weight: 700; font-size: 14px; } .pv-band-text p { margin: 6px 0 0; }
.pv-ovals { margin: 12px 0; }
.pv-oval { width: 60%; min-height: 80px; margin-top: -14px; border-radius: 50%; display: grid; place-items: center; text-align: center; padding: 14px 24px; font-size: 13.5px; }
.pv-card { border-radius: 12px; padding: 14px 16px; margin: 10px 0; font-size: 14px; }
.pv-card p { margin: 4px 0 8px; }
.pv-card details { margin-top: 8px; } .pv-card summary { cursor: pointer; font-weight: 700; }
.pv-grid { display: grid; gap: 10px; margin: 10px 0; }
.pv-grid-card { border-radius: 8px; padding: 12px; min-height: 110px; font-size: 13.5px; }
.pv-video { position: relative; border: 1px solid #000; min-height: 90px; background: #e4e4e4; margin: 10px 0; }
.pv-video-title { position: absolute; top: 8px; left: 12px; font-weight: 700; text-shadow: 0 0 6px #fff, 0 0 3px #fff; }
.pv-play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; }
.pv-pill { border-radius: 40px; padding: 12px 22px; margin: 8px 0; width: 72%; text-align: center; font-size: 13.5px; }
.pv-pill p { margin: 4px 0 0; }
.pv-label { font-weight: 700; color: #4C4C4C; font-size: 11px; font-family: system-ui, sans-serif; }
.pv-link { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pv-button { border-radius: 26px; padding: 10px 16px; text-align: center; font-weight: 700; margin: 10px 0; }
.pv-missing { border: 1px dashed #999; padding: 12px; color: #666; font-size: 13px; text-align: center; margin: 8px 0; }

/* Blazor moves focus to the page heading after navigation (for screen readers); it should not draw a focus ring. */
h1:focus { outline: none; }
.pv-stage { margin: 18px -16px 6px; padding: 4px 16px; background: #f1ecf6; font: 700 11px system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #5a4a6b; }
.pv-statement { border: 1px solid #ECB6A5; border-radius: 4px; padding: 8px 12px; margin: 8px 0; font-size: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.pv-card-white { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.pv-scale { display: flex; justify-content: space-between; gap: 2px; margin: 4px 0 12px; }
.pv-scale span { flex: 1; text-align: center; border: 1px solid #bbb; border-radius: 50%; aspect-ratio: 1; display: grid; place-items: center; font-size: 10px; }
.pv-chart { width: 100%; height: auto; margin: 6px 0; background: #fafafa; border-radius: 6px; }
.pv-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; margin-bottom: 6px; }
.pv-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.pv-small { font-size: 12.5px; margin: 2px 0; }
.pv-two-buttons { display: flex; justify-content: center; gap: 14px; margin: 14px 0; font-size: 12.5px; }
.pv-two-buttons span { padding: 10px 14px; border-radius: 10px; text-align: center; }
.pv-center { text-align: center; }
.pv-answer { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 12px; }
.pv-badge { flex: none; width: 28px; height: 28px; border-radius: 12px; background: #AED3FF; display: grid; place-items: center; font-size: 13px; }
.pv-answer-box { flex: 1; min-height: 64px; border: 1.5px dashed #888; }
.block-gallery-group { margin: 18px 0 8px; font: 700 12px system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--bs-secondary-color, #666); }
.block-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.block-pick { display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px 14px; border: 1px solid var(--bs-border-color, #ccc); border-radius: 10px; background: var(--bs-body-bg, #fff); color: inherit; }
.block-pick:hover, .block-pick:focus-visible { border-color: #7a5fa0; box-shadow: 0 0 0 3px rgba(122, 95, 160, .2); outline: none; }
.block-pick:disabled { opacity: .6; }
.block-pick-icon { flex: none; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: #ece5f3; font-size: 18px; font-weight: 700; color: #5a4a6b; }
.block-pick-text { display: flex; flex-direction: column; min-width: 0; }
.block-pick-text small { color: var(--bs-secondary-color, #666); line-height: 1.3; }

/* ---- block cards (tab editor) ---- */
.editor-nav { top: 1.25rem; }
.block-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 12px; transition: box-shadow .15s, border-color .15s; }
.block-card:hover { box-shadow: var(--shadow-md); }
.block-card.is-open { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.block-card.has-errors { border-color: var(--bad); }
.block-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.block-type-icon { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 15px; }
.block-toggle { flex: 1 1 8rem; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 0; border: 0; background: transparent; text-align: left; color: var(--ink); }
.block-toggle strong { font-weight: 650; }
.block-summary { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.block-actions { display: flex; gap: 2px; flex: none; }
.icon-btn { width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); display: grid; place-items: center; font-size: 15px; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.icon-btn:disabled { opacity: .35; }
.icon-btn-danger:hover:not(:disabled) { background: var(--bad-soft); color: var(--bad); }
.block-body { padding: 4px 18px 18px; border-top: 1px solid var(--line); }
.block-help { color: var(--muted); font-size: 13.5px; margin: 14px 0 16px; }
.pill { flex: none; font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; }
.pill-danger { background: var(--bad-soft); color: var(--bad); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-muted { background: var(--surface-2); color: var(--muted); }

/* ---- the add-block gallery, refined ---- */
.block-pick { background: var(--surface); border-color: var(--line); }
.block-pick-icon { background: var(--accent-soft); color: var(--accent-ink); }
.block-pick:hover, .block-pick:focus-visible { border-color: var(--accent); box-shadow: var(--ring); }
.block-gallery-group { color: var(--muted); }

/* ---- category grid ---- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.cat-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .18s, transform .18s; }
.cat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cat-card.is-hidden { opacity: .72; }
.cat-cover { height: 150px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); }
.cat-cover img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 14px; }
.cat-cover .cat-initial { font-size: 44px; font-weight: 800; color: var(--accent); opacity: .5; }
.cat-body { padding: 14px 16px 6px; flex: 1; }
.cat-title { font-size: 1.1rem; font-weight: 650; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.cat-title::after { content: ""; position: absolute; inset: 0; }   /* the whole card is the link */
.cat-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.cat-foot { position: relative; z-index: 1; display: flex; align-items: center; gap: 4px; padding: 8px 12px 12px; }
.cat-foot .spacer { flex: 1; }

/* fixes after the first look */
.cat-cover { position: relative; overflow: hidden; }
.cat-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 14px; }
h1:focus, h1:focus-visible, .page-title:focus-visible { outline: none; box-shadow: none; }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- sections of a block (Intro / Skattning / Diagram) ---- */
.section-tabs { display: flex; gap: 4px; padding: 4px; margin: 4px 0 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; width: fit-content; max-width: 100%; }
.section-tab { position: relative; border: 0; background: transparent; color: var(--muted); font-weight: 600; padding: 7px 16px; border-radius: 9px; }
.section-tab:hover { color: var(--ink); }
.section-tab.active { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.section-dot { position: absolute; top: 5px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
/* the same steps as clickable chips in the phone preview */
.pv-steps { display: flex; gap: 6px; margin: 4px 0 8px; }
.pv-step { flex: 1; text-align: center; }
.pv-step.active { background: #BA9CD1; border-color: #BA9CD1; font-weight: 700; }

/* the steps of a rating flow, listed under their tab in the side menu */
.nav-section { padding-left: 2.6rem !important; font-size: .85rem; }
.nav-section::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .45; margin-right: .6rem; vertical-align: middle; }
.list-group-item.is-current-parent { background: var(--surface-2); font-weight: 650; color: var(--accent-ink); }
.section-heading { display: flex; align-items: baseline; gap: 12px; margin: 2px 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.section-heading span { font-size: 1.05rem; font-weight: 700; color: var(--accent-ink); }
.section-heading small { color: var(--muted); }

/* ---- the real app (Flutter web build) in the editor's preview ---- */
.app-preview { display: block; width: 100%; height: min(78vh, 780px); border: 0; border-radius: 16px; background: #f1f1f4; }

/* ---- the rich-text editor (js/richtext.js) ---- */
.rte { border: 1px solid var(--bs-border-color); border-radius: .5rem; background: var(--bs-body-bg); }
.rte.is-invalid { border-color: var(--bs-form-invalid-border-color, #dc3545); }
.rte-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; border-bottom: 1px solid var(--bs-border-color); background: var(--bs-tertiary-bg); border-radius: .5rem .5rem 0 0; position: sticky; top: 0; z-index: 2; }
.rte-btn { border: 1px solid transparent; background: transparent; color: inherit; border-radius: .35rem; padding: 2px 8px; font-size: .85rem; line-height: 1.5; cursor: pointer; }
.rte-btn:hover { background: var(--bs-secondary-bg); }
.rte-btn.is-active { background: var(--bs-primary-bg-subtle, #cfe2ff); border-color: var(--bs-primary-border-subtle, #9ec5fe); }
.rte-b { font-weight: 700; } .rte-i { font-style: italic; } .rte-u { text-decoration: underline; } .rte-s { text-decoration: line-through; }
.rte-sep { width: 1px; align-self: stretch; background: var(--bs-border-color); margin: 0 2px; }
.rte-color { display: inline-flex; align-items: center; gap: 2px; font-size: .85rem; }
.rte-color input[type=color] { width: 26px; height: 24px; padding: 0; border: 1px solid var(--bs-border-color); border-radius: .25rem; background: none; }
.rte-color button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 4px; }
.rte-source { display: block; width: 100%; min-height: 220px; max-height: 60vh; padding: 10px 12px; border: 0; outline: none; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; background: transparent; color: inherit; }
.rte.is-source .rte-btn:not(.rte-keep) { opacity: .4; pointer-events: none; }
.rte.is-source .rte-color { opacity: .4; pointer-events: none; }
.rte-content { padding: 10px 12px; min-height: 180px; max-height: 60vh; overflow: auto; }
.rte-content .ProseMirror { outline: none; min-height: 160px; }
.rte-content .ProseMirror p { margin: 0 0 .6rem; }
.rte-content .ProseMirror h1 { font-size: 1.5rem; font-weight: 700; margin: .4rem 0; }
.rte-content .ProseMirror h2 { font-size: 1.15rem; font-weight: 700; margin: .4rem 0; }
.rte-content .ProseMirror h3 { font-size: 1rem; font-weight: 700; margin: .4rem 0; }
.rte-content .ProseMirror blockquote { border-left: 3px solid var(--bs-border-color); margin: .4rem 0; padding-left: .8rem; color: var(--bs-secondary-color); }
.rte-content .ProseMirror a { color: var(--bs-link-color); text-decoration: underline; }
.rte-content .ProseMirror img { display: block; max-width: 100%; height: auto; margin: .5rem 0; }
.rte-content .ProseMirror img.ProseMirror-selectednode { outline: 2px solid var(--bs-primary); }
.rte-pictures { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; padding: 8px; border: 1px dashed var(--bs-border-color); border-radius: .5rem; max-height: 220px; overflow: auto; }
.rte-pictures .media-choice { border: 1px solid var(--bs-border-color); border-radius: .35rem; padding: 2px; background: none; cursor: pointer; }
.rte-pictures .media-choice img { display: block; width: 72px; height: 72px; object-fit: cover; }

/* Appearance page */
.appearance-grid { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .appearance-grid { grid-template-columns: 1fr; } }
.bg-swatch { width: 64px; height: 64px; border-radius: .6rem; border: 1px solid var(--bs-border-color); display: inline-block; }
