/* Layout refinement only: keep existing editor controls and processing behavior. */
.cloud-selection-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: -12px 0 20px;
}
.cloud-selection-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  min-width: 0;
}
.cloud-selection-controls:has(.cloud-selection-bar:not([hidden])) {
  display: flex;
  background: var(--canvas);
  padding: 4px 12px;
  border-radius: 4px;
  gap: 16px;
}
.cloud-selection-controls:has(.cloud-selection-bar:not([hidden])) > [data-select-mode] {
  order: 2;
  flex: none;
}
.cloud-selection-bar {
  flex: 1;
}
.cloud-selection-bar [data-selection-count] {
  order: 0;
  font-weight: 600;
  color: #18212f;
  min-width: 66px;
}
.cloud-selection-bar label {
  order: 1;
}
.cloud-selection-bar [data-selection-trash] {
  order: 2;
  margin-left: auto;
  color: var(--danger);
  gap: 6px;
}
.cloud-selection-bar [data-selection-trash] svg {
  width: 18px;
  height: 18px;
}
.cloud-selection-bar label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: 44px;
}
.cloud-selection-bar input,
.cloud-card-select input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  padding: 0;
  margin: 0;
  flex: none;
}
.cloud-selection-bar input:focus-visible,
.cloud-card-select input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.cloud-selectable {
  position: relative;
  min-width: 0;
}
.cloud-selectable > .video-card {
  width: 100%;
}
.cloud-card-select {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  margin: 0;
  cursor: pointer;
  isolation: isolate;
}
.cloud-card-select::before {
  content: '';
  position: absolute;
  width: 26px;
  height: 26px;
  background: #fff;
  border-radius: 3px;
  z-index: -1;
}
.cloud-selectable.is-selected .poster,
.cloud-selectable.is-selected .asset-poster {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.cloud-storage-status {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
  font-weight: 400;
}
@media (max-width: 480px) {
  .cloud-selection-controls:has(.cloud-selection-bar:not([hidden])) {
    gap: 8px;
    padding: 4px 8px;
  }
  .cloud-selection-bar {
    gap: 4px 12px;
  }
  .cloud-selection-bar [data-selection-count] {
    min-width: 0;
  }
  .cloud-selection-bar [data-selection-trash] {
    margin-left: 0;
  }
}
.page-header {
  gap: 16px;
  margin-bottom: 28px;
}
.header-actions,
.project-links {
  flex-wrap: wrap;
}
.page-heading {
  flex: 1;
}
.page-heading h1 {
  min-width: 0;
}
.section-heading {
  flex-wrap: wrap;
  gap: 8px 16px;
}
.section-heading h3 {
  margin-right: auto;
}
.project-row {
  gap: 16px;
}
.project-row strong,
.recent-copy,
.card-title {
  min-width: 0;
  overflow-wrap: anywhere;
}
.project-row .count {
  flex: none;
  white-space: nowrap;
}
.recent-copy > span {
  line-height: 1.5;
}
.project-context {
  gap: 12px 24px;
  align-items: center;
}
.raw-toolbar {
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
}
.raw-toolbar > p {
  flex: 1 1 220px;
  line-height: 1.6;
}
.cloud-target {
  line-height: 1.6;
}
.cloud-filters {
  justify-content: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}
.cloud-filters .template-picker {
  flex: 0 1 220px;
  min-width: 0;
}
.cloud-filters select {
  width: 100%;
  max-width: 220px;
  margin: 0;
}
.cloud-filters .cloud-tabs {
  gap: 20px;
}
.cloud-filters .cloud-tabs .button {
  border: 0;
  border-radius: 0;
  background: none;
  padding: 10px 0;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}
.cloud-filters .cloud-tabs [aria-current] {
  color: #18212f;
  box-shadow: inset 0 -2px currentColor;
}
.cloud-part > .section-heading {
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.cloud-part > .section-heading h3 {
  margin-right: 0;
}
.cloud-part > .section-heading .caption {
  font-size: 12px;
}
@media (max-width: 760px) {
  .cloud-filters {
    gap: 12px;
    align-items: center;
  }
  .cloud-filters .template-picker {
    flex: 1 1 100%;
  }
  .cloud-filters select {
    max-width: none;
  }
  .cloud-filters .cloud-tabs {
    flex: 0 1 auto;
    gap: 24px;
  }
  .cloud-filters .cloud-tabs .button {
    flex: none;
  }
}
.workspace-dialog .dialog-heading {
  gap: 16px;
  align-items: center;
}
.workspace-dialog .dialog-heading h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}
.workspace-dialog .dialog-heading .icon-button {
  flex: none;
}
.workspace-dialog .dialog-actions {
  gap: 12px;
}
.content-edit-links > button {
  color: var(--muted);
}
.editor-actions {
  gap: 16px;
  min-width: 0;
}
.editor-actions .editor-action-row {
  gap: 8px;
}
.editor-actions .editor-action-row .button {
  padding: 10px 8px;
  gap: 6px;
  min-width: 0;
}
.editor-actions .raw-line {
  flex-wrap: wrap;
  gap: 8px;
}
.editor-actions .raw-line > a {
  min-width: 0;
  overflow-wrap: anywhere;
}
.editor-actions .disclosure-body {
  padding-left: 0;
}
.editor-actions .editor-disclosure > summary {
  gap: 10px;
}
.editor-actions .result-summary {
  padding-bottom: 4px;
}
.editor-actions textarea {
  max-width: 100%;
  resize: vertical;
}
@media (min-width: 761px) {
  /* Sidebar pengaturan kiri (lebar tetap, tinggi pas layar, isi digulir), pratinjau di kanan,
     Ubah konten di bawah pratinjau. Tinggi sidebar tidak berubah saat tab atau isi berganti. */
  main:has(.editor-layout) {
    max-width: none;
    padding: 24px 32px;
  }
  main:has(.editor-layout) .page-header {
    margin-bottom: 12px;
  }
  .editor-context {
    margin-bottom: 16px;
  }
  .editor-layout {
    --editor-height: max(440px, calc(100dvh - 126px));
    grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 12px 32px;
    align-items: start;
  }
  .editor-layout > #editor-actions {
    grid-column: 1;
    grid-row: 1 / span 2;
  }
  .editor-layout > section[aria-label='Preview video'] {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }
  .editor-layout .player {
    height: clamp(260px, calc(100dvh - 240px), 760px);
    min-height: 0;
    max-height: none;
    border-radius: 6px;
  }
  .editor-layout .player video {
    max-height: 100%;
    object-fit: contain;
  }
  .editor-layout > #editor-actions:has(> .editor-rail) {
    position: sticky;
    top: 16px;
    height: var(--editor-height);
  }
}
@media (min-width: 761px) and (max-width: 1100px) {
  main:has(.editor-layout) {
    padding: 20px 24px;
  }
  .editor-layout {
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 12px 20px;
  }
}
/* Sidebar dengan rel ikon: rel mengisi sisa tinggi, panel di dalamnya digulir, tombol Proses tetap terlihat. */
#editor-actions:has(> .editor-rail) {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#editor-actions:has(> .editor-rail) > * {
  flex: none;
}
#editor-actions:has(> .editor-rail) > .editor-rail {
  flex: 1 1 auto;
  min-height: 0;
}
.editor-rail .rail-panel {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
@media (max-width: 760px) {
  .page-header {
    margin-bottom: 20px;
  }
  .header-actions {
    flex-wrap: nowrap;
    gap: 4px;
  }
  .editor-layout {
    gap: 20px;
  }
  .editor-layout > section[aria-label='Preview video'] {
    position: static;
  }
  .editor-actions {
    gap: 16px;
  }
  .project-row {
    gap: 10px;
  }
  .project-row .count {
    font-size: 12px;
  }
  .section-heading {
    gap: 4px 12px;
  }
  .section-heading > .button {
    font-size: 12px;
  }
  .raw-toolbar > p {
    flex-basis: 100%;
  }
  .workspace-dialog .dialog-actions > .button {
    flex: 1;
  }
}

/* Unggahan terputus di Cloud: satu baris per file, tanpa kartu tambahan. */
.pending-uploads {
  margin-bottom: 32px;
}
.pending-uploads > .section-heading {
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.pending-uploads > .section-heading .caption {
  font-size: 12px;
}
.pending-uploads ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pending-uploads li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
}
.pending-uploads li > div {
  flex: 1;
  min-width: 0;
  display: grid;
}
.pending-uploads .pending-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pending-uploads .button.text {
  min-height: 44px;
}

/* Penanda proyek: logo unggahan atau huruf awal berwarna tetap (kalender, daftar proyek, Detail proyek). */
.project-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  object-fit: contain;
  overflow: hidden;
}
img.project-badge {
  background: transparent;
}
.project-badge-lg {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 14px;
}
.badge-c0 {
  background: #3056d3;
}
.badge-c1 {
  background: #127551;
}
.badge-c2 {
  background: #b63138;
}
.badge-c3 {
  background: #8a5a00;
}
.badge-c4 {
  background: #7a3fb8;
}
.badge-c5 {
  background: #0f6f7d;
}
.badge-c6 {
  background: #b4430b;
}
.badge-c7 {
  background: #4b5563;
}
.calendar-event .event-project .project-badge {
  width: 14px;
  height: 14px;
  font-size: 9px;
  border-radius: 3px;
}
.month-agenda .event-project .project-badge {
  width: 18px;
  height: 18px;
  font-size: 11px;
}
.calendar-filters {
  display: flex;
  margin: -8px 0 20px;
}
.calendar-filters .template-picker {
  flex: 0 1 260px;
  min-width: 0;
}
.calendar-filters select {
  width: 100%;
  max-width: 260px;
  margin: 0;
}
@media (max-width: 760px) {
  .calendar-filters {
    margin: -4px 0 16px;
  }
  .calendar-filters .template-picker {
    flex: 1 1 100%;
  }
  .calendar-filters select {
    max-width: none;
  }
}
/* Logo di Detail proyek */
.logo-field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 16px;
}
.logo-field .project-badge {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  font-size: 20px;
}
.logo-field .logo-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  min-width: 0;
}
.logo-field .logo-status {
  font-size: 12px;
  color: var(--muted);
}

