@import url("../css/palette.css?v=3");
@import url("../css/button-suite.css?v=4");

:root {
  color-scheme: dark;
  --accent: var(--palette-sky);
  --panel: var(--palette-navy);
  --border: rgba(var(--palette-white-rgb), 0.25);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--palette-navy);
  color: var(--palette-white);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button-link {
  min-height: 44px;
  padding: 9px 15px;
  border: 0;
  border-radius: 9px;
  color: var(--palette-white);
  background: var(--palette-blue);
  font-weight: 650;
}

button:disabled {
  opacity: 0.5;
}

.secondary {
  color: var(--palette-white);
  background: rgba(var(--palette-white-rgb), 0.1);
}

.button-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

label {
  display: block;
  margin: 14px 0 6px;
  color: rgba(var(--palette-white-rgb), 0.8);
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--palette-navy);
  color: var(--palette-white);
}

input,
select {
  min-height: 46px;
  padding: 10px 12px;
}

button:focus-visible,
.button-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
details > summary:focus-visible {
  outline: 3px solid var(--palette-sky);
  outline-offset: 2px;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
}

.login-card h1 {
  margin: 8px 0;
}

.login-card p {
  color: rgba(var(--palette-white-rgb), 0.8);
}

.login-card button {
  width: 100%;
  margin-top: 20px;
}

.login-icon {
  font-size: 36px;
}

.error {
  color: var(--palette-red) !important;
}

.editor-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--palette-navy);
}

.editor-header h1 {
  margin: 0;
  font-size: 22px;
}

.editor-header p {
  margin: 3px 0 0;
  color: rgba(var(--palette-white-rgb), 0.8);
  font-size: 13px;
}

.editor-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.editor-header-actions form {
  margin: 0;
}

.account-menu {
  position: relative;
}

.account-menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 14px;
  border-radius: 9px;
  cursor: pointer;
  color: var(--palette-white);
  background: rgba(var(--palette-white-rgb), 0.1);
  font-weight: 650;
}

.account-menu > summary::after {
  display: none;
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(88vw, 380px);
  max-height: min(72vh, 620px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--palette-navy);
  box-shadow: 0 16px 38px rgba(var(--palette-black-rgb), 0.5);
}

.account-menu-panel h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.account-menu-panel label {
  margin-top: 12px;
}

.account-menu-panel button[type="submit"] {
  width: 100%;
  margin-top: 14px;
}

.editor-main {
  width: min(1200px, 100%);
  margin: auto;
  padding: 16px 16px calc(30px + env(safe-area-inset-bottom));
}

.new-story-panel,
.user-management-panel,
.audit-panel,
.archive-health-panel,
.deleted-users-panel,
.story-settings-panel,
.share-export-panel,
.media-library-panel,
.upload-panel,
.delete-story-panel {
  margin: 0 0 12px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.new-story-panel[open],
.user-management-panel[open],
.audit-panel[open],
.archive-health-panel[open],
.deleted-users-panel[open],
.story-settings-panel[open],
.share-export-panel[open],
.media-library-panel[open],
.upload-panel[open],
.delete-story-panel[open] {
  padding-bottom: 14px;
}

/* One visual language for every expandable editor section. */
details > summary {
  list-style: none;
  gap: 10px;
  -webkit-tap-highlight-color: transparent;
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary::after {
  content: "›";
  margin-left: auto;
  flex: 0 0 auto;
  color: rgba(var(--palette-white-rgb), 0.8);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  transform-origin: center;
  transition: transform 140ms ease, color 140ms ease;
}

details[open] > summary::after {
  transform: rotate(90deg);
  color: var(--palette-white);
}

.upload-panel > summary::after {
  color: rgba(var(--palette-white-rgb), 0.8);
}

.upload-panel {
  border-color: var(--palette-blue);
}

.upload-panel > summary {
  margin: 0 -14px;
  padding: 0 14px;
  border-radius: 11px;
  background: var(--palette-blue);
  color: var(--palette-white);
  box-shadow: 0 3px 12px rgba(var(--palette-blue-rgb), 0.25);
}

.upload-panel[open] > summary {
  border-radius: 11px 11px 6px 6px;
}

.new-story-panel form,
.story-settings-panel form,
.delete-story-panel form {
  margin-top: 10px;
}

.delete-story-panel {
  border-color: var(--palette-red);
}

.delete-story-panel form {
  max-width: 620px;
}

.delete-story-identity {
  margin: 18px 0;
  padding: 10px 14px;
  border-left: 4px solid var(--palette-sky);
  border-radius: 0 9px 9px 0;
  background: rgba(var(--palette-blue-rgb), 0.1);
}

.delete-story-identity p {
  margin: 5px 0;
}

.delete-story-identity strong {
  color: var(--palette-sky);
  font-weight: 800;
  text-shadow: 0 0 12px rgba(var(--palette-sky-rgb), 0.25);
  overflow-wrap: anywhere;
}

.danger {
  margin-top: 14px;
  background: var(--palette-red); color:var(--palette-navy); }

input[readonly] {
  color: rgba(var(--palette-white-rgb), 0.8);
  background: var(--palette-navy);
}

.story-settings-identity {
  margin: 12px 0 18px;
  padding: 10px 14px;
  border-left: 3px solid rgba(var(--palette-white-rgb), 0.5);
  border-radius: 9px;
  background: var(--palette-navy);
  color: rgba(var(--palette-white-rgb), 0.8);
}

.story-settings-identity p {
  margin: 3px 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.story-settings-identity strong {
  color: var(--palette-white);
}

.story-settings-save-dock {
  position: sticky;
  top: calc(var(--editor-header-height, 84px) + 8px);
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  margin: 10px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--palette-sky);
  border-radius: 12px;
  background: var(--palette-navy);
  box-shadow: 0 8px 22px rgba(var(--palette-black-rgb), 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.story-settings-save-dock[hidden] {
  display: none;
}

.story-settings-save-label {
  min-width: 0;
  color: var(--palette-sky);
  font-weight: 750;
}

.story-settings-save-dock #save-settings {
  min-height: 44px;
  margin: 0;
  padding: 8px 16px;
  white-space: nowrap;
}

.story-settings-save-dock .inline-feedback {
  grid-column: 1 / -1;
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.form-grid.search-settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
}

.story-settings-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 20px;
  margin: 14px 0 8px;
  color: var(--palette-sky);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.story-settings-divider::before,
.story-settings-divider::after {
  content: "";
  height: 2px;
  background: rgba(var(--palette-white-rgb), 0.25);
}

.story-settings-divider::before { width: 18px; flex: 0 0 18px; }
.story-settings-divider::after { flex: 1 1 auto; }

.story-settings-divider span {
  flex: 0 1 auto;
}

.story-settings-divider-wide {
  margin: 14px 0;
}

#protected-media-normalize-panel > hr,
#unlisted-pin-panel > hr {
  height: 2px;
  margin: 16px 0;
  border: 0;
  background: rgba(var(--palette-white-rgb), 0.25);
}

.editor-section-divider {
  height: 1px;
  margin: 14px 0;
  background: rgba(var(--palette-white-rgb), 0.1);
}

.form-grid > .editor-section-divider {
  grid-column: 1 / -1;
}

.taxonomy-field {
  grid-column: 1 / -1;
}

.settings-tag-list {
  min-height: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 3px 0 8px;
}

.settings-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 7px 5px 10px;
  border: 1px solid rgba(var(--palette-white-rgb), 0.25);
  border-radius: 999px;
  background: var(--palette-navy);
  color: rgba(var(--palette-white-rgb), 0.8);
  font-size: 13px;
}

.settings-tag-chip button {
  min-width: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(var(--palette-white-rgb), 0.25);
  color: var(--palette-white);
  font-size: 16px;
  line-height: 1;
}

.settings-tag-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.settings-tag-entry button {
  min-height: 46px;
  margin: 0;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: end;
  min-height: 46px;
}

.checkbox-row input {
  width: 22px;
  min-height: 22px;
  margin: 0;
}

.help-text {
  color: rgba(var(--palette-white-rgb), 0.8);
  font-size: 14px;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.upload-subsection {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--palette-white-rgb), 0.25);
  border-radius: 11px;
  background: var(--palette-navy);
}

.upload-subsection-icon {
  width: 1.8em;
  flex: 0 0 1.8em;
  display: inline-flex;
  align-items: center;
}

.upload-subsection-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-subsection form {
  padding: 2px 14px 14px;
}

