.iv2-shell {
    --iv2-line: rgba(148, 163, 184, .22);
    --iv2-panel: rgba(255, 255, 255, .04);
    --iv2-panel-strong: rgba(255, 255, 255, .06);
    color: inherit;
    background: transparent;
  }

  .iv2-shell * { letter-spacing: 0; }

  .iv2-wrap {
    width: min(72rem, calc(100% - 32px));
    margin: 0 auto;
  }

  .iv2-panel {
    border: 1px solid var(--iv2-line);
    border-radius: 8px;
    box-shadow: none;
  }

  .iv2-panel-plain {
    background: var(--iv2-panel-strong);
    border: 1px solid var(--iv2-line);
    border-radius: 8px;
  }

  .iv2-input, .iv2-select {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, .28);
    background: rgba(15, 23, 42, .12);
    color: inherit;
    border-radius: 7px;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13px;
    color-scheme: dark;
  }

  .iv2-select option {
    background: oklch(var(--b2));
    color: oklch(var(--bc) / 0.65);
  }
  .iv2-select option:hover {
    background: oklch(var(--b3));
    color: oklch(var(--bc) / 0.50);
  }

  .iv2-input[type="color"] {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 3px;
    border-radius: 8px;
    cursor: pointer;
  }

  .iv2-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: inherit;
    opacity: .82;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
  }

  .iv2-grid {
    display: grid;
    grid-template-columns: minmax(300px, 440px) minmax(360px, 1fr);
    gap: 18px;
    align-items: start;
  }

  .iv2-sticky {
    position: sticky;
    top: 92px;
  }

  .iv2-fieldset {
    border-top: 1px solid var(--iv2-line);
    padding-top: 18px;
    margin-top: 18px;
  }

  .iv2-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: hsl(var(--bc));
    margin-bottom: 12px;
  }

  .iv2-code {
    background: #07111f;
    color: #dbeafe;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, .22);
    min-height: 460px;
    max-height: 620px;
    overflow: auto;
    padding: 16px;
    font-size: 12px;
    line-height: 1.65;
    white-space: pre;
  }

  .iv2-preview-frame {
    --dd-bg: #ffffff;
    --dd-hover: #eff6ff;
    --dd-border: #cbd5e1;
    --dd-text: #111827;
    --dd-text-hover: #0f172a;
    --dd-muted: #64748b;
    --dd-muted-hover: #475569;
    --dd-type-text: #64748b;
    --dd-icon-bg: #e0f2fe;
    --dd-icon-bg-hover: #bae6fd;
    --dd-icon-text: #0284c7;
    --dd-icon-text-hover: #0369a1;
    --dd-shadow: 0 22px 48px rgba(15, 23, 42, .16);
    --dd-radius-top: 10px;
    --dd-radius-bottom: 10px;
    --dd-font-size: 14px;
    --dd-border-width: 1px;
    --dd-icon-radius: 2px;
    --dd-icon-img-radius: 2px;
    --dd-icon-border-width: 0px;
    --dd-icon-border-color: transparent;
    --dd-icon-box-shadow: none;
    --dd-icon-align: center;
    --dd-icon-justify: center;
    --dd-name-weight: 800;
    --dd-name-style: normal;
    --dd-meta-weight: 400;
    --dd-meta-style: normal;
    --dd-font-family: inherit;
  }

  .iv2-checkout {
    background: rgba(15, 23, 42, .12);
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 8px;
    padding: 16px;
  }

  .iv2-demo-input {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 7px 7px 0 0;
    background: rgba(15, 23, 42, .12);
    color: inherit;
    padding: 9px 12px;
    font-size: 14px;
  }

  .iv2-dropdown {
    background: var(--dd-bg);
    color: var(--dd-text);
    border: var(--dd-border-width, 1px) solid var(--dd-border);
    border-radius: var(--dd-radius-top) var(--dd-radius-top) var(--dd-radius-bottom) var(--dd-radius-bottom);
    box-shadow: var(--dd-shadow);
    overflow: hidden;
    margin-top: 0;
  }

  .iv2-dd-results {
    max-height: var(--dd-max-height, 320px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0;
  }

  .iv2-dd-item {
    display: grid;
    grid-template-columns: var(--dd-icon-width, 32px) 1fr auto;
    gap: var(--dd-icon-gap, 10px);
    align-items: start;
    padding: var(--dd-item-pt,10px) var(--dd-item-pr,12px) var(--dd-item-pb,10px) var(--dd-item-pl,12px);
    border-bottom: 1px solid color-mix(in srgb, var(--dd-border) 45%, transparent);
  }

  [data-preview-icons="none"] .iv2-dd-item {
    grid-template-columns: 1fr auto;
  }

  .iv2-dd-item:last-child { border-bottom: 0; }
  .iv2-dd-item:hover,
  .iv2-dd-item.is-active { background: var(--dd-hover); }
  .iv2-dd-item:hover .iv2-dd-name,
  .iv2-dd-item.is-active .iv2-dd-name { color: var(--dd-text-hover); }
  .iv2-dd-item:hover .iv2-dd-meta,
  .iv2-dd-item.is-active .iv2-dd-meta { color: var(--dd-muted-hover); }
  .iv2-dd-mark {
    width: var(--dd-icon-width, 32px);
    min-width: var(--dd-icon-width, 32px);
    height: var(--dd-icon-height, 21px);
    display: grid;
    align-items: var(--dd-icon-align, center);
    justify-items: var(--dd-icon-justify, center);
    align-self: var(--dd-mark-self-align, center);
    border-radius: var(--dd-icon-radius, 2px);
    border: var(--dd-icon-border-width, 0px) solid var(--dd-icon-border-color, transparent);
    box-shadow: var(--dd-icon-box-shadow, none);
    overflow: hidden;
    background: color-mix(in srgb, var(--dd-icon-bg) 72%, transparent);
    color: var(--dd-icon-text);
    line-height: 1;
    font-size: 14px;
  }
  .iv2-dd-item:hover .iv2-dd-mark,
  .iv2-dd-item.is-active .iv2-dd-mark {
    background: color-mix(in srgb, var(--dd-icon-bg-hover) 78%, transparent);
    color: var(--dd-icon-text-hover);
  }
  .iv2-dd-mark img {
    width: var(--dd-icon-img-w, 100%);
    height: var(--dd-icon-img-h, 100%);
    aspect-ratio: var(--dd-icon-img-aspect, auto);
    object-fit: var(--dd-icon-img-fit, contain);
    display: block;
    border-radius: var(--dd-icon-img-radius, 2px);
  }
  [data-preview-icon-mode="emoji"] .iv2-dd-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--dd-icon-height, 21px) * .72);
    padding-bottom: 0;
  }
  .iv2-dd-name { font-weight: var(--dd-name-weight, 800); font-style: var(--dd-name-style, normal); color: var(--dd-text); font-size: var(--dd-font-size, 14px); font-family: var(--dd-font-family, inherit); line-height: var(--dd-name-lh, 1.25); }
  .iv2-dd-meta { font-weight: var(--dd-meta-weight, 400); font-style: var(--dd-meta-style, normal); color: var(--dd-muted); font-size: 0.86em; margin-top: 2px; font-family: var(--dd-font-family, inherit); line-height: var(--dd-meta-lh, 1.35); }
  .iv2-dd-badge { color: var(--dd-type-text); font-size: 0.78em; font-weight: 800; }

  [data-preview-icon-inline="true"] .iv2-dd-item {
    grid-template-columns: 1fr auto;
  }
  [data-preview-icon-inline="true"] .iv2-dd-name {
    display: flex;
    align-items: center;
    gap: var(--dd-icon-gap, 10px);
  }
  [data-preview-icon-inline="true"] .iv2-dd-name .iv2-dd-mark {
    flex-shrink: 0;
  }

  .iv2-dd-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid var(--dd-border);
    padding: 7px 10px;
    background: var(--dd-bg);
    color: var(--dd-muted);
    font-size: 11px;
  }

  .iv2-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid rgba(14, 165, 233, .24);
    background: rgba(56, 189, 248, .12);
    color: currentColor;
    font-size: 12px;
    font-weight: 800;
  }

  .iv2-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .iv2-chip {
    border: 1px solid rgba(148, 163, 184, .26);
    background: rgba(15, 23, 42, .12);
    color: inherit;
    border-radius: 8px;
    min-height: 32px;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
  }

  .iv2-chip.is-active {
    background: #9bef8f;
    border-color: #9bef8f;
    color: #0f172a;
  }

  .iv2-color-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
  }

  .iv2-range-row {
    display: grid;
    grid-template-columns: 1fr 56px;
    gap: 10px;
    align-items: center;
  }

  .iv2-sel-wrap {
    display: flex;
  }
  .iv2-sel-type {
    flex-shrink: 0;
    width: auto;
    min-width: 82px;
    border-radius: 7px 0 0 7px;
    border: 1px solid rgba(148, 163, 184, .28);
    border-right: none;
    background: rgba(15, 23, 42, .22) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E") no-repeat right 7px center;
    color: inherit;
    min-height: 38px;
    padding: 6px 22px 6px 8px;
    font-size: 12px;
    cursor: pointer;
    appearance: none;
    color-scheme: dark;
  }
  .iv2-sel-val {
    flex: 1;
    min-width: 0;
    border-radius: 0 7px 7px 0;
    border: 1px solid rgba(148, 163, 184, .28);
    background: rgba(15, 23, 42, .12);
    color: inherit;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13px;
    width: 100%;
  }
  .iv2-sel-val:focus, .iv2-sel-type:focus,
  .iv2-input:focus, .iv2-select:focus {
    outline: none;
    position: relative;
    z-index: 1;
  }

  .iv2-view-panel[hidden],
  .iv2-optional[hidden],
  .iv2-settings-panel[hidden],
  [data-color-panel][hidden],
  [data-width-control][hidden],
  [data-custom-colors-section][hidden],
  [data-analyzer-body][hidden],
  [data-sel-body][hidden],
  [data-design-subpanel][hidden],
  [data-preview-tab-panel][hidden],
  [data-address-mode-combined][hidden],
  [data-address-mode-split][hidden] {
    display: none !important;
  }

  .iv2-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: 0;
  }
  .iv2-live-badge.is-live {
    background: rgba(34,197,94,.14);
    color: #16a34a;
    border: 1px solid rgba(34,197,94,.28);
  }
  .iv2-live-badge.is-demo {
    background: rgba(148,163,184,.14);
    color: #64748b;
    border: 1px solid rgba(148,163,184,.26);
  }
  .iv2-live-badge.is-loading {
    background: rgba(56,189,248,.12);
    color: #0284c7;
    border: 1px solid rgba(56,189,248,.26);
  }

  .iv2-preview-hint {
    font-size: 11px;
    color: inherit;
    opacity: .55;
    margin-top: 6px;
    padding: 0 2px;
  }

  .iv2-input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
  }
  .iv2-input-icon-wrap .iv2-demo-input {
    padding-left: 34px;
  }
  .iv2-demo-icon {
    position: absolute;
    left: 10px;
    color: var(--dd-icon-text, #0284c7);
    pointer-events: none;
    font-size: 14px;
    z-index: 1;
  }

  @media (max-width: 1180px) {
    .iv2-grid { grid-template-columns: 1fr; }
    .iv2-sticky { position: static; }
    .iv2-code { min-height: 360px; }
  }

  @media (max-width: 640px) {
    .iv2-wrap { width: min(100% - 20px, 1440px); }
  }

  /* === Floating label - settings panel inputs/selects === */
  /* Applies automatically via :has() - no HTML class needed.
     Covers both .grid children and standalone labels (e.g. DaisyUI theme select).
     Excludes: flex-layout labels (.flex), toggle labels (:has(> .toggle)). */
  .iv2-settings-panel label:has(> .iv2-label):not(:has(> .toggle)):not(.flex),
  .iv2-settings-panel .grid > div:has(> .iv2-label) {
    position: relative;
    display: block;
    padding-top: 9px;
  }

  .iv2-settings-panel label:has(> .iv2-label):not(:has(> .toggle)):not(.flex) > .iv2-label,
  .iv2-settings-panel .grid > div:has(> .iv2-label) > .iv2-label {
    position: absolute;
    top: 0;
    left: 8px;
    padding: 0 4px;
    background: hsl(var(--b2));
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.6;
    color: inherit;
    opacity: .85;
    z-index: 1;
    pointer-events: none;
    display: block;
    margin-bottom: 0;
    white-space: nowrap;
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Color row - .iv2-color-row is the single bordered container, inputs inside have no border */
  .iv2-settings-panel label:has(> .iv2-label):not(:has(> .toggle)):not(.flex) > .iv2-color-row {
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 7px;
    background: rgba(15, 23, 42, .12);
    padding: 4px 8px;
    align-items: center;
  }
  .iv2-color-row .iv2-input {
    border: none;
    background: transparent;
    min-height: auto;
    padding: 2px 4px;
  }
  .iv2-color-row .iv2-input[type="color"] {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 2px;
  }

  /* Range row gets a subtle container border too */
  .iv2-settings-panel label:has(> .iv2-label):not(:has(> .toggle)):not(.flex) > .iv2-range-row,
  .iv2-settings-panel .grid > div:has(> .iv2-label) > .iv2-range-row {
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 7px;
    padding: 5px 8px;
  }

  .iv2-density-presets {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    flex-wrap: wrap;
  }

  .iv2-density-presets .btn { font-size: 11px; }

  .iv2-display-divider {
    display: flex; align-items: center; gap: 6px; margin: 5px 0;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: oklch(var(--bc)/.4); pointer-events: none; user-select: none;
  }
  .iv2-display-divider::before, .iv2-display-divider::after {
    content: ''; flex: 1; height: 1px; background: oklch(var(--bc)/.12);
  }
  #displayAddrFieldList.is-singleline .iv2-display-divider { opacity: .25; }