/* YouTube: tombol kirim sosial berdampingan, form kirim, dan channel per proyek di Detail proyek. */
.social-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  align-items: center;
}
.social-actions .tiktok-draft {
  margin-top: 8px;
}
.youtube-channel {
  font-weight: 600;
  font-size: 14px;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Publikasi: garis pembatas tipis dan lembut, satu baris info per video, status berupa label kecil.
   Tampilan List (baris) atau Grid (kartu 9:16), dipilih di bilah alat dan diingat per perangkat. */
.publish-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 24px;
}
.publish-toolbar select {
  margin: 0;
  min-width: 220px;
}
.view-toggle {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: var(--subtle);
}
.view-toggle .icon-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 6px;
  color: var(--muted);
}
.view-toggle .icon-button svg {
  width: 18px;
  height: 18px;
}
.view-toggle .icon-button[aria-pressed='true'] {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 2px #18212f14;
}
.publish-group {
  margin-bottom: 32px;
}
.publish-group-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.publish-group-heading h3 {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
}
.publish-group-heading span {
  min-width: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--subtle);
  color: var(--muted);
  font-size: 12px;
  line-height: 22px;
  text-align: center;
}
.publish-list {
  display: grid;
}
.publish-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f2f5;
}
.publish-row:last-child {
  border-bottom: 0;
}
.publish-poster {
  width: 44px;
  aspect-ratio: 9/16;
  border-radius: 5px;
  overflow: hidden;
  background: var(--subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}
.publish-poster img,
.publish-tile-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.publish-poster .poster-fallback {
  font-size: 9px;
  padding: 2px;
  text-align: center;
}
.publish-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.publish-title {
  display: block;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.publish-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
}
.publish-meta > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.publish-chip {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 8px;
  border-radius: 12px;
  background: var(--subtle);
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
  font-weight: 600;
  white-space: nowrap;
}
.publish-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.publish-chip.uploading,
.publish-chip.scheduled {
  background: var(--soft);
  color: var(--accent);
}
.publish-chip.sent {
  background: #e7f4ee;
  color: var(--success);
}
.publish-chip.failed {
  background: #fbeaea;
  color: var(--danger);
}
.publish-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 16px;
}
.publish-actions .button {
  margin: 0;
  width: auto;
  min-height: 40px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.publish-progress {
  grid-column: 2/-1;
  width: 100%;
  height: 4px;
  accent-color: var(--accent);
}
.publish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 24px 16px;
}
.publish-tile {
  display: grid;
  gap: 4px;
  align-content: start;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #18212f;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.publish-tile:disabled {
  cursor: not-allowed;
}
.publish-tile-poster {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 9/16;
  margin-bottom: 6px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--subtle);
}
.publish-tile-poster .publish-chip {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
  background: #fff;
  box-shadow: 0 1px 2px #18212f1f;
}
.publish-tile:hover .publish-tile-poster {
  filter: brightness(0.96);
}
.notice-inline {
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--soft);
  margin-bottom: 20px;
  font-size: 13px;
}
@media (max-width: 760px) {
  .sidebar nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .publish-toolbar select {
    min-width: 0;
  }
  .publish-toolbar .template-picker {
    flex: 1;
    min-width: 0;
  }
  .publish-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }
  .publish-row .publish-actions {
    grid-column: 2/-1;
    justify-content: flex-start;
  }
  .publish-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 12px;
  }
}

/* Dialog bergaya YouTube Studio (Kirim ke YouTube, Detail proyek): kepala, isi yang bisa digulir, bilah aksi di bawah.
   Setiap bagian punya judul dan garis pemisah sendiri agar hierarkinya jelas, tanpa disclosure yang menumpuk. */