.upload-result {
  min-height: 24px;
  margin-top: 10px;
  color: rgba(var(--palette-white-rgb), 0.8);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.upload-result.success {
  color: var(--palette-green);
}

.upload-result.error {
  color: var(--palette-red);
}

.upload-result a {
  color: var(--palette-sky);
}

.upload-result p {
  margin: 0 0 8px;
}

.upload-result code {
  display: block;
  padding: 9px;
  border-radius: 7px;
  background: var(--palette-black);
  color: rgba(var(--palette-white-rgb), 0.8);
  user-select: all;
}

.upload-result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.upload-result-actions button {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.clipboard-helper {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.editor-controls {
  display: grid;
  gap: 10px;
}

.editor-controls label {
  margin-top: 0;
}

.editor-controls .active-story-label {
  margin: 2px 0 1px;
  padding: 8px 12px;
  border-left: 4px solid var(--palette-sky);
  border-radius: 0 9px 9px 0;
  background: linear-gradient(90deg, rgba(var(--palette-blue-rgb), 0.25), transparent);
  color: var(--palette-sky);
  font-size: 22px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.01em;
  text-shadow: 0 0 14px rgba(var(--palette-sky-rgb), 0.25);
}

#story-select {
  border-color: rgba(var(--palette-sky-rgb), 0.5);
  color: var(--palette-sky);
  font-weight: 700;
  text-shadow: 0 0 12px rgba(var(--palette-sky-rgb), 0.25);
}

#story-select:focus {
  border-color: var(--palette-sky);
  outline: 2px solid rgba(var(--palette-sky-rgb), 0.25);
  outline-offset: 2px;
}

.story-actions {
  display: flex;
  gap: 10px;
}

.story-actions > * {
  flex: 1;
  justify-content: center;
}

.insert-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(92px, 1.15fr) 52px 52px 52px 52px minmax(86px, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.insert-toolbar button {
  min-width: 0;
  background: rgba(var(--palette-white-rgb), 0.1);
  transition: transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.insert-toolbar .mobile-save {
  display: none;
  background: var(--palette-blue);
}

.insert-toolbar .history-button {
  background: rgba(var(--palette-white-rgb), 0.1);
}

.insert-toolbar .history-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.insert-toolbar button:active,
.insert-toolbar button.toolbar-pressed {
  transform: scale(0.97);
  background: rgba(var(--palette-white-rgb), 0.25);
}

.insert-toolbar button.toolbar-confirmed {
  background: var(--palette-blue);
  box-shadow: inset 0 0 0 1px rgba(var(--palette-white-rgb), 0.1);
}

.insert-toolbar .private-insert-icon {
  padding-left: 0;
  padding-right: 0;
  font-size: 22px;
  line-height: 1;
}

.insert-toolbar .history-control-wrap,
.insert-toolbar .toolbar-actions-menu {
  position: relative;
  min-width: 0;
}

.insert-toolbar .history-control-wrap > button,
.insert-toolbar .toolbar-actions-menu > summary {
  width: 100%;
  height: 100%;
  min-height: 44px;
}

.insert-toolbar .toolbar-actions-menu > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 10px 8px;
  border: 0;
  border-radius: 10px;
  background: rgba(var(--palette-white-rgb), 0.1);
  color: var(--palette-white);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
}

.insert-toolbar .toolbar-actions-menu > summary::-webkit-details-marker {
  display: none;
}

/* The compact More control is the ellipsis itself; suppress the generic
   details chevron so the button stays visually single-purpose and narrow. */
.insert-toolbar .toolbar-actions-menu > summary::after {
  content: none;
  display: none;
}

.toolbar-actions-panel,
.history-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  bottom: auto;
  z-index: 20;
  min-width: 172px;
  padding: 6px;
  border: 1px solid rgba(var(--palette-white-rgb), 0.25);
  border-radius: 12px;
  background: var(--palette-navy);
  box-shadow: 0 12px 28px rgba(var(--palette-black-rgb), 0.5);
}

.toolbar-actions-panel button,
.history-menu button {
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 9px 12px;
  border-radius: 8px;
  text-align: left;
  white-space: nowrap;
}

.toolbar-actions-panel button + button,
.history-menu button + button {
  margin-top: 4px;
}

.history-menu button:disabled {
  opacity: 0.5;
}

.find-replace-panel {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid rgba(var(--palette-white-rgb), 0.5);
  border-radius: 12px;
  background: var(--palette-navy);
}

.find-replace-panel[hidden] {
  display: none;
}

.find-replace-fields {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.find-replace-fields label {
  margin: 0;
  display:flex;
  flex-direction:column;
}

.find-field-title { flex:1; font-size:18px; font-weight:750; line-height:24px; }
.find-replace-fields label:last-of-type .find-field-title { padding-right:40px; }
.find-replace-fields .find-collapse { position:absolute; top:-4px; right:0; margin:0; min-width:36px; min-height:32px; padding:0 4px; background:transparent; }

.find-replace-fields input {
  margin: 5px 0 0;
}

.find-replace-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin-top: 6px;
  color: rgba(var(--palette-white-rgb), 0.8);
}

.find-match-case {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  white-space: nowrap;
}

.find-match-case input {
  width: 22px;
  height: 22px;
  margin: 0;
}

#find-replace-status {
  text-align: right;
}

.find-replace-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.find-replace-actions[hidden] { display: none; }
.find-collapse { min-width:44px; min-height:44px; padding:4px; margin:0 0 4px; font-size:22px; }
.find-navigation { display:flex; gap:6px; }
.find-navigation button { min-width:44px; min-height:44px; padding:4px; font-size:22px; }
#find-replace-status { flex:1; font-size:13px; }
.find-replace-fields input { min-width:0; min-height:44px; padding:8px; font-size:16px; }

.find-replace-actions button {
  min-width: 0;
  min-height: 44px;
  padding: 8px;
}

.find-match-context { margin:8px 0 0; height:7em; padding:2.8em 0; box-sizing:border-box; overflow:auto; color:rgba(var(--palette-white-rgb), 0.8); font-size:14px; line-height:1.4; overflow-wrap:anywhere; scroll-behavior:auto; }
.find-match-context:empty { display:none; }
.find-match-context mark { background:rgba(var(--palette-white-rgb), 0.25); color:var(--palette-white); border-radius:3px; padding:0 2px; }

/* Only mobile Find/Replace mode frees the space occupied by sticky controls. */
@media (max-width: 760px) {
  body.find-replace-mode .editor-header,
  body.find-replace-mode .insert-toolbar,
  body.find-replace-mode .save-bar { display:none; }
  body.find-replace-mode .story-settings-save-dock { position:static; }
  body.find-replace-mode .find-replace-panel { scroll-margin-top:8px; }
}

.message {
  min-height: 24px;
  margin: 6px 0;
  color: rgba(var(--palette-white-rgb), 0.8);
  font-size: 14px;
}

.message.success {
  color: var(--palette-green);
}

.message.warning {
  color: var(--palette-amber);
}

.message.error {
  color: var(--palette-red);
}

.workspace-tabs {
  display: none;
  gap: 0;
  margin: 14px 0 10px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--palette-navy);
}

.workspace-tabs button {
  flex: 1;
  background: var(--palette-navy);
}

.workspace-tabs button.active {
  background: rgba(var(--palette-white-rgb), 0.25);
  box-shadow: 0 1px 4px rgba(var(--palette-black-rgb), 0.25);
}

.editor-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 65vh;
}

.write-panel,
.preview-panel {
  position: relative;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--palette-black);
}

#story-markdown {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 65vh;
  padding: 16px;
  border: 0;
  border-radius: 0;
  resize: vertical;
  font:
    16px/1.55 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}

.story-preview {
  padding-bottom: 40px;
}

.preview-protected-status {
  position: absolute;
  top: 10px;
  right: 38px;
  left: 10px;
  z-index: 7;
  padding: 9px 11px;
  border: 1px solid var(--palette-red);
  border-radius: 9px;
  background: rgba(var(--palette-red-rgb), 0.25);
  color: var(--palette-red);
  font-size: 13px;
  pointer-events: none;
}

.preview-media-rail {
  position: absolute;
  top: 8px;
  right: 0;
  bottom: 8px;
  z-index: 8;
  width: 30px;
  min-height: 120px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  touch-action: none;
  cursor: ns-resize;
}

.preview-media-rail[hidden] {
  display: none;
}

.preview-media-rail.viewport-rail {
  position: fixed;
  right: auto;
  bottom: auto;
}

.preview-media-rail.out-of-view {
  visibility: hidden;
  pointer-events: none;
}

.preview-media-rail:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.preview-media-rail-track {
  position: absolute;
  top: 8px;
  right: 5px;
  bottom: 8px;
  width: 4px;
  border-radius: 999px;
  background: rgba(var(--palette-white-rgb), 0.1);
}

.preview-media-markers,
.preview-media-thumb {
  position: absolute;
  inset: 0;
}

.preview-media-marker {
  position: absolute;
  left: 50%;
  width: 6px;
  height: 2px;
  border-radius: 2px;
  background: rgba(var(--palette-white-rgb), 0.8);
  transform: translate(-50%, -50%);
  transition: width 120ms ease, height 120ms ease, background 120ms ease;
}

.preview-media-marker.video {
  background: var(--palette-sky); color:var(--palette-navy); }

.preview-media-marker.gallery {
  background: var(--palette-sky); color:var(--palette-navy); }

.preview-media-marker.current {
  width: 10px;
  height: 4px;
  background: var(--palette-white);
}

.preview-media-thumb {
  right: auto;
  bottom: auto;
  left: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid var(--palette-navy);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(var(--palette-white-rgb), 0.8);
  transform: translate(-50%, -50%);
}

.preview-media-label {
  position: absolute;
  right: 24px;
  z-index: 2;
  width: max-content;
  max-width: 180px;
  padding: 5px 8px;
  border: 1px solid rgba(var(--palette-white-rgb), 0.5);
  border-radius: 7px;
  background: var(--palette-navy);
  color: var(--palette-white);
  font-size: 12px;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 100ms ease;
}

.preview-media-label.visible {
  opacity: 1;
}

.story-preview .story-photo,
.story-preview .story-video,
.story-preview .story-gallery,
.story-preview .gallery-item {
  position: relative;
}

.preview-source-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 12;
  min-width: 38px;
  min-height: 34px;
  margin: 0;
  padding: 5px 7px;
  border: 1px solid rgba(var(--palette-white-rgb), 0.5);
  border-radius: 8px;
  background: var(--palette-navy);
  box-shadow: 0 2px 8px rgba(var(--palette-black-rgb), 0.5);
  color: var(--palette-white);
  font: 750 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.02em;
  touch-action: manipulation;
}

.preview-source-badge:active {
  background: var(--palette-blue);
  transform: scale(0.96);
}

.preview-source-badge:focus-visible {
  outline: 2px solid var(--palette-white);
  outline-offset: 2px;
}

.story-preview h1,
.story-preview h2,
.story-preview h3,
.story-preview p,
.story-preview blockquote,
.story-preview ul {
  margin-left: 18px;
  margin-right: 18px;
}

.story-preview img,
.story-preview video {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  margin: auto;
  object-fit: contain;
}

.story-preview .video-player {
  position: relative;
  width: 100%;
  line-height: 0;
}

.story-preview .video-play-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0 0 0 3px;
  border: 1px solid rgba(var(--palette-white-rgb), 0.5);
  border-radius: 50%;
  color: var(--palette-white);
  background: rgba(var(--palette-black-rgb), 0.8);
  box-shadow: 0 3px 12px rgba(var(--palette-black-rgb), 0.5);
  font-size: 21px;
  line-height: 1;
}

.story-preview .video-play-button[hidden] {
  display: none;
}

.story-preview .gallery-video-item .video-play-button {
  width: 44px;
  height: 44px;
  font-size: 18px;
}

.story-preview figure {
  margin: 24px 0;
}

.story-preview .story-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.story-preview .story-gallery figure {
  min-width: 0;
  margin: 0;
  overflow: hidden;
}

.story-preview .story-gallery img,
.story-preview .story-gallery video {
  display: block;
  width: 100%;
  max-width: none;
  max-height: none;
  aspect-ratio: 9 / 16;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
}

.story-preview .story-gallery figcaption {
  display: none;
}

.story-preview figcaption {
  padding: 8px 18px;
  color: rgba(var(--palette-white-rgb), 0.8);
}

.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin: 14px -6px 0;
  padding: 10px 6px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--palette-navy) 24%);
}

