:root {
  color-scheme: light;
  --paper: #f4f1ea;
  --surface: #fffdf8;
  --surface-strong: #f8f4ea;
  --ink: #171713;
  --muted: #686458;
  --line: #d8d0bf;
  --olive: #637047;
  --copper: #a55d35;
  --blue: #2e6e8c;
  --red: #ad3e33;
  --shadow: 0 16px 40px rgba(60, 48, 34, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(23, 23, 19, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(23, 23, 19, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: Avenir Next, Helvetica Neue, Helvetica, sans-serif;
}

button,
a,
input {
  font: inherit;
}

a {
  color: inherit;
}

.shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.masthead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--copper);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: Georgia, Times New Roman, serif;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-family: Georgia, Times New Roman, serif;
  font-size: 22px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  letter-spacing: 0;
}

.header-actions,
.command-row,
.tabs,
.platforms,
.media-strip,
.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button,
.tab {
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--surface);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.button:hover,
.tab:hover {
  transform: translateY(-1px);
}

.button.ghost,
.tab {
  background: transparent;
  color: var(--ink);
}

.tab.is-active {
  background: var(--olive);
  border-color: var(--olive);
  color: white;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.metric-label,
.metric-note {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  display: block;
  margin: 8px 0 6px;
  font-family: Georgia, Times New Roman, serif;
  font-size: 30px;
  line-height: 1;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.section-title.compact {
  align-items: start;
}

.post-list {
  display: grid;
  gap: 12px;
}

.post-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.post-card {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  overflow: hidden;
}

.status-bar {
  background: var(--muted);
}

.status-ready .status-bar {
  background: var(--olive);
}

.status-draft .status-bar {
  background: var(--blue);
}

.status-published .status-bar {
  background: var(--ink);
}

.status-failed .status-bar {
  background: var(--red);
}

.post-body {
  padding: 16px;
}

.post-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.post-id {
  color: var(--muted);
  font-family: SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.chip.ready {
  border-color: rgba(99, 112, 71, 0.35);
  color: var(--olive);
}

.chip.warning {
  border-color: rgba(165, 93, 53, 0.38);
  color: var(--copper);
}

.chip.error {
  border-color: rgba(173, 62, 51, 0.38);
  color: var(--red);
}

.caption-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.caption-box {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.caption-box strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
}

.caption-box p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 0;
  max-height: 78px;
  overflow: hidden;
}

.media-strip {
  align-items: stretch;
  overflow-x: auto;
  padding-bottom: 2px;
}

.media-thumb {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  flex: 0 0 108px;
  min-height: 108px;
  overflow: hidden;
  position: relative;
  background: var(--surface-strong);
}

.media-thumb img {
  width: 100%;
  height: 108px;
  display: block;
  object-fit: cover;
}

.media-thumb span {
  position: absolute;
  left: 6px;
  bottom: 6px;
  background: rgba(23, 23, 19, 0.76);
  border-radius: 999px;
  color: white;
  font-size: 11px;
  padding: 3px 6px;
}

.command-block {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
  display: grid;
  gap: 8px;
}

.command-row {
  align-items: stretch;
}

code {
  background: #201f1a;
  border-radius: var(--radius);
  color: #f8f4ea;
  display: block;
  flex: 1;
  font-family: SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  min-width: 0;
  overflow-x: auto;
  padding: 10px;
}

.copy-button {
  min-width: 88px;
}

.panel {
  padding: 16px;
  margin-bottom: 12px;
}

.message-list {
  display: grid;
  gap: 8px;
}

.message {
  border-left: 3px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  padding: 4px 0 4px 10px;
}

.message.error {
  border-color: var(--red);
  color: var(--red);
}

.message.warning {
  border-color: var(--copper);
}

.log-item,
.asset-row,
.config-row {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
  padding: 10px 0;
}

.log-item:first-child,
.asset-row:first-child,
.config-row:first-child {
  border-top: 0;
}

.muted {
  color: var(--muted);
}

.empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 0;
}

@media (max-width: 1080px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .side-column {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .panel {
    margin-bottom: 0;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 20px, 720px);
    padding-top: 18px;
  }

  .masthead,
  .post-top,
  .section-title {
    align-items: start;
    flex-direction: column;
  }

  h1 {
    font-size: 34px;
  }

  .metrics,
  .caption-grid,
  .side-column {
    grid-template-columns: 1fr;
  }

  .tabs {
    width: 100%;
    overflow-x: auto;
  }

  .command-row {
    flex-direction: column;
  }

  .copy-button {
    width: 100%;
  }
}

/* Atlas architectural console refresh */
:root {
  color-scheme: dark;
  --paper: #11110f;
  --surface: rgba(232, 229, 217, 0.07);
  --surface-strong: rgba(232, 229, 217, 0.11);
  --ink: #f4efe3;
  --muted: #aaa494;
  --line: rgba(244, 239, 227, 0.16);
  --line-strong: rgba(244, 239, 227, 0.32);
  --olive: #9aae75;
  --copper: #d18a54;
  --blue: #6aa4b8;
  --red: #d06656;
  --charcoal: #171816;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  --radius: 8px;
}

body {
  background:
    linear-gradient(90deg, rgba(244, 239, 227, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(244, 239, 227, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, rgba(209, 138, 84, 0.09), transparent 26%),
    linear-gradient(315deg, rgba(106, 164, 184, 0.09), transparent 30%),
    #10110f;
  background-size: 44px 44px, 44px 44px, 100% 100%, 100% 100%, auto;
  color: var(--ink);
  font-family: Avenir Next, Gill Sans, Trebuchet MS, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(244, 239, 227, 0.06) 12% calc(12% + 1px), transparent calc(12% + 1px)),
    linear-gradient(90deg, transparent 0 72%, rgba(244, 239, 227, 0.05) 72% calc(72% + 1px), transparent calc(72% + 1px));
  opacity: 0.7;
}

.shell {
  width: min(1500px, calc(100vw - 36px));
  padding: 30px 0 46px;
}

.masthead {
  position: relative;
  align-items: center;
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(244, 239, 227, 0.1), transparent 42%),
    rgba(16, 17, 15, 0.76);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.masthead::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: 20px;
  width: min(36vw, 420px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--copper), transparent);
}

.eyebrow {
  color: var(--copper);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

h1 {
  font-family: Didot, Georgia, Times New Roman, serif;
  font-size: clamp(42px, 7vw, 92px);
  font-weight: 500;
  line-height: 0.92;
}

h2 {
  font-family: Didot, Georgia, Times New Roman, serif;
  font-size: 30px;
  font-weight: 500;
}

h3 {
  font-family: Didot, Georgia, Times New Roman, serif;
  font-size: clamp(28px, 3.3vw, 54px);
  font-weight: 500;
  line-height: 0.98;
  max-width: 780px;
}

.button,
.tab {
  border: 1px solid var(--line-strong);
  background: rgba(244, 239, 227, 0.1);
  color: var(--ink);
  min-height: 40px;
  padding: 9px 14px;
  backdrop-filter: blur(12px);
}

.button:not(.ghost) {
  background: var(--ink);
  color: #11110f;
}

.button.ghost,
.tab {
  color: var(--ink);
}

.button:hover,
.tab:hover {
  border-color: var(--copper);
  transform: translateY(-2px);
}

.tab.is-active {
  background: var(--copper);
  border-color: var(--copper);
  color: #11110f;
}

.metrics {
  grid-template-columns: 1.15fr repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 22px;
}

.metric {
  position: relative;
  min-height: 116px;
  background:
    linear-gradient(180deg, rgba(244, 239, 227, 0.1), rgba(244, 239, 227, 0.045)),
    rgba(16, 17, 15, 0.8);
  border: 1px solid var(--line);
  box-shadow: none;
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--copper);
}

.metric-label,
.metric-note {
  color: var(--muted);
}

.metric-value {
  color: var(--ink);
  font-family: Didot, Georgia, Times New Roman, serif;
  font-size: 36px;
}

.layout {
  grid-template-columns: minmax(0, 1fr) 386px;
  gap: 16px;
}

.section-title {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.post-list {
  gap: 16px;
}

.post-card,
.panel {
  background:
    linear-gradient(180deg, rgba(244, 239, 227, 0.08), rgba(244, 239, 227, 0.035)),
    rgba(17, 18, 16, 0.86);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.post-card {
  grid-template-columns: 6px minmax(0, 1fr);
}

.status-bar {
  background: linear-gradient(180deg, var(--muted), rgba(244, 239, 227, 0.12));
}

.status-ready .status-bar {
  background: linear-gradient(180deg, var(--olive), var(--copper));
}

.post-body {
  padding: 14px;
}

.post-grid {
  display: grid;
  grid-template-columns: minmax(290px, 0.78fr) minmax(0, 1fr);
  gap: 18px;
}

.post-content {
  min-width: 0;
  padding: 6px 4px 4px 0;
}

.post-kicker {
  color: var(--copper);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.post-id {
  color: var(--muted);
}

.status-row {
  flex-wrap: wrap;
}

.chip {
  background: rgba(244, 239, 227, 0.06);
  border-color: var(--line);
  color: var(--muted);
}

.chip.ready {
  background: rgba(154, 174, 117, 0.12);
  border-color: rgba(154, 174, 117, 0.5);
  color: #cce0a3;
}

.chip.warning {
  background: rgba(209, 138, 84, 0.12);
  border-color: rgba(209, 138, 84, 0.5);
  color: #efb47d;
}

.timeline-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 0 12px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.timeline-strip div {
  min-width: 0;
  background: rgba(16, 17, 15, 0.84);
  padding: 12px;
}

.timeline-strip span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.timeline-strip strong {
  color: var(--ink);
  display: block;
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.media-board {
  min-width: 0;
}

.media-hero {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  display: block;
  overflow: hidden;
  position: relative;
  background: #0b0c0b;
}

.media-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(244, 239, 227, 0.22);
  transform: translate(10px, 10px);
  pointer-events: none;
}

.media-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms ease, filter 600ms ease;
}

.media-hero:hover img {
  filter: saturate(1.06) contrast(1.04);
  transform: scale(1.025);
}

.media-hero.is-missing::before,
.media-thumb.is-missing::before {
  content: "Awaiting image";
  position: absolute;
  inset: 0;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.media-thumb.is-missing::before {
  content: "Pending";
  font-size: 11px;
}

.media-hero span {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(16, 17, 15, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  padding: 6px 10px;
}

.media-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  overflow: visible;
}

.media-thumb {
  aspect-ratio: 1 / 1;
  background: rgba(244, 239, 227, 0.06);
  border-color: var(--line);
  flex: initial;
  min-height: 0;
}

.media-thumb img {
  height: 100%;
}

.media-thumb span {
  background: rgba(16, 17, 15, 0.8);
  border: 1px solid var(--line);
}

.caption-grid {
  gap: 10px;
  margin: 12px 0;
}

.caption-box {
  background: rgba(244, 239, 227, 0.055);
  border-color: var(--line);
}

.caption-box strong {
  color: var(--ink);
  letter-spacing: 0.04em;
}

.caption-box p {
  color: var(--muted);
  max-height: 96px;
}

.generation-box {
  background: var(--cell-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 12px 0;
  padding: 12px;
}

.generation-head,
.prompt-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.generation-head strong,
.prompt-meta strong {
  color: var(--ink);
}

.generation-head span,
.prompt-meta span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
  text-align: right;
}

.prompt-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.prompt-item {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.prompt-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.prompt-item p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 6px 0 0;
  max-height: 72px;
  overflow: hidden;
}

.command-block {
  border-top-color: var(--line);
}

code {
  background:
    linear-gradient(90deg, rgba(209, 138, 84, 0.12), transparent 18%),
    #0b0c0b;
  border: 1px solid rgba(244, 239, 227, 0.1);
  color: #eee7d8;
}

.copy-button {
  color: var(--ink);
}

.panel {
  padding: 18px;
}

.side-column {
  position: sticky;
  top: 16px;
}

.message,
.log-item,
.asset-row,
.config-row {
  color: var(--muted);
}

.message {
  background: rgba(244, 239, 227, 0.04);
  border-left-color: var(--olive);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 8px 10px;
}

.message.error {
  border-color: var(--red);
  color: #f0a095;
}

.message.warning {
  border-color: var(--copper);
  color: #efb47d;
}

.empty,
.muted {
  color: var(--muted);
}

@media (max-width: 1180px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .side-column {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 900px) {
  .post-grid,
  .caption-grid {
    grid-template-columns: 1fr;
  }

  .media-hero {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 18px, 720px);
  }

  .masthead {
    align-items: start;
    min-height: 0;
    padding: 18px;
  }

  .metrics,
  .side-column,
  .timeline-strip {
    grid-template-columns: 1fr;
  }

  .media-strip {
    grid-template-columns: repeat(3, minmax(74px, 1fr));
  }

  .generation-head,
  .prompt-meta {
    align-items: start;
    flex-direction: column;
  }

  .generation-head span,
  .prompt-meta span {
    text-align: left;
  }

  h1 {
    font-size: 42px;
  }

  h3 {
    font-size: 31px;
  }
}

/* Theme preview system */
body[data-theme="stone"] {
  color-scheme: light;
  --paper: #ebe7dc;
  --surface: rgba(255, 253, 246, 0.78);
  --surface-strong: rgba(246, 240, 225, 0.86);
  --ink: #20221e;
  --muted: #6f6a5f;
  --line: rgba(65, 57, 44, 0.16);
  --line-strong: rgba(65, 57, 44, 0.3);
  --olive: #6e7b4d;
  --copper: #b46e3e;
  --blue: #5e8391;
  --red: #b85748;
  --shadow: 0 22px 60px rgba(72, 60, 42, 0.14);
  --page-bg:
    linear-gradient(90deg, rgba(32, 34, 30, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(32, 34, 30, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, rgba(180, 110, 62, 0.16), transparent 28%),
    #ebe7dc;
  --header-bg: linear-gradient(90deg, rgba(255, 253, 246, 0.92), rgba(235, 231, 220, 0.72));
  --panel-bg: rgba(255, 253, 246, 0.74);
  --cell-bg: rgba(255, 253, 246, 0.72);
  --code-bg: #1f211d;
  --code-ink: #f5efe2;
  --button-bg: #20221e;
  --button-ink: #fffdf6;
  --ghost-bg: rgba(255, 253, 246, 0.48);
}

body[data-theme="glass"] {
  color-scheme: light;
  --paper: #eef3f3;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-strong: rgba(226, 235, 235, 0.82);
  --ink: #132426;
  --muted: #647172;
  --line: rgba(19, 36, 38, 0.14);
  --line-strong: rgba(19, 36, 38, 0.28);
  --olive: #617a6c;
  --copper: #3a8ca0;
  --blue: #2b7594;
  --red: #bb5a4c;
  --shadow: 0 24px 70px rgba(36, 68, 72, 0.13);
  --page-bg:
    linear-gradient(90deg, rgba(19, 36, 38, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(19, 36, 38, 0.03) 1px, transparent 1px),
    linear-gradient(150deg, rgba(58, 140, 160, 0.2), transparent 30%),
    #eef3f3;
  --header-bg: linear-gradient(105deg, rgba(255, 255, 255, 0.9), rgba(218, 231, 232, 0.68));
  --panel-bg: rgba(255, 255, 255, 0.7);
  --cell-bg: rgba(255, 255, 255, 0.72);
  --code-bg: #112729;
  --code-ink: #eefbfb;
  --button-bg: #132426;
  --button-ink: #f4ffff;
  --ghost-bg: rgba(255, 255, 255, 0.44);
}

body[data-theme="gallery"] {
  color-scheme: light;
  --paper: #f7f4ed;
  --surface: rgba(255, 255, 252, 0.86);
  --surface-strong: rgba(243, 236, 222, 0.9);
  --ink: #171614;
  --muted: #72685e;
  --line: rgba(23, 22, 20, 0.13);
  --line-strong: rgba(23, 22, 20, 0.28);
  --olive: #66714c;
  --copper: #9f5f36;
  --blue: #706d92;
  --red: #9e5143;
  --shadow: 0 18px 50px rgba(50, 42, 30, 0.1);
  --page-bg:
    linear-gradient(90deg, rgba(23, 22, 20, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(23, 22, 20, 0.02) 1px, transparent 1px),
    #f7f4ed;
  --header-bg: rgba(255, 255, 252, 0.86);
  --panel-bg: rgba(255, 255, 252, 0.82);
  --cell-bg: rgba(255, 255, 252, 0.88);
  --code-bg: #171614;
  --code-ink: #fff9ec;
  --button-bg: #171614;
  --button-ink: #fff9ec;
  --ghost-bg: rgba(255, 255, 252, 0.58);
}

body[data-theme="graphite"] {
  color-scheme: dark;
  --paper: #242622;
  --surface: rgba(250, 246, 235, 0.1);
  --surface-strong: rgba(250, 246, 235, 0.14);
  --ink: #f7efe2;
  --muted: #b9b0a2;
  --line: rgba(250, 246, 235, 0.18);
  --line-strong: rgba(250, 246, 235, 0.32);
  --olive: #a6bb7b;
  --copper: #d79a61;
  --blue: #80aebe;
  --red: #d07164;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.26);
  --page-bg:
    linear-gradient(90deg, rgba(250, 246, 235, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(250, 246, 235, 0.03) 1px, transparent 1px),
    linear-gradient(135deg, rgba(215, 154, 97, 0.12), transparent 28%),
    #242622;
  --header-bg: linear-gradient(90deg, rgba(250, 246, 235, 0.12), rgba(250, 246, 235, 0.04));
  --panel-bg: rgba(31, 33, 30, 0.78);
  --cell-bg: rgba(31, 33, 30, 0.82);
  --code-bg: #161713;
  --code-ink: #f7efe2;
  --button-bg: #f7efe2;
  --button-ink: #1d1f1b;
  --ghost-bg: rgba(250, 246, 235, 0.08);
}

body[data-theme] {
  background: var(--page-bg);
  background-size: 42px 42px, 42px 42px, 100% 100%, auto;
  color: var(--ink);
}

body[data-theme]::before {
  background:
    linear-gradient(90deg, transparent 0 12%, var(--line) 12% calc(12% + 1px), transparent calc(12% + 1px)),
    linear-gradient(90deg, transparent 0 72%, var(--line) 72% calc(72% + 1px), transparent calc(72% + 1px));
  opacity: 0.48;
}

body[data-theme] .masthead {
  background: var(--header-bg);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

body[data-theme] .masthead::after {
  background: linear-gradient(90deg, transparent, var(--copper), transparent);
}

body[data-theme] .theme-dock {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

body[data-theme] .theme-swatch {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--ghost-bg);
  color: var(--muted);
  cursor: pointer;
  padding: 7px 10px;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease, background 160ms ease;
}

body[data-theme] .theme-swatch:hover {
  border-color: var(--copper);
  color: var(--ink);
  transform: translateY(-1px);
}

body[data-theme] .theme-swatch.is-active {
  background: var(--copper);
  border-color: var(--copper);
  color: var(--button-ink);
}

body[data-theme] .button,
body[data-theme] .tab {
  border-color: var(--line-strong);
  background: var(--ghost-bg);
  color: var(--ink);
}

body[data-theme] .button:not(.ghost) {
  background: var(--button-bg);
  color: var(--button-ink);
}

body[data-theme] .tab.is-active {
  background: var(--copper);
  border-color: var(--copper);
  color: var(--button-ink);
}

body[data-theme] .metric,
body[data-theme] .post-card,
body[data-theme] .panel {
  background: var(--panel-bg);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

body[data-theme] .metric::before,
body[data-theme] .status-ready .status-bar {
  background: linear-gradient(180deg, var(--copper), var(--olive));
}

body[data-theme] .section-title,
body[data-theme] .command-block,
body[data-theme] .log-item,
body[data-theme] .asset-row,
body[data-theme] .config-row {
  border-color: var(--line);
}

body[data-theme] .timeline-strip {
  background: var(--line);
  border-color: var(--line);
}

body[data-theme] .timeline-strip div,
body[data-theme] .caption-box,
body[data-theme] .message {
  background: var(--cell-bg);
}

body[data-theme] .media-hero,
body[data-theme] .media-thumb {
  background: var(--surface-strong);
  border-color: var(--line-strong);
}

body[data-theme] code {
  background: var(--code-bg);
  border-color: var(--line);
  color: var(--code-ink);
}

body[data-theme] .eyebrow,
body[data-theme] .post-kicker {
  color: var(--copper);
}

body[data-theme] .chip.ready {
  border-color: color-mix(in srgb, var(--olive) 55%, transparent);
  color: var(--olive);
}

body[data-theme] .chip.warning {
  border-color: color-mix(in srgb, var(--copper) 55%, transparent);
  color: var(--copper);
}

@media (max-width: 760px) {
  body[data-theme] .header-actions,
  body[data-theme] .theme-dock {
    justify-content: flex-start;
    width: 100%;
  }
}