dialog.workspace-dialog.studio-dialog {
  width: min(980px, calc(100vw - 32px));
  height: min(720px, calc(100dvh - 48px));
  max-height: none;
  padding: 0;
  overflow: hidden;
}
dialog.studio-dialog[open] {
  display: flex;
  flex-direction: column;
}
#project-info.studio-dialog {
  width: min(860px, calc(100vw - 32px));
  height: min(640px, calc(100dvh - 48px));
}
.studio-dialog [hidden] {
  display: none !important;
}
.studio-dialog > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.studio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 12px 12px 24px;
  border-bottom: 1px solid var(--line);
}
.studio-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 26px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.studio-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--line);
}
.studio-steps button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.studio-steps button span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid currentColor;
  font-size: 12px;
}
.studio-steps button[aria-current='step'] {
  color: var(--accent);
}
.studio-steps button.done {
  color: #18212f;
}
.studio-steps button.done span {
  background: #18212f;
  border-color: #18212f;
  color: #fff;
}
.studio-steps button:hover {
  color: #18212f;
}
.studio-step-line {
  flex: 0 1 120px;
  height: 2px;
  background: var(--line);
}
.studio-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}
.yt-body {
  grid-template-columns: minmax(0, 1fr) 300px;
}
.studio-tabs-body {
  grid-template-columns: 200px minmax(0, 1fr);
}
.studio-main {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 28px;
}
.studio-side {
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  background: var(--canvas);
  border-left: 1px solid var(--line);
}
.studio-preview {
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  background: #18212f;
  display: flex;
  align-items: center;
  justify-content: center;
}
.studio-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.studio-preview .poster-fallback {
  color: #fff;
  font-size: 12px;
  padding: 8px;
  text-align: center;
}
.studio-meta {
  margin: 16px 0 0;
  display: grid;
  gap: 12px;
}
.studio-meta dt {
  font-size: 12px;
  color: var(--muted);
}
.studio-meta dd {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.studio-meta a {
  color: var(--accent);
}
.studio-nav {
  min-height: 0;
  overflow-y: auto;
  padding: 12px 0;
  background: var(--canvas);
  border-right: 1px solid var(--line);
}
.studio-nav button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.studio-nav button:hover {
  background: var(--subtle);
  color: #18212f;
}
.studio-nav button[aria-selected='true'] {
  border-left-color: var(--accent);
  background: var(--soft);
  color: #18212f;
}
.studio-section {
  margin: 0 0 24px;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--line);
}
.studio-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.studio-section h3 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 24px;
}
.studio-hint {
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
}
.studio-hint:empty {
  display: none;
}
.studio-field {
  margin-top: 16px;
}
.studio-dialog .studio-field label,
.studio-field-title {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: #18212f;
}
.studio-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.studio-dialog .studio-label label,
.studio-label .studio-field-title,
.studio-label h3 {
  margin-bottom: 6px;
}
.studio-count {
  font-size: 12px;
  color: var(--muted);
}
.studio-field input:not([type='checkbox']):not([type='radio']),
.studio-field select,
.studio-field textarea {
  width: 100%;
  margin: 0;
}
.studio-options {
  display: grid;
}
.studio-dialog label.studio-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  margin: 0;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 400;
  color: #18212f;
  cursor: pointer;
}
.studio-check input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
  cursor: pointer;
}
.studio-check strong {
  display: block;
  font-weight: 600;
}
.studio-check small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
}
.studio-choice {
  margin-top: 12px;
  padding: 4px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.studio-choice-title {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #18212f;
}
.studio-choice .yt-when {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 0 12px 32px;
}
.studio-dialog .studio-choice .yt-when label {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
}
.studio-choice .yt-when input {
  width: 100%;
  margin: 0;
}
/* Tanggal dan jam satu baris; pindah ke baris berikut hanya bila tidak muat (HP). */
.studio-choice .yt-when {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}
.time-24,
.date-dmy {
  display: flex;
  align-items: center;
  gap: 4px;
}
.time-24 select,
.date-dmy select {
  width: 76px;
  margin: 0;
  padding-left: 10px;
}
.date-dmy #yt-year {
  width: 92px;
}
.time-24 span,
.date-dmy span {
  color: var(--muted);
  font-weight: 600;
}
.studio-choice + .studio-hint {
  margin-top: 12px;
}
.studio-message h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 26px;
}
.studio-message p {
  margin: 0 0 16px;
  color: var(--muted);
}
.studio-message .button {
  margin: 0;
}
.studio-facts {
  margin: 8px 0 16px;
  display: grid;
}
.studio-facts div {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.studio-facts dt {
  color: var(--muted);
}
.studio-facts dd {
  margin: 0;
  font-weight: 600;
}
.studio-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}
.studio-links .button {
  margin: 0;
}
.studio-message #yt-again {
  margin: 8px 0 0;
}
.studio-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.studio-card-text {
  display: grid;
  min-width: 0;
}
.studio-card-text .studio-field-title {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.studio-card .button {
  margin: 0;
}
.studio-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 4px;
}
.studio-inline-actions .button {
  margin: 0;
}
.studio-dialog .logo-field {
  margin: 0;
}
.studio-dialog .logo-field .button {
  margin: 0;
}
.studio-dialog .source-toolbar {
  margin-top: 16px;
}
.studio-dialog .source-toolbar .button,
.studio-dialog .source-search .button {
  margin: 0;
}
.studio-dialog #source-list {
  margin-top: 16px;
}
.studio-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.studio-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.studio-status > div {
  min-width: 0;
  flex: 1;
}
.studio-status p {
  margin: 0;
  font-size: 13px;
  line-height: 20px;
}
.studio-status p:empty {
  display: none;
}
.studio-status progress {
  display: block;
  width: 100%;
  max-width: 280px;
  height: 6px;
  margin: 4px 0;
  accent-color: var(--accent);
}
.studio-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}
.studio-dialog .studio-actions .button {
  margin: 0;
  width: auto;
}
@media (max-width: 760px) {
  dialog.workspace-dialog.studio-dialog,
  #project-info.studio-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: none;
    padding: 0;
  }
  .studio-head {
    padding: 8px 8px 8px 16px;
  }
  .studio-steps {
    padding: 4px 16px;
    justify-content: space-between;
  }
  .studio-main {
    padding: 16px;
  }
  .yt-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .studio-side {
    order: -1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-left: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .studio-side .studio-preview {
    flex: 0 0 96px;
  }
  .studio-meta {
    margin: 0;
    gap: 4px;
    min-width: 0;
  }
  .studio-meta > div:not(:first-child) {
    display: none;
  }
  .studio-tabs-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .studio-nav {
    display: flex;
    overflow-x: auto;
    padding: 0 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .studio-nav button {
    width: auto;
    flex: none;
    padding: 10px 12px;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }
  .studio-nav button[aria-selected='true'] {
    border-bottom-color: var(--accent);
    background: transparent;
  }
  .studio-facts div {
    grid-template-columns: 120px minmax(0, 1fr);
  }
  .studio-choice .yt-when {
    padding-left: 0;
  }
  .studio-foot {
    padding: 10px 16px;
    flex-wrap: wrap;
  }
  .studio-actions {
    margin-left: auto;
  }
  .studio-card {
    flex-wrap: wrap;
  }
}

/* Identitas: logo aplikasi di sidebar; ikon navigasi dan judul halaman hitam. */
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wordmark img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex: none;
}
/* Ikon bagian: hitam (warna teks utama), tanpa latar. */
.page-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: #18212f;
}
.page-heading .page-icon svg,
.sidebar nav .page-icon svg {
  width: 24px;
  height: 24px;
  color: inherit;
}
.page-heading .project-badge-xl {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  font-size: 17px;
}
.project-badge-xl {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 18px;
}

