.cfg { padding: 36px 0 64px; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px 30px;
}
.panel h2 { margin-bottom: 8px; }
.panel p { max-width: 760px; }
.steps { padding-left: 20px; color: #45404f; }
.steps li { margin: 6px 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.warn { margin-top: 18px; padding: 12px 16px; border-radius: 10px; background: #fff6e5; border: 1px solid #f1d49a; color: #7a5410; }
code { font-family: Consolas, "Cascadia Mono", monospace; font-size: .9em; background: #f3f0f6; padding: 1px 6px; border-radius: 5px; }

.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

.unlisted { margin-bottom: 20px; padding: 18px 22px; border-color: #e6d9f3; background: #fbf8fe; }
.unlisted h3 { font-family: var(--sans); font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.unlisted ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.unlisted li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
.list th { text-align: left; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.list td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list tr:last-child td { border-bottom: 0; }
.list .thumb { width: 76px; aspect-ratio: 16/10; border-radius: 6px; overflow: hidden; background: var(--purple-soft); }
.list .thumb img { width: 100%; height: 100%; object-fit: cover; }
.list .thumb .ph { font-size: 18px; }
.list .t { font-weight: 700; }
.list .ok { color: #2f7a46; font-size: 13px; }
.list .missing { color: #a33; font-size: 13px; font-weight: 700; }
.list .actions { white-space: nowrap; text-align: right; }
.list .actions .btn + .btn { margin-left: 6px; }

/* ---- Editor dialog ---- */
dialog#editor {
  width: min(880px, calc(100% - 32px)); max-height: calc(100vh - 40px); padding: 0;
  border: 0; border-radius: 18px; box-shadow: 0 30px 80px rgba(42, 26, 64, .35);
  color: var(--ink);
}
dialog::backdrop { background: rgba(42, 26, 64, .45); backdrop-filter: blur(2px); }
#form { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.ed-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 26px; border-bottom: 1px solid var(--line); }
.ed-head h2 { font-size: 28px; }
.x { border: 0; background: none; font-size: 30px; line-height: 1; color: var(--muted); cursor: pointer; }
.ed-body { overflow-y: auto; padding: 20px 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.ed-body .full { grid-column: 1 / -1; }
.ed-body label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 14px; color: var(--purple-ink); }
.ed-body input:not([type=checkbox]), .ed-body textarea, .ed-body select {
  font: inherit; font-size: 15.5px; font-weight: 400; color: var(--ink);
  padding: 9px 12px; border: 1px solid #d9d2e2; border-radius: 9px; background: #fff; width: 100%;
}
.ed-body textarea { resize: vertical; line-height: 1.5; }
.ed-body input:focus, .ed-body textarea:focus, .ed-body select:focus { outline: 2px solid rgba(92, 51, 142, .35); border-color: var(--purple); }
.ed-body input[readonly] { background: #f6f4f8; color: var(--muted); }
.ed-body .invalid { border-color: #c0392b !important; background: #fff8f8 !important; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 14px; margin: 0; }
legend { font-weight: 600; font-size: 14px; color: var(--purple-ink); padding: 0 6px; }
.hint, .hint-inline { font-size: 13px; color: var(--muted); font-weight: 400; }
.hint { margin: 8px 0 0; }
.entry-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.entry-path { flex: 1 1 260px; padding: 8px 10px; }
.entry-path.set { background: var(--purple-soft); color: var(--purple-deep); }
.entry-choice { margin-top: 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks label { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; color: var(--ink); }
.checks input { accent-color: var(--purple); width: 17px; height: 17px; }
.drop {
  border: 2px dashed #d6c8e6; border-radius: 12px; padding: 18px; text-align: center; color: #45404f;
  display: grid; place-items: center; gap: 10px; min-height: 120px; background: #fcfbfd;
}
.drop.over { border-color: var(--purple); background: var(--purple-soft); }
.drop img { max-height: 220px; width: auto; border-radius: 8px; box-shadow: var(--shadow); }
.linkish { border: 0; background: none; color: var(--purple); text-decoration: underline; cursor: pointer; padding: 0; font: inherit; }
kbd { font-family: inherit; font-size: 12px; border: 1px solid #ccc; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: #fff; }
.ed-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 26px; border-top: 1px solid var(--line); background: #fcfbfd; }
.ed-error { margin-right: auto; color: #a33; font-size: 14px; font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0;
  background: var(--purple-ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: opacity .2s, transform .2s; pointer-events: none; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #8a2a2a; }

@media (max-width: 700px) { .ed-body { grid-template-columns: 1fr; } }
