/* The deck editor's controls, drawn in the site's chrome rather than on the vellum. */
.bar button[data-act="edit"][hidden], .bar .help[hidden] { display: none; }
.bar button[data-act="edit"] { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; padding: 0 10px; }

body.editing .deck { padding-bottom: 120px; }
body.editing.grid .deck { padding-bottom: 120px; }
body.editing [data-k] { outline: 1px dashed transparent; outline-offset: 4px; cursor: text; }
body.editing [data-k]:hover { outline-color: color-mix(in srgb, var(--rubric) 45%, transparent); }
body.editing [data-k]:focus { outline: 2px solid var(--rubric); }
body.editing figure[data-k] { cursor: pointer; }
body.editing .slide :is(p, div, h1, td, cite):empty::before { content: "…"; opacity: .35; }
body.editing .notes [data-k] { outline-offset: 2px; }
body.editing .notes [data-k]:hover { outline-color: var(--rule); }
body.editing .notes [data-k]:focus { outline-color: var(--rust); }
body.editing .notes p:empty::before { content: "note"; opacity: .4; }
.ed-raw { white-space: pre-wrap; }
.unverified { outline: 2px dotted var(--rust) !important; outline-offset: 4px; }

body.editing .frame[data-hidden] .stage { opacity: .38; }
body.editing.grid .frame { cursor: grab; }

.ed-slidebar, .ed-blockbar, .ed-bar, .ed-dialog { font: 12px/1.4 "IBM Plex Mono", monospace; letter-spacing: .06em; color: var(--bone); }
.ed-slidebar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 0 0 8px; }
body.editing:not(.reading):not(.grid) .ed-slidebar { display: none; }
body.grid .ed-slidebar { font-size: 10px; }
.ed-slidebar .ed-n { color: var(--bone-dim); text-transform: uppercase; margin-right: 6px; }
.ed-slidebar button, .ed-slidebar select, .ed-blockbar button, .ed-blockbar select, .ed-bar button, .ed-dialog button,
.ed-dialog input, .ed-dialog textarea, .ed-mini {
  font: inherit; color: var(--bone); background: var(--surface); border: 1px solid var(--rule); padding: 4px 8px; min-height: 28px; cursor: pointer; }
.ed-slidebar button:hover, .ed-blockbar button:hover, .ed-bar button:hover, .ed-dialog button:hover, .ed-mini:hover { border-color: var(--gold-line); color: var(--gold-pale); }
:is(.ed-slidebar, .ed-blockbar, .ed-bar, .ed-dialog) :focus-visible { outline: 2px solid var(--rust); outline-offset: 1px; }
.ed-slidebar button:disabled { opacity: .35; cursor: default; }
.ed-mini { margin-top: 4px; font-size: 11px; }

.ed-blockbar { position: absolute; z-index: 7; display: flex; gap: 4px; padding: 4px; background: var(--ground); border: 1px solid var(--rule); box-shadow: 0 6px 18px rgba(0,0,0,.5); }

.ed-bar { position: fixed; z-index: 8; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 10px 16px; background: var(--ground); border-top: 1px solid var(--rule); }
.ed-bar .ed-status { flex: 1; min-width: 12em; color: var(--bone-dim); }
button.primary { border-color: var(--rust) !important; background: color-mix(in srgb, var(--rust) 30%, var(--surface)) !important; }

.ed-dialog { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; background: var(--ground); border: 1px solid var(--rule); padding: 20px; }
.ed-dialog::backdrop { background: rgba(0,0,0,.6); }
.ed-dialog h3 { font: 16px "Cinzel", serif; letter-spacing: .12em; margin: 0 0 12px; color: var(--gold-pale); }
.ed-dialog label { display: grid; gap: 4px; margin: 0 0 10px; }
.ed-dialog label > span { color: var(--bone-dim); }
.ed-dialog .ed-check { display: flex; gap: 8px; align-items: center; }
.ed-dialog input:not([type]), .ed-dialog input[type="text"] { width: 100%; cursor: text; }
.ed-text { width: 100%; min-height: 52vh; resize: vertical; font: 13px/1.5 "IBM Plex Mono", monospace !important; cursor: text !important; }
.ed-text.short { min-height: 7em; }
.ed-dialog p, .ed-help { font: 12px/1.5 "IBM Plex Mono", monospace; color: var(--bone-dim); margin: 0 0 10px; }
.ed-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 14px; }
.ed-imgtop { display: grid; grid-template-columns: 220px 1fr; gap: 16px; margin-bottom: 12px; }
.ed-preview { width: 220px; max-height: 220px; object-fit: contain; background: var(--surface); }
.ed-search { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.ed-search input { flex: 1; min-width: 12em; cursor: text; }
.ed-upload { display: flex !important; align-items: center; gap: 6px; margin: 0 !important; }
.ed-upload input { max-width: 15em; }
.ed-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.ed-hit { display: grid !important; gap: 4px; padding: 4px !important; text-align: left; }
.ed-hit img { width: 100%; height: 110px; object-fit: cover; }
.ed-hit span { font-size: 10px; color: var(--bone-dim); }
@media (max-width: 600px) { .ed-imgtop { grid-template-columns: 1fr; } .ed-preview { width: 100%; } }