/* Bilah alat halaman (filter, template, tab): satu baris dengan garis bawah, terpisah dari isi. */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 0 0 24px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}
.page-toolbar select {
  margin: 0;
}
.page-toolbar + .section-heading,
main .section-heading {
  margin-bottom: 16px;
}
.section-heading h3 {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
}
.section-heading .button svg {
  width: 18px;
  height: 18px;
}

/* Proyek: kartu per proyek dengan logo, jumlah hasil, dan channel YouTube. */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.project-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #18212f;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.project-card:hover {
  border-color: #c5cfdf;
  background: var(--canvas);
}
.project-card:active {
  filter: brightness(0.98);
}
.project-card-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.project-card-copy strong {
  font-size: 15px;
  line-height: 22px;
  overflow-wrap: anywhere;
}
.project-card-copy span {
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
}
.project-card-copy .project-card-channel {
  color: #b8323a;
  overflow-wrap: anywhere;
}

/* Workspace: baris terakhir dikerjakan menampilkan penanda proyek. */
.recent-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.recent-meta .project-badge {
  width: 16px;
  height: 16px;
}

/* Editor: Publikasikan sejajar dengan Unduh, Bagikan, Jadwalkan. */
.editor-action-row.four {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 760px) {
  .page-heading .project-badge-xl {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
  .page-heading > .icon-button + .page-icon,
  .page-heading > .icon-button + .project-badge {
    display: none;
  }
  .project-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .page-toolbar {
    padding-bottom: 12px;
    margin-bottom: 20px;
  }
}
/* Aksi bagian (mis. Proses, Pengingat) dikelompokkan di kanan judul bagian. */
.section-heading > h3 + .button {
  margin-left: auto;
}
.section-heading > .button {
  margin-top: 0;
  width: auto;
}
/* Cloud: Pilih berada di bilah alat yang sama; saat memilih, bilah pilihan memakai satu baris penuh. */
.cloud-filters.page-toolbar {
  justify-content: flex-start;
}
.cloud-filters .cloud-tabs {
  margin-right: auto;
}
.page-toolbar .cloud-selection-controls {
  margin: 0;
}
.page-toolbar .cloud-selection-controls:has(.cloud-selection-bar:not([hidden])) {
  flex: 1 1 100%;
}
/* Filter proyek di Kalender dan Publikasi: dipisahkan dari isi dengan garis yang sama. */
.calendar-filters {
  margin: 0 0 20px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}
.calendar-filters select {
  margin: 0;
}
@media (max-width: 760px) {
  .sidebar > .wordmark {
    display: none;
  }
}
/* Garis pembatas bilah alat dibuat lebih lembut agar tidak mencolok. */
.page-toolbar,
.calendar-filters {
  border-bottom-color: #eef1f5;
}
/* Kalender: satu bilah (Hari ini, panah, nama bulan di kiri; filter proyek di kanan) dengan garis lembut. */
.calendar-toolbar {
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eef1f5;
}
.calendar-toolbar .month-controls {
  gap: 4px;
}
.calendar-toolbar .month-controls h2 {
  margin: 0 0 0 8px;
  font-size: 20px;
  line-height: 28px;
}
.calendar-toolbar .month-controls .button {
  margin: 0 8px 0 0;
  min-height: 40px;
  padding: 8px 16px;
}
.calendar-project-picker select {
  margin: 0;
  min-width: 220px;
}
.calendar-note {
  margin: 0 0 16px;
}
@media (min-width: 761px) {
  .calendar-day {
    min-height: 120px;
  }
}

/* Workspace: kartu mulai satu baris, daftar terakhir dikerjakan ringkas dengan garis lembut. */
.start-area {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 24px;
  padding: 24px 28px;
}
.start-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.start-copy h2 {
  margin: 0;
  font-size: 18px;
  line-height: 26px;
}
.start-copy p {
  margin: 0;
}
.start-project {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.start-area > .button {
  margin: 0;
  width: auto;
}
.recent-section .recent-row {
  min-height: 0;
  padding: 12px 0;
  gap: 14px;
  border-bottom-color: #f0f2f5;
}
.recent-section .recent-row:last-child {
  border-bottom: 0;
}
.recent-section .recent-poster,
.recent-section .recent-row > .poster-fallback {
  width: 44px;
  height: 78px;
  object-fit: cover;
  border-radius: 5px;
  flex: none;
}
.recent-section .recent-copy strong {
  font-size: 14px;
  line-height: 20px;
}
@media (max-width: 760px) {
  .calendar-toolbar .month-controls {
    flex: 1 1 100%;
  }
  .calendar-toolbar .month-controls h2 {
    font-size: 18px;
    margin-left: 4px;
  }
  .calendar-project-picker {
    flex: 1 1 100%;
  }
  .calendar-project-picker select {
    min-width: 0;
    width: 100%;
  }
  .start-area {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .start-area > .button {
    width: 100%;
  }
}
.recent-meta .project-badge {
  color: #fff;
  font-size: 10px;
}
/* Tanpa garis pembatas di bilah alat (Proyek, Cloud, Kalender): cukup jarak, seperti Publikasi. */
.page-toolbar,
.calendar-toolbar,
.calendar-filters {
  border-bottom: 0;
  padding-bottom: 0;
}
.project-context.page-toolbar {
  margin-bottom: 28px;
}
.project-links {
  gap: 16px;
}
/* Halaman proyek tampilan List. */
.project-result-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid #f0f2f5;
  background: none;
  color: #18212f;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.project-result-row:last-child {
  border-bottom: 0;
}
.project-result-row:hover {
  background: var(--canvas);
}
.project-result-row .publish-chip {
  margin: 0;
}
/* Dialog template editing otomatis bergaya Studio. */
#templates-dialog.studio-dialog {
  width: min(720px, calc(100vw - 32px));
  height: min(700px, calc(100dvh - 48px));
}
.studio-single {
  grid-template-columns: minmax(0, 1fr);
}
.studio-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
#templates-dialog .template-list {
  display: grid;
  margin-top: 12px;
}
#templates-dialog .template-row {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid #f0f2f5;
  background: none;
  text-align: left;
  font: inherit;
  color: #18212f;
  cursor: pointer;
}
#templates-dialog .template-row:last-child {
  border-bottom: 0;
}
#templates-dialog .template-row:hover {
  background: var(--canvas);
}
#templates-dialog .target-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
#templates-dialog .target-custom input {
  max-width: 140px;
}
#templates-dialog .studio-check {
  margin-top: 12px;
}
@media (max-width: 760px) {
  #templates-dialog.studio-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
  }
  .studio-row {
    grid-template-columns: 1fr;
  }
}
/* Editor video: ringkasan hasil dalam kartu lembut berlabel; menu di bawah (Lokasi file, Raw, Buat versi lain,
   Ubah konten, Teks awal, Sesuaikan) menjadi daftar baris dengan garis tipis, label gelap dan ikon abu. */
