@charset "UTF-8";

:root {
  --bg: #0b0c0a;
  --bg-rgb: 11, 12, 10;
  --surface: #12140f;
  --surface-raised: #181b14;
  --surface-soft: #1e2119;
  --ink: #f2efe5;
  --ink-rgb: 242, 239, 229;
  --muted: #8f9283;
  --muted-strong: #b9bbad;
  --line: rgba(242, 239, 229, 0.12);
  --line-strong: rgba(242, 239, 229, 0.24);
  --accent: #d8ff4f;
  --accent-rgb: 216, 255, 79;
  --accent-ink: #11120e;
  --accent-ink-strong: #080906;
  --accent-soft: rgba(216, 255, 79, 0.14);
  --accent-line: rgba(216, 255, 79, 0.4);
  --danger: #ff7657;
  --font-sans: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  --font-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-mono: "DM Mono", "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 16px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 94px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  background: radial-gradient(circle at 75% 0%, rgba(var(--accent-rgb), 0.08), transparent 25%);
  pointer-events: none;
}

.site-noise {
  position: fixed;
  z-index: 1000;
  inset: 0;
  opacity: 0.17;
  mix-blend-mode: soft-light;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

code {
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(var(--ink-rgb), 0.04);
  color: var(--ink);
  font: 400 0.88em/1.3 var(--font-mono);
}

.pulse {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.5);
  animation: pulse 2.6s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.5); }
  55% { box-shadow: 0 0 0 5px rgba(var(--accent-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
}

/* Header */

.studio-bar {
  position: sticky;
  z-index: 90;
  top: 0;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  min-height: 70px;
  padding: 11px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(var(--bg-rgb), 0.86);
  backdrop-filter: blur(18px) saturate(1.25);
}

.studio-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
}

.studio-mark {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink-strong);
  font: italic 400 23px/1 var(--font-display);
  transform: rotate(-4deg);
}

.studio-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.studio-brand-text strong {
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.studio-brand-text span {
  color: var(--muted);
  font: 400 7px/1.2 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.save-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font: 400 8px/1 var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 180ms ease;
}

.save-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  transition: background 180ms ease;
}

.save-state.is-saving .save-dot {
  background: #ffc857;
  animation: pulse 1s infinite;
}

.save-state.is-error {
  color: var(--danger);
}

.save-state.is-error .save-dot {
  background: var(--danger);
}

.studio-bar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.bar-link {
  margin-right: 7px;
  color: var(--muted);
  font: 400 8px/1 var(--font-mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: color 180ms ease;
}

.bar-link:hover {
  color: var(--accent);
}

.btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font: 500 9px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms var(--ease);
}

.btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 180ms var(--ease);
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn-solid {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-solid:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--muted-strong);
}

.btn-ghost:hover,
.btn-outline:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-outline {
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 7px;
}

.btn-dashed {
  border: 1px dashed var(--line-strong);
  color: var(--muted-strong);
}

.btn-dashed:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-danger {
  border-color: rgba(255, 118, 87, 0.3);
  color: #ff9b85;
}

.btn-danger:hover {
  border-color: #ff7657;
  background: rgba(255, 118, 87, 0.1);
  color: #ffb09f;
}

/* Layout */

.studio-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  width: 100%;
  max-width: 1500px;
  margin-inline: auto;
}

.studio-aside {
  position: sticky;
  top: 70px;
  display: flex;
  height: calc(100vh - 70px);
  flex-direction: column;
  padding: 30px 23px 22px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.aside-head {
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.aside-kicker {
  color: var(--accent);
  font: 400 8px/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.aside-head p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.studio-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 22px 0;
}

.studio-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 10px 10px 2px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
  transition: background 180ms ease, color 180ms ease;
}

.studio-nav a span {
  width: 18px;
  color: var(--muted);
  font: 400 7px/1 var(--font-mono);
  transition: color 180ms ease;
}

.studio-nav a:hover {
  background: var(--surface);
  color: var(--ink);
}

.studio-nav a.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.studio-nav a.is-active span {
  color: var(--accent);
}

.aside-note {
  margin-top: auto;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.aside-note-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-strong);
  font: 400 7px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.aside-note p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.aside-exit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 19px;
  color: var(--muted);
  font: 400 8px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 180ms ease;
}

