/* The scene header and tabs stay fixed while the active collection scrolls. */
.scene-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 20px;
  margin-bottom: 18px;
  border-bottom: 1px solid #d9e4df1c;
}

.scene-tabs [role="tab"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 2px 10px;
  border-bottom: 2px solid transparent;
  color: #c0d1c4a6;
  font-size: 12px;
}

.scene-tabs [role="tab"][aria-selected="true"] {
  border-bottom-color: #ead2a5;
  color: #f1e4c9;
}

#saved-view-count {
  padding: 2px 5px;
  border: 1px solid #d5ded61a;
  border-radius: 5px;
  color: #c2d1c0b8;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.scene-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

#scene-browse-panel {
  overflow: hidden;
}

#scene-saved-panel {
  flex-grow: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #6a7a76 transparent;
}

/* Empty and short collections use only the height they need. */
#scene-dialog[open][data-tab="saved"] {
  height: fit-content;
}

.saved-view-toolbar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  margin-bottom: 14px;
}

#save-view-button {
  min-height: 40px;
  padding-inline: 18px;
  border-radius: 10px;
  font-size: 12px;
}

#save-view-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.saved-view-status {
  flex: 0 0 auto;
  margin: -3px 0 13px;
  color: #ebd5ae;
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.preset-editor {
  flex: 0 0 auto;
  min-width: 0;
  margin-bottom: 16px;
  padding: 15px;
  border: 1px solid #ead2a532;
  border-radius: 12px;
  background: #0b23344d;
}

.preset-editor h3 {
  margin: 0 0 12px;
  color: #e6d9bf;
  font-size: 12px;
  font-weight: 500;
}

.preset-editor .stacked-label {
  margin: 0 0 7px;
  font-size: 10px;
}

.preset-editor .text-input {
  min-height: 42px;
  padding: 10px;
}

.preset-current-summary,
.preset-live-note {
  color: #c2d1c0b8;
  font-size: 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.preset-current-summary {
  margin: 9px 0 0;
}

.preset-current-summary:empty {
  display: none;
}

.preset-live-note {
  margin: 4px 0 0;
  color: #9bb6b4;
  font-size: 9px;
}

.preset-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 13px;
}

.preset-editor-actions button {
  min-height: 38px;
  padding-inline: 17px;
  border-radius: 9px;
  font-size: 11px;
}

.saved-view-list {
  display: grid;
  flex: 0 1 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  grid-auto-rows: max-content;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 3px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #6a7a76 transparent;
}

.saved-view-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d9e4df21;
  border-radius: 12px;
  background: #ffffff05;
  transition: border-color .2s, background .2s;
}

.saved-view-card:hover {
  border-color: #d9c6a755;
}

.saved-view-card.is-current {
  border-color: #ead2a5;
  background: #d8c5a00d;
}

.saved-view-card [data-preset-apply] {
  display: grid;
  position: relative;
  grid-template-columns: 108px minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  min-height: 108px;
  padding: 0;
  text-align: left;
}

.saved-view-art {
  display: block;
  position: relative;
  min-width: 0;
  min-height: 108px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(155deg, #274958, #617b7b);
}

.saved-view-art > svg,
.saved-view-art > .scene-theme-art {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.saved-view-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(#05172620, #071b3340);
  pointer-events: none;
}

.saved-view-art * {
  animation: none !important;
  transition: none !important;
}

.saved-view-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  padding: 12px;
}

.saved-view-copy strong {
  display: block;
  color: #f1ebd9;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.saved-view-copy small {
  display: block;
  margin-top: 4px;
  color: #bed0c6;
  font-size: 9px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.saved-view-current {
  display: inline-flex;
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  border: 1px solid #ead2a53b;
  border-radius: 4px;
  background: #102b38e6;
  color: #ead2a5;
  font-size: 8px;
  line-height: 1.3;
}

.saved-view-current .icon {
  width: 10px;
  height: 10px;
}

.saved-view-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  padding: 3px 7px;
  border-top: 1px solid #d9e4df0d;
}

.saved-view-actions button {
  display: inline-flex;
  flex: 0 0 35px;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  min-height: 35px;
  border-radius: 8px;
  color: #c6d5c6b8;
}

.saved-view-actions button:hover {
  background: #d5c9ac13;
  color: #eadac0;
}

.saved-view-actions .icon {
  width: 14px;
  height: 14px;
}

.saved-view-empty {
  flex: 0 0 auto;
  margin: 0;
  padding: 30px 12px 38px;
  color: #c2d1c0b8;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.saved-view-footer {
  flex: 0 0 auto;
  margin: 12px 0 0;
  color: #9fb9b29e;
  font-size: 9px;
  line-height: 1.5;
}

/* Preview skins stay independent of the clock currently active on the page. */
#scene-saved-panel .saved-view-clock {
  display: flex;
  position: absolute;
  inset: 0;
  z-index: 1;
  align-items: center;
  justify-content: center;
  color: #f4ebd5;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 29px;
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  line-height: 1.13;
  letter-spacing: 0;
  text-shadow: 0 2px 12px #04122080;
  pointer-events: none;
}