.result-summary {
  gap: 10px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--canvas);
}
.result-facts {
  display: grid;
  gap: 4px;
  margin: 0;
}
.result-facts div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  font-size: 12px;
  line-height: 18px;
}
.result-facts dt {
  color: var(--muted);
}
.result-facts dd {
  margin: 0;
  color: #18212f;
  overflow-wrap: anywhere;
}
.editor-utilities {
  padding-top: 0;
}
.editor-utilities > *,
.editor-actions > .content-actions,
.cut-setup > .editor-disclosure {
  border-top: 1px solid #f0f2f5;
}
.editor-actions > .content-actions {
  margin-top: -16px;
}
.editor-disclosure > summary {
  color: #18212f;
}
.editor-disclosure > summary > svg {
  color: var(--muted);
}
.editor-disclosure > summary .disclosure-value {
  color: var(--muted);
  font-weight: 400;
}
.raw-line {
  flex-wrap: nowrap;
  min-height: 48px;
}
.raw-line > a {
  min-width: 0;
  overflow: hidden;
}
.raw-line > a span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.raw-line .button {
  margin: 0;
}
/* Isi bagian yang dibuka menjorok sejajar teks judul bagian; label isian lebih ringan dari judul bagian. */
.editor-disclosure > .disclosure-body {
  padding-left: 30px;
  padding-bottom: 16px;
}
.editor-disclosure .editor-field-label label,
.editor-disclosure .disclosure-body > label {
  font-weight: 500;
  color: var(--muted);
}
.editor-disclosure .editor-field + .editor-field {
  margin-top: 4px;
}
@media (max-width: 760px) {
  .editor-disclosure > .disclosure-body {
    padding-left: 0;
  }
}
/* Publikasi: filter proyek, cari judul, urutan; tanggal diunggah; ganti judul di samping judul. */
.publish-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.publish-filters select {
  margin: 0;
}
.publish-filters .publish-sort select {
  min-width: 200px;
}
.publish-search input {
  width: 220px;
  height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--canvas);
  font: inherit;
  font-size: 13px;
  color: #18212f;
}
.publish-row {
  grid-template-columns: 44px minmax(0, 1fr) auto auto auto;
}
.publish-title-line {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.publish-title-line .publish-title {
  min-width: 0;
}
.publish-rename.icon-button {
  width: 32px;
  height: 32px;
  min-width: 32px;
  color: var(--muted);
  flex: none;
  opacity: 0.7;
}
.publish-rename.icon-button svg {
  width: 16px;
  height: 16px;
}
.publish-rename.icon-button:hover,
.publish-rename.icon-button:focus-visible {
  opacity: 1;
  color: #18212f;
}
.publish-date {
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
  white-space: nowrap;
}
.publish-tile .publish-date {
  white-space: normal;
}
.publish-tile-poster {
  width: 100%;
  padding: 0;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.publish-tile-poster:disabled {
  cursor: not-allowed;
}
.publish-tile:hover .publish-tile-poster {
  filter: none;
}
.publish-tile-poster:hover {
  filter: brightness(0.96);
}
/* HP: toolbar dua baris (cari + tampilan, lalu proyek + urutkan); baris video: poster kiri, isi bertumpuk rapat. */
@media (max-width: 760px) {
  .publish-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
  }
  .publish-filters {
    display: contents;
  }
  .publish-search {
    grid-column: 1/-1;
    grid-row: 1;
    margin-right: 88px;
  }
  .publish-toolbar .view-toggle {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .publish-filters > label.template-picker:not(.publish-sort) {
    grid-column: 1;
    grid-row: 2;
  }
  .publish-filters .publish-sort {
    grid-column: 2;
    grid-row: 2;
  }
  .publish-filters:not(:has(#publish-project)) .publish-sort {
    grid-column: 1/-1;
  }
  .publish-filters > label {
    min-width: 0;
  }
  .publish-search input,
  .publish-filters select,
  .publish-filters .publish-sort select {
    width: 100%;
    min-width: 0;
    height: 40px;
    font-size: 14px;
  }
  .publish-filters select {
    padding-top: 0;
    padding-bottom: 0;
    text-overflow: ellipsis;
  }
  .publish-toolbar .view-toggle .icon-button {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }
  .publish-row {
    grid-template-columns: 48px auto minmax(0, 1fr);
    gap: 6px 10px;
    align-items: center;
    padding: 14px 0;
  }
  .publish-row .publish-poster {
    grid-column: 1;
    grid-row: 1 / span 3;
    align-self: start;
    width: 48px;
  }
  .publish-row .publish-copy {
    grid-column: 2/-1;
    grid-row: 1;
  }
  .publish-row .publish-chip {
    grid-column: 2;
    grid-row: 2;
    padding: 0 8px 0 6px;
    line-height: 20px;
  }
  .publish-row .publish-date {
    grid-column: 3;
    grid-row: 2;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .publish-row .publish-actions {
    grid-column: 2/-1;
    grid-row: 3;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px 12px;
    margin-top: 2px;
  }
  .publish-row .publish-actions .button {
    min-height: 36px;
    padding: 6px 14px;
    font-size: 13px;
  }
  .publish-row .publish-actions .button.text {
    padding-left: 4px;
    padding-right: 4px;
  }
  .publish-row .publish-progress {
    grid-column: 2/-1;
    grid-row: 4;
  }
  .publish-row .publish-title-line {
    margin-right: -6px;
  }
}

/* Impor folder konten */
.folder-path {
  display: flex;
  gap: 8px;
}
.folder-path input {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.folder-path .button {
  margin: 0;
  width: auto;
  flex: none;
}
.folder-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.folder-list-head h3 {
  margin: 0;
}
.folder-list {
  display: grid;
}
.folder-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: start;
  gap: 4px 12px;
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
  font-weight: 400;
}
.folder-row:last-child {
  border-bottom: 0;
}
.folder-row input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}
.folder-row.blocked {
  cursor: default;
}
.folder-row.blocked .folder-copy {
  opacity: 0.6;
}
.folder-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.folder-copy strong {
  font-size: 14px;
  line-height: 20px;
}
.folder-copy small {
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.folder-copy .folder-note {
  color: #7a5a00;
}
.folder-row .publish-chip {
  margin-top: 1px;
}
.folder-side {
  display: grid;
  justify-items: end;
  gap: 4px;
}
.folder-side .publish-chip {
  justify-self: end;
}
.folder-done {
  min-height: 28px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.folder-done:hover {
  color: #18212f;
}
.folder-done:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.folder-finished {
  margin-top: 4px;
  border-top: 1px solid #f0f2f5;
}
.folder-finished summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.folder-finished summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.folder-row.done {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 4px 0;
  cursor: default;
  border-bottom: 0;
}
.folder-row.done .folder-copy strong {
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.folder-empty {
  padding: 12px 0;
}
.yt-pin {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f2f5;
}
.yt-pin h4 {
  margin: 0;
  font-size: 13px;
}
.yt-pin p {
  margin: 0;
  white-space: pre-wrap;
}
.yt-pin .button {
  justify-self: start;
  width: auto;
  margin: 0;
}
@media (max-width: 760px) {
  .publish-import {
    display: none;
  }
}
.folder-side-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Ruang: pemilih ruang di sidebar (desktop) dan di ujung bilah bawah (HP). */
.sidebar nav[hidden] {
  display: none;
}
.space-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  margin: -16px 0 -8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #18212f;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.space-switch:hover {
  background: var(--subtle);
}
.space-switch:focus-visible,
.space-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.space-switch .page-icon svg {
  width: 20px;
  height: 20px;
}
.space-label {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 18px;
}
.space-caption {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.space-name {
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.space-chevron {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.space-dialog {
  width: min(420px, calc(100vw - 32px));
}
.space-list {
  display: grid;
  gap: 8px;
}
.space-option {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #18212f;
  text-decoration: none;
}
.space-option:hover {
  background: var(--subtle);
}
.space-option[aria-current] {
  border-color: var(--accent);
  background: var(--soft);
}
.space-option > span:last-child {
  display: grid;
  line-height: 20px;
}
.space-option small {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}
@media (max-width: 760px) {
  .sidebar {
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }
  .sidebar nav {
    flex: 1;
    margin: 0;
  }
  .sidebar nav[data-space-nav='links'],
  .sidebar nav[data-space-nav='tasks'] {
    grid-template-columns: minmax(0, 96px);
    justify-content: start;
  }
  .space-switch {
    order: 2;
    flex: none;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    width: 64px;
    min-height: 54px;
    margin: 0;
    padding: 4px 2px;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
  }
  .space-switch .page-icon svg {
    width: 24px;
    height: 24px;
  }
  .space-label {
    flex: none;
  }
  .space-caption {
    font-size: 12px;
    line-height: 16px;
  }
  .space-name,
  .space-chevron {
    display: none;
  }
}

/* Ruang Tautan */
.link-list {
  display: grid;
}
.link-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 14px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f2f5;
}
.link-row:last-child {
  border-bottom: 0;
}
.link-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 15px;
}
.link-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.link-title {
  font-weight: 650;
  color: #18212f;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  justify-self: start;
  max-width: 100%;
}
.link-title:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-title:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.link-domain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.link-warning {
  padding: 0 8px;
  border-radius: 10px;
  background: #fff4e0;
  color: #7a5a00;
  font-weight: 600;
}
.link-note {
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.link-actions .icon-button svg {
  width: 20px;
  height: 20px;
}
.link-actions .is-favorite {
  color: #b7791f;
}
.links-empty {
  padding: 16px 0;
}
.link-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 0;
  font-weight: 500;
}
.link-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}
#link-dialog input:not([type='checkbox']),
#link-dialog textarea {
  margin-bottom: 12px;
}
#link-dialog textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--canvas);
  font: inherit;
  resize: vertical;
}
.link-delete {
  margin-right: auto;
}
@media (max-width: 760px) {
  .link-row {
    gap: 4px 10px;
  }
  .link-actions {
    gap: 0;
    margin-right: -8px;
  }
  .link-actions .icon-button {
    width: 40px;
    min-width: 40px;
  }
  .links-toolbar {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .links-toolbar .publish-search {
    flex: 1;
    min-width: 0;
    margin-right: 0;
  }
  .links-toolbar .publish-search input {
    width: 100%;
    min-width: 0;
    height: 40px;
  }
  .links-toolbar .template-picker {
    flex: 0 0 136px;
    min-width: 0;
  }
  .links-toolbar select {
    width: 100%;
    min-width: 0;
    height: 40px;
  }
}

/* Ruang Tugas */
.task-list {
  display: grid;
}
.task-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 4px 14px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f2f5;
}
.task-row:last-child {
  border-bottom: 0;
}
.task-check {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.task-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.task-title {
  justify-self: start;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: #18212f;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.task-title:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.task-title:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.task-row.done .task-title {
  color: var(--muted);
  font-weight: 500;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
}
.task-due.late {
  color: var(--danger);
  font-weight: 600;
}
.task-flag {
  padding: 0 8px;
  border-radius: 10px;
  background: #fff4e0;
  color: #7a5a00;
  font-weight: 600;
}
.task-project {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.task-note {
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tasks-done {
  margin-top: 12px;
}
.task-when {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
#task-dialog input:not([type='checkbox']),
#task-dialog textarea,
#task-dialog select {
  margin-bottom: 12px;
}
#task-dialog textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--canvas);
  font: inherit;
  resize: vertical;
}
#task-dialog .date-dmy {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}
#task-dialog .date-dmy select {
  width: 76px;
  margin: 0;
  padding-left: 10px;
}
#task-dialog #task-year {
  width: 92px;
}
#task-dialog .date-dmy span {
  color: var(--muted);
  font-weight: 600;
}
/* Tugas di Kalender: baris ringkas, beda dari kartu jadwal tayang. */
.calendar-task {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 28px;
  padding: 2px 6px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #18212f;
  font: inherit;
  font-size: 12px;
  line-height: 16px;
  text-align: left;
  cursor: pointer;
}
.calendar-task:hover {
  background: var(--subtle);
}
.calendar-task svg {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--muted);
}
.calendar-task span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-task.late svg,
.calendar-task.late {
  color: var(--danger);
}
.agenda-day .calendar-task {
  min-height: 40px;
  font-size: 14px;
  padding: 6px 8px;
}
.calendar-day,
.day-events {
  min-width: 0;
}
.calendar-task {
  max-width: 100%;
  min-width: 0;
}
/* Penanda data yang ditambahkan AI lewat MCP. */
.ai-chip {
  padding: 0 7px;
  border-radius: 10px;
  background: var(--subtle);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0.3px;
}

/* Keamanan: token akses */
.space-footer {
  display: flex;
  justify-content: flex-start;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #f0f2f5;
}
.security-dialog {
  width: min(640px, calc(100vw - 32px));
  height: auto;
  max-height: min(760px, calc(100dvh - 48px));
}
.scope-table {
  display: grid;
  gap: 2px;
  margin: 8px 0 12px;
}
.scope-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px 88px;
  align-items: center;
  min-height: 40px;
  border-bottom: 1px solid #f0f2f5;
}
.scope-row:last-child {
  border-bottom: 0;
}
.scope-row > span {
  font-size: 14px;
}
.scope-row .link-check {
  margin: 0;
}
.token-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f2f5;
}
.token-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.token-row small {
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
}
.security-new {
  margin-top: 12px;
}
.security-new summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.security-new input {
  margin-bottom: 8px;
}
.security-reveal {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #fff4e0;
}
.security-reveal p {
  margin: 0 0 8px;
  color: #18212f;
}
.security-token {
  display: flex;
  align-items: center;
  gap: 8px;
}
.security-token code {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  overflow-wrap: anywhere;
  user-select: all;
}

