/* The dashboard's Brand view (public/brand.js). Loads after dashboard.css and uses its tokens. */
.view-brand [hidden] { display: none !important; }
.view-brand { padding: 28px clamp(16px, 4vw, 48px) 64px; max-width: 1320px; margin: 0 auto; }
.bv-head { align-items: flex-end; }
.bv-sub { margin-top: 6px; max-width: 60ch; color: var(--muted); font-size: var(--fs-1); }
.bv-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.bv-signin { display: grid; justify-items: start; gap: 14px; padding: 28px; border-radius: var(--r-card); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }

.bv-start { margin: 8px 0 24px; }
.bv-start h2, .bv-group > legend, .bv-contrast h3 { font-size: var(--fs-0); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.bv-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.bv-way { display: grid; grid-template-rows: auto 1fr auto auto; gap: 8px; align-content: start; padding: 16px; border-radius: var(--r-card); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.bv-way > label { font-weight: 600; color: var(--text); font-size: var(--fs-1); }
.bv-way small, .bv-field small, .bv-sw small { color: var(--muted); font-size: var(--fs-0); line-height: 1.4; }
.bv-way .btn { justify-self: start; }
.view-brand textarea, .view-brand select, .view-brand input:not([type="range"]):not([type="color"]):not([type="radio"]):not([type="checkbox"]):not([type="file"]) {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--text) 5%, transparent);
  box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); font: inherit; font-size: 16px; }
.view-brand textarea { resize: vertical; min-height: 84px; }
.view-brand input[type="file"] { font-size: var(--fs-1); color: var(--muted); min-height: 40px; }
.view-brand :is(textarea, select, input):focus-visible { outline: 2px solid var(--pen); outline-offset: 1px; }
.view-brand [aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--danger) !important; }
.bv-notes { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: var(--fs-1); color: var(--body); }
.bv-notes:empty { display: none; }
.bv-notes li { padding-left: 18px; position: relative; }
.bv-notes li::before { content: ""; position: absolute; left: 4px; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.bv-notes[data-tone="error"] li::before { background: var(--danger); }
.bv-empty { padding: 40px 0; color: var(--muted); text-align: center; }

.bv-grid { display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); gap: 20px; align-items: start; }
.bv-controls { display: grid; gap: 14px; min-width: 0; }
.bv-group { display: grid; gap: 14px; margin: 0; padding: 18px; min-width: 0; border: 0; border-radius: var(--r-card); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.bv-group > legend { float: left; width: 100%; margin-bottom: 2px; }
.bv-field { display: grid; gap: 6px; }
.bv-field > label, .bv-seg legend, .bv-sw label { font-size: var(--fs-1); font-weight: 500; color: var(--text); }
.bv-range { display: grid; grid-template-columns: minmax(0, 1fr) 64px; align-items: center; gap: 10px; }
.bv-range input { width: 100%; min-height: 32px; accent-color: var(--pen); }
.bv-range output { font-variant-numeric: tabular-nums; font-size: var(--fs-1); color: var(--body); text-align: right; }
.bv-check { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; font-size: var(--fs-1); color: var(--body); }
.bv-check input { width: 18px; height: 18px; accent-color: var(--pen); }

.bv-seg { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 6px; }
.bv-seg-row { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); width: fit-content; max-width: 100%; }
.bv-seg-row label { position: relative; }
.bv-seg-row input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.bv-seg-row span, .bv-tabs button { display: grid; place-items: center; min-height: 32px; padding: 0 12px; border-radius: 9px; font-size: 13.5px; color: var(--muted); transition: background-color var(--t-1) var(--ease), color var(--t-1) var(--ease); }
.bv-seg-row input:checked + span, .bv-tabs button[aria-checked="true"] { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); }
.bv-seg-row input:focus-visible + span { outline: 2px solid var(--pen); outline-offset: 1px; }

.bv-swatches { display: grid; gap: 10px; }
.bv-sw { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; }
.bv-sw > div { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 2px 10px; align-items: center; }
.bv-sw label { grid-column: 1; }
.bv-sw .bv-hex { grid-column: 2; grid-row: 1 / span 2; font-family: var(--mono); font-size: 14px !important; min-height: 36px !important; }
.bv-sw small { grid-column: 1; }
.bv-sw input[type="color"] { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: none; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line-2); }
.bv-sw input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.bv-sw input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 9px; }
.bv-sw input[type="color"]::-moz-color-swatch { border: 0; border-radius: 9px; }

.bv-contrast { display: grid; gap: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.bv-contrast ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.bv-contrast li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 82px; gap: 10px; align-items: center; font-size: var(--fs-1); }
.bv-contrast b { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--text); }
.bv-contrast em { font-style: normal; font-size: var(--fs-0); text-align: right; }
.bv-contrast li.ok em { color: var(--ok); }
.bv-contrast li.bad em { color: var(--danger); font-weight: 600; }
.bv-chip { display: grid; place-items: center; height: 26px; border-radius: 7px; font-weight: 600; font-size: 13px; box-shadow: inset 0 0 0 1px var(--line-2); }
.bv-warn { color: var(--danger); font-size: var(--fs-1); }
.bv-pass { color: var(--ok); font-size: var(--fs-1); }
.bv-contrast .btn { justify-self: start; }

.bv-preview { position: sticky; top: 12px; display: grid; grid-template-rows: auto minmax(0, 1fr); height: calc(100dvh - 120px); min-height: 520px; border-radius: var(--r-card); overflow: hidden; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.bv-pbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); font-size: var(--fs-1); color: var(--muted); }
.bv-pseg button { width: auto; min-width: 32px; padding: 0 10px; font-size: 13px; }
.bv-pseg button[aria-checked="true"] { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); }
#bv-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }

@media (max-width: 1180px) {
  .bv-ways { grid-template-columns: 1fr; }
  .bv-grid { grid-template-columns: 1fr; }
  .bv-preview { position: relative; top: 0; height: 72vh; min-height: 420px; order: -1; }
}
@media (max-width: 520px) {
  .bv-sw > div { grid-template-columns: 1fr; }
  .bv-sw .bv-hex { grid-column: 1; grid-row: auto; }
  .bv-contrast li { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .bv-contrast em { grid-column: 2 / -1; text-align: left; }
}

.bv-projects { margin-top: 24px; padding: 18px; border-radius: var(--r-card); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.bv-projects h2 { font-size: var(--fs-0); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.bv-projects ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.bv-proj { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.bv-proj span { display: grid; min-width: 0; }
.bv-proj b { color: var(--text); font-weight: 500; font-size: var(--fs-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bv-proj small { color: var(--muted); font-size: var(--fs-0); }
.bv-proj input { flex: none; width: 20px; height: 20px; accent-color: var(--pen); }
.bv-proj input:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }
