@layer components {
  body[data-page="campaign-creative-tracker"] {
    --ctc-navy: #071f42;
    --ctc-navy-2: #0b2f61;
    --ctc-blue: #075ee5;
    --ctc-blue-dark: #0649b6;
    --ctc-blue-soft: #edf5ff;
    --ctc-text: #10213a;
    --ctc-muted: #5b687b;
    --ctc-border: #d9e1eb;
    --ctc-border-strong: #b9c7d9;
    --ctc-surface: #ffffff;
    --ctc-subtle: #f6f8fb;
    --ctc-green: #178548;
    --ctc-green-soft: #e9f7ef;
    --ctc-amber: #b65d08;
    --ctc-amber-soft: #fff3df;
    --ctc-red: #b42318;
    --ctc-red-soft: #fff0ee;
    --ctc-radius: 10px;
    --ctc-shadow: 0 18px 45px rgba(7, 31, 66, 0.09);
    color: var(--ctc-text);
    background: #fff;
  }

  body[data-page="campaign-creative-tracker"] .tools-hero {
    min-height: 0;
    padding: clamp(18px, 2vw, 26px) 0 clamp(16px, 1.8vw, 22px);
    background: #fff;
    color: var(--ctc-text);
  }

  body[data-page="campaign-creative-tracker"] .tools-hero .wrapper {
    max-width: min(1560px, calc(100vw - 40px));
  }

  body[data-page="campaign-creative-tracker"] .tools-hero .hero-eyebrow {
    margin: 0 0 10px;
    color: var(--ctc-blue);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  body[data-page="campaign-creative-tracker"] .tools-hero:not([data-page-masthead]) h1 {
    margin: 0;
    width: auto !important;
    max-width: none !important;
    color: var(--ctc-navy);
    font-size: clamp(2rem, 3vw, 2.75rem) !important;
    line-height: 1.04;
    letter-spacing: -0.045em;
  }

  body[data-page="campaign-creative-tracker"] .tools-hero .hero-summary {
    max-width: 850px;
    margin: 9px 0 0;
    color: var(--ctc-muted);
    font-size: clamp(1rem, 1.5vw, 1.16rem);
    line-height: 1.55;
  }

  body[data-page="campaign-creative-tracker"] .ctc-section {
    padding: 0 0 clamp(64px, 8vw, 110px);
    background: #fff;
  }

  body[data-page="campaign-creative-tracker"] .ctc-page-wrapper {
    width: 100%;
    max-width: min(1700px, calc(100vw - 24px)) !important;
    padding-inline: 0;
  }

  .ctc-app {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--ctc-border);
    border-radius: 14px;
    background: var(--ctc-surface);
    box-shadow: var(--ctc-shadow);
    font-family: var(--font-sans, "Inter", "Segoe UI", Arial, sans-serif);
  }

  .ctc-app *,
  .ctc-dialog * {
    box-sizing: border-box;
  }

  .ctc-loading,
  .ctc-empty {
    display: grid;
    min-height: 380px;
    place-items: center;
    padding: 40px;
    color: var(--ctc-muted);
    text-align: center;
  }

  .ctc-empty {
    align-content: center;
    gap: 8px;
  }

  .ctc-empty h2,
  .ctc-empty p {
    margin: 0;
  }

  .ctc-app-header {
    display: grid;
    grid-template-columns: minmax(210px, 0.8fr) minmax(420px, 1.6fr) minmax(250px, 0.9fr);
    min-width: 0;
    min-height: 78px;
    align-items: center;
    gap: 24px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--ctc-border);
    background: #fff;
  }

  .ctc-app-title {
    min-width: 0;
  }

  .ctc-app-title h2,
  .ctc-app-title p {
    margin: 0;
  }

  .ctc-app-title h2 {
    color: var(--ctc-navy);
    font-size: 1.35rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
  }

  .ctc-app-title p {
    margin-top: 5px;
    overflow: hidden;
    color: var(--ctc-muted);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ctc-view-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
    padding: 4px;
    border: 1px solid var(--ctc-border);
    border-radius: 9px;
    background: var(--ctc-subtle);
  }

  .ctc-view-tabs button {
    display: flex;
    min-width: 0;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border: 0;
    border-radius: 6px;
    color: var(--ctc-muted);
    background: transparent;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
  }

  .ctc-view-tabs button:hover {
    color: var(--ctc-navy);
  }

  .ctc-view-tabs button.is-active {
    color: var(--ctc-blue);
    background: #fff;
    box-shadow: 0 2px 8px rgba(7, 31, 66, 0.1);
  }

  .ctc-view-tabs svg,
  .ctc-button svg,
  .ctc-icon-button svg,
  .ctc-import-button svg,
  .ctc-family-card > svg,
  .ctc-metric svg,
  .ctc-validation svg,
  .ctc-qa-row svg,
  .ctc-dashboard-qa svg,
  .ctc-activity-item svg,
  .ctc-timeline-item svg,
  .ctc-attention svg,
  .ctc-tree-row svg,
  .ctc-package-meta svg,
  .ctc-manifest-row svg,
  .ctc-file-drop svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .ctc-app-actions,
  .ctc-toolbar-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  .ctc-button,
  .ctc-icon-button,
  .ctc-text-button,
  .ctc-import-button {
    font-family: inherit;
  }

  .ctc-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
  }

  .ctc-button-primary {
    border-color: var(--ctc-blue);
    color: #fff;
    background: var(--ctc-blue);
  }

  .ctc-button-primary:hover {
    border-color: var(--ctc-blue-dark);
    background: var(--ctc-blue-dark);
  }

  .ctc-button-secondary {
    border-color: var(--ctc-border-strong);
    color: var(--ctc-blue-dark);
    background: #fff;
  }

  .ctc-button-secondary:hover {
    border-color: var(--ctc-blue);
    background: var(--ctc-blue-soft);
  }

  .ctc-button-ghost {
    border-color: transparent;
    color: var(--ctc-muted);
    background: transparent;
  }

  .ctc-button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
  }

  .ctc-mobile-back {
    display: none;
  }

  .ctc-icon-button {
    display: inline-grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 1px solid var(--ctc-border);
    border-radius: 7px;
    color: var(--ctc-muted);
    background: #fff;
    cursor: pointer;
  }

  .ctc-icon-button:hover {
    border-color: var(--ctc-blue);
    color: var(--ctc-blue);
    background: var(--ctc-blue-soft);
  }

  .ctc-text-button {
    padding: 4px 0;
    border: 0;
    color: var(--ctc-blue);
    background: transparent;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
  }

  .ctc-view {
    min-width: 0;
    background: #fff;
  }

  .ctc-library-layout {
    display: grid;
    grid-template-columns: minmax(230px, 0.72fr) minmax(410px, 1.6fr) minmax(360px, 1.05fr);
    min-width: 0;
    min-height: 720px;
  }

  .ctc-family-pane,
  .ctc-rendition-pane,
  .ctc-inspector {
    min-width: 0;
    background: #fff;
  }

  .ctc-family-pane,
  .ctc-rendition-pane {
    padding: 18px;
  }

  .ctc-family-pane {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--ctc-border);
    background: var(--ctc-subtle);
  }

  .ctc-rendition-pane {
    border-right: 1px solid var(--ctc-border);
  }

  .ctc-inspector {
    padding: 20px;
  }

  .ctc-pane-heading,
  .ctc-inspector-header,
  .ctc-section-heading {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
  }

  .ctc-pane-heading h3,
  .ctc-pane-heading p,
  .ctc-inspector-header h3,
  .ctc-inspector-header p,
  .ctc-section-heading h4,
  .ctc-section-heading p {
    margin: 0;
  }

  .ctc-pane-heading h3,
  .ctc-inspector-header h3 {
    color: var(--ctc-navy);
    font-size: 1.05rem;
    letter-spacing: -0.01em;
  }

  .ctc-pane-heading p,
  .ctc-inspector-header p,
  .ctc-section-heading p {
    margin-top: 4px;
    color: var(--ctc-muted);
    font-size: 0.74rem;
    line-height: 1.45;
  }

  .ctc-pane-heading-main {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ctc-border);
  }

  .ctc-overline {
    margin: 0 0 5px !important;
    color: var(--ctc-blue) !important;
    font-size: 0.66rem !important;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .ctc-family-id {
    display: grid;
    justify-items: end;
    gap: 2px;
    color: var(--ctc-muted);
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .ctc-family-id strong {
    color: var(--ctc-navy);
    font-size: 0.75rem;
  }

  .ctc-family-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
  }

  .ctc-family-card {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) 18px;
    min-width: 0;
    min-height: 92px;
    align-items: center;
    gap: 12px;
    padding: 9px;
    border: 1px solid var(--ctc-border);
    border-radius: 9px;
    color: var(--ctc-text);
    background: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  .ctc-family-card:hover {
    border-color: var(--ctc-border-strong);
    box-shadow: 0 8px 22px rgba(7, 31, 66, 0.07);
  }

  .ctc-family-card.is-selected {
    border-color: var(--ctc-blue);
    background: var(--ctc-blue-soft);
    box-shadow: 0 0 0 1px var(--ctc-blue);
  }

  .ctc-family-card > svg {
    width: 16px;
    height: 16px;
    color: var(--ctc-muted);
  }

  .ctc-family-card-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
  }

  .ctc-family-card-copy strong,
  .ctc-family-card-copy span,
  .ctc-family-card-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ctc-family-card-copy strong {
    color: var(--ctc-navy);
    font-size: 0.82rem;
  }

  .ctc-family-card-copy span {
    color: var(--ctc-muted);
    font-size: 0.72rem;
  }

  .ctc-family-card-copy small {
    color: var(--ctc-blue-dark);
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: capitalize;
  }

  .ctc-import-button {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: auto;
    padding: 10px 14px;
    border: 1px dashed var(--ctc-border-strong);
    border-radius: 8px;
    color: var(--ctc-blue-dark);
    background: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
  }

  .ctc-import-button:hover {
    border-color: var(--ctc-blue);
    background: var(--ctc-blue-soft);
  }

  .ctc-asset {
    position: relative;
    display: grid;
    width: 100%;
    min-width: 0;
    min-height: 84px;
    overflow: hidden;
    place-items: center;
    border-radius: 7px;
    background: #e8edf4;
  }

  .ctc-asset img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 84px;
    object-fit: cover;
  }

  .ctc-asset.is-compact {
    width: 82px;
    min-height: 66px;
    aspect-ratio: 4 / 3;
    flex: 0 0 auto;
  }

  .ctc-asset.is-compact img {
    min-height: 66px;
  }

  .ctc-asset-empty {
    gap: 5px;
    padding: 12px;
    color: var(--ctc-muted);
    background: #eef2f6;
    font-size: 0.67rem;
    text-align: center;
  }

  .ctc-asset-empty svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
  }

  .ctc-play {
    position: absolute;
    inset: 50% auto auto 50%;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    color: #fff;
    background: rgba(7, 31, 66, 0.76);
    transform: translate(-50%, -50%);
  }

  .ctc-play svg {
    width: 19px;
    height: 19px;
    margin-left: 2px;
    fill: currentColor;
    stroke: currentColor;
  }

  .ctc-rendition-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: 12px;
  }

  .ctc-rendition-card {
    display: grid;
    min-width: 0;
    align-content: start;
    padding: 8px;
    border: 1px solid var(--ctc-border);
    border-radius: 9px;
    color: var(--ctc-text);
    background: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  .ctc-rendition-card:hover {
    border-color: var(--ctc-border-strong);
    box-shadow: 0 9px 24px rgba(7, 31, 66, 0.08);
  }

  .ctc-rendition-card.is-selected {
    border-color: var(--ctc-blue);
    box-shadow: 0 0 0 2px rgba(7, 94, 229, 0.18);
  }

  .ctc-rendition-card.is-wide {
    grid-column: span 2;
  }

  .ctc-rendition-card.is-wide .ctc-asset {
    aspect-ratio: 4 / 1;
  }

  .ctc-rendition-card.is-tall {
    grid-row: span 2;
  }

  .ctc-rendition-card.is-tall .ctc-asset {
    min-height: 255px;
  }

  .ctc-rendition-card:not(.is-wide):not(.is-tall) .ctc-asset {
    aspect-ratio: 16 / 9;
  }

  .ctc-rendition-copy {
    display: grid;
    gap: 9px;
    padding: 10px 3px 3px;
  }

  .ctc-rendition-copy > span:first-child {
    display: grid;
    gap: 3px;
  }

  .ctc-rendition-copy strong {
    color: var(--ctc-navy);
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .ctc-rendition-copy small {
    color: var(--ctc-muted);
    font-size: 0.66rem;
  }

  .ctc-rendition-tags {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
  }

  .ctc-format,
  .ctc-status {
    display: inline-flex;
    min-height: 23px;
    align-items: center;
    padding: 3px 7px;
    border: 1px solid var(--ctc-border);
    border-radius: 5px;
    color: var(--ctc-muted);
    background: var(--ctc-subtle);
    font-size: 0.61rem;
    font-weight: 800;
    line-height: 1;
  }

  .ctc-format-interactive {
    border-color: #9bd1ae;
    color: #116c38;
    background: var(--ctc-green-soft);
  }

  .ctc-format-animated {
    border-color: #c5b8ff;
    color: #5a3eb5;
    background: #f0edff;
  }

  .ctc-format-video,
  .ctc-format-ctv {
    border-color: #adc9f7;
    color: var(--ctc-blue-dark);
    background: var(--ctc-blue-soft);
  }

  .ctc-status-override {
    border-color: #f2c685;
    color: var(--ctc-amber);
    background: var(--ctc-amber-soft);
  }

  .ctc-validation {
    display: inline-grid;
    width: 23px;
    height: 23px;
    margin-left: auto;
    place-items: center;
    border-radius: 50%;
  }

  .ctc-validation svg {
    width: 14px;
    height: 14px;
  }

  .ctc-validation.is-valid {
    color: var(--ctc-green);
    background: var(--ctc-green-soft);
  }

  .ctc-validation.is-error {
    color: var(--ctc-red);
    background: var(--ctc-red-soft);
  }

  .ctc-inspector-header {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ctc-border);
  }

  .ctc-inheritance-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    color: var(--ctc-muted);
    font-size: 0.72rem;
  }

  .ctc-inheritance-summary svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
  }

  .ctc-rule-grid {
    display: grid;
    gap: 9px;
  }

  .ctc-rule-field {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    min-width: 0;
    align-items: center;
    gap: 9px;
  }

  .ctc-rule-label {
    color: var(--ctc-muted);
    font-size: 0.72rem;
    font-weight: 700;
  }

  .ctc-rule-field select,
  .ctc-field select,
  .ctc-field input,
  .ctc-override-grid select {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 8px 30px 8px 10px;
    border: 1px solid var(--ctc-border-strong);
    border-radius: 6px;
    color: var(--ctc-text);
    background-color: #fff;
    font: inherit;
    font-size: 0.76rem;
  }

  .ctc-rule-field select:focus,
  .ctc-field select:focus,
  .ctc-field input:focus,
  .ctc-override-grid select:focus {
    border-color: var(--ctc-blue);
    outline: 2px solid rgba(7, 94, 229, 0.15);
    outline-offset: 1px;
  }

  .ctc-rule-field small {
    color: var(--ctc-muted);
    font-size: 0.6rem;
    white-space: nowrap;
  }

  .ctc-rule-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--ctc-border);
  }

  .ctc-section-heading h4 {
    color: var(--ctc-navy);
    font-size: 0.86rem;
  }

  .ctc-destination-grid,
  .ctc-override-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 12px;
  }

  .ctc-field {
    display: grid;
    min-width: 0;
    gap: 6px;
  }

  .ctc-field > span {
    color: var(--ctc-muted);
    font-size: 0.68rem;
    font-weight: 800;
  }

  .ctc-field input:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    background: var(--ctc-subtle);
  }

  .ctc-segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid var(--ctc-border-strong);
    border-radius: 7px;
  }

  .ctc-segmented button {
    min-height: 38px;
    padding: 7px 8px;
    border: 0;
    border-right: 1px solid var(--ctc-border);
    color: var(--ctc-muted);
    background: #fff;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
  }

  .ctc-segmented button:last-child {
    border-right: 0;
  }

  .ctc-segmented button.is-active {
    color: var(--ctc-blue);
    background: var(--ctc-blue-soft);
    box-shadow: inset 0 0 0 1px var(--ctc-blue);
  }

  .ctc-override-section {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--ctc-border);
    border-radius: 8px;
    background: var(--ctc-subtle);
  }

  .ctc-override-section.is-enabled {
    border-color: #9cc1fb;
    background: #f7fbff;
  }

  .ctc-switch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ctc-muted);
    font-size: 0.67rem;
    font-weight: 800;
    cursor: pointer;
  }

  .ctc-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .ctc-switch span {
    position: relative;
    width: 37px;
    height: 21px;
    border-radius: 999px;
    background: #b9c4d1;
    transition: background 160ms ease;
  }

  .ctc-switch span::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(7, 31, 66, 0.24);
    content: "";
    transition: transform 160ms ease;
  }

  .ctc-switch input:checked + span {
    background: var(--ctc-blue);
  }

  .ctc-switch input:checked + span::after {
    transform: translateX(16px);
  }

  .ctc-switch em {
    font-style: normal;
  }

  .ctc-inherit-note {
    margin: 12px 0 0;
    color: var(--ctc-muted);
    font-size: 0.72rem;
    line-height: 1.5;
  }

  .ctc-qa-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
  }

  .ctc-qa-row svg {
    width: 17px;
    height: 17px;
  }

  .ctc-qa-row.is-valid {
    color: #116b39;
    background: var(--ctc-green-soft);
  }

  .ctc-qa-row.is-error {
    color: var(--ctc-red);
    background: var(--ctc-red-soft);
  }

  .ctc-qa-row a {
    margin-left: auto;
    color: currentColor;
    font-weight: 800;
  }

  .ctc-link-list {
    display: grid;
    gap: 7px;
    margin-top: 10px;
  }

  .ctc-link-preview {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-width: 0;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--ctc-border);
    border-radius: 6px;
    background: #fff;
    color: var(--ctc-muted);
    font-size: 0.66rem;
  }

  .ctc-link-preview > svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
  }

  .ctc-link-preview.is-error {
    color: var(--ctc-red);
    background: var(--ctc-red-soft);
  }

  .ctc-link-variant {
    display: inline-grid;
    min-width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 4px;
    color: #fff;
    background: var(--ctc-blue);
    font-weight: 800;
  }

  .ctc-link-preview code {
    overflow: hidden;
    color: var(--ctc-text);
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ctc-link-preview .ctc-icon-button {
    width: 29px;
    height: 29px;
  }

  .ctc-link-preview .ctc-icon-button svg {
    width: 15px;
    height: 15px;
  }

  .ctc-dashboard,
  .ctc-export {
    min-width: 0;
    background: #fff;
  }

  .ctc-dashboard {
    padding: 24px;
  }

  .ctc-dashboard-toolbar {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }

  .ctc-dashboard-toolbar h2,
  .ctc-dashboard-toolbar p {
    margin: 0;
  }

  .ctc-dashboard-toolbar h2 {
    color: var(--ctc-navy);
    font-size: 1.7rem;
    letter-spacing: -0.035em;
  }

  .ctc-dashboard-toolbar p {
    margin-top: 4px;
    color: var(--ctc-muted);
  }

  .ctc-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0;
  }

  .ctc-metric {
    display: grid;
    grid-template-columns: 38px auto;
    min-width: 0;
    align-items: center;
    column-gap: 10px;
    padding: 14px;
    border: 1px solid var(--ctc-border);
    border-radius: 8px;
    background: #fff;
  }

  .ctc-metric-icon {
    display: grid;
    width: 38px;
    height: 38px;
    grid-row: 1 / 3;
    place-items: center;
    border-radius: 50%;
    color: var(--ctc-blue);
    background: var(--ctc-blue-soft);
  }

  .ctc-metric strong {
    color: var(--ctc-blue-dark);
    font-size: 1.4rem;
    line-height: 1;
  }

  .ctc-metric > span:last-child {
    overflow: hidden;
    color: var(--ctc-muted);
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ctc-metric.is-success .ctc-metric-icon {
    color: var(--ctc-green);
    background: var(--ctc-green-soft);
  }

  .ctc-metric.is-success strong {
    color: var(--ctc-green);
  }

  .ctc-metric.is-error .ctc-metric-icon {
    color: var(--ctc-red);
    background: var(--ctc-red-soft);
  }

  .ctc-metric.is-error strong {
    color: var(--ctc-red);
  }

  .ctc-dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 0.28fr);
    min-width: 0;
    gap: 18px;
  }

  .ctc-dashboard-table,
  .ctc-activity-rail section,
  .ctc-attention {
    border: 1px solid var(--ctc-border);
    border-radius: 8px;
    background: #fff;
  }

  .ctc-dashboard-table-header {
    padding: 14px 16px 8px;
  }

  .ctc-dashboard-table-header h3 {
    margin: 0 0 12px;
    color: var(--ctc-navy);
    font-size: 1rem;
  }

  .ctc-dashboard-columns {
    display: grid;
    grid-template-columns: minmax(250px, 1.35fr) 0.55fr minmax(190px, 1fr) 0.65fr 0.55fr 0.45fr;
    gap: 12px;
    padding: 0 26px 0 52px;
    color: var(--ctc-muted);
    font-size: 0.6rem;
    font-weight: 800;
  }

  .ctc-dashboard-list {
    display: grid;
    gap: 7px;
    padding: 0 10px 10px;
  }

  .ctc-dashboard-family {
    overflow: hidden;
    border: 1px solid var(--ctc-border);
    border-radius: 7px;
  }

  .ctc-dashboard-family.is-expanded {
    border-color: #a9c8f7;
  }

  .ctc-dashboard-family-row {
    display: grid;
    grid-template-columns: 22px 72px minmax(150px, 1fr) 0.55fr minmax(170px, 1fr) 0.65fr 0.55fr 0.45fr;
    width: 100%;
    min-width: 0;
    min-height: 72px;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 0;
    color: var(--ctc-text);
    background: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  .ctc-dashboard-family.is-expanded .ctc-dashboard-family-row {
    background: var(--ctc-blue-soft);
  }

  .ctc-dashboard-chevron {
    display: grid;
    place-items: center;
    color: var(--ctc-blue);
    transition: transform 160ms ease;
  }

  .ctc-dashboard-chevron svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
  }

  .ctc-dashboard-family.is-expanded .ctc-dashboard-chevron {
    transform: rotate(90deg);
  }

  .ctc-dashboard-name {
    display: grid;
    min-width: 0;
    gap: 3px;
  }

  .ctc-dashboard-name strong,
  .ctc-dashboard-name small,
  .ctc-dashboard-utm {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ctc-dashboard-name strong {
    color: var(--ctc-navy);
    font-size: 0.76rem;
  }

  .ctc-dashboard-name small,
  .ctc-dashboard-partner,
  .ctc-dashboard-test,
  .ctc-dashboard-count {
    color: var(--ctc-muted);
    font-size: 0.65rem;
  }

  .ctc-dashboard-partner {
    text-transform: capitalize;
  }

  .ctc-dashboard-utm {
    color: var(--ctc-blue-dark);
    font-size: 0.64rem;
    font-weight: 700;
  }

  .ctc-dashboard-count {
    text-align: center;
  }

  .ctc-dashboard-qa {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.63rem;
    font-weight: 800;
  }

  .ctc-dashboard-qa svg {
    width: 17px;
    height: 17px;
  }

  .ctc-dashboard-qa.is-valid {
    color: var(--ctc-green);
  }

  .ctc-dashboard-qa.is-error {
    color: var(--ctc-red);
  }

  .ctc-dashboard-children {
    border-top: 1px solid var(--ctc-border);
    background: #fff;
  }

  .ctc-dashboard-child {
    position: relative;
    display: grid;
    grid-template-columns: 72px minmax(150px, 1fr) minmax(170px, 1fr) 0.65fr 0.55fr;
    min-width: 0;
    min-height: 62px;
    align-items: center;
    gap: 10px;
    margin-left: 44px;
    padding: 7px 12px;
    border-bottom: 1px solid #edf1f5;
  }

  .ctc-dashboard-child:last-child {
    border-bottom: 0;
  }

  .ctc-dashboard-child .ctc-tree-line {
    position: absolute;
    top: -1px;
    bottom: 50%;
    left: -22px;
    width: 14px;
    border-bottom: 1px dashed #9db0c7;
    border-left: 1px dashed #9db0c7;
  }

  .ctc-activity-rail {
    display: grid;
    align-content: start;
    gap: 12px;
  }

  .ctc-activity-rail section {
    padding: 16px;
  }

  .ctc-activity-rail h3 {
    margin: 0 0 14px;
    color: var(--ctc-navy);
    font-size: 0.92rem;
  }

  .ctc-activity-item,
  .ctc-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }

  .ctc-activity-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--ctc-blue);
  }

  .ctc-activity-item > div,
  .ctc-timeline-item > div {
    display: grid;
    gap: 3px;
  }

  .ctc-activity-item strong,
  .ctc-timeline-item strong {
    color: var(--ctc-navy);
    font-size: 0.74rem;
  }

  .ctc-activity-item span,
  .ctc-activity-item small,
  .ctc-timeline-item span {
    color: var(--ctc-muted);
    font-size: 0.65rem;
  }

  .ctc-timeline-item + .ctc-timeline-item {
    margin-top: 14px;
  }

  .ctc-timeline-item > svg {
    width: 22px;
    height: 22px;
    padding: 3px;
    border: 1px solid var(--ctc-green);
    border-radius: 50%;
    color: var(--ctc-green);
  }

  .ctc-attention {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 13px;
    border-color: #efc27b;
    color: var(--ctc-amber);
    background: var(--ctc-amber-soft);
    font-size: 0.69rem;
    font-weight: 800;
  }

  .ctc-export-header {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 28px;
    color: #fff;
    background: var(--ctc-navy);
  }

  .ctc-export-header h2,
  .ctc-export-header p {
    margin: 0;
  }

  .ctc-export-header h2 {
    color: #fff !important;
    font-size: 1.45rem;
    letter-spacing: -0.025em;
  }

  .ctc-export-header p {
    margin-top: 5px;
    color: #c9d7e7 !important;
    font-size: 0.74rem;
  }

  .ctc-export-header dl {
    display: flex;
    margin: 0;
  }

  .ctc-export-header dl div {
    min-width: 116px;
    padding: 0 18px;
    border-left: 1px solid rgba(255, 255, 255, 0.32);
  }

  .ctc-export-header dt,
  .ctc-export-header dd {
    margin: 0;
  }

  .ctc-export-header dt {
    color: #aebfd3;
    font-size: 0.61rem;
    font-weight: 700;
  }

  .ctc-export-header dd {
    margin-top: 4px;
    font-size: 0.73rem;
    font-weight: 800;
  }

  .ctc-export-header dd.is-ready {
    color: #76e19a;
  }

  .ctc-export-header dd.is-error {
    color: #ffb4ac;
  }

  .ctc-export-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    border-bottom: 1px solid var(--ctc-border);
    background: #fff;
  }

  .ctc-export-metrics span {
    padding: 15px;
    border-right: 1px solid var(--ctc-border);
    color: var(--ctc-muted);
    font-size: 0.69rem;
    text-align: center;
  }

  .ctc-export-metrics span:last-child {
    border-right: 0;
  }

  .ctc-export-metrics strong {
    margin-right: 5px;
    color: var(--ctc-blue-dark);
    font-size: 1rem;
  }

  .ctc-export-metrics .is-success strong {
    color: var(--ctc-green);
  }

  .ctc-export-metrics .is-error strong {
    color: var(--ctc-red);
  }

  .ctc-export-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
    min-width: 0;
  }

  .ctc-export-formats {
    min-width: 0;
    padding: 16px 28px;
    border-right: 1px solid var(--ctc-border);
  }

  .ctc-export-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    min-width: 0;
    align-items: center;
    gap: 18px;
    min-height: 105px;
    border-bottom: 1px solid var(--ctc-border);
  }

  .ctc-export-row:last-child {
    border-bottom: 0;
  }

  .ctc-export-check {
    display: grid;
    grid-template-columns: 27px 54px;
    align-items: center;
    gap: 12px;
    cursor: pointer;
  }

  .ctc-export-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .ctc-export-check > span {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border: 1px solid var(--ctc-border-strong);
    border-radius: 4px;
    color: #fff;
    background: #fff;
  }

  .ctc-export-check input:checked + span {
    border-color: var(--ctc-blue);
    background: var(--ctc-blue);
  }

  .ctc-export-check > span svg {
    width: 16px;
    height: 16px;
  }

  .ctc-export-check em {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border: 1px solid var(--ctc-border);
    border-radius: 7px;
    color: var(--ctc-blue);
    background: var(--ctc-subtle);
    font-style: normal;
  }

  .ctc-export-check em svg {
    width: 29px;
    height: 29px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
  }

  .ctc-export-copy {
    min-width: 0;
  }

  .ctc-export-copy h3,
  .ctc-export-copy p {
    margin: 0;
  }

  .ctc-export-copy h3 {
    color: var(--ctc-navy);
    font-size: 0.96rem;
  }

  .ctc-export-copy h3 small {
    color: var(--ctc-muted);
    font-size: 0.68rem;
    font-weight: 600;
  }

  .ctc-export-copy p {
    margin-top: 5px;
    color: var(--ctc-muted);
    font-size: 0.69rem;
    line-height: 1.45;
  }

  .ctc-package-contents {
    min-width: 0;
    padding: 22px;
    background: var(--ctc-subtle);
  }

  .ctc-package-contents > h3 {
    margin: 0 0 15px;
    color: var(--ctc-navy);
    font-size: 1rem;
  }

  .ctc-package-tree {
    display: grid;
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ctc-border);
  }

  .ctc-tree-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    min-width: 0;
    align-items: center;
    gap: 8px;
    color: var(--ctc-text);
    font-size: 0.7rem;
  }

  .ctc-tree-row svg {
    width: 17px;
    height: 17px;
    color: var(--ctc-blue);
  }

  .ctc-tree-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ctc-tree-row small {
    color: var(--ctc-muted);
  }

  .ctc-tree-row.is-family {
    padding-left: 18px;
  }

  .ctc-tree-row.is-rendition {
    padding-left: 42px;
    color: var(--ctc-muted);
  }

  .ctc-package-meta {
    display: grid;
    gap: 4px;
    margin: 16px 0;
    padding: 14px;
    border: 1px solid var(--ctc-border);
    border-radius: 7px;
    background: #fff;
  }

  .ctc-package-meta strong {
    color: var(--ctc-navy);
    font-size: 0.75rem;
  }

  .ctc-package-meta span,
  .ctc-package-meta small {
    color: var(--ctc-muted);
    font-size: 0.65rem;
  }

  .ctc-package-meta small {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--ctc-green);
    font-weight: 800;
  }

  .ctc-package-meta small svg {
    width: 14px;
    height: 14px;
  }

  .ctc-manifest-row,
  .ctc-version-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--ctc-border);
    color: var(--ctc-text);
    font-size: 0.68rem;
    font-weight: 700;
  }

  .ctc-manifest-row svg {
    width: 17px;
    height: 17px;
  }

  .ctc-manifest-row svg:last-child {
    margin-left: auto;
  }

  .ctc-version-row {
    display: grid;
    gap: 9px;
  }

  .ctc-version-row > div {
    display: flex;
    gap: 8px;
  }

  .ctc-version-row button {
    min-width: 42px;
    padding: 5px 10px;
    border: 1px solid var(--ctc-border);
    border-radius: 999px;
    color: var(--ctc-muted);
    background: #fff;
    font: inherit;
    font-size: 0.65rem;
  }

  .ctc-version-row button.is-current {
    border-color: #9bd1ae;
    color: var(--ctc-green);
    background: var(--ctc-green-soft);
  }

  .ctc-export-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--ctc-border);
    background: #fff;
  }

  .ctc-dialog {
    width: min(640px, calc(100vw - 28px));
    max-height: min(88vh, 900px);
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(7, 31, 66, 0.28);
  }

  .ctc-dialog-wide {
    width: min(980px, calc(100vw - 28px));
  }

  .ctc-dialog::backdrop {
    background: rgba(7, 22, 43, 0.58);
    backdrop-filter: blur(3px);
  }

  .ctc-dialog-card {
    margin: 0;
    padding: 24px;
    border: 0;
    color: var(--ctc-text);
    background: #fff;
    font-family: var(--font-sans, "Inter", "Segoe UI", Arial, sans-serif);
  }

  .ctc-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--ctc-border);
  }

  .ctc-dialog-header h2,
  .ctc-dialog-header p {
    margin: 0;
  }

  .ctc-dialog-header h2 {
    color: var(--ctc-navy);
    font-size: 1.28rem;
    letter-spacing: -0.02em;
  }

  .ctc-dialog-header p {
    max-width: 650px;
    margin-top: 6px;
    color: var(--ctc-muted);
    font-size: 0.76rem;
    line-height: 1.5;
  }

  .ctc-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
  }

  .ctc-field-wide {
    grid-column: 1 / -1;
  }

  .ctc-file-drop {
    position: relative;
    display: grid;
    min-height: 170px;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 24px;
    border: 1px dashed var(--ctc-border-strong);
    border-radius: 9px;
    color: var(--ctc-blue-dark);
    background: var(--ctc-blue-soft);
    text-align: center;
    cursor: pointer;
  }

  .ctc-file-drop:hover {
    border-color: var(--ctc-blue);
  }

  .ctc-file-drop svg {
    width: 34px;
    height: 34px;
  }

  .ctc-file-drop span {
    font-size: 0.88rem;
    font-weight: 800;
  }

  .ctc-file-drop small {
    color: var(--ctc-muted);
    font-size: 0.68rem;
  }

  .ctc-file-drop input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    opacity: 0;
  }

  .ctc-form-note,
  .ctc-form-status {
    margin: 13px 0 0;
    color: var(--ctc-muted);
    font-size: 0.7rem;
    line-height: 1.5;
  }

  .ctc-form-status {
    min-height: 20px;
    font-weight: 700;
  }

  .ctc-form-status[data-tone="error"] {
    color: var(--ctc-red);
  }

  .ctc-form-status[data-tone="success"] {
    color: var(--ctc-green);
  }

  .ctc-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--ctc-border);
  }

  .ctc-dialog-actions-split {
    justify-content: space-between;
  }

  .ctc-dictionary-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
  }

  .ctc-dictionary-group {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 16px;
    padding: 13px;
    border: 1px solid var(--ctc-border);
    border-radius: 8px;
    background: var(--ctc-subtle);
  }

  .ctc-dictionary-group h3,
  .ctc-dictionary-group span {
    margin: 0;
  }

  .ctc-dictionary-group h3 {
    color: var(--ctc-navy);
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.78rem;
  }

  .ctc-dictionary-group > div:first-child > span {
    color: var(--ctc-muted);
    font-size: 0.64rem;
  }

  .ctc-option-list {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 7px;
  }

  .ctc-option-chip {
    display: inline-grid;
    grid-template-columns: auto auto 20px;
    align-items: center;
    gap: 6px;
    padding: 5px 5px 5px 8px;
    border: 1px solid var(--ctc-border);
    border-radius: 6px;
    color: var(--ctc-text);
    background: #fff;
    font-size: 0.64rem;
  }

  .ctc-option-chip code {
    color: var(--ctc-muted);
    font-size: 0.6rem;
  }

  .ctc-option-chip button {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 4px;
    color: var(--ctc-muted);
    background: var(--ctc-subtle);
    font: inherit;
    cursor: pointer;
  }

  .ctc-option-chip button:hover {
    color: var(--ctc-red);
    background: var(--ctc-red-soft);
  }

  .ctc-dictionary-add {
    display: grid;
    grid-template-columns: 0.8fr 1fr 1.2fr auto;
    align-items: end;
    gap: 10px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--ctc-border);
    border-radius: 8px;
    background: #fff;
  }

  .ctc-preview-body {
    margin-top: 18px;
  }

  .ctc-preview-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    border-bottom: 1px solid var(--ctc-border);
  }

  .ctc-preview-tabs span {
    padding: 9px 12px;
    color: var(--ctc-muted);
    font-size: 0.68rem;
    font-weight: 800;
    white-space: nowrap;
  }

  .ctc-preview-tabs span.is-active {
    border-bottom: 2px solid var(--ctc-blue);
    color: var(--ctc-blue);
  }

  .ctc-preview-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--ctc-border);
    border-top: 0;
  }

  .ctc-preview-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    font-size: 0.65rem;
  }

  .ctc-preview-table th,
  .ctc-preview-table td {
    padding: 9px;
    border-bottom: 1px solid var(--ctc-border);
    text-align: left;
  }

  .ctc-preview-table th {
    color: var(--ctc-navy);
    background: var(--ctc-subtle);
  }

  .ctc-preview-table td {
    color: var(--ctc-muted);
  }

  .ctc-preview-table td.is-valid {
    color: var(--ctc-green);
    font-weight: 800;
  }

  .ctc-preview-table td.is-error {
    color: var(--ctc-red);
    font-weight: 800;
  }

  .ctc-preview-note {
    margin: 14px 0 0;
    color: var(--ctc-muted);
    font-size: 0.7rem;
    line-height: 1.5;
  }

  .ctc-toast {
    position: fixed;
    z-index: 10000;
    right: 20px;
    bottom: 20px;
    max-width: min(420px, calc(100vw - 40px));
    padding: 12px 16px;
    border: 1px solid var(--ctc-border-strong);
    border-radius: 8px;
    color: #fff;
    background: var(--ctc-navy);
    box-shadow: 0 12px 32px rgba(7, 31, 66, 0.24);
    font-size: 0.74rem;
    font-weight: 700;
  }

  .ctc-toast[data-tone="success"] {
    border-color: #70c58e;
    background: #126b37;
  }

  .ctc-toast[data-tone="error"] {
    border-color: #e39a91;
    background: #92251b;
  }

  @media (max-width: 1420px) {
    .ctc-app-header {
      grid-template-columns: minmax(190px, 0.7fr) minmax(380px, 1.4fr) auto;
      gap: 14px;
    }

    .ctc-app-actions .ctc-button span {
      display: none;
    }

    .ctc-library-layout {
      grid-template-columns: minmax(210px, 0.62fr) minmax(390px, 1.35fr) minmax(340px, 1fr);
    }

    .ctc-rule-field {
      grid-template-columns: 86px minmax(0, 1fr);
    }

    .ctc-rule-field small {
      display: none;
    }

    .ctc-metrics {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ctc-dashboard-columns {
      display: none;
    }

    .ctc-dashboard-family-row {
      grid-template-columns: 22px 64px minmax(130px, 1.1fr) 0.55fr minmax(150px, 0.9fr) 0.6fr 0.5fr 0.4fr;
    }
  }

  @media (max-width: 1120px) {
    .ctc-app-header {
      grid-template-columns: 1fr auto;
    }

    .ctc-view-tabs {
      grid-column: 1 / -1;
      grid-row: 2;
      order: 3;
    }

    .ctc-library-layout {
      grid-template-columns: minmax(210px, 0.55fr) minmax(0, 1.45fr);
    }

    .ctc-inspector {
      grid-column: 1 / -1;
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 0 24px;
      border-top: 1px solid var(--ctc-border);
    }

    .ctc-inspector-header,
    .ctc-inheritance-summary,
    .ctc-rule-grid {
      grid-column: 1;
    }

    .ctc-rule-section {
      grid-column: 2;
    }

    .ctc-override-section {
      margin-top: 0;
    }

    .ctc-generated-links {
      grid-column: 1 / -1;
    }

    .ctc-dashboard-layout {
      grid-template-columns: 1fr;
    }

    .ctc-activity-rail {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ctc-dashboard-family-row {
      grid-template-columns: 22px 60px minmax(130px, 1fr) 0.55fr minmax(140px, 0.85fr) 0.55fr 0.5fr 0.4fr;
    }

    .ctc-dashboard-child {
      grid-template-columns: 60px minmax(130px, 1fr) minmax(140px, 0.85fr) 0.55fr 0.5fr;
    }

    .ctc-export-layout {
      grid-template-columns: 1fr;
    }

    .ctc-export-formats {
      border-right: 0;
    }

    .ctc-package-contents {
      border-top: 1px solid var(--ctc-border);
    }
  }

  @media (max-width: 820px) {
    body[data-page="campaign-creative-tracker"] .tools-hero .wrapper {
      max-width: calc(100vw - 28px);
    }

    .ctc-page-wrapper {
      max-width: calc(100vw - 16px) !important;
    }

    .ctc-app-header {
      grid-template-columns: minmax(0, 1fr) auto;
      padding: 13px;
    }

    .ctc-app-actions .ctc-button-secondary {
      display: none;
    }

    .ctc-view-tabs button {
      min-height: 40px;
      padding-inline: 7px;
    }

    .ctc-view-tabs button svg {
      display: none;
    }

    .ctc-library-layout {
      display: block;
      min-height: 0;
    }

    .ctc-family-pane,
    .ctc-rendition-pane,
    .ctc-inspector {
      border: 0;
      border-bottom: 1px solid var(--ctc-border);
    }

    .ctc-family-pane {
      display: block;
      padding: 14px;
    }

    .ctc-family-list {
      display: flex;
      max-width: 100%;
      padding-bottom: 5px;
      overflow-x: auto;
      scroll-snap-type: x proximity;
    }

    .ctc-family-card {
      min-width: min(280px, 78vw);
      scroll-snap-align: start;
    }

    .ctc-import-button {
      margin-top: 12px;
    }

    .ctc-rendition-pane {
      padding: 14px;
    }

    .ctc-inspector {
      display: block;
      padding: 16px;
    }

    .ctc-mobile-back {
      display: inline-flex;
      min-height: 44px;
      margin-bottom: 12px;
      padding-inline: 4px;
    }

    .ctc-library-layout[data-mobile-pane="families"] :is(.ctc-rendition-pane, .ctc-inspector),
    .ctc-library-layout[data-mobile-pane="renditions"] :is(.ctc-family-pane, .ctc-inspector),
    .ctc-library-layout[data-mobile-pane="inspector"] :is(.ctc-family-pane, .ctc-rendition-pane) {
      display: none;
    }

    .ctc-override-section {
      margin-top: 18px;
    }

    .ctc-dashboard {
      padding: 14px;
    }

    .ctc-dashboard-toolbar {
      align-items: flex-start;
    }

    .ctc-toolbar-actions {
      flex-direction: column;
      align-items: stretch;
    }

    .ctc-metrics {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ctc-dashboard-table {
      border: 0;
    }

    .ctc-dashboard-table-header {
      padding-inline: 0;
    }

    .ctc-dashboard-list {
      padding: 0;
    }

    .ctc-dashboard-family-row {
      grid-template-columns: 20px 58px minmax(0, 1fr) auto;
      min-height: 76px;
    }

    .ctc-dashboard-family-row .ctc-dashboard-partner,
    .ctc-dashboard-family-row .ctc-dashboard-utm,
    .ctc-dashboard-family-row .ctc-dashboard-test,
    .ctc-dashboard-family-row .ctc-dashboard-qa {
      display: none;
    }

    .ctc-dashboard-child {
      grid-template-columns: 58px minmax(0, 1fr) auto;
      margin-left: 26px;
    }

    .ctc-dashboard-child .ctc-dashboard-utm,
    .ctc-dashboard-child .ctc-dashboard-test {
      display: none;
    }

    .ctc-activity-rail {
      grid-template-columns: 1fr;
    }

    .ctc-export-header {
      display: grid;
      padding: 18px;
    }

    .ctc-export-header dl {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ctc-export-header dl div {
      min-width: 0;
      padding: 0 10px;
    }

    .ctc-export-header dl div:first-child {
      padding-left: 0;
      border-left: 0;
    }

    .ctc-export-metrics {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ctc-export-metrics span:nth-child(3) {
      border-right: 0;
    }

    .ctc-export-row {
      grid-template-columns: 84px minmax(0, 1fr);
      gap: 12px;
      padding: 14px 0;
    }

    .ctc-export-row > .ctc-button {
      grid-column: 2;
      justify-self: start;
    }

    .ctc-form-grid,
    .ctc-destination-grid,
    .ctc-override-grid,
    .ctc-dictionary-group,
    .ctc-dictionary-add {
      grid-template-columns: 1fr;
    }

    .ctc-field-wide {
      grid-column: auto;
    }

    .ctc-dictionary-group {
      gap: 9px;
    }
  }

  @media (max-width: 540px) {
    .ctc-app-header {
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 10px;
    }

    .ctc-app-title p {
      display: none;
    }

    .ctc-app-actions .ctc-button {
      width: 40px;
      padding: 0;
    }

    .ctc-rendition-grid {
      grid-template-columns: 1fr;
    }

    .ctc-rendition-card.is-wide {
      grid-column: auto;
    }

    .ctc-rendition-card.is-wide .ctc-asset,
    .ctc-rendition-card:not(.is-tall) .ctc-asset {
      aspect-ratio: 16 / 8;
    }

    .ctc-rendition-card.is-tall {
      grid-row: auto;
    }

    .ctc-rendition-card.is-tall .ctc-asset {
      min-height: 260px;
    }

    .ctc-rule-field {
      grid-template-columns: 1fr;
      gap: 4px;
    }

    .ctc-rule-field small {
      display: block;
    }

    .ctc-segmented button {
      min-height: 44px;
      font-size: 0.65rem;
    }

    .ctc-dashboard-toolbar {
      display: grid;
    }

    .ctc-toolbar-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      flex-direction: initial;
    }

    .ctc-metrics {
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .ctc-metric {
      padding: 10px;
    }

    .ctc-export-formats,
    .ctc-package-contents {
      padding: 14px;
    }

    .ctc-export-row {
      grid-template-columns: 72px minmax(0, 1fr);
    }

    .ctc-export-check {
      grid-template-columns: 24px 42px;
      gap: 7px;
    }

    .ctc-export-check em {
      width: 42px;
      height: 42px;
    }

    .ctc-export-actions {
      display: grid;
      grid-template-columns: 1fr;
      padding: 14px;
    }

    .ctc-dialog-card {
      padding: 18px;
    }

    .ctc-dialog-actions {
      display: grid;
      grid-template-columns: 1fr;
    }

    .ctc-dialog-actions-split {
      display: flex;
      flex-wrap: wrap;
    }

    .ctc-toast {
      right: 12px;
      bottom: 12px;
      max-width: calc(100vw - 24px);
    }
  }

  /* Interaction and QA fidelity refinements for the test workspace. */
  .ctc-rendition-grid {
    grid-auto-flow: row;
  }

  .ctc-asset img,
  .ctc-asset video {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 84px;
    object-fit: contain;
    background: #e8edf4;
  }

  .ctc-asset.is-compact img,
  .ctc-asset.is-compact video {
    object-fit: cover;
  }

  .ctc-switch input:focus-visible + span,
  .ctc-export-check input:focus-visible + span {
    outline: 3px solid color-mix(in srgb, var(--ctc-blue) 42%, transparent);
    outline-offset: 3px;
  }

  .ctc-file-drop:focus-within {
    border-color: var(--ctc-blue);
    outline: 3px solid color-mix(in srgb, var(--ctc-blue) 28%, transparent);
    outline-offset: 3px;
  }

  .ctc-rendition-metadata {
    display: grid;
    gap: 12px;
    margin-top: 16px;
    padding-top: 15px;
    border-top: 1px solid var(--ctc-border);
  }

  .ctc-qa-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .ctc-check-field {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid var(--ctc-border);
    border-radius: 7px;
    color: var(--ctc-text);
    background: #fff;
    font-size: 0.7rem;
    font-weight: 750;
    cursor: pointer;
  }

  .ctc-check-field input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: var(--ctc-blue);
  }

  .ctc-check-field:focus-within {
    border-color: var(--ctc-blue);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ctc-blue) 18%, transparent);
  }

  .ctc-preview-badge {
    display: inline-flex;
    margin-left: 8px;
    padding: 3px 7px;
    border-radius: 999px;
    color: var(--ctc-blue-dark);
    background: var(--ctc-blue-soft);
    font-size: 0.57rem;
    font-weight: 850;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .ctc-export-row.is-preview-only {
    background: linear-gradient(90deg, rgba(238, 244, 255, 0.68), transparent 65%);
  }

  .ctc-export-row.is-preview-only .ctc-export-check {
    cursor: default;
  }

  .ctc-export-row.is-preview-only .ctc-export-check > span {
    border-style: dashed;
    background: var(--ctc-subtle);
  }

  .ctc-option-chip button {
    width: 36px;
    height: 36px;
  }

  @media (max-width: 1420px) {
    .ctc-dashboard-columns {
      display: grid;
    }
  }

  @media (max-width: 1120px) {
    .ctc-dashboard-columns {
      display: none;
    }

    .ctc-dashboard-family-row {
      grid-template-columns: 20px 58px minmax(0, 1fr) auto;
      grid-template-areas:
        "chevron asset name count"
        ". . partner qa"
        ". . utm test";
      row-gap: 7px;
      padding-block: 10px;
    }

    .ctc-dashboard-family-row .ctc-dashboard-chevron {
      grid-area: chevron;
    }

    .ctc-dashboard-family-row > .ctc-asset {
      grid-area: asset;
    }

    .ctc-dashboard-family-row .ctc-dashboard-name {
      grid-area: name;
    }

    .ctc-dashboard-family-row .ctc-dashboard-partner {
      grid-area: partner;
    }

    .ctc-dashboard-family-row .ctc-dashboard-utm {
      grid-area: utm;
    }

    .ctc-dashboard-family-row .ctc-dashboard-test {
      grid-area: test;
    }

    .ctc-dashboard-family-row .ctc-dashboard-qa {
      grid-area: qa;
    }

    .ctc-dashboard-family-row .ctc-dashboard-count {
      grid-area: count;
    }

    .ctc-dashboard-family-row .ctc-dashboard-partner,
    .ctc-dashboard-family-row .ctc-dashboard-utm,
    .ctc-dashboard-family-row .ctc-dashboard-test,
    .ctc-dashboard-family-row .ctc-dashboard-qa {
      display: inline-flex;
      min-width: 0;
      align-items: center;
      gap: 5px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .ctc-dashboard-family-row .ctc-dashboard-partner::before {
      content: "Partner:";
      color: var(--ctc-muted);
      font-weight: 700;
      text-transform: none;
    }

    .ctc-dashboard-family-row .ctc-dashboard-utm::before {
      content: "UTM:";
      color: var(--ctc-muted);
      font-weight: 700;
    }

    .ctc-dashboard-family-row .ctc-dashboard-test::before {
      content: "Test:";
      color: var(--ctc-muted);
      font-weight: 700;
    }

    .ctc-dashboard-child {
      grid-template-columns: 58px minmax(0, 1fr) auto;
      grid-template-areas:
        "asset name qa"
        ". utm test";
      row-gap: 6px;
    }

    .ctc-dashboard-child > .ctc-asset {
      grid-area: asset;
    }

    .ctc-dashboard-child .ctc-dashboard-name {
      grid-area: name;
    }

    .ctc-dashboard-child .ctc-dashboard-utm {
      grid-area: utm;
    }

    .ctc-dashboard-child .ctc-dashboard-test {
      grid-area: test;
    }

    .ctc-dashboard-child .ctc-dashboard-qa {
      grid-area: qa;
    }

    .ctc-dashboard-child .ctc-dashboard-utm,
    .ctc-dashboard-child .ctc-dashboard-test {
      display: inline-flex;
      min-width: 0;
      gap: 5px;
      overflow: hidden;
      white-space: nowrap;
    }

    .ctc-dashboard-child .ctc-dashboard-utm::before {
      content: "UTM:";
      color: var(--ctc-muted);
      font-weight: 700;
    }

    .ctc-dashboard-child .ctc-dashboard-test::before {
      content: "Test:";
      color: var(--ctc-muted);
      font-weight: 700;
    }
  }

  @media (max-width: 540px) {
    .ctc-app-actions .ctc-button {
      width: 40px;
      min-width: 40px;
      padding: 0;
    }

    .ctc-app-actions .ctc-action-label {
      display: none;
    }

    .ctc-dashboard-family-row {
      grid-template-columns: 18px 50px minmax(0, 1fr) auto;
    }

    .ctc-dashboard-family-row .ctc-dashboard-test,
    .ctc-dashboard-family-row .ctc-dashboard-qa {
      justify-self: start;
    }

    .ctc-dashboard-child {
      margin-left: 20px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .ctc-switch span,
    .ctc-switch span::after,
    .ctc-dashboard-chevron {
      transition: none;
    }
  }

  @media print {
    body[data-page="campaign-creative-tracker"] #combined-header-nav,
    body[data-page="campaign-creative-tracker"] .tools-hero,
    body[data-page="campaign-creative-tracker"] .tools-account-dock,
    body[data-page="campaign-creative-tracker"] .footer,
    body[data-page="campaign-creative-tracker"] .ctc-app-header,
    body[data-page="campaign-creative-tracker"] .ctc-export-actions,
    body[data-page="campaign-creative-tracker"] .ctc-toast {
      display: none !important;
    }

    body[data-page="campaign-creative-tracker"] .ctc-app {
      border: 0;
      box-shadow: none;
    }

    body[data-page="campaign-creative-tracker"] .ctc-section {
      padding: 0;
    }
  }
}

@layer components {
  .ctc-welcome { min-height: 320px; gap: 16px; }
  .ctc-welcome p { max-width: 48ch; }
  .ctc-rendition-settings > summary { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; cursor: pointer; padding-block: 8px; font-weight: 700; }
  .ctc-rendition-settings > summary span { color: var(--ctc-muted); font-size: .82rem; font-weight: 500; }
  .ctc-rendition-settings[open] > summary { margin-bottom: 16px; }
  .ctc-campaign-menu { position: relative; }
  .ctc-campaign-menu > summary { cursor: pointer; }
  .ctc-campaign-menu > div { position: absolute; right: 0; top: 100%; min-width: 180px; display: grid; gap: 4px; z-index: 12; padding: 8px; border: 1px solid var(--ctc-border); border-radius: 12px; background: #fff; box-shadow: 0 8px 24px #091f3b18; }
  .ctc-campaign-menu:not([open]) > div { display: none; }
  .ctc-app-actions { flex-wrap: wrap; }
  @media (max-width: 600px) {
    .ctc-app-header { grid-template-columns: minmax(0, 1fr); }
    .ctc-app-title { grid-row: 1; }
    .ctc-app-title p { display: block; overflow-wrap: anywhere; white-space: normal; overflow: visible; text-overflow: clip; }
    .ctc-app-actions { grid-row: 2; justify-content: flex-start; }
    .ctc-view-tabs { grid-row: 3; }
    .ctc-app-actions .ctc-button { width: auto; padding: 8px 12px; }
    .ctc-app-actions .ctc-button-secondary { display: inline-flex; }
    .ctc-app-actions .ctc-button .ctc-action-label { display: inline; }
    .ctc-campaign-menu > div { left: 0; right: auto; }
  }
}