/* Halaman masuk (akses dari HP/perangkat lain) */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
  padding: 24px;
}
.login-card {
  width: min(380px, 100%);
  margin: 0;
  padding: 32px 28px;
  min-height: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 24px;
}
.login-card h1 {
  font-size: 22px;
  line-height: 30px;
}
.login-card .wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-card form {
  display: grid;
  gap: 8px;
}
.login-card label {
  font-weight: 600;
  font-size: 13px;
}
.login-card .error-text {
  font-size: 13px;
  min-height: 0;
}
.login-card .error-text:empty {
  display: none;
}
.login-card .button {
  width: 100%;
  margin-top: 12px;
}
.login-note {
  font-size: 13px;
  line-height: 21px;
}
.login-card form[hidden],
.login-card [hidden] {
  display: none;
}
.login-card .button.text {
  margin-top: 0;
}
.login-links {
  display: flex;
  gap: 8px;
}
.login-card #login-lead {
  margin: -12px 0 0;
}
.space-account {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.security-login {
  display: grid;
  gap: 8px;
}
.security-login label {
  margin: 8px 0 0;
}
.security-login .button {
  justify-self: start;
  margin-top: 8px;
}
.security-login-state {
  font-size: 13px;
  color: var(--muted);
}
.security-login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  align-items: center;
}

