/* MVTLoop authoring: brand preset, secondary/tertiary colours and custom fonts (study-brand-editor.js). */
.study-brand-extras { display: grid; gap: 14px; margin: 14px 0 4px; }
/* Grouped brand settings: Preset, Colours (one row per role) and Layout and shape. */
.brand-group { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--border, #dde1ea); border-radius: 12px; background: #fff; }
.brand-group-title { margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted, #566176); }
.brand-group-hint, .brand-field-hint { margin: 0; font-size: .82rem; line-height: 1.4; color: var(--ink-muted, #566176); }
.study-brand-preset { max-width: 340px; }
.brand-colour-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.brand-colour-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 104px 64px; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--border, #dde1ea); border-radius: 10px; }
.brand-colour-row .brand-colour-swatch { -webkit-appearance: none; appearance: none; width: 34px !important; min-width: 34px; height: 34px !important; min-height: 34px; padding: 0 !important; border: 1px solid var(--border, #dde1ea); border-radius: 8px; background: none; cursor: pointer; }
.brand-colour-swatch::-webkit-color-swatch-wrapper { padding: 2px; }
.brand-colour-swatch::-webkit-color-swatch { border: 0; border-radius: 6px; }
.brand-colour-text { display: grid; min-width: 0; }
.brand-colour-name { font-weight: 600; font-size: .9rem; color: var(--ink, #172033); }
.brand-colour-use { font-size: .78rem; line-height: 1.35; color: var(--ink-muted, #566176); }
/* The setup form gives inputs a wide minimum; keep the hex box inside its own column. */
.brand-colour-row .study-brand-hex { box-sizing: border-box; width: 104px !important; min-width: 0 !important; max-width: 104px; min-height: 34px; padding: 4px 8px; font-size: .85rem; }
.brand-colour-auto { box-sizing: border-box; width: 64px; min-width: 0; min-height: 34px; padding: 4px 8px; justify-content: center; }
.brand-layout-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; align-items: start; }
.brand-layout-grid .setup-field { display: grid; gap: 6px; font-weight: 600; }
.study-brand-extras:empty { display: none; }
.study-brand-extras .setup-field { display: grid; gap: 6px; }
.study-brand-extras .hint-inline { font-weight: 400; color: var(--ink-muted, #566176); font-size: .85em; }
.study-brand-preset .hint { margin: 0; }
.study-brand-hex { width: 9ch; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.study-brand-hex.is-invalid { border-color: var(--danger, #c62839); }
.study-brand-hex::placeholder { text-transform: none; }
.brand-colour-row [data-brand-auto][hidden] { visibility: hidden; display: inline-flex; }
.study-brand-warnings { grid-column: 1 / -1; margin: 0; list-style: disc; padding: 10px 12px 10px 30px; border-radius: 10px; background: #fff8e6; border: 1px solid #f1d38a; color: #6b4b00; font-size: .85rem; display: grid; gap: 4px; }
.study-brand-warnings[hidden] { display: none; }
.study-font-extras { grid-column: 1 / -1; }
.study-font-custom { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: var(--canvas, #f7f8fb); border: 1px solid var(--border, #dde1ea); }
.study-font-custom[hidden] { display: none; }
.study-font-custom .setup-field { display: grid; gap: 6px; }
.study-font-custom .hint { margin: 0; }
.study-font-file { display: flex; gap: 8px; align-items: center; }
.study-font-file input[type="text"] { flex: 1; min-width: 0; }
.study-font-upload { position: relative; overflow: hidden; cursor: pointer; white-space: nowrap; }
.study-font-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.study-font-upload:focus-within { outline: 3px solid var(--ring, rgba(81,70,216,.35)); outline-offset: 2px; }

/* Live preview sample: primary button, secondary link, tertiary required marker. */
.study-brand-sample { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: .85rem; }
.study-brand-sample-q { font-weight: 600; }
.study-brand-sample-q b { color: var(--preview-tertiary, var(--preview-brand)); }
.study-brand-sample-link { color: var(--preview-secondary, var(--preview-brand)); text-decoration: underline; }
.study-brand-sample-btn { margin-left: auto; padding: 6px 16px; border-radius: 8px; background: var(--preview-action, var(--preview-brand)); color: #fff; font-weight: 700; }
.study-brand-sample-focus { padding: 2px 8px; outline: 3px solid #0b0c0c; outline-offset: 4px; box-shadow: 0 0 0 4px var(--preview-focus, #ffdd00); margin: 0 6px; }
.study-brand-sample-choice { display: inline-flex; align-items: center; gap: 6px; }
.study-brand-sample-radio, .study-brand-sample-check { width: 14px; height: 14px; border: 2px solid var(--preview-control, var(--preview-brand)); display: inline-grid; place-content: center; }
.study-brand-sample-radio { border-radius: 50% !important; }
.study-brand-sample-radio::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--preview-control, var(--preview-brand)); }
.study-brand-sample-check { border-radius: 3px; }
.study-brand-sample-check::before { content: ""; width: 3px; height: 7px; margin-top: -2px; border: solid var(--preview-control, var(--preview-brand)); border-width: 0 2px 2px 0; transform: rotate(45deg); }
[data-study-corners="square"] .study-brand-sample-check { border-radius: 0; }
@media (max-width: 560px) { .brand-colour-row { grid-template-columns: 34px minmax(0, 1fr) 64px; } .brand-colour-row .study-brand-hex { grid-column: 2; width: 100% !important; max-width: none; } }
@media (max-width: 760px) { .brand-layout-grid { grid-template-columns: 1fr; } }

/* Live preview of Square corner style in the welcome card */
[data-study-corners="square"], [data-study-corners="square"] * { border-radius: 0 !important; }
.study-brand-corners .hint { margin: 0; }

/* Keep the three-column brand grid tidy: long option text and hints must not spill into the next column. */
.study-brand-extras > .setup-field { min-width: 0; }
.study-brand-extras select { width: 100%; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.study-brand-extras .hint { overflow-wrap: anywhere; }
@media (max-width: 900px) { .study-brand-extras { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .study-brand-extras { grid-template-columns: minmax(0, 1fr); } }
