:root,
:root[data-theme="green"] {
  color-scheme: dark;
  --bg: #050705;
  --panel: #0a0f0a;
  --panel2: #0d160d;
  --line: #173717;
  --line2: #255f25;
  --accent: #7cff68;
  --accent2: #35e65c;
  --soft: #bdfcba;
  --text: #e9f5e9;
  --muted: #8ca38c;
  --danger: #ff3c5a;
  --amber: #ffd166;
  --amber-border: rgb(255 209 102 / .5);
  --danger-border: rgb(255 60 90 / .5);
  --warning-button-text: #120d02;
  --topbar-bg: rgb(5 7 5 / .9);
  --panel-bg: linear-gradient(180deg, rgb(13 22 13 / .9), rgb(5 10 5 / .94));
  --accent-wash: rgb(124 255 104 / .10);
  --button-text: #061006;
  --code-bg: #020502;
  --shadow: rgb(0 0 0 / .28);
  --row-bg: rgb(13 22 13 / .6);
  --primary-wash: rgb(124 255 104 / .06);
  --warning-wash: rgb(255 209 102 / .06);
  --callout-wash: rgb(124 255 104 / .05);
  --cyan: #66eaff;
  --on-danger: #fff;
  --editor-bg: #0d160d;
  --editor-text: #e9f5e9;
}