/* Rencana edit (plan-editor.js): daftar rencana, lalu editor ala CapCut yang ringan.
   Pratinjau di tengah, panel pengaturan kanan (satu tab sekaligus), timeline dua jalur di bawah. */
.plan-list {
  display: grid;
  gap: 4px;
}
.plan-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.plan-name {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 420px;
  font-weight: 600;
}
dialog.workspace-dialog.studio-dialog.plan-editing {
  width: min(1320px, calc(100vw - 24px));
  height: calc(100dvh - 24px);
}
.plan-editing .studio-head {
  padding: 8px 12px;
}
.plan-editor {
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-rows: minmax(0, 1fr) auto;
  background: var(--canvas);
}
.pe-stage {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 16px 8px;
}
.pe-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}
.pe-frame.is-landscape {
  aspect-ratio: 16 / 9;
  flex: 0 1 auto;
  width: 100%;
  max-height: 100%;
}
.pe-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Posisi, perataan dan geser diisi text-style-ui.js paintText (CSSOM), lebar blok = baris terpanjang. */
.pe-text {
  position: absolute;
  width: max-content;
  max-width: 86%;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
  pointer-events: none;
  -webkit-text-stroke: var(--outline, 0) var(--outline-color, #000);
  paint-order: stroke fill;
}
.pe-text.movable {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.pe-text.movable:hover,
.pe-text.dragging {
  outline: 1px dashed rgb(255 255 255 / 0.8);
  outline-offset: 4px;
}
.pe-text.dragging {
  cursor: grabbing;
}
.pe-text[hidden] {
  display: none;
}
.pe-empty {
  position: absolute;
  inset: auto 12px 12px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgb(0 0 0 / 0.7);
  color: #fff;
  font-size: 13px;
}
.pe-transport {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  width: min(100%, 360px);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--muted);
}
.pe-transport span:last-child {
  text-align: right;
}
.pe-play {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #18212f;
  color: #fff;
  cursor: pointer;
}
.pe-play svg {
  width: 18px;
  height: 18px;
}
.pe-side {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: #fff;
}
.pe-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.pe-tabs button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 6px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.pe-tabs svg {
  width: 18px;
  height: 18px;
}
.pe-tabs button[aria-selected='true'] {
  color: #18212f;
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.pe-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px 18px;
  display: grid;
  align-content: start;
  gap: 14px;
}
.pe-panel h3 {
  margin: 0;
  font-size: 14px;
}
.pe-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.pe-field > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.pe-field textarea {
  resize: vertical;
}
.pe-pair {
  display: flex;
  align-items: end;
  gap: 8px;
}
.pe-pair .pe-field {
  flex: 1;
}
.pe-seg {
  display: flex;
  padding: 2px;
  border-radius: 8px;
  background: var(--subtle);
}
.pe-seg button {
  flex: 1;
  min-width: 0;
  padding: 6px 4px;
  border: 0;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 13px;
  color: #18212f;
  cursor: pointer;
}
.pe-seg button[aria-pressed='true'] {
  background: #fff;
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.14);
  font-weight: 600;
}
.pe-seg .font-bold {
  font-family: 'Segoe UI Black', 'Arial Black', sans-serif;
  font-weight: 900;
}
.pe-seg .font-regular {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-weight: 400;
}
.pe-seg .font-serif {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
}
.pe-seg .font-mono {
  font-family: Consolas, 'Courier New', monospace;
  font-weight: 700;
}
.pe-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.pe-swatch {
  position: relative;
  display: block;
  flex: none;
  margin: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgb(16 24 40 / 0.2);
  border-radius: 50%;
  background: var(--swatch, #fff);
  cursor: pointer;
}
.pe-swatches > .pe-swatch {
  margin: 0;
}
.pe-swatch[aria-pressed='true'] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.pe-custom {
  overflow: hidden;
  background: conic-gradient(#ff3b30, #ffd400, #34c759, #00c7ff, #3056d3, #ff5fa2, #ff3b30);
}
.pe-custom input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.pe-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.pe-switch input {
  width: 18px;
  height: 18px;
}
.pe-timeline {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 8px 12px 12px;
  min-width: 0;
}
.pe-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}
.pe-tools .button svg {
  width: 16px;
  height: 16px;
}
.pe-total {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pe-add {
  position: relative;
  margin-right: 8px;
}
.pe-media {
  position: absolute;
  z-index: 5;
  left: 0;
  bottom: calc(100% + 6px);
  width: min(320px, 80vw);
  max-height: 300px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 28px rgb(16 24 40 / 0.16);
}
.pe-media p {
  margin: 0 4px 6px;
}
.pe-media button {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px;
  border: 0;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.pe-media button:hover {
  background: var(--subtle);
}
.pe-media img,
.pe-thumb {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--subtle);
  display: grid;
  place-items: center;
}
.pe-thumb svg {
  width: 16px;
  height: 16px;
}
.pe-media span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pe-media small {
  color: var(--muted);
}
.pe-tracks {
  display: grid;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior: contain;
  padding-bottom: 4px;
}
.pe-track {
  display: flex;
  gap: 3px;
  min-width: max-content;
}
.pe-block {
  position: relative;
  flex: 1 1 0;
  min-width: 76px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 2px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}
.pe-track-video .pe-block {
  height: 52px;
  background: #dfe6f7;
  color: #18212f;
}
.pe-track-video .pe-block span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pe-track-video .pe-block small {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pe-track-text .pe-block {
  height: 30px;
  background: var(--subtle);
  color: var(--muted);
}
.pe-track-text .pe-block.has-text {
  background: #fdf0c4;
  color: #4a3b00;
}
.pe-track-text .pe-block span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pe-block svg {
  flex: none;
  width: 14px;
  height: 14px;
}
.pe-block[aria-pressed='true'] {
  border-color: #18212f;
}
.pe-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--danger);
  pointer-events: none;
}
@media (max-width: 760px) {
  dialog.workspace-dialog.studio-dialog.plan-editing {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }
  .plan-editor {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .pe-stage,
  .pe-side {
    min-height: auto;
  }
  /* Pratinjau tetap terlihat saat panel teks digulir. */
  .pe-stage {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 8px 10px 6px;
    background: var(--canvas);
    border-bottom: 1px solid var(--line);
  }
  .pe-tools {
    flex-wrap: wrap;
  }
  .pe-total {
    flex-basis: 100%;
    margin: 4px 0 0;
  }
  .pe-frame {
    flex: none;
    height: 34dvh;
  }
  .pe-frame.is-landscape {
    height: auto;
  }
  .pe-timeline {
    grid-column: auto;
    grid-row: 2;
    border-bottom: 1px solid var(--line);
  }
  .pe-side {
    grid-row: 3;
    border-left: 0;
  }
  .pe-panel {
    overflow: visible;
  }
}

/* Pratinjau langsung di editor video (live-preview.js): bingkai sesuai Format, teks awal, strip potongan. */
.player.live-preview {
  background: #0d1117;
}
.lp-frame {
  position: relative;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.lp-frame.lp-portrait {
  aspect-ratio: 9 / 16;
}
.lp-frame.lp-landscape {
  aspect-ratio: 16 / 9;
}
.player .lp-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  cursor: pointer;
}
.lp-bar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 10px;
}
.lp-bar .pe-play {
  flex: none;
}
.lp-track {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}
.lp-strip {
  position: relative;
  height: 14px;
  margin-top: 6px;
  border-radius: 4px;
  background: repeating-linear-gradient(135deg, #e7eaf0 0 6px, #f4f5f8 6px 12px);
  cursor: pointer;
  overflow: hidden;
}
.lp-keep {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 3px;
  background: #b9c8f3;
  pointer-events: none;
}
.lp-head {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--danger);
  pointer-events: none;
  z-index: 1;
}
.lp-facts {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.lp-notes {
  margin: 0;
  font-size: 12px;
}
.hook-more {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}
.hook-more[hidden] {
  display: none;
}
.text-style {
  display: grid;
  gap: 12px;
}
@media (max-width: 760px) {
  .player.live-preview {
    height: min(56svh, 520px);
  }
}
.text-nudge {
  margin: 0;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.text-nudge output {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.text-nudge input {
  width: 100%;
  height: 24px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  accent-color: var(--accent);
}

/* Rel ikon editor video (editor-panel.js RAIL): ikon di kiri, satu kelompok pengaturan di kanan, pilihan berupa tombol. */
.cut-setup.editor-rail {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.rail-icons {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 4px;
  background: var(--canvas);
  border-right: 1px solid var(--line);
}
.rail-icons button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.rail-icons svg {
  width: 18px;
  height: 18px;
}
.rail-icons button:hover {
  background: var(--subtle);
  color: #18212f;
}
.rail-icons button[aria-selected='true'] {
  background: var(--soft);
  color: var(--accent);
}
.rail-panel {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 12px 14px 16px;
}
.rail-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rail-head h3 {
  margin: 0;
  font-size: 14px;
  flex: 1;
}
.editor-actions .rail-summary {
  margin: -10px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.rail-field {
  display: grid;
  gap: 6px;
}
.rail-field .editor-field-label span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.chip-row button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.chip-wrap,
.chip-grid {
  flex-wrap: wrap;
  gap: 2px;
}
.chip-wrap button {
  flex: 1 0 auto;
  padding-inline: 10px;
}
.chip-grid button {
  flex: 1 0 calc(50% - 2px);
}
.choice-list {
  display: grid;
  gap: 4px;
}
.choice-list button {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  text-align: left;
  color: #18212f;
  cursor: pointer;
}
.choice-list button[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--soft);
  font-weight: 600;
}
.pe-text.sample {
  opacity: 0.45;
}
@media (max-width: 760px) {
  /* HP: pratinjau di atas, sidebar setinggi tetap dengan isi digulir, Ubah konten paling bawah. */
  .editor-layout .player.live-preview {
    height: 34svh;
    min-height: 200px;
  }
  /* Pratinjau menempel di atas selama mengatur, jadi perubahan teks tetap terlihat. */
  .editor-layout:has(.live-preview) > section[aria-label='Preview video'] {
    position: sticky;
    top: 0;
    z-index: 4;
    margin: 0 -16px;
    padding: 8px 16px 6px;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }
  .editor-layout:has(.live-preview) .lp-notes {
    display: none;
  }
  #editor-actions:has(> .editor-rail) > .editor-rail {
    flex: none;
    height: max(320px, calc(66svh - 170px));
  }
}
/* Isi bingkai Penuh: pratinjau diperbesar memenuhi bingkai seperti hasil (FFmpeg scale increase + crop). */
.pe-frame.is-cover video,
.player .lp-frame.lp-cover video {
  object-fit: cover;
}

/* Header editor video: logo proyek, judul + pensil, baris kecil nama proyek · status (tanpa baris konteks terpisah). */
.editor-header .page-heading {
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.project-badge.project-badge-header {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  font-size: 18px;
  font-weight: 700;
}
img.project-badge.project-badge-header {
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}
.editor-header .title-stack {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.editor-header .title-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.editor-header .title-row h1 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-header .editor-context {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin: 0;
  min-width: 0;
  font-size: 13px;
  color: var(--muted);
}
.page-header .editor-context a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}
.page-header .editor-context a:hover {
  color: #18212f;
  text-decoration: underline;
}
.page-header .editor-context span {
  flex: none;
  text-align: left;
  white-space: nowrap;
}
.page-header .editor-context .status-saved {
  color: var(--success);
}
@media (max-width: 760px) {
  .editor-header .page-heading > .icon-button + .project-badge {
    display: inline-flex;
  }
  .project-badge.project-badge-header {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
  .editor-header .title-row h1 {
    display: block;
    white-space: nowrap;
  }
}
