.studio {
  width: min(1136px, calc(100vw - 64px));
  max-width: none;
  max-height: min(90dvh, 900px);
  padding: 0;
  border-radius: 18px;
  border: 1px solid var(--control-line);
  background: var(--surface);
  overflow: hidden;
}
.studio[open] {
  display: flex;
  flex-direction: column;
}
.studio::backdrop {
  background: #060609bb;
  backdrop-filter: blur(5px);
}
.studio h2 {
  font-size: 20px;
  letter-spacing: -0.04em;
}
.studio h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 630;
  letter-spacing: -0.015em;
}
.studio-head,
.studio-footer {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
}
.studio-head {
  border-bottom: 1px solid var(--line);
}
.studio-symbol,
.upload-symbol {
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--tint);
  color: var(--accent);
}
.studio-symbol {
  width: 33px;
  height: 33px;
}
.studio-symbol svg {
  width: 16px;
}
.icon-button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 0;
}
.studio-head .icon-button {
  margin-left: auto;
}
.studio-body {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  overflow: hidden;
  min-height: 0;
  flex: 1 1 auto;
}
.studio-editor,
.studio-preview {
  padding: 25px clamp(19px, 2.2vw, 32px) 28px;
  min-width: 0;
  overflow: auto;
}
.studio-preview {
  background: var(--bg);
  border-left: 1px solid var(--line);
}
.studio-preview .section-line {
  margin-bottom: 19px;
  min-height: 25px;
}
.section-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.section-line h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-line .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.section-line > span,
.section-line select {
  color: var(--muted);
  font-size: 12px;
}
.section-line select {
  max-width: 55%;
}
.destinations {
  position: relative;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 20px;
}
.target-trigger {
  margin-top: 9px;
  background: var(--hover);
  padding: 5px 9px 5px 6px;
  border-radius: 22px;
  max-width: 100%;
}
.target-trigger > span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.target-trigger strong {
  font-weight: 560;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.target-trigger > .icon {
  width: 13px;
  color: var(--muted);
}
.studio-avatar {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--tint);
  color: #ffc1b4;
  font-size: 12px;
  font-weight: 650;
}
.studio-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.target-picker {
  position: absolute;
  z-index: 2;
  top: calc(100% - 15px);
  width: min(380px, 100%);
  padding: 10px;
  border-radius: 12px;
  background: var(--raised);
  border: 1px solid var(--control-line);
  box-shadow: 0 10px 32px #0006;
}
.target-picker input[type="search"] {
  width: 100%;
  margin-bottom: 5px;
}
.target-picker [data-el="options"] {
  max-height: min(240px, 29dvh);
  overflow: auto;
}
.target-picker label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  font-size: 13px;
  cursor: pointer;
}
.target-picker label:hover {
  background: var(--raised);
}
.target-picker label small {
  margin-left: auto;
  color: var(--muted);
}
.target-picker input[type="checkbox"] {
  accent-color: var(--coral);
}
.target-picker p {
  padding: 8px 4px;
  color: var(--muted);
}
.writing {
  background: var(--raised);
  border: 1px solid var(--control-line);
  border-radius: 10px;
  overflow: hidden;
}
.writing:focus-within {
  border-color: var(--accent);
}
.writing textarea,
.writing input {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  line-height: 1.6;
  font-weight: 400;
  background: transparent;
  color: var(--ink);
  border: 0;
  outline: 0;
  border-radius: 0;
}
.writing textarea {
  resize: vertical;
  display: block;
  min-height: 110px;
  max-height: 38dvh;
}
.writing input {
  border-bottom: 1px solid var(--line);
  font-weight: 550;
}
.writing textarea::placeholder,
.writing input::placeholder {
  color: var(--muted);
}
.media-label {
  margin-top: 20px;
}
.studio .text-action {
  font-size: 12px;
  gap: 5px;
}
.studio .text-action .icon {
  color: inherit;
  width: 13px;
}
.drop-media {
  display: grid;
  justify-items: center;
  justify-content: center;
  align-content: center;
  gap: 4px;
  min-height: 124px;
  width: 100%;
  border: 1px dashed #4c4d54;
  background: var(--raised);
  border-radius: 10px;
}
.drop-media:hover:enabled,
.drop-media.dragover {
  background: var(--tint);
  border-color: var(--accent);
}
.upload-symbol {
  width: 31px;
  height: 31px;
  margin-bottom: 3px;
  background: var(--hover);
  color: var(--accent);
}
.upload-symbol svg {
  width: 16px;
}
.drop-media strong {
  font-size: 13px;
  color: var(--ink);
}
.drop-media strong span,
.drop-media small {
  color: var(--muted);
  font-weight: 450;
}
.drop-media small {
  font-size: 11px;
  letter-spacing: 0.03em;
}
.link-entry {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.link-entry input {
  flex: 1;
  width: 0;
}
.attachment-list:empty {
  display: none;
}
.attachment-list {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}
.attachment {
  display: flex;
  gap: 5px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.attachment button:first-child {
  display: block;
  text-align: left;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.attachment button[aria-pressed="true"] {
  color: var(--accent);
}
.yt-settings {
  margin-top: 16px;
}
.yt-settings summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 550;
  font-size: 13px;
}
.yt-settings summary::-webkit-details-marker {
  display: none;
}
.yt-settings summary svg {
  width: 13px;
}
.yt-settings[open] summary svg {
  transform: rotate(180deg);
}
.yt-settings label {
  margin-top: 10px;
}
.preview-card {
  max-width: 380px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 13px;
  border: 1px solid var(--control-line);
  background: var(--raised);
}
.preview-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
}
.preview-identity .studio-avatar {
  width: 35px;
  height: 35px;
}
.preview-identity strong,
.preview-identity small {
  display: block;
  overflow-wrap: anywhere;
}
.preview-identity small {
  color: var(--muted);
  font-size: 12px;
}
.preview-copy {
  overflow-wrap: anywhere;
}
.preview-copy strong:not(:empty),
.preview-copy p:not(:empty) {
  display: block;
  margin: 0 15px 10px;
  white-space: pre-wrap;
}
.preview-stage {
  background: var(--hover);
}
.preview-placeholder {
  aspect-ratio: 1.35;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  background-image: radial-gradient(#77778038 0.9px, transparent 1px);
  background-size: 10px 10px;
}
.preview-placeholder .icon {
  width: 44px;
  height: 44px;
  padding: 11px;
  box-sizing: content-box;
  color: var(--muted);
  stroke-width: 1.2;
  background: var(--raised);
  border-radius: 16px;
  border: 1px solid var(--control-line);
}
.preview-stage img,
.preview-stage video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 42dvh;
  object-fit: contain;
  background: var(--bg);
}
.short-video .preview-placeholder {
  aspect-ratio: 4/5;
}
.preview-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 4px;
  font-size: 12px;
  color: var(--muted);
}
.preview-pagination button {
  font-size: 18px;
  padding: 0 8px;
  background: transparent;
  border: 0;
}
.studio-footer {
  justify-content: space-between;
  border-top: 1px solid var(--line);
  background: var(--surface);
  gap: 10px;
}
.studio-footer .actions {
  flex: none;
}
.timing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.timing select,
.timing input {
  font-size: 12px;
  min-height: 34px;
}
.timing small {
  font-size: 11px;
  color: var(--muted);
}
.studio-error {
  flex: none;
  padding: 9px 24px;
  background: var(--tint);
  color: #ffc1b4;
  font-size: 13px;
}
.studio-tabs {
  display: none;
}
@media (max-width: 740px) {
  .studio {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .studio-head,
  .studio-footer {
    padding: 12px 16px;
  }
  .studio-tabs {
    display: flex;
    gap: 16px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
  }
  .studio-tabs button {
    padding: 12px 2px 9px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    border-bottom: 2px solid transparent;
  }
  .studio-tabs [aria-pressed="true"] {
    color: var(--accent);
    border-bottom-color: var(--accent);
  }
  .studio-body {
    display: flex;
    flex: 1;
  }
  .studio-editor,
  .studio-preview {
    flex: 1;
    padding: 17px 16px;
  }
  .studio-preview {
    display: none;
    border: 0;
  }
  .studio.show-preview .studio-preview {
    display: block;
  }
  .studio.show-preview .studio-editor {
    display: none;
  }
  .studio-footer {
    align-items: stretch;
    flex-direction: column;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .timing {
    gap: 5px;
  }
  .timing input {
    flex: 1;
    min-width: 120px;
  }
  .studio-footer .actions button {
    flex: 1;
  }
  .studio-error {
    padding: 8px 16px;
  }
}
.short-card {
  display: flex;
  flex-direction: column;
  width: min(100%, 280px);
  background: var(--surface);
}
.short-card .preview-stage {
  order: 0;
}
.short-card .preview-identity {
  order: 1;
  padding-bottom: 10px;
}
.short-card .preview-copy {
  order: 2;
}
.short-card .preview-placeholder {
  aspect-ratio: 9/14;
  max-height: 40dvh;
}
.short-card .preview-stage video {
  aspect-ratio: 9/14;
  max-height: 40dvh;
}

.studio-formats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 14px; }
.studio-formats button, .studio-short { padding: 7px 13px; border-radius: 7px; font-size: 13px; }
.studio-formats button[aria-pressed=true], .studio-short { border: 1px solid var(--accent); background: var(--tint); color: var(--ink); }
.studio-formats [data-el=pick-format] { color: var(--muted); font-size: 13px; }
.studio [hidden] { display: none !important; }

.studio-disclosure {margin:12px 0 18px;}
.studio-disclosure label {display:flex;align-items:center;gap:8px;margin-top:8px;font-weight:400;}
.studio-disclosure input {width:16px;height:16px;margin:0;accent-color:var(--accent);}
.studio-disclosure small {color:var(--muted);}
.studio-disclosure [hidden] {display:none;}
