.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-4);
    cursor: pointer;
    user-select: none;
    width: 100%;
    color: var(--nav-text);
}
.brand-logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}
.brand-logo-container {
    display: flex;
    align-items: center;
    max-width: 140px;
    max-height: 36px;
    overflow: hidden;
}
.brand-logo, .default-logo {
    max-width: 100%;
    max-height: 36px;
    object-fit: contain;
}
.brand-toggle-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    color: var(--nav-text);
    opacity: 0.4;
    transition: var(--transition);
}
.brand-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: var(--sp-1);
    overflow: hidden;
}
.brand-name-text {
    font-weight: var(--fw-700);
    letter-spacing: -0.025em;
    color: var(--nav-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    width: 100%;
    text-align: center;
    transition: var(--transition);
}
.brand-name-text.brand-name-short {
    font-size: var(--fs-4);
    text-transform: none;
    letter-spacing: -0.025em;
    font-weight: var(--fw-700);
}
.brand-name-text.brand-name-medium {
    font-size: var(--fs-4);
    text-transform: none;
    letter-spacing: -0.015em;
    font-weight: var(--fw-700);
}
.brand-name-text.brand-name-long {
    font-size: var(--fs-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: var(--fw-700);
}

/* Brand Identity Admin Page Styles */
.top-bar-sub {
    margin: 0;
}
.brand-top-row {
    display: flex;
    gap: var(--sp-5);
    align-items: center;
}
.brand-logo-section {
    flex-shrink: 0;
    width: 210px;
}
.brand-details-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}
.brand-detail-row {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}
.branding-form-container {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}
.branding-form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}
/* The flex gap above is the single source of vertical spacing between the
   three section cards; neutralise the default .card bottom margin so it does
   not stack on top of the gap. Retune section spacing via the gap alone. */
.branding-form > .card {
    margin-bottom: 0;
}
.form-row-flex {
    display: flex;
    gap: var(--sp-5);
    align-items: flex-end;
}
.w-full {
    width: 100%;
}
.logo-dropzone {
    /* Native <button>: strip the UA chrome so the dashed frame below owns the look. */
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    color: inherit;
    width: 100%;
    border: 2px dashed var(--border);
    border-radius: var(--radius-card);
    padding: var(--sp-4);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-sizing: border-box;
    min-height: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
}
.logo-dropzone.dragover {
    border-color: var(--accent);
}
/* The placeholder (icon over text) stacks via flex; non-!important so the
   .display-none toggle still wins when a logo is present. */
.logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.logo-preview-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--sp-3);
}

.segmented-control-track {
    position: relative;
    display: flex;
    background: var(--surface-raised);
    padding: var(--sp-1);
    border-radius: var(--radius-control);
    border: 1px solid var(--border);
    user-select: none;
    width: 280px;
    height: var(--field-h);
    align-items: center;
    cursor: pointer;
}
/* Opt-in full-width track (e.g. branding light/dark) — beats the fixed width above. */
.segmented-control-track.w-full { width: 100%; }
.segmented-control-segment {
    position: relative;
    flex: 1;
    z-index: 2;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: var(--fs-2);
    font-weight: var(--fw-600);
    cursor: pointer;
    text-align: center;
    padding: var(--sp-1) 0;
    transition: color var(--transition);
    pointer-events: none;
}
.segmented-control-segment.active {
    color: var(--text);
}
.segmented-control-capsule {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(33.33% - 5.3px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    box-shadow: var(--sh-1);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}
.logo-preview-img {
    max-height: 40px;
    border-radius: var(--radius-control);
}
.logo-placeholder-icon {
    color: var(--text-muted);
    margin-bottom: var(--sp-2);
}
.logo-placeholder-text {
    font-size: var(--fs-2);
    color: var(--text-muted);
    margin: 0;
}
#brand-name-input {
    height: var(--field-h);
    box-sizing: border-box;
}
.theme-selector-container {
    display: flex;
    background: var(--surface-raised);
    padding: var(--sp-1);
    border-radius: var(--radius-control);
    gap: var(--sp-1);
}
/* Color trigger group: swatch + hex, one bordered group, equal height, and an
   accent focus-glow like every other field. The swatch fills its half edge to
   edge (no inner padding); a hairline divides it from the hex input. */
.color-input-container {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    padding: 0;
    width: 115px;
    height: var(--field-h);
    box-sizing: border-box;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}
.color-input-container:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-surface);
}
.color-swatch {
    width: var(--field-h);
    height: 100%;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface);
}
.color-input-container.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-surface);
}
/* Scoped to the container so it outranks the global input[type="text"] border
   rule (comp_styles_inputs.html) — otherwise the input draws its own border
   inside the container, doubling with the swatch divider + container edge. */