.save-bar button {
  width: 100%;
  min-height: 54px;
  font-size: 18px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .editor-main {
    padding-left: 10px;
    padding-right: 10px;
  }
  .story-settings-save-dock {
    top: calc(var(--editor-header-height, 96px) + 6px);
    margin-right: -4px;
    margin-left: -4px;
  }
  .workspace-tabs {
    display: flex;
  }
  .insert-toolbar {
    position: sticky;
    top: var(--editor-header-height, 96px);
    z-index: 4;
    grid-template-columns: 42px 42px minmax(48px, 0.9fr) minmax(48px, 0.9fr) 46px minmax(64px, 1.15fr);
    gap: 6px;
    margin: 10px -4px 12px;
    padding: 8px 4px;
    border: 1px solid rgba(var(--palette-white-rgb), 0.25);
    border-radius: 12px;
    background: var(--palette-navy);
    box-shadow: 0 8px 18px rgba(var(--palette-black-rgb), 0.25);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  /* V22.7.17.1: one stable compact sticky row on iPhone. Five less-frequent
     insert actions live under ⋯, Undo/Redo share one history control, and
     the two-way jump bookmark always occupies its slot (disabled when idle). */
  .insert-toolbar > button,
  .insert-toolbar > .history-control-wrap,
  .insert-toolbar > .toolbar-actions-menu {
    min-width: 0;
  }
  .insert-toolbar button,
  .insert-toolbar .toolbar-actions-menu > summary {
    min-height: 50px;
    font-size: 14px;
  }
  .insert-toolbar .mobile-save {
    display: block;
    background: var(--palette-blue);
  }
  .insert-toolbar .private-insert-icon {
    font-size: 20px;
  }
  .insert-toolbar .editor-jump-bookmark:not([hidden]) {
    display: inline-flex;
  }
  .insert-toolbar .editor-jump-bookmark {
    width: 100%;
    height: 50px;
    min-width: 0;
    min-height: 50px;
    padding: 0;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    font-size: 22px;
  }
  .insert-toolbar .editor-jump-bookmark.return-mode {
    background: var(--palette-blue);
  }
  .insert-toolbar .editor-jump-bookmark:disabled {
    opacity: 0.5;
    cursor: default;
  }
  .insert-toolbar .history-button {
    padding: 0;
    font-size: 21px;
  }
  .insert-toolbar .toolbar-actions-menu > summary {
    padding: 0;
    font-size: 28px;
    line-height: 1;
    letter-spacing: 1px;
  }
  .toolbar-actions-panel {
    left: auto;
    right: 0;
  }
  .history-menu {
    left: 0;
  }
  .find-replace-panel {
    margin: -4px -4px 10px;
    padding: 10px;
  }
  .find-replace-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .find-replace-options {
    font-size: 14px;
  }
  .find-replace-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .find-replace-actions button {
    font-size: 13px;
  }
  .editor-header {
    gap: 8px;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  }
  .editor-header p {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.2;
  }
  /* The page title is already present in the browser document title. Hiding
     the large duplicate heading on phones gives the story editor more room. */
  .editor-header > div:first-child > h1 {
    display: none;
  }
  .editor-header-actions {
    gap: 6px;
  }
  .editor-header-actions .secondary,
  .account-menu > summary {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 14px;
  }
  .account-menu-panel {
    position: fixed;
    top: var(--editor-header-height, 96px);
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100vh - var(--editor-header-height, 96px) - 16px);
  }
  /* Mobile SAVE lives in the sticky toolbar. The legacy save bar, including
     its inline success panel, must not consume editing height on iPhone. */
  .save-bar {
    display: none;
  }

  /* Reclaim the vertical space that used to belong to the mobile save bar.
     The write/preview workspace now fills the usable dynamic viewport below
     the sticky header + toolbar instead of stopping at the old 60vh floor. */
  .editor-main {
    padding-bottom: max(4px, env(safe-area-inset-bottom));
  }
  .editor-workspace {
    height: max(360px, calc(100dvh - var(--editor-header-height, 96px) - var(--insert-toolbar-height, 132px) - 18px - env(safe-area-inset-bottom)));
    min-height: 0;
  }
  .write-panel.active,
  .preview-panel.active {
    height: 100%;
    min-height: 0;
  }
  #story-markdown {
    height: 100%;
    min-height: 0;
    resize: none;
  }
  .story-preview {
    height: 100%;
    overflow: auto;
  }

  /* Global editor status becomes a transient overlay on narrow screens so
     feedback never reserves permanent space below story.md. Local form
     feedback keeps the normal .message / .inline-feedback layout. */
  #message {
    position: fixed;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    left: 14px;
    z-index: 30;
    min-height: 0;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid rgba(var(--palette-white-rgb), 0.25);
    border-radius: 12px;
    background: var(--palette-navy);
    box-shadow: 0 8px 24px rgba(var(--palette-black-rgb), 0.5);
    color: rgba(var(--palette-white-rgb), 0.8);
    text-align: center;
    pointer-events: none;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  #message:empty {
    display: none;
  }
  #message.success {
    border-color: var(--palette-green);
    background: var(--palette-navy);
    color: var(--palette-green);
  }
  #message.warning {
    border-color: rgba(var(--palette-amber-rgb), 0.5);
    background: rgba(var(--palette-amber-rgb), 0.25);
    color: var(--palette-amber);
  }
  #message.error {
    border-color: var(--palette-red);
    background: rgba(var(--palette-red-rgb), 0.25);
    color: var(--palette-red);
  }
  .editor-workspace {
    display: block;
  }
  .write-panel,
  .preview-panel {
    display: none;
  }
  .write-panel.active,
  .preview-panel.active {
    display: block;
  }
  #story-markdown {
    font-size: 16px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .upload-grid {
    grid-template-columns: 1fr;
  }
}

/* Stage 1 multi-user account list */
.user-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.inline-feedback {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
}

.inline-feedback.working,
.inline-feedback.success,
.inline-feedback.error {
  display: block;
}

.inline-feedback.working {
  border: 1px solid rgba(var(--palette-white-rgb), 0.25);
  background: var(--palette-navy);
  color: rgba(var(--palette-white-rgb), 0.8);
}

.inline-feedback.success {
  border: 1px solid var(--palette-green);
  background: var(--palette-navy);
  color: var(--palette-green);
}

.inline-feedback.error {
  border: 1px solid var(--palette-red);
  background: rgba(var(--palette-red-rgb), 0.25);
  color: var(--palette-red);
}

.action-working {
  opacity: 0.8;
  cursor: wait;
}

/* Completion/error text belongs in the existing feedback message. Button
   colors retain their semantic role, including retry and completed states. */

.save-bar .inline-feedback {
  margin-top: 0.65rem;
  text-align: center;
}

.inline-feedback a {
  color: var(--palette-sky);
}

.personal-view-conversion,
.protected-story-publication {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px solid rgba(var(--palette-white-rgb), 0.5);
  border-radius: 14px;
  background: var(--palette-navy);
}

.personal-view-conversion h3,
.protected-story-publication h3 {
  margin: 0 0 8px;
}

.personal-view-conversion > * + *,
.protected-story-publication > * + * {
  margin-top: 12px;
}

.personal-view-conversion .checkbox-row,
.protected-story-publication .checkbox-row {
  align-items: flex-start;
}

.publication-readiness {
  color: var(--palette-amber);
  font-weight: 700;
}

.publication-readiness.is-ready {
  color: var(--palette-green);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 4px;
  min-width: 42px;
  min-height: 38px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(var(--palette-white-rgb), 0.1);
  color: var(--palette-white);
  font-size: 18px;
  line-height: 1;
}

.password-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Login-page password reveal control: keep the password field on its own row.
   Other password toggles in dialogs retain the compact in-field layout. */
.login-page .password-wrap {
  width: 100%;
}

.login-page .password-wrap input {
  padding-right: 12px;
}

.login-page .password-wrap .password-toggle {
  position: static;
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  padding: 7px 12px;
  border-radius: 9px;
}

.login-page .password-wrap + button[type="submit"] {
  margin-top: 20px;
}

.password-dialog {
  width: min(92vw, 460px);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  color: var(--palette-white);
}

