@media screen {
  #cp-studio {
    --cp-ink: #392d39;
    --cp-muted: #695c67;
    --cp-plum: #70465f;
    --cp-plum-deep: #563247;
    --cp-sage: #49634f;
    --cp-sage-soft: #edf3e9;
    --cp-apricot: #b75f35;
    --cp-cream: #fffaf2;
    --cp-card: #fffdf9;
    --cp-line: #e7d9ce;
    --cp-focus: #8a3e63;
    max-width: 1440px;
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2.6rem) clamp(0.75rem, 2.6vw, 2rem) 4rem;
    color: var(--cp-ink);
  }

  #cp-studio :where(button, input, select, textarea) { font: inherit; }
  #cp-studio :where(h1, h2, h3, p, span, label) { overflow-wrap: anywhere; }
  #cp-studio :where(a, button, input, select, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--cp-focus);
    outline-offset: 3px;
  }
  #cp-studio :where(#cp-toolbar-h, #cp-library-heading, #cp-scene-guide-summary, .cp-card[id]) {
    scroll-margin-top: max(1rem, calc(var(--header-height, 100px) + 1rem));
  }

  #cp-studio .cp-eyebrow {
    margin: 0 0 0.55rem;
    color: var(--cp-sage);
    font-size: 0.75rem;
    font-weight: 850;
    letter-spacing: 0.14em;
    line-height: 1.4;
    text-transform: uppercase;
  }

  #cp-studio .cp-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(1rem, 4vw, 3rem);
    min-height: 280px;
    overflow: hidden;
    padding: clamp(1.35rem, 4vw, 3.5rem);
    margin: 0 0 1.4rem;
    border: 1px solid #ead8ca;
    border-radius: 30px;
    background: linear-gradient(118deg, #fff7ed 0%, var(--cp-cream) 56%, #f2e5d8 100%);
    box-shadow: 0 18px 44px rgb(65 42 49 / 8%);
    text-align: left;
  }
  #cp-studio .cp-hero-copy { position: relative; z-index: 1; min-width: 0; max-width: 900px; }
  #cp-studio .cp-hero h1 {
    max-width: 800px;
    margin: 0 0 0.8rem;
    color: var(--cp-plum-deep);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2.1rem, 4.7vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.04;
  }
  #cp-studio .cp-hero-copy > p:not(.cp-eyebrow) {
    max-width: 790px;
    margin: 0;
    color: #584e58;
    font-size: clamp(1rem, 1.45vw, 1.1rem);
    line-height: 1.7;
  }
  #cp-studio .cp-hero-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.05rem; }
  #cp-studio .cp-hero-copy > p.cp-archive-feedback { margin-top: 1rem; color: var(--cp-muted); font-size: 0.83rem; line-height: 1.5; }
  #cp-studio .cp-archive-feedback a { color: var(--cp-plum-deep); text-underline-offset: 3px; }
  #cp-studio .cp-hero-meta > span {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border: 1px solid #e3d2c5;
    border-radius: 999px;
    background: rgb(255 255 255 / 82%);
    color: var(--cp-plum-deep);
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.25;
  }
  #cp-studio .cp-hero-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1.2rem; }
  #cp-studio .cp-hero-actions a {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1rem;
    border: 1px solid var(--cp-plum-deep);
    border-radius: 12px;
    background: var(--cp-plum-deep);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    transition: background-color 160ms ease, transform 160ms ease;
  }
  #cp-studio .cp-hero-actions a:nth-child(2) { background: #fffdf9; color: var(--cp-plum-deep); }
  #cp-studio .cp-hero-actions a:hover { background: #70465f; transform: translateY(-1px); }
  #cp-studio .cp-hero-actions a:nth-child(2):hover { background: #f4ebe3; }
  #cp-studio .cp-hero-art {
    position: relative;
    display: grid;
    width: clamp(118px, 18vw, 214px);
    aspect-ratio: 1;
    place-items: center;
    isolation: isolate;
    color: var(--cp-plum);
  }
  #cp-studio .cp-hero-art::before {
    position: absolute;
    z-index: -1;
    width: 94%;
    aspect-ratio: 1;
    border: 1px solid rgb(112 70 95 / 22%);
    border-radius: 50%;
    background: radial-gradient(circle, #fffefa 0 45%, #f5e6d9 46% 67%, transparent 68%);
    box-shadow: 0 15px 35px rgb(76 47 62 / 12%);
    content: '';
  }
  #cp-studio .cp-note { position: absolute; color: var(--cp-plum); font-family: Georgia, serif; line-height: 1; }
  #cp-studio .cp-note-one { top: 12%; left: 14%; font-size: clamp(2rem, 4vw, 3.7rem); transform: rotate(-12deg); }
  #cp-studio .cp-note-two { top: 22%; right: 8%; color: var(--cp-sage); font-size: clamp(1.8rem, 3.4vw, 3rem); transform: rotate(10deg); }
  #cp-studio .cp-note-three { bottom: 8%; left: 22%; color: var(--cp-apricot); font-size: clamp(2.2rem, 4.4vw, 4rem); transform: rotate(-8deg); }
  #cp-studio .cp-music-line {
    width: 46%;
    height: 23%;
    border-top: 4px solid var(--cp-sage);
    border-bottom: 4px solid var(--cp-plum);
    border-radius: 50%;
    transform: rotate(-20deg);
  }
  #cp-studio .cp-music-line::after {
    display: block;
    width: 100%;
    height: 100%;
    border-bottom: 3px solid #c8794c;
    border-radius: 50%;
    content: '';
    transform: rotate(15deg) translateY(-0.25rem);
  }

  #cp-studio .cp-toolbar {
    padding: clamp(1rem, 2.2vw, 1.55rem);
    margin: 0 0 1.15rem;
    border: 1px solid var(--cp-line);
    border-radius: 22px;
    background: var(--cp-card);
    box-shadow: 0 8px 24px rgb(65 42 49 / 5%);
  }
  #cp-studio .cp-toolbar > h2 {
    margin: 0 0 0.35rem;
    color: var(--cp-plum-deep);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    line-height: 1.2;
  }
  #cp-studio .cp-toolbar-help { margin: 0 0 1.15rem; color: var(--cp-muted); font-size: 0.93rem; line-height: 1.55; }
  #cp-studio .cp-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(145px, 1fr));
    gap: 0.85rem;
    align-items: end;
  }
  #cp-studio .cp-field { display: flex; min-width: 0; flex-direction: column; gap: 0.4rem; }
  #cp-studio .cp-field label {
    color: var(--cp-ink);
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1.35;
  }
  #cp-studio .cp-field select,
  #cp-studio .cp-field input[type='search'] {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 0.65rem 0.75rem;
    border: 1px solid #cdbdb3;
    border-radius: 11px;
    background: #fffefa;
    color: var(--cp-ink);
    font-size: 0.95rem;
    line-height: 1.4;
  }
  #cp-studio .cp-field input[type='search']::placeholder { color: #70636d; opacity: 1; }
  #cp-studio .cp-field :where(input, select):focus-visible { border-color: var(--cp-plum); }

  #cp-studio .cp-carnet-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    padding: 1rem;
    margin-top: 1.2rem;
    border: 1px solid #cad6c5;
    border-radius: 16px;
    background: var(--cp-sage-soft);
  }
  #cp-studio .cp-carnet-heading { flex: 1 1 100%; }
  #cp-studio .cp-carnet-heading .cp-eyebrow { margin-bottom: 0.2rem; }
  #cp-studio .cp-carnet-info { color: #3e5543; font-size: 0.91rem; font-weight: 700; }
  #cp-studio .cp-carnet-info strong { color: #304b36; font-size: 1.05em; }
  #cp-studio .cp-btn {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0.95rem;
    border: 1px solid var(--cp-plum-deep);
    border-radius: 11px;
    background: var(--cp-plum-deep);
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
    transition: background-color 160ms ease, transform 160ms ease;
  }
  #cp-studio .cp-btn:hover:not(:disabled) { background: #70465f; transform: translateY(-1px); }
  #cp-studio .cp-btn.secondary { border-color: #9aaa98; background: #fffefa; color: #344d39; }
  #cp-studio .cp-btn.secondary:hover:not(:disabled) { background: #e2eadf; }
  #cp-studio .cp-btn:disabled { cursor: not-allowed; opacity: 0.58; }

  #cp-studio .cp-library-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 0.55rem 1rem;
    margin: 1.7rem 0 0.9rem;
  }
  #cp-studio .cp-library-heading > div { min-width: 0; }
  #cp-studio .cp-library-heading h2 {
    margin: 0 0 0.3rem;
    color: var(--cp-plum-deep);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.55rem, 2.7vw, 2.15rem);
    line-height: 1.2;
  }
  #cp-studio .cp-library-heading p { margin: 0; color: var(--cp-muted); font-size: 0.93rem; line-height: 1.5; }
  #cp-studio .cp-count {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border: 1px solid #dfc9b9;
    border-radius: 999px;
    background: #f8eee4;
    color: #6c3d2d;
    font-size: 0.88rem;
    font-weight: 850;
  }
  #cp-studio .cp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  #cp-studio .cp-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--cp-line);
    border-radius: 18px;
    background: var(--cp-card);
    box-shadow: 0 7px 20px rgb(65 42 49 / 5%);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  }
  #cp-studio .cp-card:hover { border-color: #ceb6a6; box-shadow: 0 12px 28px rgb(65 42 49 / 10%); transform: translateY(-2px); }
  #cp-studio .cp-card:target { outline: 3px solid var(--cp-focus); outline-offset: 3px; }
  #cp-studio .cp-card[hidden] { display: none !important; }
  #cp-studio .cp-card-open {
    display: flex;
    width: 100%;
    min-height: 170px;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1.1rem 1.1rem 0.85rem;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
  }
  #cp-studio .cp-card-open:hover { background: #fff9f1; }
  #cp-studio .cp-card-open:focus-visible { outline-offset: -4px; }
  #cp-studio .cp-card-head { display: flex; min-width: 0; align-items: center; gap: 0.7rem; }
  #cp-studio .cp-card-emoji { flex: 0 0 auto; font-size: 2.2rem; line-height: 1; }
  #cp-studio .cp-card-title { color: var(--cp-plum-deep); font-family: Georgia, 'Times New Roman', serif; font-size: 1.18rem; font-weight: 750; line-height: 1.25; }
  #cp-studio .cp-card-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
  #cp-studio .cp-badge {
    display: inline-flex;
    min-height: 27px;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border: 1px solid #e6d8ce;
    border-radius: 999px;
    background: #f7f0e9;
    color: #5c5058;
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.2;
  }
  #cp-studio .cp-badge.cp-badge-type { border-color: #ead0bb; background: #f8e8d9; color: #713d29; }
  #cp-studio .cp-card-cta { margin-top: auto; color: var(--cp-plum-deep); font-size: 0.88rem; font-weight: 850; }
  #cp-studio .cp-card-foot { padding: 0.65rem 1.1rem 0.85rem; border-top: 1px solid #f0e7df; background: #fffaf5; }
  #cp-studio .cp-card-check { display: flex; min-height: 44px; align-items: center; gap: 0.55rem; color: #554953; cursor: pointer; font-size: 0.84rem; font-weight: 650; }
  #cp-studio .cp-card-check input { width: 24px; height: 24px; flex: 0 0 auto; accent-color: var(--cp-sage); cursor: pointer; }
  #cp-studio .cp-card[data-selected='1'] { border-color: #718a70; box-shadow: 0 0 0 2px #dce8d7, 0 7px 20px rgb(65 42 49 / 5%); }

  #cp-studio .cp-scene-guide {
    padding: 1rem 1.2rem;
    margin: 1.5rem 0 0;
    border: 1px solid #d7c8bd;
    border-radius: 18px;
    background: #f7f1e9;
    color: var(--cp-ink);
  }
  #cp-studio .cp-scene-guide summary {
    display: list-item;
    min-height: 44px;
    padding: 0.55rem 0;
    color: var(--cp-plum-deep);
    cursor: pointer;
    font-weight: 850;
    line-height: 1.4;
  }
  #cp-studio .cp-scene-guide-content { max-width: 82ch; padding-top: 0.4rem; line-height: 1.65; }
  #cp-studio .cp-scene-guide-content h2,
  #cp-studio .cp-scene-guide-content h3 { color: var(--cp-plum-deep); }
  #cp-studio .cp-scene-guide-content li { margin: 0.4rem 0; }
  #cp-studio .cp-scene-guide-content a { color: #5c3a53; font-weight: 750; text-underline-offset: 3px; }

  html[data-theme='dark'] #cp-studio {
    --cp-ink: #f2e9e1;
    --cp-muted: #d0c2ca;
    --cp-plum: #e2b9cf;
    --cp-plum-deep: #f0d6e4;
    --cp-sage: #c0d7b8;
    --cp-sage-soft: #29382d;
    --cp-apricot: #f0b28d;
    --cp-card: #28242b;
    --cp-line: #50424e;
    --cp-focus: #f4b7d5;
  }
  html[data-theme='dark'] #cp-studio .cp-hero {
    border-color: #594352;
    background: linear-gradient(118deg, #302631 0%, #29252b 58%, #3a302e 100%);
  }
  html[data-theme='dark'] #cp-studio .cp-hero-art::before { border-color: #6f5664; background: radial-gradient(circle, #40343d 0 45%, #493a42 46% 67%, transparent 68%); }
  html[data-theme='dark'] #cp-studio .cp-hero-copy > p:not(.cp-eyebrow),
  html[data-theme='dark'] #cp-studio .cp-library-heading p,
  html[data-theme='dark'] #cp-studio .cp-toolbar-help { color: #d5c9d1; }
  html[data-theme='dark'] #cp-studio .cp-hero-meta > span { border-color: #594b55; background: #332e35; color: #f0d6e4; }
  html[data-theme='dark'] #cp-studio .cp-hero-actions a { border-color: #e1b5ca; background: #70465f; color: #fff; }
  html[data-theme='dark'] #cp-studio .cp-hero-actions a:nth-child(2) { background: #332e35; color: #f0d6e4; }
  html[data-theme='dark'] #cp-studio .cp-toolbar,
  html[data-theme='dark'] #cp-studio .cp-card { background: #28242b; }
  html[data-theme='dark'] #cp-studio .cp-field label,
  html[data-theme='dark'] #cp-studio .cp-card-check { color: #e6dce3; }
  html[data-theme='dark'] #cp-studio .cp-field select,
  html[data-theme='dark'] #cp-studio .cp-field input[type='search'] { border-color: #63535e; background: #211e24; color: #f2e9e1; }
  html[data-theme='dark'] #cp-studio .cp-field input[type='search']::placeholder { color: #c5b8c2; }
  html[data-theme='dark'] #cp-studio .cp-carnet-bar { border-color: #52634f; }
  html[data-theme='dark'] #cp-studio .cp-carnet-info,
  html[data-theme='dark'] #cp-studio .cp-carnet-info strong { color: #dcebd6; }
  html[data-theme='dark'] #cp-studio .cp-btn { border-color: #ae7a97; background: #70465f !important; color: #fff !important; }
  html[data-theme='dark'] #cp-studio .cp-btn.secondary { border-color: #768875; background: #28362b !important; color: #e3f0de !important; }
  html[data-theme='dark'] #cp-studio .cp-btn.secondary:hover:not(:disabled) { background: #354638; }
  html[data-theme='dark'] #cp-studio .cp-count { border-color: #6a5046; background: #3a2d2b; color: #ffd1b8; }
  html[data-theme='dark'] #cp-studio .cp-card-open:hover { background: #302b32; }
  html[data-theme='dark'] #cp-studio .cp-badge { border-color: #5b4c58; background: #342e36; color: #e2d6df; }
  html[data-theme='dark'] #cp-studio .cp-badge.cp-badge-type { border-color: #79553f; background: #49342d; color: #ffd2b4; }
  html[data-theme='dark'] #cp-studio .cp-card-foot { border-color: #453a44; background: #242127; }
  html[data-theme='dark'] #cp-studio .cp-card[data-selected='1'] { border-color: #91ac88; box-shadow: 0 0 0 2px #394b38; }
  html[data-theme='dark'] #cp-studio .cp-scene-guide { border-color: #554751; background: #2d282f; }
  html[data-theme='dark'] #cp-studio .cp-scene-guide-content a { color: #f2c5db; }

  #cp-tbi .cp-tbi-bar { background: #fffaf2; border-color: #e7d9ce; }
  #cp-tbi .cp-tbi-bar h2 { color: #563247; }
  #cp-tbi .cp-tbi-badge { background: #f8e8d9; color: #713d29; }
  #cp-tbi .cp-btn,
  #cp-tbi .cp-tbi-nav button { min-height: 44px; background: #563247; color: #fff; }
  #cp-tbi .cp-btn.secondary { background: #edf3e9; color: #304b36; }
  #cp-tbi .cp-tbi-nav { gap: clamp(0.4rem, 3vw, 1.2rem); padding-inline: clamp(0.65rem, 3vw, 1.2rem); }
  #cp-tbi .cp-tbi-nav button { padding-inline: clamp(0.6rem, 2.5vw, 1.3rem); font-size: clamp(0.85rem, 2vw, 1.05rem); }
  #cp-tbi button:focus-visible { outline: 3px solid #8a3e63; outline-offset: 3px; }
  html[data-theme='dark'] #cp-tbi .cp-tbi-bar { background: #28242b; border-color: #50424e; }
  html[data-theme='dark'] #cp-tbi .cp-tbi-bar h2 { color: #f0d6e4; }
  html[data-theme='dark'] #cp-tbi .cp-tbi-badge { background: #49342d; color: #ffd2b4; }
  html[data-theme='dark'] #cp-tbi .cp-btn,
  html[data-theme='dark'] #cp-tbi .cp-tbi-nav button { background: #70465f !important; color: #fff !important; }
  html[data-theme='dark'] #cp-tbi .cp-btn.secondary { background: #29382d !important; color: #dcebd6 !important; }
  html[data-theme='dark'] #cp-tbi button:focus-visible { outline-color: #f4b7d5; }

  @media (max-width: 1050px) {
    #cp-studio .cp-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #cp-studio .cp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 680px) {
    #cp-studio .cp-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    #cp-studio .cp-hero-art { position: absolute; top: 3.6rem; right: 0.65rem; width: 62px; }
    #cp-studio .cp-hero-copy { padding-right: 0; }
    #cp-studio .cp-hero h1 { max-width: 100%; padding-right: 56px; font-size: clamp(2rem, 8vw, 3rem); }
    #cp-studio .cp-hero-copy > p:not(.cp-eyebrow) { font-size: 1rem; }
    #cp-studio .cp-hero-meta { position: relative; z-index: 1; }
    #cp-studio .cp-filters { grid-template-columns: minmax(0, 1fr); }
    #cp-studio .cp-library-heading { align-items: start; }
    #cp-studio .cp-library-heading > div { flex-basis: 100%; }
    #cp-studio .cp-grid { grid-template-columns: minmax(0, 1fr); }
    #cp-studio .cp-card-open { min-height: 0; }
    #cp-studio .cp-carnet-bar > .cp-btn { flex: 1 1 100%; }
  }
  @media (prefers-reduced-motion: reduce) {
    #cp-studio *, #cp-studio *::before, #cp-studio *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  }
}