.color-input-container .color-text-input {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 var(--sp-2);
    height: 100%;
    width: 100%;
    min-width: 0;
    font-size: var(--fs-1);
    font-family: var(--font-mono, monospace);
    text-transform: uppercase;
    color: var(--text);
    outline: none;
    box-shadow: none;
}
.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
    gap: var(--sp-3);
    margin-bottom: var(--sp-3);
}
.colors-single-line-grid {
    display: grid;
    gap: var(--sp-4);
    margin-top: 0;
    width: max-content;
    justify-content: start;
    justify-items: start;
}
.page-colors-grid {
    grid-template-columns: repeat(5, 115px);
}
.nav-colors-grid {
    grid-template-columns: repeat(5, 115px);
}
/* Inline color-picker panel — expands as a row beneath a colors card. Reuses the
   spectrum/hue engine (ids custom-picker-spectrum / spectrum-cursor /
   custom-picker-hue are preserved), restyled here as cp-*. */
.cp-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.cp-panel.open { grid-template-rows: 1fr; }
.cp-panel > .cp-inner { min-height: 0; overflow: hidden; }
.cp-inner-pad {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    margin-top: var(--sp-3);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--border);
}

/* Library row (top): server-global swatches, add current, remove any */
.cp-library { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.cp-lib-swatch {
    position: relative;
    width: 24px; height: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    padding: 0; cursor: pointer;
    transition: var(--transition);
}
.cp-lib-swatch.active { box-shadow: 0 0 0 2px var(--accent); }
.cp-lib-remove {
    position: absolute; top: -6px; right: -6px;
    width: 15px; height: 15px; border-radius: 50%;
    background: var(--danger); color: var(--n-0);
    font-size: var(--fs-0); line-height: 15px; text-align: center;
    border: none; cursor: pointer; display: none; padding: 0;
}
.cp-lib-swatch:hover .cp-lib-remove { display: block; }
.cp-lib-add {
    width: 24px; height: 24px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px dashed var(--border); background: transparent;
    border-radius: var(--radius-control); color: var(--text-muted);
    cursor: pointer; transition: var(--transition);
}
.cp-lib-add:hover { border-color: var(--accent); color: var(--accent); }

/* Editor row: SV square · vertical hue · format inputs */
.cp-editor { display: flex; gap: var(--sp-4); align-items: flex-start; }
.cp-spectrum-wrap { position: relative; width: 200px; height: 150px; flex-shrink: 0; }
.cp-spectrum { width: 200px; height: 150px; border-radius: var(--radius-control); cursor: crosshair; display: block; }
.cp-cursor {
    position: absolute; width: 10px; height: 10px;
    border-radius: 50%; border: 2px solid var(--n-0);
    box-shadow: 0 0 0 1px var(--n-950);
    pointer-events: none; transform: translate(-50%, -50%);
}
.cp-hue {
    -webkit-appearance: none; appearance: none;
    width: 14px; height: 150px; flex-shrink: 0; margin: 0;
    writing-mode: vertical-lr;
    border-radius: var(--radius-control); cursor: pointer; outline: none;
    background: linear-gradient(to bottom, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}
.cp-hue::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 18px; height: 6px; border-radius: 2px;
    background: var(--surface); border: 1px solid var(--surface-dark); cursor: pointer;
}
.cp-hue::-moz-range-thumb {
    width: 18px; height: 6px; border-radius: 2px;
    background: var(--surface); border: 1px solid var(--surface-dark); cursor: pointer;
}
.cp-formats { display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; min-width: 0; }
.cp-format-tabs { display: inline-flex; align-self: flex-start; border: 1px solid var(--border); border-radius: var(--radius-control); overflow: hidden; }
.cp-fmt { padding: var(--sp-1) var(--sp-3); font-size: var(--fs-1); font-weight: var(--fw-600); background: var(--surface); color: var(--text-muted); border: none; cursor: pointer; }
.cp-fmt + .cp-fmt { border-left: 1px solid var(--border); }
.cp-fmt.active { background: var(--accent); color: var(--n-0); }
.cp-format-inputs { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.cp-num { display: flex; flex-direction: column; gap: var(--sp-1); }
.cp-num label { font-size: var(--fs-1); color: var(--text-muted); font-weight: var(--fw-600); text-transform: uppercase; letter-spacing: 0.05em; }
.cp-num input { width: 60px; }
.cp-num input.cp-hex-full { width: 120px; text-transform: uppercase; }
.form-actions-row {
    padding-top: var(--sp-4);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}
.domain-form-row {
    display: flex;
    gap: var(--sp-2);
}
.domain-error-text {
    display: none;
    margin-top: var(--sp-2);
    color: var(--danger);
    font-size: var(--fs-1);
    font-weight: var(--fw-600);
}
.dns-instructions-container {
    background: var(--surface-raised);
    padding: var(--sp-4);
    border-radius: var(--radius-control);
    border: 1px solid var(--border);
}
.dns-header {
    font-size: var(--fs-1);
    font-weight: var(--fw-700);
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--sp-3);
}
.dns-table {
    width: 100%;
    font-size: var(--fs-2);
}
.dns-th {
    padding: var(--sp-1) 0;
}
.dns-tr-none {
    border: none;
}
.dns-tr-border {
    border-top: 1px solid var(--border);
}
.dns-td-pad {
    padding: var(--sp-2) 0;
}
.dns-td-mono {
    padding: var(--sp-2) 0;
    font-family: monospace;
}
.error-text {
    color: var(--danger);
    font-size: var(--fs-1);
    font-weight: var(--fw-600);
}
