.res-workspace {
  max-width:1200px;
  margin:auto;
  padding:24px 20px 48px;
  color:var(--text-main,#e2e8f0);
  min-width:0;
  overflow-wrap:anywhere;
}

.res-workspace *, .res-filters * {
  box-sizing:border-box;
}

.res-head,.res-actions,.res-toolbar,.res-filter-actions {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
}

.res-head {
  justify-content:space-between;
  margin-bottom:22px;
}

.res-head h1 {
  margin:0 0 6px;
  font-size:1.6rem;
}

.res-hint {
  color:var(--text-muted,#9ca3af);
  font-size:.88rem;
  line-height:1.6;
  margin:8px 0;
}

.res-panel,.res-section {
  border:1px solid #ffffff1a;
  border-radius:18px;
  background:rgba(2,6,23,.72);
  box-shadow:0 12px 36px #0003;
  margin-bottom:18px;
  min-width:0;
}

.res-panel {
  padding:20px;
}

.res-section>summary {
  padding:18px 20px;
  font-size:1.05rem;
  font-weight:700;
  cursor:pointer;
}

.res-section[open]>summary {
  border-bottom:1px solid #ffffff12;
  margin-bottom:18px;
}

.res-section-content {
  padding:0 20px 20px;
  min-width:0;
}

.res-filters {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(145px,1fr));
  gap:12px;
  align-items:end;
  margin-bottom:22px;
  min-width:0;
}

.res-filters .ndh-field {
  margin:0;
  min-width:0;
}

.res-filters label,.res-workspace .ndh-field>label {
  display:block;
  font-size:.84rem;
  font-weight:600;
  margin-bottom:7px;
  color:var(--text-muted,#9ca3af);
}

.res-filters input,.res-filters select,.res-workspace .ndh-field input:not([type=checkbox]):not([type=file]),.res-workspace textarea,.res-workspace select {
  width:100%;
  min-width:0;
  max-width:100%;
  background:#0f172a;
  border:1px solid #ffffff24;
  border-radius:10px;
  color:#f1f5f9;
  padding:11px 12px;
  font:inherit;
}

.res-filters input:focus,.res-filters select:focus,.res-workspace input:focus,.res-workspace textarea:focus,.res-workspace select:focus {
  outline:2px solid #fb923c;
  outline-offset:2px;
}

.res-workspace .ndh-field {
  margin-bottom:18px;
  min-width:0;
}

.res-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:0 18px;
}

.res-workspace textarea {
  min-height:300px;
  resize:vertical;
  line-height:1.65;
}

.res-workspace textarea.res-summary {
  min-height:100px;
}

.res-workspace button,.res-workspace .btn-ndh-outline,.res-workspace .btn-ndh-glass,.res-filters button,.res-filters a {
  min-height:44px;
  padding:10px 15px;
  border-radius:12px;
  font:inherit;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
}

.res-workspace button {
  background:#f9731612;
  border:1px solid #f973164d;
  color:#fb923c;
}

.res-workspace button:disabled {
  opacity:.5;
  cursor:wait;
}

.res-workspace .res-primary {
  background:#f97316;
  color:#0b1120;
  font-weight:800;
}

.res-workspace .res-danger {
  border-color:#ef444450;
  color:#f87171;
}

.res-list-head,.res-list-row {
  display:grid;
  grid-template-columns:minmax(230px,2.1fr) minmax(130px,1fr) minmax(115px,.8fr) minmax(140px,1fr);
  gap:18px;
  align-items:center;
}

.res-list-head {
  font-size:.8rem;
  color:#9ca3af;
  padding:0 4px 14px;
}

.res-list-row {
  padding:20px 4px;
  border-top:1px solid #ffffff14;
}

.res-identity {
  display:flex;
  gap:14px;
  min-width:0;
  align-items:flex-start;
}

.res-identity h2 {
  font-size:1rem;
  line-height:1.4;
  margin:0 0 8px;
}

.res-identity h2 a {
  color:#f1f5f9;
  text-decoration:none;
}

.res-cover {
  width:88px;
  aspect-ratio:16/10;
  flex-shrink:0;
  border-radius:10px;
  background:linear-gradient(135deg,#1e293b,#0f172a);
  overflow:hidden;
  position:relative;
  display:grid;
  place-items:center;
  color:#fb923c;
}

.res-cover img {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
}

.res-pill {
  display:inline-block;
  padding:4px 9px;
  border:1px solid #ffffff20;
  border-radius:999px;
  font-size:.77rem;
  margin:0 4px 6px 0;
  color:#cbd5e1;
}

.res-pill-accent {
  color:#fb923c;
  border-color:#f9731644;
  background:#f9731612;
}

.res-pill-published {
  color:#4ade80;
  border-color:#4ade8044;
}

.res-small {
  font-size:.78rem;
  color:#9ca3af;
}

.res-actions form {
  margin:0;
}

.res-actions details {
  width:100%;
}

.res-actions summary {
  cursor:pointer;
  font-size:.85rem;
  color:#9ca3af;
  padding:8px 0;
}

.res-toolbar {
  margin-bottom:10px;
}

.res-toolbar button {
  padding:7px 11px;
  font-size:.85rem;
}

.res-media-preview {
  width:min(100%,360px);
  max-height:220px;
  object-fit:contain;
  border:1px solid #ffffff20;
  border-radius:12px;
  margin:12px 0;
  display:block;
}

.res-file {
  width:100%;
  max-width:100%;
  color:#cbd5e1;
  font:inherit;
}

.res-drop {
  border:1px dashed #f9731666;
  padding:16px;
  border-radius:12px;
}

.res-drop.is-dragging {
  background:#f9731622;
}

.res-code {
  display:block;
  overflow-wrap:anywhere;
  font-size:.8rem;
  margin:12px 0;
}

.res-check {
  display:flex;
  align-items:center;
  gap:10px;
  margin:14px 0;
  min-height:44px;
}

.res-check input {
  accent-color:#f97316;
  width:20px;
  height:20px;
  flex-shrink:0;
}

.res-save-bar {
  position:sticky;
  bottom:0;
  padding:14px;
  border:1px solid #ffffff22;
  border-radius:14px;
  background:#0f172af5;
  z-index:20;
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}

.res-preview-frame {
  display:block;
  width:100%;
  height:720px;
  border:1px solid #ffffff20;
  border-radius:14px;
  margin:16px auto 0;
  background:#020617;
}

.res-preview-frame.is-mobile {
  width:390px;
  max-width:100%;
}

.res-feedback {
  white-space:pre-line;
  color:#fb923c;
  line-height:1.5;
}

.res-workspace [hidden] {
  display:none!important;
}

@media(max-width:1000px) {
  .res-list-head {
    display:none;
  }
  .res-list-row {
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  }
  .res-identity {
    grid-column:1/-1;
  }
}

@media(max-width:600px) {
  .res-workspace {
    padding:18px 12px 32px;
  }
  .res-panel {
    padding:16px;
  }
  .res-grid {
    grid-template-columns:minmax(0,1fr);
  }
  .res-section-content {
    padding:0 14px 16px;
  }
  .res-section>summary {
    padding:16px 14px;
  }
  .res-filters {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .res-filters .ndh-field:first-child,.res-filter-actions {
    grid-column:1/-1;
  }
  .res-list-row {
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:10px;
    background:#0f172a66;
    border:1px solid #ffffff14;
    border-radius:14px;
    padding:14px;
    margin:14px 0;
  }
  .res-cover {
    width:76px;
  }
  .res-save-bar .res-primary {
    flex:1;
  }
  .res-toolbar {
    gap:6px;
  }
  .res-workspace textarea {
    min-height:260px;
    font-size:16px;
  }
}


.res-file-picker {
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  max-width:100%;
  padding:10px 15px;
  border:1px solid rgba(249,115,22,.35);
  border-radius:12px;
  color:#fb923c;
  background:rgba(249,115,22,.07);
  cursor:pointer;
}
.res-file-picker .res-file {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  cursor:pointer;
}
.res-file-picker:focus-within {
  outline:2px solid #fb923c;
  outline-offset:2px;
}

/* ─── Rich content editor (admin only) ─────────────────────────── */
.res-rich-toolbar {
  gap:6px;
}
.res-rich-toolbar select {
  width:auto;
  min-height:44px;
}
.res-rich-toolbar button[aria-pressed="true"] {
  background:#f97316;
  color:#0b1120;
}
.res-rich-label {
  font-size:.85rem;
  color:#cbd5e1;
  margin:4px 0 8px;
}
.res-rich-image {
  border:1px solid #f9731644;
  border-radius:12px;
  padding:14px 14px 4px;
  margin-bottom:10px;
  background:#f973160a;
}
.res-rich-shell {
  border:1px solid #ffffff22;
  border-radius:12px;
  background:#0f172a99;
  min-width:0;
}
.res-rich-shell.is-dragging {
  border-color:#f97316;
  background:#f9731614;
}
.res-rich-content {
  min-height:320px;
  padding:16px 18px;
  outline:none;
  color:#e2e8f0;
  line-height:1.7;
  overflow-wrap:anywhere;
}
.res-rich-shell:focus-within {
  outline:2px solid #fb923c;
  outline-offset:2px;
}
.res-rich-content > *:first-child { margin-top:0; }
.res-rich-content p { margin:.3rem 0 .75rem; }
.res-rich-content h2 {
  margin:1.6rem 0 .7rem;
  padding-left:.7rem;
  border-left:3px solid #ff8840e6;
  font-size:1.3rem;
  font-weight:900;
  color:#fff;
}
.res-rich-content h3 { margin:1.3rem 0 .5rem; font-size:1.1rem; font-weight:800; color:#fff; }
.res-rich-content h4 { margin:1rem 0 .4rem; font-size:1rem; font-weight:700; }
.res-rich-content ul,.res-rich-content ol { padding-left:1.4rem; margin:.4rem 0 .85rem; }
.res-rich-content li p { margin:.15rem 0; }
.res-rich-content strong { color:#fff; }
.res-rich-content a { color:#fb923c; }
.res-rich-content blockquote {
  margin:1.1rem 0;
  padding:.5rem 1rem;
  border-left:3px solid #f973168c;
  background:#f973160f;
  border-radius:0 10px 10px 0;
}
.res-rich-content hr { border:none; border-top:1px solid #ffffff2e; margin:1.6rem 0; }
.res-rich-content hr.ProseMirror-selectednode { border-top-color:#f97316; }
.res-rich-content table {
  display:block;
  max-width:100%;
  overflow-x:auto;
  border-collapse:collapse;
  margin:1rem 0;
}
.res-rich-content th,.res-rich-content td {
  border:1px solid #ffffff22;
  padding:6px 10px;
  min-width:80px;
  vertical-align:top;
}
.res-rich-content th { background:#f973161a; }
.res-rich-content th p,.res-rich-content td p { margin:0; }
.res-rich-content .resource-inline-figure { margin:1.2rem 0; text-align:center; }
.res-rich-content .resource-inline-figure img {
  max-width:100%;
  height:auto;
  border-radius:10px;
  border:1px solid #f973162e;
}
.res-rich-content .resource-inline-figure.is-size-medium img { max-width:min(100%,520px); }
.res-rich-content .resource-inline-figure.is-size-small img { max-width:min(100%,300px); }
.res-rich-content .resource-inline-figure.is-align-left { text-align:left; }
.res-rich-content .resource-inline-figure.is-align-right { text-align:right; }
.res-rich-content .resource-inline-figure figcaption { margin-top:.4rem; font-size:.82rem; font-style:italic; color:#9ca3af; }
.res-rich-content .ProseMirror-selectednode img { outline:3px solid #f97316; outline-offset:2px; }
.res-rich-content p.is-editor-empty:first-child::before {
  content:attr(data-placeholder);
  float:left;
  height:0;
  color:#64748b;
  pointer-events:none;
}
.res-rich-uploading {
  margin:1rem 0;
  padding:18px;
  border:1px dashed #f97316;
  border-radius:12px;
  color:#fb923c;
  text-align:center;
  font-size:.9rem;
}
.res-rich-uploading::before {
  content:"";
  display:inline-block;
  width:14px;
  height:14px;
  margin-right:8px;
  vertical-align:-2px;
  border:2px solid #fb923c;
  border-right-color:transparent;
  border-radius:50%;
  animation:res-spin .8s linear infinite;
}
@keyframes res-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) {
  .res-rich-uploading::before { animation:none; }
}
.res-counter { margin-top:6px; }
.res-counter.is-long { color:#fb923c; }

@media(max-width:600px) {
  .res-rich-toolbar {
    flex-wrap:nowrap;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    padding-bottom:4px;
  }
  .res-rich-toolbar > * { flex-shrink:0; }
  .res-rich-content {
    min-height:260px;
    padding:14px 12px;
    font-size:16px;
  }
}