.password-dialog::backdrop {
  background: rgba(var(--palette-black-rgb), 0.8);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.user-action {
  border: 1px solid transparent;
  color: var(--palette-white);
  transition:
    filter 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

.user-action:hover {
  filter: none;
  transform: translateY(-1px);
}

.user-action:active {
  filter: none;
  transform: translateY(0);
  box-shadow: inset 0 2px 5px rgba(var(--palette-black-rgb), 0.25);
}

/* Account action class names are behavior hooks and aliases in button-suite.css. */

.user-action:disabled {
  filter: none;
  transform: none;
}

.user-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(var(--palette-white-rgb), 0.25);
  border-radius: 10px;
}

.user-row > span {
  grid-column: 1 / -1;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.user-row .user-action {
  width: 100%;
  min-height: 48px;
  justify-content: center;
}

@media (max-width: 760px) {
  .user-row {
    grid-template-columns: 1fr 1fr;
  }
  .user-row .user-action {
    min-height: 54px;
    padding: 10px 8px;
  }
}


/* V21: local action feedback is consistent across forms and dynamic actions. */
.user-action-feedback {
  grid-column: 1 / -1;
  margin-top: 4px;
}

.upload-result.inline-feedback {
  min-height: 0;
}

.upload-result.inline-feedback.success,
.upload-result.inline-feedback.error,
.upload-result.inline-feedback.working {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  details > summary::after {
    transition: none;
  }
}

/* V22.7.17: the two-way jump bookmark is a compact toolbar action again. */
.editor-jump-bookmark {
  display: none;
  background: rgba(var(--palette-white-rgb), 0.1);
  color: var(--palette-white);
  transition: transform 120ms ease, background-color 120ms ease;
}


/* V22.7.18: collapse infrequent story/admin controls behind one compact More
   chooser. The actual sections are preserved and only the selected one is
   shown, keeping the primary editing path visually quiet and predictable. */
.secondary-actions-menu {
  margin: 0 0 12px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.secondary-actions-menu > summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  cursor: pointer;
  color: var(--palette-white);
  font-weight: 700;
}

.secondary-actions-menu[open] {
  padding-bottom: 10px;
}

.secondary-actions-list {
  display: grid;
  gap: 4px;
  padding: 2px 0 0;
}

.secondary-action-choice {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: var(--palette-navy);
  color: var(--palette-white);
  text-align: left;
  font-weight: 650;
}

.secondary-action-choice > span {
  flex: 0 0 auto;
  color: rgba(var(--palette-white-rgb), 0.8);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
}

.secondary-action-choice:active {
  background: rgba(var(--palette-white-rgb), 0.1);
}

.secondary-action-choice:hover,
.secondary-action-choice:focus-visible {
  background: rgba(var(--palette-white-rgb), 0.25);
}

.secondary-action-choice.danger-choice:hover,
.secondary-action-choice.danger-choice:focus-visible {
  background: rgba(var(--palette-red-rgb), 0.25);
}

.secondary-actions-divider {
  height: 1px;
  margin: 5px 4px;
  background: rgba(var(--palette-white-rgb), 0.25);
}

.secondary-actions-caption {
  padding: 4px 10px 1px;
  color: var(--palette-sky);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.secondary-action-choice.danger-choice {
  border: 1px solid var(--palette-red);
  background: var(--palette-navy);
  color: var(--palette-red);
}

/* Closed secondary sections no longer consume page space. Selecting an item
   from More opens exactly one of these existing sections below the chooser. */
.secondary-section:not([open]) {
  display: none;
}

.secondary-section[open] {
  scroll-margin-top: calc(var(--editor-header-height, 96px) + 12px);
}

.archive-health-results { margin-top: 14px; display: grid; gap: 12px; }
.health-overall { padding: 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--palette-navy); }
.health-overall h3 { margin: 0 0 5px; font-size: 20px; }
.health-overall p { margin: 0; color: rgba(var(--palette-white-rgb), 0.8); }
.health-card { padding: 13px; border: 1px solid rgba(var(--palette-white-rgb), 0.25); border-radius: 11px; background: var(--palette-navy); }
.health-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.health-card h3, .health-card h4 { margin: 0; }
.health-badge { flex: 0 0 auto; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.health-badge.healthy { background: rgba(var(--palette-green-rgb), 0.25); color: var(--palette-green); }
.health-badge.warning { background: rgba(var(--palette-amber-rgb), 0.25); color: var(--palette-amber); }
.health-badge.action { background: rgba(var(--palette-red-rgb), 0.25); color: var(--palette-red); }
.health-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.health-metric { min-width: 0; padding: 10px; border-radius: 8px; background: var(--palette-navy); }
.health-metric strong { display: block; overflow-wrap: anywhere; font-size: 17px; }
.health-metric span { color: rgba(var(--palette-white-rgb), 0.8); font-size: 11px; }
.health-checklist, .health-notes, .health-storage { margin: 11px 0 0; padding: 0; list-style: none; }
.health-checklist li, .health-notes li, .health-storage li { padding: 7px 0; border-top: 1px solid rgba(var(--palette-white-rgb), 0.25); color: rgba(var(--palette-white-rgb), 0.8); font-size: 13px; }
.health-command { display: block; margin-top: 7px; padding: 8px 10px; border: 1px solid rgba(var(--palette-white-rgb), 0.25); border-radius: 7px; background: var(--palette-navy); color: var(--palette-sky); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.health-checklist li.pass::before { content: "✓ "; color: var(--palette-green); font-weight: 800; }
.health-checklist li.fail::before { content: "! "; color: var(--palette-red); font-weight: 800; }
.health-storage li { display: flex; justify-content: space-between; gap: 12px; }
.health-issues { margin-top: 11px; border-top: 1px solid rgba(var(--palette-white-rgb), 0.25); }
.health-path-list { margin: 0; padding: 0 0 0 18px; color: rgba(var(--palette-white-rgb), 0.8); font-size: 12px; overflow-wrap: anywhere; }
.health-path-list li { margin: 6px 0; }

.media-library-panel[open] { padding-bottom: 16px; }
.media-library-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.settings-cover-preview { display: grid; place-items: center; margin-top: 12px; height: 190px; border: 1px solid rgba(var(--palette-white-rgb), 0.5); border-radius: 10px; background: var(--palette-black); overflow: hidden; }
.settings-cover-preview[hidden] { display: none; }
.settings-cover-preview canvas { display: block; max-width: 100%; max-height: 180px; width: auto; height: auto; }
.settings-cover-actions { display: grid; grid-template-columns: 1fr 1fr .7fr; gap: 6px; margin-top: 10px; }
.settings-cover-actions button { min-width: 0; padding: 9px 5px; font-size: 13px; }
.media-library-jump {
  position: sticky;
  top: calc(var(--editor-header-height, 84px) + 6px);
  z-index: 4;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin: 10px 0;
  padding: 7px;
  border: 1px solid rgba(var(--palette-white-rgb), 0.5);
  border-radius: 12px;
  background: var(--palette-navy);
  box-shadow: 0 6px 16px rgba(var(--palette-black-rgb), 0.5);
}
.media-library-jump[hidden] { display: none; }
.media-library-jump { flex-wrap:wrap; }
.media-library-jump #media-library-select { flex:0 0 auto; width:auto; min-width:54px; padding:0 8px; font-size:13px; }
.media-library-auto { flex:1 0 100%; display:flex; align-items:center; gap:8px; border-bottom:1px solid rgba(var(--palette-white-rgb), 0.5); padding-bottom:6px; min-width:0; }
body.library-auto-playing .editor-header,
body.library-auto-playing .media-library-jump { visibility:hidden; pointer-events:none; }
.media-library-auto select { flex:0 0 80px; width:80px; margin:0; padding:6px; min-height:44px; font-size:13px; }
.media-library-auto label { display:flex; align-items:center; gap:4px; margin:0; font-size:12px; color:var(--palette-sky); }
.media-library-auto input { width:56px; min-width:0; min-height:44px; padding:6px; margin:0; box-sizing:border-box; font-size:14px; }
.media-library-auto output { font-size:12px; color:var(--palette-sky); min-width:30px; }
.media-library-jump .media-library-auto button { flex:0 0 44px; width:44px; min-width:44px; min-height:44px; font-size:20px; }
#media-library-selection { flex:1 0 100%; display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
#media-library-selection[hidden] { display:none; }
#media-library-selection span { flex:1 0 100%; font-size:12px; color:var(--palette-sky); }
#media-library-aside-group { flex:1 1 120px; width:0; min-width:0; margin:0; font-size:13px; padding:6px; min-height:44px; }
#media-library-selection #media-library-rename-group { flex:0 0 65px; min-width:0; }
#media-library-selection button { flex:1 1 100px; width:auto; padding:6px; font-size:13px; }
.media-library-aside-section { grid-column:1/-1; min-width:0; border-top:1px solid rgba(var(--palette-white-rgb), 0.5); padding-top:12px; }
.media-library-aside-section > h3 { margin:0; color:var(--palette-sky); font-size:1rem; }
.media-library-card.is-selectable { cursor:pointer; position:relative; }
.media-library-card.is-selectable::before { content:'○'; position:absolute; top:8px; left:8px; z-index:3; width:28px; height:28px; display:grid; place-items:center; border-radius:50%; background:var(--palette-navy); color:var(--palette-white); pointer-events:none; }
.media-library-card.is-selected { outline:3px solid var(--palette-sky); outline-offset:-3px; }
.media-library-card.is-selected::before { content:'✓'; background:var(--palette-blue); }
.media-library-jump button { flex: 0 0 48px; width: 48px; min-width: 48px; min-height: 48px; padding: 0; background: rgba(var(--palette-white-rgb), 0.25); color: var(--palette-white); font-size: 25px; line-height: 1; }
.media-library-jump button:focus-visible { outline: 3px solid var(--palette-sky); outline-offset: 2px; }
.media-library-position-slider { flex: 1 1 0; width: 100%; min-width: 0; min-height: 48px; margin: 0 17px 0 8px; padding: 0; border: 0; background: transparent; accent-color: var(--palette-sky); appearance: none; -webkit-appearance: none; }
.media-library-position-slider::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: rgba(var(--palette-white-rgb), 0.25); }
.media-library-position-slider::-webkit-slider-thumb { width: 34px; height: 34px; margin-top: -13px; border: 2px solid var(--palette-sky); border-radius: 50%; background: var(--palette-sky); -webkit-appearance: none; color:var(--palette-navy); }
.media-library-position-slider::-moz-range-track { height: 8px; border-radius: 8px; background: rgba(var(--palette-white-rgb), 0.25); }
.media-library-position-slider::-moz-range-thumb { width: 30px; height: 30px; border: 2px solid var(--palette-sky); border-radius: 50%; background: var(--palette-sky); color:var(--palette-navy); }
.media-library-position-slider:disabled { opacity: 0.5; }
.media-library-position-slider:focus-visible { outline: 3px solid var(--palette-sky); outline-offset: 2px; }
.media-library-filters {
  display: block;
  margin: 14px 0;
}
.media-library-scope {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 4px;
  border: 1px solid rgba(var(--palette-white-rgb), 0.25);
  border-radius: 12px;
  background: var(--palette-navy);
}
.media-library-scope button { min-height: 42px; padding: 8px 12px; background: transparent; color: rgba(var(--palette-white-rgb), 0.8); }
.media-library-scope button.active { background: rgba(var(--palette-white-rgb), 0.1); color: var(--palette-white); box-shadow: inset 0 -3px var(--palette-blue); }
.media-library-destination {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(var(--palette-white-rgb), 0.25);
  border-radius: 12px;
  background: var(--palette-navy);
}
.media-library-destination label { color: var(--palette-sky); }
.media-library-filter-panel { margin-top:10px; overflow:hidden; border:1px solid rgba(var(--palette-white-rgb), 0.5); border-radius:12px; background:var(--palette-navy); }
.media-library-filter-panel > summary strong { flex:0 0 auto; }
.media-library-filter-panel > summary span { min-width:0; overflow:hidden; color:rgba(var(--palette-white-rgb), 0.8); font-size:.86rem; text-overflow:ellipsis; white-space:nowrap; }
.media-library-filter-panel.has-active-filters > summary { background:rgba(var(--palette-white-rgb), 0.1); }
.media-library-filter-panel.has-active-filters > summary span { color:var(--palette-sky); }
.media-library-filter-fields { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; padding:12px; border-top:1px solid rgba(var(--palette-white-rgb), 0.25); }
.media-library-filter-fields label { margin:0; font-size:12px; color:rgba(var(--palette-white-rgb), 0.8); }
.media-library-filter-fields input, .media-library-filter-fields select { margin-top:5px; }
.media-library-filter-actions { display:flex; align-items:flex-end; grid-column:1 / -1; }
.media-library-filter-actions button { min-height:42px; margin:0; padding:8px 14px; }
/* Backfill earlier one-column holes with later singles, without splitting pairs. */
.media-library-grid { display: grid; grid-auto-flow: row dense; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.media-library-pair { grid-column:span 2; min-width:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.media-pair-dialog { width:min(540px,calc(100vw - 24px)); max-height:calc(100dvh - 32px); overflow:auto; box-sizing:border-box; padding:18px; border:1px solid rgba(var(--palette-white-rgb), 0.5); border-radius:16px; background:rgba(var(--palette-white-rgb), 0.1); color:var(--palette-white); }
.media-pair-dialog::backdrop { background:rgba(var(--palette-black-rgb), 0.8); }
.media-pair-dialog header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.media-pair-dialog h2 { margin:0; font-size:1.25rem; }
.media-pair-dialog header button { margin:0; padding:6px 14px; font-size:1.6rem; }
.media-pair-dialog label { display:block; margin-top:14px; }
.media-pair-dialog select,.media-pair-dialog input { width:100%; box-sizing:border-box; }
.media-pair-name { overflow-wrap:anywhere; font-weight:700; }
.media-pair-actions { display:flex; gap:12px; margin-top:18px; }
.media-pair-preview { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:14px; }
.media-pair-preview > div { min-width:0; overflow:hidden; border-radius:8px; background:var(--palette-navy); }
.media-pair-preview img { display:block; width:100%; aspect-ratio:16/10; object-fit:cover; }
.media-pair-preview span { display:block; padding:8px; font-size:.8rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.media-library-card { min-width: 0; overflow: hidden; border: 1px solid rgba(var(--palette-white-rgb), 0.25); border-radius: 12px; background: var(--palette-navy); }
.media-library-visual { position: relative; display: grid; aspect-ratio: 16 / 10; place-items: center; overflow: hidden; background: var(--palette-navy); color: rgba(var(--palette-white-rgb), 0.8); font-weight: 800; }
.media-library-visual img { width: 100%; height: 100%; object-fit: cover; }
.media-library-visual > .arrange-thumbnail { position:absolute; inset:0; width:100%; height:100%; aspect-ratio:auto; cursor:default; }
.media-library-visual .arrange-thumbnail-visual { display:grid; place-items:center; }
.media-library-visual canvas { width:100%; height:100%; object-fit:cover; }
.media-library-visual .arrange-thumbnail-visual > img,
.media-library-visual .arrange-thumbnail-visual > canvas {
  position:absolute;
  left:50%; top:50%;
  display:block;
  width:100%; height:100%; max-width:none;
  object-fit:cover;
  transform:translate(-50%,-50%);
}
.media-library-visual.phone-rotated img,
.media-library-visual.phone-rotated canvas {
  width: 62.5%;
  height: 160%;
  max-width: none;
  transform: rotate(-90deg);
  object-fit: cover;
}
.media-library-visual.phone-rotated .arrange-thumbnail-visual > img,
.media-library-visual.phone-rotated .arrange-thumbnail-visual > canvas {
  width:62.5%; height:160%;
  transform:translate(-50%,-50%) rotate(-90deg);
}
.media-library-visual.video { font-size: 34px; }
.media-reframe-launch { cursor:pointer; }
.media-reframe-launch:focus-visible { outline:3px solid var(--palette-sky); outline-offset:-3px; }
.media-reframe-icon { position:absolute; left:8px; right:auto; bottom:8px; display:grid; place-items:center; width:30px; height:30px; border-radius:8px; background:rgba(var(--palette-navy-rgb), 0.8); color:var(--palette-white); font:400 24px/1 system-ui,sans-serif; pointer-events:none; }
.media-framing-preview { position:relative; width:100%; aspect-ratio:16 / 10; overflow:hidden; background:var(--palette-navy); touch-action:none; cursor:grab; user-select:none; }
.media-framing-preview img { position:absolute; pointer-events:none; }
.media-framing-slider { display:grid!important; grid-template-columns:1fr auto; gap:6px; }
.media-framing-slider input[type=range] { grid-column:1 / -1; width:100%; min-height:32px; margin:0; padding:0; }
.media-framing-dialog button[aria-pressed=true] { background:rgba(var(--palette-white-rgb), 0.25); box-shadow:inset 0 0 0 2px var(--palette-sky); }
.media-library-play-badge {
  position: absolute; right: 9px; bottom: 9px;
  display: grid; place-items: center; width: 44px; height: 44px; min-height:44px; padding:0; margin:0; z-index:1;
  border: 2px solid var(--palette-white); border-radius: 50%;
  background: rgba(var(--palette-black-rgb), 0.8); color: var(--palette-white); font-size: 19px;
  line-height: 1; text-indent: 2px;
  box-shadow: 0 2px 8px rgba(var(--palette-black-rgb), 0.5);
}
.media-library-visual.video button.media-reframe-icon { pointer-events:auto; border:0; padding:0; margin:0; min-height:30px; width:30px; height:30px; z-index:1; }
.media-library-inline-player { position:absolute; inset:0; z-index:4; background:var(--palette-black); cursor:default; }
.media-library-inline-player video { position:static; display:block; width:100%; height:100%; max-width:100%; object-fit:contain; transform:none; }
.media-library-review-close { position:absolute; right:4px; top:4px; width:36px; min-height:36px; height:36px; margin:0; padding:0; border:1px solid rgba(var(--palette-white-rgb), 0.5); border-radius:50%; background:rgba(var(--palette-black-rgb), 0.8); color:var(--palette-white); font:26px/1 system-ui,sans-serif; }
.media-library-review-status { position:absolute; top:4px; left:4px; right:44px; margin:0; padding:4px; background:rgba(var(--palette-black-rgb), 0.8); color:var(--palette-white); font-size:11px; pointer-events:none; }
.media-library-body { padding: 11px; }
.media-library-body h3 { margin: 0 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-library-body h3, .media-library-meta, .media-library-references { font-family:inherit; font-size:11px; font-weight:400; color:rgba(var(--palette-white-rgb), 0.8); }
.media-library-badges { display: flex; flex-wrap: wrap; gap: 3px; }
.media-library-badges span { padding: 1px 5px; border-radius: 999px; background: rgba(var(--palette-white-rgb), 0.1); color: var(--palette-sky); font-size: 9px; text-transform: uppercase; }
.media-library-meta, .media-library-references { margin: 8px 0 0; color: rgba(var(--palette-white-rgb), 0.8); font-size: 11px; overflow-wrap: anywhere; }
.media-library-meta { margin-top:4px; }
.media-library-references { min-height: 0; }
.media-library-insert { width: 100%; margin-top: 10px; }

/* Wider scrollbar on desktop. iOS may keep its own overlay scrollbar; the
   sticky Top/Bottom controls provide reliable touch targets there. */
@media (pointer: fine) {
  html { scrollbar-width: auto; scrollbar-color: var(--palette-sky) var(--palette-navy); }
  html::-webkit-scrollbar { width: 18px; }
  html::-webkit-scrollbar-thumb { border: 3px solid var(--palette-navy); border-radius: 12px; background: var(--palette-sky); color:var(--palette-navy); }
  html::-webkit-scrollbar-track { background: var(--palette-navy); }
}

@media (max-width: 600px) {
  .health-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-library-filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-library-destination { grid-template-columns: 1fr; }
}

.share-export-panel > section + section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border, rgba(var(--palette-white-rgb), 0.25));
}

.share-export-section h2 {
  margin: 0 0 .45rem;
  font-size: 1.15rem;
}

.share-url-row,
.story-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}

.share-url-row input {
  flex: 1 1 18rem;
  min-width: 0;
}

.share-created,
.story-share-list {
  margin-top: 1rem;
}

.story-share-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .65rem;
  align-items: center;
  padding: .75rem 0;
  border-top: 1px solid var(--border, rgba(var(--palette-white-rgb), 0.25));
}

.story-share-item p { margin: 0; }
.story-share-item .share-state { color: var(--muted, rgba(var(--palette-white-rgb), 0.8)); font-size: .9rem; }
.story-share-item.is-inactive { opacity: 0.5; }

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: .6rem .9rem;
  border-radius: .7rem;
  background: var(--palette-blue);
  color: var(--palette-white);
  font-weight: 700;
  text-decoration: none;
}

.button-link.secondary { background: rgba(var(--palette-white-rgb), 0.1); }
.button-link[aria-disabled="true"] {
  opacity: 0.8;
  cursor: wait;
  pointer-events: none;
}

@media (min-width: 1100px) {
  .media-library-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .secondary-actions-menu {
    padding-left: 10px;
    padding-right: 10px;
  }

  .secondary-actions-menu > summary {
    min-height: 46px;
  }

  .secondary-action-choice {
    min-height: 46px;
    padding-left: 10px;
    padding-right: 8px;
  }
}

/* V22.7.18.1: Rename and View story now live under More. Reload belongs to
   the active editing workflow and sits immediately beside Write/Preview. */
.secondary-actions-list a.secondary-action-choice {
  box-sizing: border-box;
  text-decoration: none;
}

.workspace-mode-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 14px 0 10px;
}

.workspace-mode-row .workspace-tabs {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.workspace-reload {
  flex: 0 0 auto;
  min-height: 44px;
  padding-left: 18px;
  padding-right: 18px;
}

@media (max-width: 760px) {
  .workspace-mode-row {
    gap: 8px;
    margin-top: 14px;
  }

  .workspace-reload {
    flex: 0 0 29%;
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
  }

  .workspace-mode-row .workspace-tabs {
    margin: 0;
  }
}
#rename-story.secondary-action-choice::after {
  content: "›";
  flex: 0 0 auto;
  color: rgba(var(--palette-white-rgb), 0.8);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
}

/* V22.7.18.2: Story Editing now owns the former More chooser. This combines
   the blue section label and secondary-action row without changing the
   existing action IDs or section handlers. */
.editor-controls .story-editing-menu {
  margin: 2px 0 1px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.editor-controls .story-editing-menu[open] {
  padding-bottom: 0;
}

.editor-controls .story-editing-menu .secondary-actions-list {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

@media (max-width: 760px) {
  .editor-controls .story-editing-menu {
    padding-left: 0;
    padding-right: 0;
  }
}

/* One compact primary workflow row. The mode button names the mode it will
   open next, keeping Reload, Upload, Preview/Write, and Arrange equally sized. */
.workspace-mode-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.workspace-mode-row > button {
  min-width: 0;
  min-height: 52px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 750;
}

.workspace-reload {
  width: auto;
  background: rgba(var(--palette-white-rgb), 0.1);
  color: var(--palette-white);
}

.workspace-upload {
  background: rgba(var(--palette-white-rgb), 0.25);
  border-color: var(--palette-blue);
  color: var(--palette-white);
  box-shadow: none;
}

.workspace-upload.active {
  background: var(--palette-blue);
  border-color: var(--palette-sky);
}

.workspace-mode-row .workspace-tabs.workspace-mode-toggle {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: rgba(var(--palette-white-rgb), 0.25);
  color: var(--palette-white);
  box-shadow: 0 1px 4px rgba(var(--palette-black-rgb), 0.25);
}

.workspace-arrange {
  width: auto;
  background: rgba(var(--palette-white-rgb), 0.1);
  color: var(--palette-white);
}

.compact-upload-panel {
  margin: 8px 0;
}

.compact-upload-panel:not([open]) {
  display: none;
}

.compact-upload-panel > .upload-panel-native-summary {
  display: none;
}

.compact-upload-panel[open] {
  border-color: var(--border);
}

@media (max-width: 760px) {
  .workspace-mode-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .workspace-mode-row > button {
    min-height: 50px;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 15px;
  }

  .workspace-reload {
    flex: initial;
  }

  .workspace-mode-row .workspace-tabs.workspace-mode-toggle {
    margin: 0;
  }
}


/* V22.7.18.5: Create Story now belongs to the Story Editing chooser.
   Give this constructive action a restrained blue accent without competing
   with Upload/SAVE or the destructive red Delete action. */
.secondary-action-choice.create-story-choice {
  border: 1px solid rgba(var(--palette-white-rgb), 0.25);
  background: rgba(var(--palette-white-rgb), 0.1);
  color: rgba(var(--palette-white-rgb), 0.8);
}

.secondary-action-choice.create-story-choice:active {
  background: rgba(var(--palette-white-rgb), 0.1);
}

.create-story-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* V22.8.0: optional public-story journey waypoints. */
.map-waypoint-panel {
  grid-column: 1 / -1;
  margin: 12px 0 16px;
  padding: 12px 0 0;
  border-top: 2px solid rgba(var(--palette-white-rgb), 0.5);
}

.map-overview-editor {
  margin: 14px 0;
  padding: 12px;
  border-left: 2px solid rgba(var(--palette-white-rgb), 0.5);
  border-radius: 0 8px 8px 0;
  background: rgba(var(--palette-navy-rgb), 0.5);
}

.map-overview-editor h3 { margin: 0 0 10px; color: var(--palette-sky); }
.map-overview-editor > .secondary { width: 100%; margin: 8px 0; }
.map-overview-preview { margin-bottom: 8px; }

.map-waypoint-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.map-waypoint-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(var(--palette-white-rgb), 0.25);
  border-radius: 10px;
  background: var(--palette-navy);
}

.map-waypoint-item.active {
  border-color: var(--palette-sky);
}

.map-waypoint-item p {
  margin: 0;
}

.map-waypoint-item small {
  display: block;
  color: rgba(var(--palette-white-rgb), 0.8);
}

.map-waypoint-item-actions {
  display: flex;
  gap: 5px;
}

.map-waypoint-item-actions button {
  min-width: 42px;
  padding: 7px 9px;
}

.map-waypoint-editor {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--palette-white-rgb), 0.25);
}

.map-waypoint-editor h3 {
  margin: 0 0 10px;
}

.map-waypoint-search-row,
.map-coordinate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.map-waypoint-search-row {
  margin: 8px 0;
}

#map-waypoint-results {
  margin-bottom: 10px;
}

.map-waypoint-media-picker {
  display: flex;
  gap: 8px;
  margin: 8px 0 12px;
  overflow-x: auto;
  padding: 2px 1px 7px;
  -webkit-overflow-scrolling: touch;
}

.map-waypoint-media-choice {
  position: relative;
  flex: 0 0 94px;
  width: 94px;
  min-height: 84px;
  padding: 0;
  overflow: hidden;
  border: 2px solid rgba(var(--palette-white-rgb), 0.25);
  border-radius: 9px;
  background: var(--palette-navy);
  color: var(--palette-white);
}

.map-waypoint-media-choice.selected { border-color: var(--palette-sky); }
.map-waypoint-media-choice img,
.map-waypoint-media-choice video { display: block; width: 100%; height: 64px; object-fit: cover; background: var(--palette-navy); }
.map-waypoint-media-choice .map-waypoint-video-icon { display: grid; place-items: center; height: 64px; padding: 0; background: var(--palette-navy); color: var(--palette-sky); font-size: 25px; }
.map-waypoint-media-choice span { display: block; overflow: hidden; padding: 5px; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.map-waypoint-media-empty { margin: 0; color: rgba(var(--palette-white-rgb), 0.8); font-size: 13px; }

.map-waypoint-preview {
  height: 260px;
  margin-top: 10px;
  border: 1px solid rgba(var(--palette-white-rgb), 0.25);
  border-radius: 10px;
  background: var(--palette-navy);
  overflow: hidden;
}

.map-waypoint-preview .leaflet-control-attribution {
  font-size: 9px;
}

.editor-waypoint-pin-wrapper {
  border: 0;
  background: transparent;
}

.editor-waypoint-pin {
  position: absolute;
  top: 4px;
  left: 5px;
  display: block;
  width: 27px;
  height: 27px;
  transform: rotate(-45deg);
  border: 3px solid var(--palette-white);
  border-radius: 50% 50% 50% 0;
  background: var(--palette-blue);
  box-shadow: 0 2px 7px rgba(var(--palette-black-rgb), 0.5);
}

.editor-waypoint-pin::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--palette-white);
}