.aside-exit:hover {
  color: var(--accent);
}

.studio-main {
  width: 100%;
  max-width: 1080px;
  padding: 0 clamp(25px, 4vw, 62px) 40px;
}

.studio-intro {
  padding: clamp(58px, 7vw, 96px) 0 clamp(42px, 5vw, 70px);
  border-bottom: 1px solid var(--line);
}

.intro-kicker {
  color: var(--muted);
  font: 400 9px/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.studio-intro h1 {
  margin-top: 18px;
  font: 400 clamp(62px, 8.7vw, 112px)/0.84 var(--font-display);
  letter-spacing: -0.05em;
}

.studio-intro h1 em {
  color: var(--accent);
  font-style: italic;
}

.studio-intro > p {
  max-width: 580px;
  margin-top: 25px;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.7;
}

.intro-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 28px;
}

.intro-meta span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font: 400 7px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.intro-meta strong {
  color: var(--ink);
  font-weight: 500;
}

/* Panels */

.panel {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  scroll-margin-top: 94px;
  overflow: hidden;
}

.panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.72fr);
  gap: 30px;
  align-items: end;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(var(--ink-rgb), 0.012);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 13px;
}

.panel-no {
  display: inline-grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
  font: 400 7px/1 var(--font-mono);
}

.panel-head h2 {
  font: 400 34px/1 var(--font-display);
  letter-spacing: -0.035em;
}

