/* Admin: plain, neutral, phone-friendly. */
body.admin { background: var(--bg-2); min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; text-decoration: none; letter-spacing: .02em; }
.topnav { display: flex; gap: 4px; }
.topnav a { text-decoration: none; padding: 6px 10px; color: var(--fg-2); }
.topnav a.active { background: var(--bg-3); color: var(--fg); }
.me { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 64px; outline: none; }
.admin-main.center { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; }

.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.page-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-head .sub { margin: 4px 0 0; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tile { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); text-decoration: none; color: inherit; min-width: 0; }
.tile:hover { border-color: #9a9a9a; }
.tile-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile-title { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.tile-meta { font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.tile-accent { height: 4px; background: var(--line); }
.space-logo { height: 56px; display: flex; align-items: center; padding: 12px 14px 0; }
.space-logo img { max-height: 40px; max-width: 180px; }
.space-logo .initial { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: #333; }
.thumb { aspect-ratio: 16 / 9; background: var(--bg-3); overflow: hidden; display: block; border-bottom: 1px solid var(--line-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--fg-2); border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { background: #fff; border-color: var(--line); color: var(--fg); font-weight: 600; }

.panel { background: #fff; border: 1px solid var(--line); padding: 16px; margin-bottom: 16px; }
.panel h2 { font-size: 16px; }
.two-col { display: grid; gap: 16px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

.preview { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); }
.preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.url-row { display: flex; gap: 8px; align-items: stretch; }
.url-row input { font-family: var(--mono); font-size: 13px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.form-grid { display: grid; gap: 12px; max-width: 640px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field .hint { font-size: 13px; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.status { font-size: 14px; }

.access-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.access-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
@media (max-width: 520px) { .access-row { grid-template-columns: 1fr auto; } .access-row .check { grid-column: 1; } }

.once { border: 2px solid var(--accent); padding: 12px; margin: 12px 0; background: #fff; }

.progress { height: 8px; background: var(--bg-3); margin: 8px 0; }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.filelist { max-height: 220px; overflow: auto; font-family: var(--mono); font-size: 12px; border: 1px solid var(--line-2); padding: 6px 8px; background: var(--bg-2); margin: 8px 0; }
.dropzone { border: 1px dashed #9a9a9a; padding: 16px; background: var(--bg-2); }
.dropzone.over { background: var(--bg-3); }

.thread { border: 1px solid var(--line); background: #fff; margin-bottom: 12px; }
.thread.resolved { opacity: .7; }
.comment { padding: 10px 12px; border-top: 1px solid var(--line-2); }
.comment:first-child { border-top: 0; }
.comment.reply { padding-left: 28px; background: var(--bg-2); }
.comment-head { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 4px; align-items: center; }
.comment-head .author { color: var(--fg); font-weight: 600; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.thread-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 6px 12px; border-top: 1px solid var(--line-2); }

.swatches { display: flex; gap: 0; border: 1px solid var(--line); width: fit-content; }
.swatches span { width: 36px; height: 24px; display: block; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type=text] { max-width: 120px; font-family: var(--mono); }
.brand-preview { border: 1px solid var(--line); padding: 16px; max-width: 320px; }
.brand-preview .bp-btn { display: inline-block; padding: 6px 12px; color: #fff; margin-top: 8px; font-weight: 500; }

.empty { padding: 24px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.filters .field { min-width: 160px; }
td.wrap { white-space: normal; overflow-wrap: anywhere; max-width: 360px; }
td.nowrap { white-space: nowrap; }
.detail { font-family: var(--mono); font-size: 12px; color: var(--fg-2); }

@media (max-width: 600px) {
  .admin-main { padding: 14px 10px 48px; }
  .topbar { gap: 8px; padding: 8px 10px; }
  .me { display: none; }
  .grid { grid-template-columns: 1fr; }
  .url-row { flex-direction: column; }
}