@media (max-width: 600px) {
  .map-waypoint-search-row,
  .map-coordinate-grid {
    grid-template-columns: 1fr;
  }
}

.arrange-dialog { width: min(1000px, 96vw); max-width: 96vw; height: 92dvh; max-height: 92dvh; padding: 16px; background: var(--palette-black); color: var(--palette-white); border: 1px solid rgba(var(--palette-white-rgb), 0.25); border-radius: 16px; overflow-y: auto; }
.arrange-dialog::backdrop { background: rgba(var(--palette-black-rgb), 0.8); }
.arrange-sticky-tools {
  position: sticky; top: -16px; z-index: 4;
  margin: 0 -8px; padding: 10px 8px 12px;
  border-bottom: 1px solid rgba(var(--palette-white-rgb), 0.25);
  background: var(--palette-black);
  box-shadow: 0 10px 18px rgba(var(--palette-black-rgb), 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.arrange-dialog header {
  display: grid; gap: 8px; padding: 0 0 8px;
}
.arrange-heading {
  position: relative;
  display: flex; align-items: center; justify-content: flex-start;
  width: 100%; min-width: 0; padding: 10px 52px 10px 16px !important;
  border: 1px solid rgba(var(--palette-white-rgb), 0.25); border-radius: 12px;
  background: var(--palette-navy); color: var(--palette-white);
  text-align: left; font: inherit; font-weight: 800;
}
.arrange-heading:hover { background: var(--palette-navy); }
.arrange-heading-chevron {
  position: absolute; right: 19px; top: 50%;
  width: 13px; height: 13px;
  border-top: 3px solid currentColor; border-left: 3px solid currentColor;
  transform: translateY(-25%) rotate(45deg);
}
.arrange-dialog header button { min-width: 0; padding: 8px 6px; }
.arrange-dialog header [data-act="back"] { width: 100%; }
.arrange-actions {
  display: grid;
  grid-template-columns: minmax(0,.8fr) minmax(120px,1.4fr) minmax(0,.8fr);
  gap: 8px;
}
.arrange-actions button { white-space: nowrap; }
.arrange-dialog button { min-height: 44px; }
.arrange-move { display: grid; grid-template-columns: minmax(0,.8fr) minmax(120px,1.4fr) minmax(0,.8fr); align-items: end; gap: 8px; }
.arrange-move label { min-width: 0; }
.arrange-move select { width: 100%; }
.arrange-move button { min-width: 0; padding: 8px 10px; white-space: nowrap; }
.arrange-status:empty { display: none; }
.arrange-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(135px,1fr)); gap: 12px; }
.arrange-separator { grid-column: 1 / -1; padding: 12px; background: var(--palette-navy); overflow-wrap: anywhere; }
.arrange-card { position: relative; min-width: 0; border: 2px solid rgba(var(--palette-white-rgb), 0.25); border-radius: 12px; overflow: hidden; background: var(--palette-navy); }
.arrange-card.selected { border-color: var(--palette-sky); }
.arrange-selection-order {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  display: grid; place-items: center; width: 30px; height: 30px;
  border: 2px solid var(--palette-white); border-radius: 50%;
  background: var(--palette-blue); color: var(--palette-white); font-weight: 800;
}
.arrange-card img,.arrange-placeholder { display: block; width: 100%; height: 105px; object-fit: contain; background: var(--palette-black); }
.arrange-thumbnail { position:relative; width:100%; aspect-ratio:16 / 9; overflow:hidden; background:var(--palette-navy); cursor:pointer; }
.arrange-thumbnail-visual { position:absolute; inset:0; }
.arrange-card .arrange-thumbnail img,.arrange-card .arrange-thumbnail canvas { display:block; width:100%; height:100%; object-fit:cover; }
.arrange-thumbnail-fallback { display:grid; place-items:center; width:100%; height:100%; color:var(--palette-sky); font:400 36px/1 system-ui,sans-serif; background:linear-gradient(145deg,rgba(var(--palette-white-rgb), 0.25),var(--palette-navy)); }
.arrange-thumbnail-badge { position:absolute; left:8px; bottom:8px; padding:3px 7px; border:1px solid var(--palette-sky); border-radius:12px; background:rgba(var(--palette-navy-rgb), 0.8); color:var(--palette-white); font:700 12px/1.4 system-ui,sans-serif; pointer-events:none; }
.arrange-card button { font-size: 13px; padding: 8px; }
.arrange-card .arrange-phone-rotation {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-top: 1px solid rgba(var(--palette-white-rgb), 0.25);
  border-radius: 0;
  background: var(--palette-navy);
  color: rgba(var(--palette-white-rgb), 0.8);
  text-align: left;
}
.arrange-card .arrange-phone-rotation[aria-pressed="true"] {
  background: rgba(var(--palette-white-rgb), 0.1);
  color: var(--palette-sky);
}
.arrange-card .arrange-handle { position: absolute; top: 0; right: 0; touch-action: none; min-width: 44px; background: var(--palette-navy); font-size: 24px; cursor: grab; user-select: none; }
.arrange-status { color: var(--palette-sky); }

.arrange-card.drop-target { border-top: 5px solid var(--palette-sky); }

@media (max-width: 480px) {
  .arrange-dialog header { gap: 5px; }
  .arrange-dialog header button { font-size: 12px; }
  .arrange-actions { gap: 5px; }
  .arrange-actions button { padding: 8px 4px; }
  .arrange-move { gap: 5px; }
  .arrange-move button { padding: 8px 5px; font-size: 12px; }
}