#scene-saved-panel .saved-view-clock .digit {
  display: inline-block;
  position: static;
  flex: 0 0 .56em;
  width: .56em;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  text-align: center;
}

#scene-saved-panel .saved-view-clock .digit::after {
  display: none;
}

#scene-saved-panel .saved-view-clock .time-colon {
  flex: 0 0 .27em;
  width: .27em;
  padding: 0 0 .05em;
  font-size: .72em;
  text-align: center;
}

#scene-saved-panel .saved-view-clock[data-skin="classic"] {
  font-weight: 650;
}

#scene-saved-panel .saved-view-art[data-view="3d"] .saved-view-clock {
  transform: translateY(-8px);
}

#scene-saved-panel .saved-view-clock[data-skin="led"] {
  color: #f1dbaa;
  font-family: "Courier New", monospace;
  font-size: 27px;
  font-weight: 500;
  text-shadow: 0 0 12px #f3ce944d;
}

#scene-saved-panel .saved-view-clock[data-skin="airport"],
#scene-saved-panel .saved-view-clock[data-skin="flip"] {
  gap: .04em;
  font-size: 25px;
  font-weight: 600;
}

#scene-saved-panel .saved-view-clock .split-digit {
  position: relative;
  flex-basis: .67em;
  width: .67em;
  min-width: .67em;
  height: 1.13em;
  border: 1px solid #d7d7c426;
  border-radius: .04em;
  background: #141e27;
  box-shadow: 0 .035em .065em #0004;
  isolation: isolate;
}

#scene-saved-panel .saved-view-clock[data-skin="flip"] .split-digit {
  border-color: #dfd1b429;
  border-radius: .06em;
  background: #18313e;
}

.scene-tabs button:focus-visible,
.saved-view-actions button:focus-visible {
  outline: 2px solid #f0d8a6;
  outline-offset: 2px;
}

.saved-view-card [data-preset-apply]:focus-visible {
  outline: 2px solid #f0d8a6;
  outline-offset: -3px;
}

#scene-browse-panel[hidden],
#scene-saved-panel[hidden],
#preset-editor[hidden],
#saved-view-list[hidden],
#saved-view-empty[hidden],
#saved-view-status[hidden],
.saved-view-current[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .scene-tabs {
    gap: 18px;
    margin-bottom: 14px;
  }

  .scene-tabs [role="tab"] {
    min-height: 36px;
    padding-bottom: 9px;
    font-size: 11px;
  }

  .saved-view-card [data-preset-apply] {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .saved-view-copy {
    padding: 10px;
  }

  .saved-view-copy strong {
    font-size: 11px;
  }

  #scene-saved-panel .saved-view-clock {
    font-size: 27px;
  }

  #scene-saved-panel .saved-view-clock[data-skin="airport"],
  #scene-saved-panel .saved-view-clock[data-skin="flip"] {
    font-size: 23px;
  }
}

@media (max-width: 480px) {
  .saved-view-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .saved-view-toolbar {
    margin-bottom: 12px;
  }

  #save-view-button {
    min-height: 38px;
    font-size: 11px;
  }

  .preset-editor {
    padding: 12px;
  }

  .saved-view-empty {
    padding: 22px 8px 28px;
    font-size: 11px;
  }
}

@media (max-height: 480px) {
  #scene-browse-panel {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (prefers-reduced-motion: reduce) {
  .saved-view-card,
  .scene-tabs button,
  .saved-view-actions button {
    transition: none;
  }
}