.panel-desc {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.panel-body {
  padding: 27px 28px 30px;
}

.panel-body > * + * {
  margin-top: 21px;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
}

.toolbar-count {
  color: var(--muted);
  font: 400 8px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toolbar-count strong {
  color: var(--ink);
  font-weight: 500;
}

/* Fields */

.field-grid {
  display: grid;
  gap: 18px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  display: block;
  color: var(--muted-strong);
  font: 400 8px/1.4 var(--font-mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.field-label span {
  color: var(--muted);
  font-size: 7px;
  text-transform: none;
  letter-spacing: 0.02em;
}

.field-help {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.field-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 4px;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="url"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="url"],
select {
  min-height: 41px;
  padding: 0 12px;
}

textarea {
  min-height: 88px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #5f6256;
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--line-strong);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-line);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23979a8b' stroke-width='1.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

textarea[data-bind="posts.0.body"] {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.75;
}

/* Accent + appearance */

.accent-control {
  display: flex;
  align-items: center;
  gap: 9px;
}

.color-input {
  width: 44px;
  height: 41px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}

.color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input::-webkit-color-swatch {
  border: 0;
  border-radius: 5px;
}

.color-text {
  flex: 1;
  font-family: var(--font-mono) !important;
  text-transform: uppercase;
}

.accent-swatch {
  width: 41px;
  height: 41px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--accent);
}

.accent-presets {
  display: flex;
  gap: 7px;
  margin-top: 11px;
}

.accent-presets button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(var(--ink-rgb), 0.2);
  border-radius: 50%;
  background: var(--swatch);
  transition: transform 180ms var(--ease), box-shadow 180ms ease;
}

.accent-presets button:hover {
  transform: scale(1.16);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.segmented {
  display: inline-flex;
  width: max-content;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}

.segmented button {
  display: inline-flex;
  min-height: 33px;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 400 8px/1 var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background 180ms ease, color 180ms ease;
}

.segmented button.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

.mode-dot {
  width: 9px;
  height: 9px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: #0b0c0a;
}

.mode-dot.light {
  background: #f1eee3;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 15px 0 4px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.switch-row .field-help {
  display: block;
  margin-top: 4px;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-ui {
  position: relative;
  width: 42px;
  height: 23px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  transition: background 180ms ease, border-color 180ms ease;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 220ms var(--ease), background 180ms ease;
}

.switch-row input:checked + .switch-ui {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.switch-row input:checked + .switch-ui::after {
  background: var(--accent);
  transform: translateX(19px);
}

.switch-row input:focus-visible + .switch-ui {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.theme-preview {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.preview-strip {
  display: flex;
  align-items: center;
  gap: 9px;
}

.preview-mark {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink-strong);
  font: italic 400 18px/1 var(--font-display);
}

.preview-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-lines i {
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: var(--line-strong);
}

.preview-lines i:last-child {
  width: 30px;
}

.preview-dot {
  width: 6px;
  height: 6px;
  margin-left: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.preview-type {
  margin-left: auto;
  color: var(--ink);
  font: 400 32px/1 var(--font-display);
}

.preview-type em {
  color: var(--accent);
  font-size: 28px;
}

.preview-bar {
  width: 70px;
  height: 3px;
  background: var(--line);
}

.preview-bar span {
  display: block;
  width: 60%;
  height: 100%;
  background: var(--accent);
}

/* Arrays */

.array-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.array-list.compact {
  gap: 8px;
}

.array-card {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
}

.array-card.stats-card {
  grid-template-columns: minmax(0, 0.45fr) minmax(0, 1fr) auto;
}

.array-card.fact-card {
  grid-template-columns: minmax(0, 0.55fr) minmax(0, 1fr) auto;
}

.array-card .field {
  gap: 5px;
}

.array-card input {
  min-height: 36px;
  font-size: 12px;
}

.mini-action {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.mini-action:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface-raised);
}

.mini-action.is-remove:hover {
  border-color: rgba(255, 118, 87, 0.5);
  color: var(--danger);
  background: rgba(255, 118, 87, 0.08);
}

.action-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Editor accordions */

.editor-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.editor-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  overflow: hidden;
}

.editor-item[open] {
  border-color: var(--line-strong);
}

.editor-item summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  cursor: pointer;
  list-style: none;
  transition: background 180ms ease;
}

.editor-item summary::-webkit-details-marker {
  display: none;
}

.editor-item summary:hover {
  background: rgba(var(--ink-rgb), 0.02);
}

.summary-index {
  display: inline-grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font: 400 7px/1 var(--font-mono);
}

.summary-title {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-meta {
  margin-left: auto;
  color: var(--muted);
  font: 400 7px/1 var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.summary-badge {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font: 400 6px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.summary-badge.is-live {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.summary-badge.is-featured {
  border-color: rgba(255, 200, 87, 0.3);
  color: #ffc857;
}

.summary-chevron {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 200ms ease;
}

.editor-item[open] .summary-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.editor-body {
  display: flex;
  flex-direction: column;
  gap: 17px;
  padding: 18px 16px 17px;
  border-top: 1px solid var(--line);
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 3px;
}

.editor-footer-note {
  color: var(--muted);
  font: 400 7px/1.4 var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 22px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-strong);
  font: 400 8px/1 var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-field input {
  flex: 1;
}

.progress-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 12px;
  align-items: center;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: var(--line);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  appearance: none;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-line);
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
}

.progress-output {
  color: var(--accent);
  font: 400 9px/1 var(--font-mono);
  text-align: right;
}

.markdown-help {
  margin-top: 17px;
  padding: 14px 15px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: rgba(var(--ink-rgb), 0.015);
}

.markdown-help p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

/* Popup, publishing */

.panel-publish {
  border-color: var(--accent-line);
}

.publish-callout {
  display: flex;
  gap: 16px;
  padding: 17px;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  background: var(--accent-soft);
}

.publish-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 18px;
}

.publish-callout h3 {
  font: 400 21px/1.1 var(--font-display);
  letter-spacing: -0.02em;
}

.publish-callout p {
  margin-top: 5px;
  color: var(--muted-strong);
  font-size: 11px;
  line-height: 1.6;
}

.publish-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.publish-steps {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.publish-steps li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  color: var(--muted);
  font-size: 11px;
}

.publish-steps li span {
  color: var(--accent);
  font: 400 8px/1 var(--font-mono);
}

.secondary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.file-button {
  cursor: pointer;
}

.studio-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 35px;
  padding: 18px 2px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 400 7px/1.4 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Dialog */

.publish-dialog {
  width: min(490px, calc(100vw - 32px));
  padding: 31px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
}

.publish-dialog::backdrop {
  background: rgba(4, 5, 3, 0.7);
  backdrop-filter: blur(5px);
}

.dialog-close {
  position: absolute;
  top: 13px;
  right: 14px;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
}

.dialog-close:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.dialog-kicker {
  color: var(--accent);
  font: 400 8px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.publish-dialog h2 {
  margin-top: 16px;
  font: 400 50px/0.9 var(--font-display);
  letter-spacing: -0.04em;
}

.publish-dialog > p {
  margin-top: 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}

.dialog-later {
  margin-top: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 400 8px/1 var(--font-mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.dialog-later:hover {
  color: var(--accent);
}

/* Toast */

.toast {
  position: fixed;
  z-index: 1200;
  right: 20px;
  bottom: 20px;
  max-width: calc(100vw - 40px);
  padding: 12px 16px;
  border: 1px solid var(--accent-line);
  border-radius: 9px;
  background: var(--surface-raised);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font: 400 9px/1.5 var(--font-mono);
  opacity: 0;
  transform: translateY(9px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */

@media (max-width: 1080px) {
  .studio-bar {
    grid-template-columns: 1fr auto;
  }

  .save-state {
    display: none;
  }

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

  .studio-aside {
    position: sticky;
    z-index: 70;
    top: 70px;
    display: block;
    height: auto;
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(var(--bg-rgb), 0.92);
    backdrop-filter: blur(14px);
    overflow-x: auto;
  }

  .aside-head,
  .aside-note,
  .aside-exit {
    display: none;
  }

  .studio-nav {
    flex-direction: row;
    gap: 3px;
    width: max-content;
    padding: 9px 22px;
  }

  .studio-nav a {
    padding: 8px 11px;
    white-space: nowrap;
    font-size: 10px;
  }

  .studio-nav a span {
    display: none;
  }

  .studio-main {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .studio-bar {
    grid-template-columns: 1fr auto;
    padding-inline: 16px;
  }

  .bar-link {
    display: none;
  }

  .studio-bar-actions .btn-ghost {
    display: none;
  }

  .studio-main {
    padding-inline: 16px;
  }

  .studio-intro {
    padding-top: 54px;
  }

  .studio-intro h1 {
    font-size: clamp(58px, 17vw, 86px);
  }

  .panel-head {
    grid-template-columns: 1fr;
    gap: 9px;
    align-items: start;
    padding: 20px;
  }

  .panel-body {
    padding: 20px;
  }

  .field-grid.two,
  .field-grid.three {
    grid-template-columns: 1fr;
  }

  .array-card,
  .array-card.stats-card,
  .array-card.fact-card {
    grid-template-columns: 1fr 1fr auto;
  }

  .array-card .field:first-child {
    grid-column: 1 / -1;
  }

  .array-card.stats-card .field:first-child {
    grid-column: auto;
  }

  .field-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
  }

  .theme-preview {
    gap: 10px;
    padding: 14px;
  }

  .preview-bar {
    display: none;
  }

  .secondary-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-meta {
    display: none;
  }

  .editor-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .publish-dialog {
    padding: 25px;
  }

  .publish-dialog h2 {
    font-size: 43px;
  }
}

@media (max-width: 450px) {
  .studio-mark {
    width: 31px;
    height: 31px;
    font-size: 20px;
  }

  .studio-brand-text strong {
    font-size: 14px;
  }

  .studio-bar-actions .btn {
    min-height: 36px;
    padding: 0 12px;
  }

  .array-card,
  .array-card.stats-card,
  .array-card.fact-card {
    grid-template-columns: 1fr auto;
  }

  .array-card .field,
  .array-card.stats-card .field:first-child {
    grid-column: 1 / -1;
  }

  .array-card .action-group {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

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

  .theme-preview {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Small editor states */

.empty-inline,
.empty-panel {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.empty-panel {
  padding: 34px 20px;
}

.post-body-input {
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  line-height: 1.75 !important;
}

[data-import-fallback] {
  display: none;
}