:root[data-theme="mono"] {
  color-scheme: light;
  --bg: #fff;
  --panel: #fff;
  --panel2: #f5f5f5;
  --line: #d7d7d7;
  --line2: #8a8a8a;
  --accent: #050505;
  --accent2: #222;
  --soft: #292929;
  --text: #111;
  --muted: #555;
  --danger: #9b1528;
  --amber: #333;
  --amber-border: #777;
  --danger-border: #9b1528;
  --warning-button-text: #fff;
  --topbar-bg: rgb(255 255 255 / .94);
  --panel-bg: linear-gradient(180deg, #fff, #f7f7f7);
  --accent-wash: rgb(0 0 0 / .035);
  --button-text: #fff;
  --code-bg: #f2f2f2;
  --shadow: rgb(0 0 0 / .12);
  --row-bg: #fafafa;
  --primary-wash: rgb(0 0 0 / .04);
  --warning-wash: rgb(107 75 0 / .07);
  --callout-wash: rgb(0 0 0 / .035);
  --cyan: #333;
  --on-danger: #fff;
  --editor-bg: #fff;
  --editor-text: #111;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(circle at top left, var(--accent-wash), transparent 35%), var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
a { color: inherit; }
input, textarea, select, button { font: inherit; }
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--button-text);
  font-weight: 900;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
}
.brand { color: var(--text); font-size: 20px; font-weight: 900; text-decoration: none; }
.brand span, .kicker, h1, h2, .badge { color: var(--accent); }
nav { display: flex; gap: 12px; flex: 1; flex-wrap: wrap; }
nav a, .row-actions a { color: var(--muted); text-decoration: none; font-size: 12px; text-transform: uppercase; }
nav a { padding: 8px 4px; }
nav a:hover, nav a[aria-current="page"] { color: var(--accent); }
.shell { max-width: 1240px; margin: 0 auto; padding: 26px; }
.login-card, .panel, .hero, .cards article {
  border: 1px solid var(--line);
  background: var(--panel-bg);
  box-shadow: 0 20px 70px var(--shadow);
}
.login-card { width: min(100%, 460px); margin: 8vh auto; padding: 28px; }
.hero { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 24px; margin-bottom: 18px; }
.panel { padding: 22px; margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.editorial-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cards article { padding: 20px; }
.cards strong { display: block; font-size: 36px; color: var(--accent); }
.cards span { display: block; min-height: 2.5em; }
.cards a { display: inline-block; margin-top: 10px; color: var(--soft); font-size: 12px; }
.muted { color: var(--muted); line-height: 1.6; }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; }
.form, .article-form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; text-transform: uppercase; }
input, textarea, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line2);
  color: var(--text);
  padding: 11px;
}
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
textarea { min-height: 84px; resize: vertical; }
.hermes-warning { border-color: var(--amber-border); color: var(--amber); margin-bottom: 16px; }
.origin-label { color: var(--muted); }
.source-manager { border: 1px solid var(--line); padding: 18px; }
.source-list { display: grid; gap: 14px; }
.source-card { border: 1px solid var(--line2); background: var(--row-bg); padding: 14px; }
.source-card-head, .source-order-actions { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.source-order-actions button { min-height: 38px; padding: 7px 10px; }
.source-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.btn, .ghost, .danger, .linklike {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--button-text);
  padding: 10px 14px;
  font-weight: 900;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
}
.ghost { background: transparent; color: var(--accent); }
.danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.linklike { padding: 0; border: 0; background: transparent; color: var(--accent); }
.actions, .section-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
th { color: var(--accent); font-size: 12px; text-transform: uppercase; }
.badge { border: 1px solid var(--line2); padding: 3px 7px; font-size: 11px; }
.badge-ready, .badge-success { color: var(--accent); }
.badge-draft { color: var(--amber); border-color: var(--amber-border); }
.badge-archived, .badge-failed { color: var(--danger); border-color: var(--danger-border); }
.alert { border: 1px solid var(--line2); padding: 12px; }
.error { color: var(--danger); }
.alert p { margin: 0; }
.studio-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.studio-toolbar button { border: 1px solid var(--line2); color: var(--accent); background: var(--panel2); padding: 7px 9px; cursor: pointer; }
#editor { background: var(--editor-bg); color: var(--editor-text); }
:root[data-theme="green"] .toastui-editor-defaultUI,
:root[data-theme="green"] .toastui-editor-toolbar,
:root[data-theme="green"] .toastui-editor-main,
:root[data-theme="green"] .toastui-editor-md-container,
:root[data-theme="green"] .toastui-editor-ww-container {
  border-color: var(--line2);
  background: var(--editor-bg);
  color: var(--editor-text);
}
:root[data-theme="green"] .toastui-editor-md-container .toastui-editor,
:root[data-theme="green"] .toastui-editor-ww-container .toastui-editor-contents {
  background: var(--editor-bg);
  color: var(--editor-text);
}
.image-manager {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line2);
  background: var(--panel2);
}
.image-manager h2, .image-manager p { margin: 0; }
.image-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.image-actions { justify-content: flex-start; }
.cover-preview { max-width: 520px; padding: 10px; border: 1px dashed var(--line2); }
.cover-preview img { display: block; width: 100%; height: auto; }
.rendered { line-height: 1.8; }
.rendered img, .rendered video, .rendered iframe { max-width: 100%; }
.rendered table { display: block; max-width: 100%; overflow-x: auto; }
.rendered code { overflow-wrap: anywhere; }
.rendered pre, .lxm-terminal { border: 1px solid var(--line2); background: var(--code-bg); padding: 14px; overflow: auto; }
.lxm-underline { text-decoration: underline; text-decoration-color: var(--accent); }
.lxm-color-green { color: var(--accent); }
.lxm-color-cyan { color: var(--cyan); }
.lxm-color-yellow { color: var(--amber); }
.lxm-color-red { color: var(--danger); }
.lxm-color-gray { color: var(--muted); }
.lxm-color-white { color: var(--text); }
.lxm-callout { border-left: 2px solid var(--accent); background: var(--callout-wash); padding: 12px; margin: 14px 0; }
.lxm-callout-warning { border-left-color: var(--amber); }
.private-preview-notice {
  display: flex;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 1px solid var(--amber);
  background: var(--warning-wash);
  color: var(--text);
}
.private-preview-notice strong { color: var(--amber); }
.preview-section {
  margin-bottom: 22px;
  padding: clamp(16px, 3vw, 34px);
  border: 1px solid var(--line);
  background: var(--panel2);
}
.preview-section-label {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}
.editorial-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 34%);
  min-height: 230px;
  overflow: hidden;
  border: 1px solid var(--line2);
  background: var(--panel);
  box-shadow: 0 16px 45px var(--shadow);
}
.editorial-card-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(22px, 4vw, 44px);
}
.editorial-card h2 {
  margin: 6px 0 10px;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.55rem, 3vw, 2.55rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.editorial-card-image {
  width: 100%;
  height: 100%;
  min-height: 230px;
  object-fit: cover;
}
.editorial-eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.editorial-meta {
  color: var(--muted);
  font-size: .78rem;
}
.editorial-description {
  max-width: 62ch;
  margin-bottom: 0;
  color: var(--soft);
  line-height: 1.55;
}
.preview-article-section {
  padding-inline: clamp(16px, 5vw, 72px);
  background: var(--bg);
}
.editorial-article {
  width: min(100%, 780px);
  margin: 0 auto;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.editorial-article-header {
  margin: clamp(20px, 5vw, 54px) 0 clamp(28px, 6vw, 64px);
  padding-bottom: clamp(22px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
}
.editorial-article-header h1 {
  margin: 12px 0 18px;
  color: var(--text);
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 1;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}
.editorial-lead {
  max-width: 62ch;
  color: var(--soft);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.6;
}
.preview-article-body {
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.preview-article-body h1,
.preview-article-body h2,
.preview-article-body h3,
.preview-article-body h4 {
  margin: 1.8em 0 .65em;
  color: var(--text);
  line-height: 1.2;
}
.preview-article-body p,
.preview-article-body ul,
.preview-article-body ol,
.preview-article-body blockquote { margin-block: 1.15em; }
.preview-article-body img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 2rem auto;
}
.preview-article-body blockquote {
  margin-inline: 0;
  padding-left: 20px;
  border-left: 3px solid var(--accent);
  color: var(--soft);
}
.editorial-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.editorial-tag {
  padding: 6px 10px;
  border: 1px solid var(--line2);
  color: var(--text);
  font: 700 .72rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.preview-actions { margin-top: 22px; }
.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr);
  gap: 18px;
}
.compact-list { display: grid; }
.compact-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.compact-item:last-child { border-bottom: 0; }
.compact-item p { margin: 5px 0 0; font-size: 12px; overflow-wrap: anywhere; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.session-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle { white-space: nowrap; }
@media (max-width: 820px) {
  .topbar { align-items: stretch; flex-direction: column; gap: 10px; padding: 12px 16px; }
  .topbar nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
  .topbar nav a { min-height: 40px; display: flex; align-items: center; }
  .session-actions, .logout-form, .logout-form .ghost, .theme-toggle { width: 100%; }
  .hero, .actions, .section-head { align-items: stretch; flex-direction: column; }
  .grid, .form-grid, .dashboard-columns, .image-fields, .source-fields { grid-template-columns: 1fr; }
  .editorial-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shell { padding: 14px; }
  .panel, .hero { padding: 18px; }
  .actions > *, .actions > form, .actions > form > button { width: 100%; }
  .studio-toolbar { flex-wrap: nowrap; overflow-x: auto; padding: 3px 3px 9px; }
  .studio-toolbar button { min-height: 44px; flex: 0 0 auto; }
  .toastui-editor-defaultUI { max-width: 100%; overflow: hidden; }
  .toastui-editor-main { min-width: 0; }
  .toastui-editor-md-container, .toastui-editor-ww-container { width: 100% !important; }
  .toastui-editor-md-preview { display: none; }
  .upload-box { align-items: stretch; }
  .upload-box label, .upload-box button { width: 100%; }
  .private-preview-notice { flex-direction: column; }
  .editorial-card { grid-template-columns: 1fr; }
  .editorial-card-image {
    grid-row: 1;
    height: min(58vw, 320px);
    min-height: 180px;
  }
  .preview-article-section { padding-inline: 18px; }

  .responsive-table { overflow: visible; }
  .responsive-table table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td { display: block; width: 100%; }
  .responsive-table thead { display: none; }
  .responsive-table tr {
    margin-bottom: 14px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    background: var(--row-bg);
  }
  .responsive-table td {
    display: grid;
    grid-template-columns: minmax(90px, 35%) minmax(0, 1fr);
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
  }
  .responsive-table td:last-child { border-bottom: 0; }
  .responsive-table td::before {
    content: attr(data-label);
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }
  .responsive-table td.empty-state { display: block; }
  .responsive-table td.empty-state::before { content: none; }
  .responsive-table .row-actions { display: flex; }
  .responsive-table .select-col { text-align: left; width: 100%; }
}

/* === LXM Studio actions clarity v1 === */
.drafts-table .select-col {
  width: 44px;
  text-align: center;
}

.draft-title strong {
  color: var(--text);
  font-size: 14px;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid var(--line2);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
  cursor: pointer;
}

.mini-action-primary {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--primary-wash);
}

.mini-action-primary:hover {
  background: var(--accent);
  color: var(--button-text);
}

.mini-action-warning {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--warning-wash);
}

.mini-action-warning:hover {
  background: var(--amber);
  color: var(--warning-button-text);
}

.drafts-footer-actions {
  margin-top: 16px;
  justify-content: flex-start;
  align-items: center;
}

.drafts-footer-actions .muted {
  margin: 0;
  font-size: 12px;
}

.empty-state {
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.draft-filters { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(5, minmax(120px, 1fr)); gap: 12px; margin: 20px 0; padding: 16px; border: 1px solid var(--line); background: var(--row-bg); }
.filter-actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }
.list-summary, .pagination, .page-numbers { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.list-summary { justify-content: space-between; margin: 12px 0; color: var(--muted); }
.list-summary strong { color: var(--text); }
.pagination { justify-content: center; margin-top: 20px; }
.page-numbers a { min-width: 38px; padding: 9px; border: 1px solid var(--line2); color: var(--text); text-align: center; text-decoration: none; }
.page-numbers a[aria-current="page"] { border-color: var(--accent); background: var(--accent); color: var(--button-text); font-weight: 900; }
button:disabled { cursor: not-allowed; opacity: .5; }

@media (max-width: 820px) {
  .draft-filters { grid-template-columns: 1fr 1fr; }
  .filter-search, .filter-actions { grid-column: 1 / -1; }
  .filter-actions > * { flex: 1 1 180px; }
  .pagination { align-items: stretch; flex-direction: column; }
  .pagination > .ghost { width: 100%; }
  .page-numbers { justify-content: center; }
  .row-actions {
    align-items: stretch;
  }

  .mini-action {
    width: 100%;
  }

  .drafts-footer-actions {
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .draft-filters { grid-template-columns: 1fr; }
  .draft-filters > * { grid-column: 1; }
  .editorial-stats { grid-template-columns: 1fr; }
  .cards span { min-height: 0; }
  h1 { font-size: 1.65rem; overflow-wrap: anywhere; }
  h2 { font-size: 1.25rem; }
  .compact-item { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 1.5rem 0; overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
