@layer shorts {
  .shorts-page { min-height: 100vh; background: #151619; color: #e7e8eb; }
  .shorts-page main { width: min(1240px, 100%); margin: 0 auto; padding: 46px 24px 72px; }
  .shorts-open-main { font-size: 13px; text-underline-offset: 4px; white-space: nowrap; }
  .shorts-intro { max-width: 760px; margin-bottom: 30px; }
  .shorts-kicker, .shorts-step { color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .14em; }
  .shorts-intro h1 { margin-top: 12px; font-size: clamp(34px, 5vw, 54px); line-height: 1.05; letter-spacing: -.045em; }
  .shorts-intro > p:last-child { max-width: 680px; margin-top: 18px; color: #b4b8c1; font-size: 18px; line-height: 1.65; }

  .shorts-workspace { display: grid; grid-template-columns: 310px minmax(0, 1fr); overflow: hidden; border: 1px solid #303239; border-radius: 12px; background: #1b1c20; box-shadow: 0 26px 80px #0002; }
  .shorts-editor { padding: 24px; border-right: 1px solid #303239; }
  .shorts-editor-heading, .shorts-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .shorts-editor h2, .shorts-preview-heading h2 { margin-top: 3px; font-size: 20px; line-height: 1.3; letter-spacing: -.02em; }
  .shorts-text-button { color: #ddaaa3; padding: 8px 0; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
  .shorts-text-button:disabled { cursor: default; opacity: .45; }
  .shorts-drop-zone { position: relative; display: flex; min-height: 170px; margin-top: 22px; padding: 24px 18px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; overflow: hidden; border: 1px dashed #41444d; border-radius: 9px; background: #212328; text-align: center; transition: border-color .15s, background .15s; }
  .shorts-drop-zone:hover, .shorts-drop-zone:focus-within, .shorts-drop-zone.dragging { border-color: var(--accent); background: #2c2324; }
  .shorts-drop-symbol { display: grid; width: 38px; height: 38px; margin-bottom: 4px; place-items: center; border: 1px solid #555964; border-radius: 8px; color: #b2b6c0; font-size: 24px; line-height: 1; }
  .shorts-drop-zone strong { font-size: 14px; }
  .shorts-drop-zone > span:not(.shorts-drop-symbol) { color: #aeb2bc; font-size: 13px; }
  .shorts-choose { color: #ff796a; text-decoration: underline; text-underline-offset: 3px; }
  .shorts-drop-zone small { color: #9297a1; font-size: 11px; }
  .shorts-drop-zone input { position: absolute; inset: 0; height: 100%; cursor: pointer; opacity: 0; }
  .shorts-image-info { min-height: 18px; margin-top: 11px; color: #9ea3ae; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
  .shorts-status { min-height: 18px; margin-top: 4px; color: #ff9b80; font-size: 11px; line-height: 1.45; white-space: pre-line; }
  .shorts-versions { display: grid; gap: 7px; margin-top: 10px; }
  .shorts-version { display: grid; grid-template-columns: minmax(0, 1fr) 30px; align-items: stretch; overflow: hidden; border: 1px solid #393c45; border-radius: 8px; background: #191a1e; }
  .shorts-version.is-active { border-color: #d86155; box-shadow: 0 0 0 1px #d8615545; }
  .shorts-version-select { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 6px; text-align: left; }
  .shorts-version-select img { width: 34px; height: 48px; flex: none; border-radius: 4px; background: #282a30; object-fit: cover; object-position: center; }
  .shorts-version-select > span { display: grid; min-width: 0; gap: 2px; }
  .shorts-version-select b { color: #d9dce3; font-size: 12px; font-weight: 650; }
  .shorts-version-select small { overflow: hidden; color: #858b96; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .shorts-version-remove { border-left: 1px solid #30333a; color: #9da2ac; font-size: 18px; }
  .shorts-version-remove:hover { color: #ff887a; background: #2b2425; }
  .shorts-label { display: flex; justify-content: space-between; margin: 19px 0 8px; color: #aeb2bc; font-size: 12px; font-weight: 600; }
  .shorts-label span { color: #8d929d; font-weight: 450; }
  .shorts-editor textarea { display: block; min-height: 86px; resize: vertical; border: 1px solid #393c45; border-radius: 7px; padding: 11px 12px; background: #151619; color: #e1e3e8; font-size: 13px; line-height: 1.5; }
  .shorts-editor textarea:disabled { cursor: default; opacity: .55; }
  .shorts-hint { margin-top: 7px; color: #9398a3; font-size: 11px; line-height: 1.5; }
  .shorts-privacy { margin-top: 28px; padding-top: 18px; border-top: 1px solid #303239; }
  .shorts-privacy summary { color: #abb0ba; font-size: 12px; }
  .shorts-privacy p { margin-top: 12px; color: #9399a5; font-size: 11px; line-height: 1.65; }

  .shorts-preview-shell { min-width: 0; padding: 24px 26px 18px; display: flex; flex-direction: column; }
  .shorts-preview-actions { display: flex; flex: none; gap: 7px; }
  .shorts-theme, .shorts-compare { flex: none; padding: 8px 11px; border: 1px solid #3b3e47; border-radius: 7px; color: #c9cbd2; background: #22242a; font-size: 12px; }
  .shorts-theme:hover, .shorts-compare:hover { border-color: #656a75; }
  .shorts-compare:disabled { cursor: default; opacity: .45; }
  .shorts-preview-note { margin: 10px 0 18px; color: #969ca7; font-size: 11px; line-height: 1.55; }
  .shorts-preview-board { --board: #0f0f0f; --card-text: #f1f1f1; --card-muted: #aaa; --search-border: #383838; min-width: 0; padding: 22px; border-radius: 9px; background: var(--board); color: var(--card-text); font-family: Arial, sans-serif; }
  .shorts-preview-board[data-preview-theme="light"] { --board: #fff; --card-text: #0f0f0f; --card-muted: #606060; --search-border: #ccc; }
  .shorts-reference { margin-top: 22px; }
  .shorts-reference summary { color: #c1c5ce; font-size: 12px; }
  .shorts-reference > p { margin: 10px 0 14px; color: #9398a3; font-size: 11px; line-height: 1.5; }
  .shorts-reference-media { width: min(100%, 170px); margin: 0 auto; overflow: hidden; border-radius: 9px; background: #23252a; }
  .shorts-reference-media img { display: block; width: auto; height: auto; max-width: 100%; max-height: 300px; margin: 0 auto; object-fit: contain; background: #222; }
  .shorts-youtube-header { display: flex; align-items: center; gap: 24px; padding-bottom: 32px; }
  .shorts-youtube-logo { display: flex; align-items: center; gap: 4px; color: var(--card-text); font-size: 22px; font-weight: 750; letter-spacing: -1.2px; white-space: nowrap; }
  .shorts-search-bar { display: flex; align-items: center; justify-content: space-between; width: min(360px, 100%); height: 36px; margin-left: auto; padding: 0 15px; border: 1px solid var(--search-border); border-radius: 24px; color: var(--card-muted); font-size: 14px; }
  .shorts-search-bar > span { font-size: 25px; }
  .shorts-shelf-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--card-text); font-size: 20px; font-weight: 700; }
  .shorts-shelf { display: grid; grid-auto-flow: column; grid-auto-columns: max(140px, calc((100% - 48px) / 5)); gap: 12px; padding: 3px 2px 16px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--card-muted) var(--board); }
  .shorts-shelf:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  .shorts-card { min-width: 0; scroll-snap-align: start; }
  .shorts-card-image { position: relative; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 12px; background: #23252a; }
  .shorts-card-image img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
  .shorts-card h4 { display: -webkit-box; margin: 11px 0 0; overflow: hidden; color: var(--card-text); font-size: 15px; font-weight: 600; line-height: 20px; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .shorts-card p { margin-top: 5px; color: var(--card-muted); font-size: 12px; line-height: 17px; }
  .shorts-empty { position: relative; display: grid; width: 100%; aspect-ratio: 9 / 16; place-content: center; gap: 4px; overflow: hidden; color: #d9dce2; background: linear-gradient(145deg, #353945, #252831); text-align: center; }
  .shorts-empty::before, .shorts-empty::after { content: ""; position: absolute; inset: 0; }
  .shorts-empty::before { background: linear-gradient(90deg, transparent 49.5%, #ffffff13 50%, transparent 50.5%), linear-gradient(transparent 49.5%, #ffffff13 50%, transparent 50.5%); }
  .shorts-empty::after { inset: 12%; border: 1px solid #ffffff19; border-radius: 50%; }
  .shorts-empty span { width: 38px; height: 38px; margin: 0 auto 5px; border: 2px solid #ffffff6b; border-radius: 8px; transform: rotate(8deg); }
  .shorts-empty b { z-index: 1; font-size: 18px; }
  .shorts-empty small { z-index: 1; color: #aeb3bd; font-size: 11px; }
  .shorts-crop-empty { position: absolute; inset: 0; aspect-ratio: auto; }
  .shorts-preview-footer { display: flex; justify-content: space-between; gap: 16px; padding-top: 11px; color: #8e949f; font-size: 10px; }
  .shorts-preview-footer a { flex: none; text-underline-offset: 3px; }
  .shorts-shelf-hint { margin-top: 9px; color: var(--card-muted); font-size: 11px; line-height: 1.5; }
  .shorts-compare-view > h3 { margin-bottom: 18px; color: var(--card-text); font-size: 20px; line-height: 1.3; }
  .shorts-compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; }
  .shorts-compare-card { min-width: 0; }
  .shorts-compare-card > img { display: block; width: 100%; aspect-ratio: 2 / 3; border-radius: 12px; background: #23252a; object-fit: cover; object-position: center; }
  .shorts-compare-label { margin-top: 10px; color: var(--card-muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  .shorts-compare-card h4 { display: -webkit-box; margin-top: 4px; overflow: hidden; color: var(--card-text); font-size: 14px; font-weight: 600; line-height: 19px; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

  .shorts-facts, .shorts-faq, .shorts-page-footer { width: min(920px, 100%); margin: 64px auto 0; }
  .shorts-facts { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); gap: 42px; padding: 32px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .shorts-facts h2, .shorts-faq h2 { margin-top: 7px; font-size: 26px; line-height: 1.25; letter-spacing: -.025em; }
  .shorts-facts > p, .shorts-faq article p { color: #b4b8c1; font-size: 15px; line-height: 1.75; }
  .shorts-facts a, .shorts-page-footer a { text-underline-offset: 4px; }
  .shorts-faq-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 27px; }
  .shorts-faq article h3 { margin-bottom: 9px; font-size: 16px; line-height: 1.4; }
  .shorts-page-footer { width: min(920px, calc(100% - 32px)); display: flex; flex-wrap: wrap; gap: 12px 26px; padding: 25px 0 54px; border-top: 1px solid var(--line); color: #b7bbc4; font-size: 13px; }
  .shorts-page-footer p { width: 100%; color: #8f949e; font-size: 11px; line-height: 1.6; }

  @media (max-width: 850px) {
    .shorts-workspace { grid-template-columns: 280px minmax(0, 1fr); }
    .shorts-preview-board { padding: 22px 18px; }
  }
  @media (max-width: 700px) {
    .shorts-page main { padding: 34px 16px 56px; }
    .shorts-intro > p:last-child { font-size: 16px; }
    .shorts-workspace { display: block; }
    .shorts-editor { border-right: 0; border-bottom: 1px solid #303239; }
    .shorts-editor textarea { font-size: 16px; }
    .shorts-preview-shell { padding: 22px 18px 17px; }
    .shorts-youtube-header { gap: 16px; }
    .shorts-facts { grid-template-columns: 1fr; gap: 18px; }
    .shorts-faq-grid { grid-template-columns: 1fr; gap: 26px; }
  }
  @media (max-width: 430px) {
    .shorts-compare-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shorts-open-main { font-size: 11px; }
    .shorts-page .app-header { padding: 0 14px; }
    .shorts-page .brand { font-size: 16px; }
    .shorts-page .brand img { width: 28px; height: 28px; }
    .shorts-preview-heading { align-items: flex-start; }
    .shorts-preview-actions { flex-direction: column; }
    .shorts-theme, .shorts-compare { padding: 7px 9px; font-size: 11px; }
    .shorts-preview-board { padding: 20px 12px; }
    .shorts-youtube-logo { font-size: 19px; }
    .shorts-search-bar { display: none; }
    .shorts-preview-footer { flex-wrap: wrap; gap: 8px; }
  }
}