/* Single-item sharing keeps the existing Media Library insertion controls. */
.media-library-card-actions,.media-share-actions { display:flex; flex-wrap:wrap; gap:8px; }
.media-share-panel { width:min(560px,calc(100vw - 32px)); max-height:85dvh; overflow:auto; box-sizing:border-box; border:1px solid rgba(var(--palette-white-rgb), 0.5); border-radius:14px; padding:20px; background:rgba(var(--palette-white-rgb), 0.1); color:var(--palette-white); }
.media-share-panel::backdrop { background:rgba(var(--palette-black-rgb), 0.5); }
.media-share-panel h2 { margin-top:0; } .media-share-panel p { overflow-wrap:anywhere; }
.media-share-panel input:not([type=checkbox]),.media-share-panel select { width:100%; margin:8px 0; box-sizing:border-box; }
.media-share-panel label { display:block; margin:14px 0; } .media-share-panel label input[type=checkbox] { width:auto; }
.media-share-panel button { margin:6px 6px 6px 0; } .media-share-download { display:block; color:var(--palette-sky); margin:16px 0; }
.media-share-dialog { padding:0; }
.media-share-header { position:sticky; top:0; z-index:1; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 20px; background:rgba(var(--palette-white-rgb), 0.1); border-bottom:1px solid rgba(var(--palette-white-rgb), 0.5); }
.media-share-header h2 { margin:0; min-width:0; }
.media-share-header .media-share-close { display:grid; place-items:center; flex:0 0 44px; width:44px; min-height:44px; margin:0; padding:0; font:400 28px/1 system-ui,sans-serif; }
.media-share-body { padding:0 20px 20px; }
.media-framing-dialog { width:min(560px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); margin:12px auto; }
.media-framing-dialog .media-share-header { padding:10px 12px; }
.media-framing-dialog .media-share-header h2 { font-size:20px; }
.media-framing-dialog .media-share-body { display:grid; gap:8px; padding:0 12px 12px; }
.media-framing-dialog .media-framing-preview { max-width:40dvh; margin:0 auto; }
.media-framing-dialog .help-text { margin:0; font-size:12px; line-height:1.4; }
.media-framing-dialog [role=status]:empty { display:none; }
.media-framing-dialog .media-framing-slider { margin:0; gap:2px; font-size:14px; }
.media-framing-dialog .media-framing-slider input[type=range] { margin:0; padding:0; min-height:32px; }
.media-framing-dialog .media-share-actions { display:flex; gap:8px; margin:0; }
.media-framing-dialog .media-share-actions button { min-height:44px; margin:0; padding:8px 12px; font-size:14px; }
.media-framing-dialog .media-share-actions:last-child { position:sticky; bottom:-12px; background:rgba(var(--palette-white-rgb), 0.1); padding:4px 0 8px; }
.media-share-existing { border-top:1px solid rgba(var(--palette-white-rgb), 0.5); margin-top:18px; padding-top:12px; } .media-share-existing p { font-size:.85rem; }

/* Task-first workspace. Home, browsing and sharing do not expose the editor. */
body[data-workspace-view]:not([data-workspace-view="edit"]) .editor-main > *,
body[data-workspace-view="edit"][data-has-story="false"] .editor-main > * { display:none; }
body[data-workspace-view] .editor-main > #message,
body[data-workspace-view="home"] .editor-main > #workspace-home,
body[data-workspace-view="stories"] .editor-main > #workspace-stories,
body[data-workspace-view="links"] .editor-main > #workspace-shared-links,
body[data-workspace-view="media"] .editor-main > #secondary-media-library,
body[data-workspace-view="create"] .editor-main > #secondary-create-story,
body[data-workspace-view="admin"] .editor-main > .user-management-panel,
body[data-workspace-view="admin"] .editor-main > .audit-panel,
body[data-workspace-view="admin"] .editor-main > .archive-health-panel,
body[data-workspace-view="admin"] .editor-main > #secondary-full-backup,
body[data-workspace-view="admin"] .editor-main > .deleted-users-panel,
body[data-workspace-view="admin"] .editor-main > #secondary-homepage-cards,
body[data-workspace-view="admin"] .editor-main > #secondary-search-settings,
body[data-workspace-view="admin"] .editor-main > #secondary-design-elements,
body[data-workspace-view="edit"] .editor-main > .editor-controls,
body[data-workspace-view="share"] .editor-main > .editor-controls { display:block; }
body[data-workspace-view="share"][data-has-story="true"] .editor-main > #secondary-share-export { display:block; }

body[data-workspace-view="edit"] #workspace-home,
body[data-workspace-view="edit"] #workspace-stories,
body[data-workspace-view="edit"] #workspace-shared-links,
body[data-workspace-view="edit"][data-has-story="true"] #workspace-choose-story { display:none !important; }
body[data-workspace-view="edit"][data-has-story="false"] #workspace-choose-story,
body[data-workspace-view="share"][data-has-story="false"] #workspace-choose-story { display:block; }
body[data-workspace-view="share"] .story-editing-menu { display:none; }
body[data-workspace-view="media"] .media-library-destination { display:none; }
.workspace-home,.workspace-stories,.workspace-shared-links { padding:20px 0; }
.workspace-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:28px 0; }
.workspace-choices a,.workspace-story-card { background:rgba(var(--palette-white-rgb), 0.1); border:1px solid rgba(var(--palette-white-rgb), 0.25); border-radius:14px; padding:22px; color:var(--palette-white); text-decoration:none; }
.workspace-choices a:hover,.workspace-choices a:focus-visible { border-color:var(--palette-sky); background:rgba(var(--palette-white-rgb), 0.1); outline:3px solid var(--palette-sky); outline-offset:3px; }
.workspace-choices strong { display:block; font-size:1.2rem; margin-bottom:12px; }
.workspace-choices span { display:block; color:rgba(var(--palette-white-rgb), 0.8); line-height:1.5; }
.workspace-admin-link { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; box-sizing:border-box; width:100%; min-height:56px; padding:16px 20px; margin:20px 0; border:1px solid var(--palette-sky); border-radius:14px; background:rgba(var(--palette-white-rgb), 0.1); color:var(--palette-white); text-align:left; text-decoration:none; }
.workspace-admin-link strong { display:block; font-size:1.2rem; margin-bottom:8px; }
.workspace-admin-link span { display:block; color:rgba(var(--palette-white-rgb), 0.8); line-height:1.5; }
.workspace-admin-link:hover { background:rgba(var(--palette-white-rgb), 0.25); border-color:var(--palette-sky); }
.workspace-admin-link:focus-visible { outline:3px solid var(--palette-sky); outline-offset:3px; }
#workspace-continue { margin:12px 0 0; }
#workspace-continue a { display:flex; align-items:center; justify-content:space-between; gap:12px; box-sizing:border-box; width:100%; min-height:52px; padding:12px 16px; border:1px solid var(--palette-sky); border-radius:12px; background:var(--palette-navy); color:var(--palette-sky); font-weight:650; line-height:1.3; text-decoration:none; }
#workspace-continue a::after { content:"›"; flex:0 0 auto; color:var(--palette-sky); font-size:1.65rem; line-height:1; }
#workspace-continue a:hover { border-color:var(--palette-sky); background:rgba(var(--palette-white-rgb), 0.1); color:var(--palette-white); }
#workspace-continue a:active { background:rgba(var(--palette-white-rgb), 0.25); }
#workspace-continue a:focus-visible { outline:3px solid var(--palette-sky); outline-offset:3px; }
.workspace-story-card { margin:14px 0; padding:16px; }
.workspace-story-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; min-width:0; }
.workspace-story-heading-copy { min-width:0; flex:1; }
.workspace-story-card h3 { margin:0 0 4px; overflow-wrap:anywhere; }
.workspace-story-card p { color:rgba(var(--palette-white-rgb), 0.8); margin:5px 0; }
.workspace-story-cover { display:block; flex:0 0 auto; width:88px; aspect-ratio:4 / 3; border:1px solid rgba(var(--palette-white-rgb), 0.5); border-radius:10px; background:var(--palette-navy); object-fit:cover; }
.workspace-story-card .workspace-story-media { display:grid; gap:3px; margin:5px 0 7px; font-size:.87rem; color:rgba(var(--palette-white-rgb), 0.8); }
.workspace-story-media-row { display:flex; align-items:baseline; gap:7px; min-width:0; line-height:1.35; }
.workspace-story-card .workspace-story-media strong { flex:0 0 auto; color:var(--palette-white); font-size:.9em; }
.workspace-story-card .workspace-story-media span { display:block; min-width:0; }
.workspace-story-file-summary::before { content:"|"; margin-right:7px; }
.workspace-story-field { display:grid; grid-template-columns:minmax(0,1fr) 3rem; align-items:center; gap:10px; margin:10px 0; }
.workspace-story-field > input,.workspace-story-field > select { width:100%; min-width:0; min-height:44px; margin:0; }
.workspace-story-field > label { margin:0; }
.workspace-story-card .workspace-story-edited { font-size:.78rem; line-height:1.3; margin:4px 0 0; }
.workspace-story-actions { display:flex; gap:10px; flex-wrap:wrap; }
.workspace-section-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.workspace-section-heading h2,.workspace-section-heading p { margin-top:0; }
.workspace-shared-links > select { width:min(260px,100%); margin:8px 0 18px; }
.workspace-link-card { background:rgba(var(--palette-white-rgb), 0.1); border:1px solid rgba(var(--palette-white-rgb), 0.25); border-radius:14px; margin:14px 0; padding:18px; }
.workspace-link-card h3 { margin:0 0 6px; overflow-wrap:anywhere; }
.workspace-link-meta { color:rgba(var(--palette-white-rgb), 0.8); display:grid; gap:5px; margin:10px 0 14px; }
.workspace-link-status { display:inline-block; border:1px solid var(--palette-sky); border-radius:999px; color:rgba(var(--palette-white-rgb), 0.8); font-size:.8rem; padding:3px 9px; }
.workspace-link-status.expired,.workspace-link-status.revoked { border-color:rgba(var(--palette-white-rgb), 0.5); color:rgba(var(--palette-white-rgb), 0.8); }
.workspace-link-actions { display:flex; flex-wrap:wrap; gap:8px; }
.workspace-link-actions button,.workspace-link-actions a { margin:0; }
/* Sharing dashboard: standard slate surfaces and blue primary actions. */
body[data-workspace-view="links"] { background:var(--palette-navy); color:var(--palette-white); --panel:rgba(var(--palette-white-rgb), 0.1); --border:rgba(var(--palette-white-rgb), 0.25); --accent:var(--palette-sky); }
body[data-workspace-view="links"] .editor-header { background:var(--palette-navy); border-bottom-color:rgba(var(--palette-white-rgb), 0.25); }
body[data-workspace-view="links"] .editor-header p,
body[data-workspace-view="links"] .workspace-shared-links p,
body[data-workspace-view="links"] .workspace-link-meta { color:rgba(var(--palette-white-rgb), 0.8); }
body[data-workspace-view="links"] .secondary { background:rgba(var(--palette-white-rgb), 0.25); color:var(--palette-white); }
body[data-workspace-view="links"] .secondary:hover:not(:disabled) { background:rgba(var(--palette-white-rgb), 0.25); }
body[data-workspace-view="links"] #workspace-refresh-links { background:var(--palette-blue); color:var(--palette-white); }
body[data-workspace-view="links"] #workspace-refresh-links:hover:not(:disabled) { background:var(--palette-blue); }
body[data-workspace-view="links"] #workspace-link-status { background:rgba(var(--palette-white-rgb), 0.1); border-color:rgba(var(--palette-white-rgb), 0.5); color:var(--palette-white); }
body[data-workspace-view="links"] .workspace-link-card { background:rgba(var(--palette-white-rgb), 0.1); border-color:rgba(var(--palette-white-rgb), 0.25); }
body[data-workspace-view="links"] .workspace-link-status { background:rgba(var(--palette-green-rgb), 0.25); border-color:rgba(var(--palette-green-rgb), 0.25); color:var(--palette-green); }
body[data-workspace-view="links"] .workspace-link-status:is(.expired,.revoked) { background:rgba(var(--palette-white-rgb), 0.25); border-color:rgba(var(--palette-white-rgb), 0.5); color:rgba(var(--palette-white-rgb), 0.8); }
body[data-workspace-view="links"] .workspace-link-actions .danger { background:var(--palette-red); color:var(--palette-navy); }
body[data-workspace-view="links"] .workspace-link-actions .danger:hover:not(:disabled) { background:var(--palette-red); color:var(--palette-navy); }
body[data-workspace-view="links"] :is(button,a,select,input,summary):focus-visible { outline:3px solid var(--palette-sky); outline-offset:3px; }
body[data-workspace-view] .editor-header h1 { display:block; font-size:1.1rem; }
@media (max-width:700px) { .workspace-choices { grid-template-columns:1fr; gap:12px; margin:20px 0; } .workspace-choices a { padding:20px; } .workspace-section-heading { align-items:stretch; flex-direction:column; } body[data-workspace-view] .editor-header { flex-wrap:wrap; } .editor-header-actions { flex-wrap:wrap; } }
@media (max-width:420px) {
  .workspace-story-cover { width:80px; }
  .workspace-story-card .workspace-story-media { font-size:.82rem; }
  .workspace-story-media-row { gap:5px; }
}

