/* darkux admin: same look as the site, plus forms. */
body.admin { max-width: 52rem; }
.admin .top nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; font: .9375rem var(--mono); }
.admin .top nav form { display: inline; margin: 0; }
.mark small { font-size: .75rem; color: var(--muted); }
button.link { background: none; border: 0; padding: 0; color: var(--link); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
main { margin-top: 2rem; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 1rem; }
.bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.bar h1 { margin: 0; }
.center { max-width: 28rem; }
.status { padding: .75rem 1rem; border-radius: var(--radius); background: var(--panel); font: .9375rem var(--mono); }
.status.error { background: #fde7e5; color: #8c1d18; }
.badge { display: inline-block; padding: 0 .5rem; border-radius: 4px; border: 1px solid var(--muted); font: .75rem var(--mono); color: var(--muted); vertical-align: 2px; }

label { display: block; margin: 1rem 0 .375rem; font-weight: 600; font-size: 1rem; }
label .quiet { font-weight: 400; }
input[type="text"], input[type="search"], input[type="datetime-local"], textarea {
  width: 100%; padding: .625rem .75rem; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--bg); color: var(--text); font: 1rem var(--font);
}
textarea { font-family: var(--mono); line-height: 1.5; resize: vertical; }
input:focus, textarea:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 1rem; }
.grid p { margin: 0; }
fieldset { margin: 1.5rem 0 0; padding: 1rem; border: 1px solid var(--rule); border-radius: var(--radius); }
legend { padding: 0 .375rem; font-weight: 600; }
.media-list ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.media-list li { display: grid; grid-template-columns: 96px 1fr; gap: .25rem 1rem; align-items: start; }
.media-list li img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; grid-row: span 3; border: 1px solid var(--rule); }
.media-list li label { margin: 0; font-weight: 400; font-size: .875rem; }
.media-list .kind { font: .75rem var(--mono); color: var(--muted); text-transform: uppercase; }
.upload { font-weight: 400; margin-top: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 .5rem; }
button.ghost, .ghost {
  min-height: 44px; padding: 0 1rem; border: 1px solid var(--rule); border-radius: 22px;
  background: transparent; color: var(--text); font: .875rem var(--mono); cursor: pointer;
}
.media-list button.ghost { min-height: 36px; }
.danger { color: #b3261e !important; }
button:disabled { opacity: .5; cursor: progress; }
.restore { padding: .75rem 1rem; background: var(--panel); border-radius: var(--radius); font-size: .9375rem; }
.preview { margin-top: 2rem; padding: 1.25rem; border: 1px dashed var(--rule); border-radius: var(--radius); }
.preview h2 { margin: 0 0 .75rem; font: 500 .875rem var(--mono); text-transform: uppercase; color: var(--muted); }

.posts { list-style: none; margin: 1rem 0; padding: 0; }
.posts li { padding: .75rem 0; border-bottom: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; }
.posts li a:first-child { color: var(--text); text-decoration: none; flex: 1 1 20rem; }
.posts .when { font: .8125rem var(--mono); color: var(--muted); margin-right: .5rem; }
.audit { width: 100%; border-collapse: collapse; font: .8125rem var(--mono); }
.audit th, .audit td { text-align: left; padding: .375rem .5rem; border-bottom: 1px solid var(--rule); vertical-align: top; }

dialog.confirm { max-width: 26rem; border: 1px solid var(--rule); border-radius: 14px; padding: 1.5rem; background: var(--bg); color: var(--text); }
dialog.confirm::backdrop { background: rgb(0 0 0 / .45); }
dialog.confirm h2 { margin: 0 0 .5rem; font-size: 1.25rem; }
dialog.confirm .what { font-weight: 600; }

/* Text field helpers */
.bodyhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .5rem; }
.bodyhead label { margin-bottom: .375rem; }
button.ghost.small { min-height: 32px; padding: 0 .75rem; font-size: .8125rem; }
.help { margin: .375rem 0 0; font-size: .875rem; }
.help code { font-size: .8125rem; }
.embeds { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .375rem; font: .8125rem var(--mono); }
.embeds:empty { display: none; }
.embeds li { padding: .375rem .625rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); overflow-wrap: anywhere; }
.embeds li.failed { background: transparent; border-style: dashed; color: var(--muted); }
.embeds .kind { text-transform: uppercase; color: var(--muted); }

/* Tags as chips */
.tagfield { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; min-height: 46px; padding: .375rem .5rem;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); }
.tagfield:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.tagfield .chips { display: contents; }
.chip { display: inline-flex; align-items: center; gap: .125rem; padding: .125rem .125rem .125rem .625rem; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--rule); font: .875rem var(--mono); }
.chip button { width: 28px; height: 28px; border: 0; border-radius: 14px; background: none; color: var(--muted); font-size: 1rem; cursor: pointer; }
.chip button:hover { color: var(--text); background: var(--rule); }
.tagfield input[type="text"] { flex: 1 1 6rem; min-width: 6rem; width: auto; border: 0; padding: .25rem; box-shadow: none; font: .9375rem var(--mono); }
.tagfield input[type="text"]:focus { box-shadow: none; }