body[data-workspace-view="media"] .media-library-insert { display:none; }
body[data-workspace-view] .editor-main > dialog[open],
body[data-workspace-view] .editor-main > p.message.warning { display:block; }
/* Keep the task-route visibility rule from exposing an empty mobile toast. */
body[data-workspace-view] .editor-main > #message:empty { display:none; }

/* Compact Home without changing the story editor or other task pages. */
body[data-workspace-view="home"] .editor-main { padding-top:8px; }
.workspace-home { padding-top:0; }
.workspace-home > h2 { margin:0 0 12px; }
.workspace-home > p:not(#workspace-continue) { margin:0 0 16px; }
.workspace-greeting { display:flex; flex-wrap:wrap; align-items:baseline; column-gap:12px; row-gap:4px; margin:0 0 16px; }
.workspace-greeting > h2,.workspace-greeting > p { margin:0; }
.workspace-greeting > h2 { flex:0 1 auto; max-width:100%; overflow-wrap:anywhere; }
.workspace-greeting > p { flex:1 1 150px; min-width:0; }
.homepage-checkbox-text { white-space:nowrap; }
#media-library-feedback.success { white-space:pre-line; }
.workspace-home .workspace-choices { margin-top:16px; margin-bottom:20px; }
.workspace-home .workspace-choices a { padding:16px 20px; }
.workspace-home .workspace-choices strong { margin-bottom:8px; }

/* Keep the story browser close to the workspace header on small screens.
   This is intentionally route-specific so editor toolbars and panels retain
   their established sticky offsets and spacing. */
body[data-workspace-view="stories"] .editor-main { padding-top:8px; }
body[data-workspace-view="stories"] .workspace-stories { padding-top:4px; }
body[data-workspace-view="stories"] .workspace-stories > h2 { margin:0 0 12px; }

/* Share and reversible Trash fit on one row even in two-column phone cards. */
.media-library-card-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:6px; }
.media-library-card-actions.has-pair { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.media-library-card-actions > button { min-width:0; width:100%; min-height:44px; margin:0; padding:8px 0; display:grid; place-items:center; }
.media-library-card-actions > button svg { display:block; width:22px; height:22px; pointer-events:none; }
.media-library-card-actions > .media-library-insert { grid-column:1 / -1; }
.media-trash-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid rgba(var(--palette-white-rgb), 0.25); }
.media-trash-row span { min-width: 0; overflow-wrap: anywhere; }
.media-trash-row button { flex-shrink: 0; }

.media-trash-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .75rem 0; }
.media-trash-select-all, .media-trash-file { display: flex; align-items: center; gap: .65rem; margin: 0; }
.media-trash-file { flex: 1; min-width: 0; }
.media-trash-file input, .media-trash-select-all input { flex: 0 0 auto; width: 22px; height: 22px; margin: 0; }
.media-trash-file span { font-size: .95rem; }

/* Match the standard full-width collapsible section header. */
.media-trash-panel { margin: 12px 0; }


/* One shared section-bar component. Account/toolbar menus are separate controls. */
.editor-page details.editor-disclosure {
  --disclosure-border: rgba(var(--palette-white-rgb), 0.5);
  --disclosure-background: var(--palette-navy);
  min-width: 0;
  padding: 0;
  border: 1px solid var(--disclosure-border);
  border-radius: 12px;
  background: var(--disclosure-background);
}
.editor-page details.editor-disclosure > summary {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  min-height: 50px;
  gap: 10px;
  margin: 0;
  padding: 9px 42px 9px 14px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--palette-white);
  font-size: 16px;
  font-weight: 750;
  font-style: normal;
  letter-spacing: normal;
  text-shadow: none;
  box-shadow: none;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}
.editor-page details.editor-disclosure > summary strong { font-weight: inherit; }
.editor-page details.editor-disclosure > summary::-webkit-details-marker { display: none; }
.editor-page details.editor-disclosure > summary::after {
  content: "⌄";
  position: absolute;
  right: 15px;
  top: 50%;
  translate: 0 -50%;
  transform: none;
  margin: 0;
  padding: 0;
  color: var(--palette-sky);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: none;
}
.editor-page details.editor-disclosure[open] > summary::after { content: "⌃"; transform: none; }
.editor-page details.editor-disclosure > summary:hover { background: rgba(var(--palette-white-rgb), 0.1); }
.editor-page details.editor-disclosure > summary:focus-visible { outline: 3px solid var(--palette-sky); outline-offset: -3px; }
.editor-page details.editor-disclosure[open] > summary { border-radius: 11px 11px 0 0; border-bottom: 1px solid var(--disclosure-border); }
.editor-page details.editor-disclosure > :not(summary) { margin-left: 14px; margin-right: 14px; }
.editor-page details.editor-disclosure[open] { padding-bottom: 12px; }
/* Standard compact body for load-action/result panels. The shared disclosure
   supplies 14px side gutters and 12px bottom padding. */
.editor-disclosure-body {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}
.editor-disclosure-body > button {
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 15px;
  font-size: 16px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
.editor-disclosure-body > .user-list { margin: 0; }
.editor-disclosure-body > .user-list:empty { display: none; }
/* Filter fields already supply their own interior gutter. */
.editor-page details.editor-disclosure > .media-library-filter-fields { margin: 0; }
.editor-page details.editor-disclosure.has-active-filters > summary { background: rgba(var(--palette-white-rgb), 0.1); }
/* Keep administration bars evenly separated, including the backup section. */
body[data-workspace-view="admin"] .editor-main > details.secondary-section {
  margin: 0 0 12px;
}
body[data-workspace-view="admin"] .editor-main > #secondary-archive-health,
body[data-workspace-view="admin"] .editor-main > #secondary-full-backup {
  --disclosure-background: rgba(var(--palette-white-rgb), 0.1);
  --disclosure-border: rgba(var(--palette-white-rgb), 0.5);
}
.bin-review-status { margin-top:10px; margin-bottom:8px; color:rgba(var(--palette-white-rgb), 0.8); font-size:14px; line-height:1.4; }
.bin-review-status:empty { display:none; }

/* Account identity ends at the story count; quota starts its own line. */
.user-account-summary > span { display: block; overflow-wrap: anywhere; }

/* Maintenance controls share the disclosure bar and existing checkbox style. */
.maintenance-controls { min-width:0; }
.maintenance-controls select { box-sizing:border-box; width:100%; min-width:0; }
.maintenance-controls .checkbox-row { display:flex; align-items:flex-start; gap:0.6rem; overflow-wrap:anywhere; }
.maintenance-controls .checkbox-row input { flex:none; width:auto; }

.bin-destination-row,.bin-upload-actions {display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
.bin-destination-row select {flex:1;min-width:0;} .bin-destination-row button {margin:0;}
#bin-upload-progress {display:block;width:100%;margin:8px 0;}

/* A fixed single attribute row; the entire row opens full, unabridged details. */
.media-library-badges.media-library-attributes {display:flex;flex-wrap:nowrap;align-items:center;gap:3px;width:100%;min-width:0;min-height:24px;max-height:24px;box-sizing:border-box;overflow:hidden;padding:0;margin:0;border:0;border-radius:5px;background:transparent;color:var(--palette-sky);text-align:left;cursor:pointer;}
.media-library-attributes > span {flex:0 0 auto;white-space:nowrap;padding:1px 5px;font-size:9px;font-weight:400;line-height:14px;}
.media-library-attributes:focus-visible {outline:2px solid var(--palette-sky);outline-offset:2px;}
.media-attribute-more {font-weight:700!important;}
.media-attribute-dialog {width:min(420px,calc(100vw - 40px));max-height:80dvh;box-sizing:border-box;overflow:auto;border:1px solid rgba(var(--palette-white-rgb), 0.5);border-radius:14px;background:var(--palette-navy);color:var(--palette-white);padding:20px;}
.media-attribute-dialog::backdrop {background:rgba(var(--palette-black-rgb), 0.5);}
.media-attribute-dialog h3 {margin:0 0 12px;overflow-wrap:anywhere;}
.media-attribute-dialog li {margin:8px 0;overflow-wrap:anywhere;}

.arrange-cover-time { display:grid; gap:6px; padding:8px; border-top:1px solid rgba(var(--palette-white-rgb), 0.25); }
.arrange-cover-time label { display:grid; gap:4px; margin:0; font-size:12px; font-weight:600; }
.arrange-cover-time input { width:100%; min-width:0; min-height:40px; padding:6px 8px; box-sizing:border-box; }
.arrange-cover-time button { min-height:44px; margin:0; }
