:root {
  --bg: #080808;
  --surface: #0c0c0c;
  --surface-soft: #171717;
  --surface-warm: #20100d;
  --ink: #f2f2ee;
  --muted: #9b9b95;
  --faint: #656560;
  --line: #333331;
  --line-strong: #555550;
  --accent: #24bd87;
  --accent-strong: #1a996d;
  --accent-soft: #102c22;
  --coral: #ff684c;
  --coral-soft: #321713;
  --warning: #f3b54a;
  --warning-soft: #2b2110;
  --danger: #ff5f57;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  --radius: 2px;
  --topbar-height: 78px;
  color-scheme: dark;
  font-family: Arial, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
}

html {
  background: var(--bg);
}

body {
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--bg);
  background-size: 100% 80px;
}

::selection {
  color: #07110d;
  background: #73e6bc;
}

.topbar {
  height: var(--topbar-height);
  grid-template-columns: minmax(250px, 1fr) auto minmax(250px, 1fr);
  padding: 0 28px;
  border-color: var(--line);
  background: rgba(8, 8, 8, 0.97);
  backdrop-filter: blur(12px);
}

.brand {
  gap: 13px;
  color: var(--ink);
}

.brand img {
  width: 43px;
  height: 43px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #fff;
  filter: grayscale(1) contrast(1.18);
}

.brand-copy strong {
  font-size: 18px;
  font-weight: 500;
  text-transform: uppercase;
}

.brand-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.main-nav {
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.nav-tab {
  position: relative;
  min-width: 112px;
  height: var(--topbar-height);
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  text-transform: uppercase;
}

.nav-tab:last-child {
  border-right: 1px solid var(--line);
}

.nav-tab:hover,
.nav-tab.is-active {
  color: var(--ink);
  background: #111;
  box-shadow: none;
}

.nav-tab.is-active::after {
  content: "";
  position: absolute;
  right: 17px;
  bottom: 0;
  left: 17px;
  height: 3px;
  background: var(--ink);
}

.nav-count {
  height: 18px;
  min-width: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
}

.connection-button {
  height: 46px;
  max-width: 280px;
  padding: 0 11px;
  border-color: var(--line-strong);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  text-transform: uppercase;
}

.connection-avatar,
.forum-account-avatar {
  width: 27px;
  height: 27px;
  display: grid;
  flex: 0 0 27px;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: #111512;
  font: 700 11px/1 "IBM Plex Mono", Consolas, monospace;
}

.connection-copy {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.connection-copy strong,
.connection-copy small {
  max-width: 175px;
  overflow: hidden;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-copy strong {
  font-size: 11px;
  font-weight: 650;
}

.connection-copy small {
  color: var(--faint);
  font: 500 8px/1 "IBM Plex Mono", Consolas, monospace;
}

.connection-button:hover {
  color: #050505;
  border-color: var(--ink);
  background: var(--ink);
}

.connection-button.is-connected {
  color: var(--ink);
  border-color: var(--accent);
  background: #0c2119;
}

.connection-button.is-connected .connection-avatar {
  color: #07100b;
  border-color: var(--accent);
  background: var(--accent);
}

.status-dot {
  background: var(--faint);
  box-shadow: none;
}

.is-connected .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(36, 189, 135, 0.12);
}

.compose-grid {
  min-height: calc(100vh - var(--topbar-height));
  grid-template-columns: 288px minmax(500px, 1fr) 332px;
  max-width: none;
  margin: 0;
}

.post-sidebar,
.ai-panel {
  padding: 27px 22px;
  background: var(--surface);
}

.post-sidebar {
  border-color: var(--line);
}

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

.sidebar-heading,
.ai-heading {
  min-height: 68px;
  align-items: flex-start;
  margin: 0 -22px 26px;
  padding: 0 22px 22px;
  border-bottom: 1px solid var(--line);
}

.sidebar-heading h1 {
  margin-top: 7px;
  font-size: 29px;
  font-weight: 400;
  line-height: 1.05;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--muted);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 9px;
  font-weight: 400;
}

.icon-button,
.tool-button {
  border-color: var(--line);
  border-radius: 0;
  color: var(--muted);
  background: transparent;
}

.icon-button:hover,
.tool-button:hover {
  color: #070707;
  border-color: var(--ink);
  background: var(--ink);
}

.field {
  gap: 8px;
  margin-bottom: 19px;
}

.field > span,
.range-field > span {
  color: var(--muted);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
}

input,
select,
textarea {
  color: var(--ink);
  border-color: var(--line-strong);
  border-radius: 0;
  background: #0a0a0a;
}

input,
select {
  height: 45px;
  padding: 0 13px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

input[readonly] {
  color: var(--muted);
  border-style: dashed;
  cursor: default;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

.post-metrics {
  gap: 0;
  margin: 25px 0;
  border-color: var(--line);
  border-radius: 0;
  background: transparent;
}

.post-metrics div {
  padding: 13px 5px;
  border-right: 1px solid var(--line);
  background: transparent;
}

.post-metrics div:last-child {
  border-right: 0;
}

.post-metrics strong {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 17px;
  font-weight: 400;
}

.post-metrics span {
  color: var(--faint);
  text-transform: uppercase;
}

.button {
  min-height: 44px;
  border-radius: 0;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.button.primary {
  color: #06100c;
  border-color: var(--accent);
  background: var(--accent);
}

.button.primary:hover {
  color: #06100c;
  border-color: #74e8bd;
  background: #74e8bd;
}

.button.secondary {
  color: var(--ink);
  border-color: var(--line-strong);
  background: transparent;
}

.button.secondary:hover,
.button.ghost:hover {
  color: #050505;
  border-color: var(--ink);
  background: var(--ink);
}

.button.ghost {
  color: var(--muted);
  background: transparent;
}

.forum-summary {
  margin-top: 25px;
  padding-top: 20px;
  border-color: var(--line);
}

.summary-icon {
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  background: transparent;
}

.forum-summary strong {
  font-weight: 500;
}

.forum-account-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 2px 0 20px;
  padding: 17px;
  border: 1px solid var(--line-strong);
  background: #0a0e0b;
  box-shadow: inset 4px 0 0 var(--accent);
}

.forum-account-avatar {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  color: #07100b;
  border-color: var(--accent);
  background: var(--accent);
  font-size: 18px;
}

.forum-account-identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.forum-account-identity > span,
.forum-account-card dt {
  color: var(--faint);
  font: 600 8px/1 "IBM Plex Mono", Consolas, monospace;
  text-transform: uppercase;
}

.forum-account-identity strong,
.forum-account-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-account-identity strong {
  color: var(--ink);
  font-size: 17px;
}

.forum-account-identity small {
  color: var(--muted);
  font-size: 10px;
}

.forum-account-card dl {
  display: flex;
  gap: 18px;
  margin: 0;
}

.forum-account-card dl > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.forum-account-card dd {
  margin: 0;
  color: var(--ink);
  font: 650 11px/1 "IBM Plex Mono", Consolas, monospace;
}

.forum-account-card dd.is-online {
  color: var(--accent);
}

@media (max-width: 900px) {
  .connection-button .connection-copy {
    display: none;
  }

  .connection-button {
    justify-content: center;
  }
}

.editor-zone {
  background: #0a0a0a;
}

.editor-toolbar {
  min-height: 58px;
  gap: 14px;
  padding: 10px 14px;
  border-color: var(--line);
  background: rgba(10, 10, 10, 0.98);
  box-shadow: none;
}

.toolbar-section {
  gap: 7px;
}

.toolbar-group {
  gap: 3px;
}

.tool-button {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-color: transparent;
}

.history-tools {
  padding: 2px;
  border: 1px solid var(--line);
}

.history-tools .tool-button {
  width: 31px;
  height: 29px;
  flex-basis: 31px;
}

.tool-button:disabled {
  color: #454541;
}

.danger-tool:not(:disabled) {
  color: var(--coral);
}

.danger-tool:not(:disabled):hover {
  color: #080808;
  border-color: var(--coral);
  background: var(--coral);
}

.labeled-tool {
  min-width: 70px;
  border: 1px solid var(--line);
}

.toolbar-separator {
  background: var(--line);
}

.editor-split {
  min-height: calc(100vh - var(--topbar-height) - 58px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.editor-pane {
  border-color: var(--line);
  background: #080808;
}

.preview-pane {
  background: #0d0d0d;
}

.pane-label {
  height: 39px;
  padding: 0 17px;
  color: var(--faint);
  border-color: var(--line);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 9px;
  font-weight: 400;
}

#saveState {
  color: var(--accent);
}

#markdownEditor {
  min-height: calc(100vh - var(--topbar-height) - 97px);
  padding: 29px 27px 140px;
  color: #ededeb;
  background: #080808;
  caret-color: var(--accent);
  font: 14px/1.82 "Cascadia Code", Consolas, "Microsoft YaHei", monospace;
}

#markdownEditor:focus {
  box-shadow: inset 2px 0 0 var(--accent);
}

.markdown-body {
  padding: 27px 30px 140px;
  color: #d8d8d3;
  font-size: 14px;
  line-height: 1.82;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  color: var(--ink);
  font-weight: 400;
  text-transform: uppercase;
}

.markdown-body h1,
.markdown-body h2 {
  border-color: var(--line);
}

.markdown-body a {
  color: #73e6bc;
}

.markdown-body blockquote {
  border-color: var(--accent);
  color: #c0c0ba;
  background: var(--accent-soft);
}

.markdown-body code {
  color: #ff9b86;
  background: var(--coral-soft);
}

.markdown-body pre {
  border-color: var(--line-strong);
  border-radius: 0;
  color: #ebebe7;
  background: #050505;
}

.markdown-body th,
.markdown-body td {
  border-color: var(--line-strong);
}

.markdown-body th {
  background: var(--surface-soft);
}

.preview-empty {
  color: var(--faint);
  font-family: "Cascadia Code", Consolas, monospace;
  text-transform: uppercase;
}

.ai-heading {
  justify-content: flex-start;
}

.ai-heading h2 {
  margin-top: 7px;
  font-size: 25px;
  font-weight: 400;
  text-transform: uppercase;
}

.ai-mark {
  width: 42px;
  height: 42px;
  border: 1px solid var(--coral);
  border-radius: 0;
  color: var(--coral);
  background: transparent;
}

.grow-field textarea {
  min-height: 205px;
}

.segmented {
  gap: 0;
  padding: 0;
  border-color: var(--line-strong);
  border-radius: 0;
  background: transparent;
}

.segmented button {
  min-height: 38px;
  border-right: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--muted);
  background: transparent;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.is-active {
  color: #050505;
  background: var(--ink);
  box-shadow: none;
}

.toggle-row strong {
  font-weight: 500;
}

.toggle {
  border-radius: 0;
  background: var(--line-strong);
}

.toggle::after {
  border-radius: 0;
}

.toggle-row input:checked + .toggle {
  background: var(--accent);
}

.ai-button {
  color: #090909;
  border-color: var(--coral);
  background: var(--coral);
}

.ai-button:hover {
  color: #090909;
  border-color: #ff9a84;
  background: #ff9a84;
}

.ai-profile-status {
  border-color: var(--line);
  border-radius: 0;
  color: var(--muted);
}

.ai-profile-status button {
  color: #73e6bc;
}

.content-workspace {
  max-width: 1280px;
  padding-top: 52px;
}

.page-header {
  padding-bottom: 28px;
  border-color: var(--line);
}

.page-header h1 {
  margin-top: 7px;
  font-size: 48px;
  font-weight: 400;
  text-transform: uppercase;
}

.draft-list {
  gap: 0;
  padding-top: 0;
  border-left: 1px solid var(--line);
}

.draft-card {
  padding: 22px;
  border-width: 0 1px 1px 0;
  border-color: var(--line);
  border-radius: 0;
  background: transparent;
}

.draft-card:hover {
  background: #101010;
}

.draft-card h2 {
  font-size: 18px;
  font-weight: 400;
  text-transform: uppercase;
}

.settings-layout {
  border-color: var(--line);
  border-radius: 0;
  background: transparent;
}

.provider-list {
  border-color: var(--line);
  background: #0c0c0c;
}

.provider-item {
  border-radius: 0;
  color: var(--muted);
}

.provider-item:hover,
.provider-item.is-active {
  color: var(--ink);
  background: #1a1a1a;
}

.provider-item.is-active {
  box-shadow: inset 3px 0 0 var(--ink);
}

.provider-symbol,
.provider-avatar {
  border-radius: 0;
  filter: saturate(0.7);
}

.settings-form {
  background: #090909;
}

.settings-heading {
  border-color: var(--line);
}

.settings-heading h2 {
  font-weight: 400;
  text-transform: uppercase;
}

.compact-toggle {
  border-color: var(--line);
}

.modal {
  border-radius: 0;
  background: #090909;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
}

.modal-card {
  padding: 28px;
  border-color: var(--line-strong);
  border-radius: 0;
  background: #090909;
}

.modal-header h2,
.confirm-modal h2,
.success-modal h2 {
  font-size: 23px;
  font-weight: 400;
  text-transform: uppercase;
}

.security-note {
  border-color: #295845;
  border-radius: 0;
  color: #73e6bc;
  background: var(--accent-soft);
}

.confirm-icon {
  border: 1px solid #765b25;
  border-radius: 0;
  color: var(--warning);
  background: var(--warning-soft);
}

.confirm-icon.success {
  border-color: #295845;
  color: var(--accent);
  background: var(--accent-soft);
}

.confirm-summary {
  border-color: var(--line);
  border-radius: 0;
  background: #111;
}

.toast {
  border-color: var(--line-strong);
  border-radius: 0;
  background: #111;
  box-shadow: var(--shadow);
}

@media (max-width: 1280px) {
  .compose-grid {
    grid-template-columns: 248px minmax(430px, 1fr) 294px;
  }

  .post-sidebar,
  .ai-panel {
    padding-right: 17px;
    padding-left: 17px;
  }

  .sidebar-heading,
  .ai-heading {
    margin-right: -17px;
    margin-left: -17px;
    padding-right: 17px;
    padding-left: 17px;
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    padding: 0 16px;
  }

  .brand-copy {
    display: none;
  }

  .nav-tab {
    min-width: 74px;
    padding: 0 13px;
  }

  .nav-tab > span:not(.nav-count) {
    display: none;
  }

  .compose-grid {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .ai-panel {
    grid-column: 1 / -1;
    min-height: auto;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .ai-panel .grow-field {
    min-height: 160px;
  }
}

@media (max-width: 680px) {
  :root {
    --topbar-height: 61px;
  }

  body {
    background-size: 100% 64px;
  }

  .topbar {
    height: var(--topbar-height);
    padding: 0 10px;
  }

  .brand img {
    width: 35px;
    height: 35px;
  }

  .main-nav {
    height: var(--topbar-height);
  }

  .nav-tab {
    width: 47px;
    min-width: 47px;
    height: var(--topbar-height);
    padding: 0;
  }

  .nav-tab.is-active::after {
    right: 8px;
    left: 8px;
  }

  .connection-button {
    width: 39px;
    height: 39px;
  }

  .compose-grid {
    display: block;
  }

  .post-sidebar,
  .ai-panel {
    padding: 22px 14px;
  }

  .sidebar-heading,
  .ai-heading {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .sidebar-heading h1 {
    font-size: 27px;
  }

  .sidebar-actions {
    grid-template-columns: 1fr 1fr;
  }

  .editor-toolbar {
    top: var(--topbar-height);
    min-height: 55px;
    padding: 8px 10px;
  }

  .history-tools {
    position: sticky;
    z-index: 2;
    left: 0;
    border-color: var(--line-strong);
    background: #0a0a0a;
  }

  .labeled-tool {
    min-width: 34px;
  }

  #markdownEditor {
    min-height: 68vh;
    padding: 24px 16px 90px;
  }

  .pane-label {
    height: 36px;
  }

  .page-header h1 {
    font-size: 36px;
  }

  .content-workspace {
    padding: 34px 14px 60px;
  }

  .settings-layout {
    border: 0;
  }

  .provider-list {
    border: 0;
    background: transparent;
  }

  .provider-item {
    border-color: var(--line);
    background: #0c0c0c;
  }

  .settings-form {
    border-color: var(--line);
    border-radius: 0;
    background: #090909;
  }
}

/* Studio integrations: GitHub sync, DeepSeek completion, timed inspiration. */
[hidden] {
  display: none !important;
}

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

.github-button {
  max-width: 190px;
}

.github-button.is-connected {
  color: #08100c;
  border-color: var(--accent);
  background: var(--accent);
}

.github-syncbar {
  min-height: 55px;
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #101411;
  box-shadow: inset 5px 0 0 var(--accent);
}

.github-syncbar[hidden] {
  display: none;
}

.github-repo-status {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.github-repo-status > svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--accent);
}

.github-repo-status > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.github-repo-status strong,
.github-repo-status small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Cascadia Code", Consolas, monospace;
}

.github-repo-status strong {
  color: var(--ink);
  font-size: 10px;
}

.github-repo-status small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.github-path-field {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0;
}

.github-path-field > span {
  color: var(--faint);
  font: 9px/1 "Cascadia Code", Consolas, monospace;
}

.github-path-field input {
  height: 34px;
  padding: 0 10px;
  font: 10px/1 "Cascadia Code", Consolas, monospace;
}

.github-syncbar .labeled-tool {
  min-width: 66px;
  border-color: var(--line-strong);
}

.github-syncbar .github-push {
  color: #07100b;
  border-color: var(--accent);
  background: var(--accent);
}

.editor-pane {
  position: relative;
}

.ai-prediction {
  position: absolute;
  z-index: 5;
  right: 14px;
  bottom: 14px;
  left: 14px;
  min-height: 68px;
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--accent);
  background: rgba(13, 19, 15, 0.97);
  box-shadow: 5px 5px 0 rgba(83, 242, 169, 0.18);
}

.ai-prediction[hidden] {
  display: none;
}

.prediction-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  color: #07100b;
  background: var(--accent);
}

.prediction-mark svg {
  width: 17px;
  height: 17px;
}

.prediction-copy {
  min-width: 0;
}

.prediction-copy > span {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font: 8px/1 "Cascadia Code", Consolas, monospace;
}

.prediction-copy p {
  max-height: 46px;
  overflow: hidden;
  color: #dfe9e2;
  font: 11px/1.45 "Cascadia Code", Consolas, "Microsoft YaHei", monospace;
  white-space: pre-wrap;
}

.ai-prediction.is-loading .prediction-mark svg {
  animation: spin 850ms linear infinite;
}

.prediction-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.prediction-actions button {
  height: 31px;
  min-width: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.prediction-actions button:first-child {
  color: #07100b;
  border-color: var(--accent);
  background: var(--accent);
}

.prediction-actions svg {
  width: 14px;
  height: 14px;
}

.prediction-actions span {
  font-size: 9px;
}

.ai-live-features {
  display: grid;
  gap: 0;
  margin-top: 18px;
  border: 1px solid var(--line);
}

.ai-live-toggle {
  position: relative;
  min-height: 63px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.ai-live-toggle > span:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ai-live-toggle strong {
  font-size: 11px;
  font-weight: 500;
}

.ai-live-toggle small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.ai-live-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.ai-live-icon.coral {
  color: var(--coral);
  border-color: var(--coral);
}

.ai-live-icon svg {
  width: 15px;
  height: 15px;
}

.ai-live-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ai-live-toggle .toggle {
  justify-self: end;
}

.ai-live-toggle input:disabled + .toggle {
  opacity: 0.35;
}

.inspiration-now {
  min-height: 37px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font: 9px/1 "Cascadia Code", Consolas, monospace;
  cursor: pointer;
}

.inspiration-now:hover {
  color: #07100b;
  background: var(--coral);
}

.inspiration-now svg {
  width: 14px;
  height: 14px;
}

.github-modal {
  width: min(520px, calc(100vw - 28px));
}

.inspiration-popup {
  position: fixed;
  z-index: 48;
  right: 22px;
  bottom: 22px;
  width: min(390px, calc(100vw - 32px));
  padding: 15px;
  border: 1px solid var(--coral);
  color: var(--ink);
  background: rgba(14, 16, 15, 0.98);
  box-shadow: 7px 7px 0 rgba(255, 107, 74, 0.22);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 180ms steps(4, end), transform 180ms steps(4, end);
}

.inspiration-popup[hidden] {
  display: none;
}

.inspiration-popup.is-showing {
  opacity: 1;
  transform: translateY(0);
}

.inspiration-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inspiration-popup-head > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--coral);
  font: 9px/1 "Cascadia Code", Consolas, monospace;
}

.inspiration-popup-head svg {
  width: 15px;
  height: 15px;
}

.inspiration-popup-head button {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.inspiration-popup blockquote {
  margin: 18px 0 14px;
  color: #f1f5f2;
  font-size: 16px;
  line-height: 1.65;
}

.inspiration-popup > small {
  color: var(--faint);
  font: 8px/1 "Cascadia Code", Consolas, monospace;
}

@media (max-width: 1180px) {
  .github-button span {
    display: none;
  }

  .github-button {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .github-repo-status {
    display: none;
  }

  .github-syncbar {
    grid-template-columns: minmax(180px, 1fr) auto auto;
  }
}

@media (max-width: 680px) {
  .topbar-actions {
    gap: 4px;
  }

  .github-button,
  .connection-button {
    width: 37px;
    height: 37px;
  }

  .github-syncbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: 7px 10px;
  }

  .github-path-field > span,
  .github-syncbar .labeled-tool span {
    display: none;
  }

  .github-syncbar .labeled-tool {
    min-width: 34px;
    padding: 0;
  }

  .ai-prediction {
    right: 9px;
    bottom: 9px;
    left: 9px;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 8px;
  }

  .prediction-mark {
    width: 30px;
    height: 30px;
  }

  .prediction-actions span {
    display: none;
  }

  .inspiration-popup {
    right: 16px;
    bottom: 16px;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #c3c3bd;
    --line: #575752;
    --line-strong: #85857f;
  }
}

/* Motion language: structural reveals, direct feedback, restrained status loops. */
@keyframes studio-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes studio-slide-right {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes studio-slide-left {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes studio-line-in {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes studio-status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(36, 189, 135, 0.24); }
  50% { box-shadow: 0 0 0 7px rgba(36, 189, 135, 0); }
}

@keyframes studio-ai-breathe {
  0%, 100% {
    border-color: var(--coral);
    color: var(--coral);
    box-shadow: inset 0 0 0 0 rgba(255, 104, 76, 0);
  }
  50% {
    border-color: #ff9a84;
    color: #ff9a84;
    box-shadow: inset 0 0 0 3px rgba(255, 104, 76, 0.08);
  }
}

@keyframes studio-dialog-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes studio-backdrop-in {
  from { background: rgba(0, 0, 0, 0); }
  to { background: rgba(0, 0, 0, 0.78); }
}

@keyframes studio-toast-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes studio-preview-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.brand img {
  transition: filter 220ms ease, transform 220ms ease;
}

.brand:hover img {
  filter: grayscale(0) contrast(1.08);
  transform: rotate(-5deg) scale(1.04);
}

.brand-copy strong,
.brand-copy small {
  transition: color 180ms ease, transform 180ms ease;
}

.brand:hover .brand-copy strong {
  transform: translateX(3px);
}

.nav-tab::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 180ms ease;
}

.nav-tab {
  isolation: isolate;
  transition: color 180ms ease, background-color 180ms ease;
}

.nav-tab:hover:not(.is-active) {
  color: #080808;
  background: transparent;
}

.nav-tab:hover:not(.is-active)::before {
  transform: scaleY(1);
}

.nav-tab svg,
.connection-button svg,
.button svg,
.tool-button svg {
  transition: transform 160ms ease;
}

.nav-tab:hover svg,
.connection-button:hover svg {
  transform: translateY(-2px);
}

.nav-tab.is-active::after {
  transform-origin: left;
  animation: studio-line-in 260ms ease both;
}

.connection-button,
.button,
.icon-button,
.tool-button,
.provider-item,
.draft-card,
.segmented button {
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.button:hover:not(:disabled) svg {
  transform: translateX(3px);
}

.button:active:not(:disabled),
.icon-button:active:not(:disabled),
.tool-button:active:not(:disabled),
.segmented button:active {
  transform: scale(0.96);
}

.is-connected .status-dot {
  animation: studio-status-pulse 2.2s ease-in-out infinite;
}

.workspace.is-active {
  animation: studio-fade-up 280ms ease both;
}

.workspace-write.is-active,
#workspace-write.is-active {
  animation-duration: 220ms;
}

.post-sidebar {
  animation: studio-slide-right 420ms 40ms ease both;
}

.editor-zone {
  animation: studio-fade-up 420ms 90ms ease both;
}

.ai-panel {
  animation: studio-slide-left 420ms 140ms ease both;
}

.sidebar-heading,
.ai-heading,
.page-header,
.settings-heading {
  position: relative;
}

.sidebar-heading::after,
.ai-heading::after,
.page-header::after,
.settings-heading::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: var(--ink);
  transform-origin: left;
  animation: studio-line-in 520ms 120ms ease both;
}

.ai-mark {
  animation: studio-ai-breathe 3s ease-in-out infinite;
}

.ai-mark:hover svg {
  transform: rotate(14deg) scale(1.08);
}

.field input,
.field select,
.field textarea {
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.field:focus-within > span {
  color: var(--ink);
  transition: color 160ms ease;
}

.history-tools {
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.history-tools:focus-within,
.history-tools:hover {
  border-color: var(--line-strong);
  box-shadow: inset 0 -2px 0 var(--ink);
}

#markdownEditor,
.markdown-body {
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.markdown-body > * {
  animation: studio-preview-in 180ms ease both;
}

.preview-pane:hover {
  background: #101010;
  transition: background-color 220ms ease;
}

.toggle::after {
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 180ms ease;
}

.toggle-row:hover .toggle {
  box-shadow: 0 0 0 1px var(--line-strong);
}

.provider-item:hover {
  transform: translateX(3px);
}

.provider-item.is-active {
  animation: studio-slide-right 220ms ease both;
}

.draft-card {
  animation: studio-fade-up 300ms ease both;
}

.draft-card:nth-child(2) { animation-delay: 35ms; }
.draft-card:nth-child(3) { animation-delay: 70ms; }
.draft-card:nth-child(4) { animation-delay: 105ms; }
.draft-card:nth-child(5) { animation-delay: 140ms; }
.draft-card:nth-child(6) { animation-delay: 175ms; }

.draft-card:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 -2px 0 var(--ink);
}

.modal[open] .modal-card {
  animation: studio-dialog-in 220ms ease both;
}

.modal[open]::backdrop {
  animation: studio-backdrop-in 180ms ease both;
}

.toast {
  animation: studio-toast-in 220ms ease both;
}

.toast:hover {
  transform: translateX(-3px);
  border-color: var(--ink);
}

.button.is-loading {
  position: relative;
  overflow: hidden;
}

.button.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.22) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: studio-loading-sweep 1.15s linear infinite;
}

@keyframes studio-loading-sweep {
  to { transform: translateX(100%); }
}

@media (hover: none) {
  .brand:hover img,
  .provider-item:hover,
  .draft-card:hover,
  .toast:hover {
    transform: none;
  }

  .nav-tab:hover:not(.is-active)::before {
    transform: scaleY(0);
  }

  .nav-tab:hover:not(.is-active) {
    color: var(--muted);
  }
}

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

/* Charcoal pixel-console treatment */
:root {
  --bg: #0b0d0c;
  --surface: #101311;
  --surface-soft: #171b18;
  --surface-warm: #21130f;
  --ink: #edf4ef;
  --muted: #9eaaa1;
  --faint: #647067;
  --line: #2b342e;
  --line-strong: #4a584f;
  --accent: #53f2a9;
  --accent-strong: #31c985;
  --accent-soft: #102b20;
  --coral: #ff6b4a;
  --coral-soft: #351812;
}

body {
  background: var(--bg);
}

.app-shell {
  position: relative;
  isolation: isolate;
  background: var(--bg);
}

.topbar {
  background: rgba(11, 13, 12, 0.96);
  box-shadow: inset 0 -3px 0 #151a17;
}

.brand img {
  border-radius: 0;
}

.brand:hover img {
  transform: translate(-2px, -2px);
  box-shadow: 2px 2px 0 var(--accent), 4px 4px 0 var(--coral);
}

.brand-copy strong,
.sidebar-heading h1,
.ai-heading h2,
.page-header h1,
.settings-heading h2,
.draft-card h2 {
  font-family: "Cascadia Code", Consolas, monospace;
  letter-spacing: 0;
}

.nav-tab:hover,
.nav-tab.is-active {
  background: #151a17;
}

.nav-tab.is-active {
  box-shadow: inset 5px 0 0 var(--accent);
}

.nav-tab.is-active::after {
  right: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
}

.nav-tab::before {
  background: var(--accent);
  transition-timing-function: steps(4, end);
}

.connection-button:hover {
  color: #08100c;
  border-color: var(--accent);
  background: var(--accent);
}

.post-sidebar,
.ai-panel {
  background: var(--surface);
}

.editor-zone,
.editor-pane,
#markdownEditor {
  background: #0c0f0d;
}

.preview-pane,
.settings-form {
  background: #111512;
}

.editor-toolbar {
  background: rgba(12, 15, 13, 0.97);
  box-shadow: inset 0 -3px 0 #151a17;
}

input,
select,
textarea {
  background: #0d100e;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 3px 3px 0 rgba(83, 242, 169, 0.2);
}

.icon-button:hover,
.tool-button:hover {
  color: #08100c;
  border-color: var(--accent);
  background: var(--accent);
}

.button,
.icon-button,
.tool-button,
.provider-item,
.draft-card,
.segmented button,
.field input,
.field select,
.field textarea {
  transition-timing-function: steps(4, end);
}

.button.primary:hover {
  border-color: #9affcc;
  background: #9affcc;
  box-shadow: 4px 4px 0 rgba(255, 107, 74, 0.72);
  transform: translate(-2px, -2px);
}

.button.secondary:hover,
.button.ghost:hover {
  color: #08100c;
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: 3px 3px 0 rgba(83, 242, 169, 0.55);
}

.post-metrics,
.history-tools,
.segmented,
.provider-list,
.settings-layout,
.modal-card,
.confirm-summary,
.toast {
  box-shadow: 3px 3px 0 rgba(83, 242, 169, 0.07);
}

.ai-mark {
  box-shadow: 4px 4px 0 var(--coral-soft);
}

.ai-button:hover {
  box-shadow: 4px 4px 0 rgba(83, 242, 169, 0.62);
  transform: translate(-2px, -2px);
}

.provider-list {
  background: #0e110f;
}

.provider-item:hover,
.provider-item.is-active {
  background: #182019;
}

.provider-item.is-active {
  box-shadow: inset 5px 0 0 var(--accent);
}

.draft-card:hover {
  background: #151a17;
  box-shadow: inset 0 -3px 0 var(--accent);
}

.modal,
.modal-card {
  background: #0d100e;
}

@media (max-width: 680px) {
  .history-tools {
    background: #0d100e;
  }

  .provider-item {
    background: #0e110f;
  }

  .settings-form {
    background: #111512;
  }
}

/* Workspace backgrounds */
#workspace-write,
#workspace-ide {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - var(--topbar-height));
  overflow: hidden;
}

.workspace-backdrop {
  position: fixed;
  z-index: 0;
  inset: var(--topbar-height) 0 0;
  pointer-events: none;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

#workspace-write > .compose-grid,
#workspace-ide > .ide-studio {
  position: relative;
  z-index: 1;
}

#workspace-write.has-workspace-background .post-sidebar,
#workspace-write.has-workspace-background .ai-panel,
#workspace-write.has-workspace-background .editor-zone,
#workspace-write.has-workspace-background .editor-toolbar,
#workspace-write.has-workspace-background .github-syncbar,
#workspace-write.has-workspace-background .editor-pane,
#workspace-write.has-workspace-background .preview-pane {
  background-color: rgb(10 13 11 / var(--workspace-panel-alpha, 0.72));
  backdrop-filter: blur(13px);
}

#workspace-write.has-workspace-background .editor-pane,
#workspace-write.has-workspace-background .preview-pane {
  background-color: rgb(9 12 10 / var(--workspace-panel-soft-alpha, 0.59));
}

#workspace-write.has-workspace-background #markdownEditor {
  background-color: transparent;
}

#workspace-write.has-workspace-background .post-sidebar input,
#workspace-write.has-workspace-background .post-sidebar select,
#workspace-write.has-workspace-background .ai-panel input,
#workspace-write.has-workspace-background .ai-panel select,
#workspace-ide.has-workspace-background .ide-run-config label,
#workspace-ide.has-workspace-background .ide-run-config input,
#workspace-ide.has-workspace-background .ide-run-config select {
  background-color: rgb(9 13 10 / var(--workspace-panel-soft-alpha, 0.59));
}

.background-modal .modal-card {
  width: min(680px, calc(100vw - 28px));
}

.background-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.background-preset {
  min-width: 0;
  padding: 0 0 9px;
  overflow: hidden;
  border: 1px solid #303833;
  border-radius: 4px;
  color: var(--muted);
  background: #0a0d0b;
  cursor: pointer;
  text-align: left;
}

.background-preset:hover,
.background-preset.is-active {
  color: var(--ink);
  border-color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.background-preset strong {
  display: block;
  padding: 0 9px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-swatch {
  height: 68px;
  display: grid;
  place-items: center;
  margin-bottom: 9px;
  border-bottom: 1px solid #303833;
}

.preset-swatch svg {
  width: 20px;
  height: 20px;
}

.preset-none {
  color: #69736d;
  background-color: #111512;
}

.preset-grid {
  background-color: #101412;
  background-image: linear-gradient(rgba(83, 242, 169, 0.28) 1px, transparent 1px), linear-gradient(90deg, rgba(83, 242, 169, 0.28) 1px, transparent 1px);
  background-size: 10px 10px;
}

.preset-signal {
  background-color: #15121a;
  background-image: repeating-linear-gradient(135deg, transparent 0 12px, rgba(255, 107, 74, 0.32) 12px 14px), linear-gradient(90deg, rgba(92, 217, 255, 0.2), transparent 70%);
}

.preset-paper {
  background-color: #171513;
  background-image: repeating-linear-gradient(0deg, rgba(246, 236, 211, 0.07) 0 1px, transparent 1px 5px), linear-gradient(110deg, rgba(255, 196, 112, 0.16), transparent 50%);
}

.background-url-row,
.background-upload-row,
.background-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.background-url-row input {
  flex: 1;
  min-width: 0;
}

.background-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 150px;
  align-items: end;
}

/* Web IDE */
.ide-workspace {
  background: #090c0a;
}

.ide-studio {
  height: calc(100vh - var(--topbar-height));
  min-height: 610px;
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr);
  color: #d9e2dc;
  background: rgba(9, 12, 10, 0.97);
}

.has-workspace-background .ide-studio {
  background: rgb(9 12 10 / var(--workspace-panel-ghost-alpha, 0.35));
}

#workspace-ide.has-workspace-background .ide-commandbar,
#workspace-ide.has-workspace-background .ide-explorer,
#workspace-ide.has-workspace-background .ide-code-pane,
#workspace-ide.has-workspace-background .ide-preview-pane {
  background: rgb(10 14 11 / var(--workspace-panel-alpha, 0.72));
  backdrop-filter: blur(13px);
}

#workspace-ide.has-workspace-background .ide-tabs,
#workspace-ide.has-workspace-background .ide-code-editor,
#workspace-ide.has-workspace-background .ide-console {
  background: rgb(8 12 9 / var(--workspace-panel-soft-alpha, 0.59));
}

#workspace-ide.has-workspace-background .ide-tab:not(.is-active),
#workspace-ide.has-workspace-background .ide-line-numbers,
#workspace-ide.has-workspace-background .ide-preview-empty {
  background: rgb(10 14 11 / var(--workspace-panel-ghost-alpha, 0.35));
}

#workspace-ide.has-workspace-background .ide-tab.is-active,
#workspace-ide.has-workspace-background #ideCodeEditor,
#workspace-ide.has-workspace-background .ide-console-output {
  background: transparent;
}

.ide-commandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  border-bottom: 1px solid #29312c;
  background: rgba(13, 17, 14, 0.96);
  backdrop-filter: blur(13px);
}

.ide-run-config {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.ide-run-config label {
  min-width: 0;
  height: 34px;
  display: flex;
  align-items: center;
  border: 1px solid #303833;
  background: #0a0e0b;
}

.ide-run-config label > span {
  padding: 0 7px;
  color: #657169;
  font: 700 8px/1 "IBM Plex Mono", Consolas, monospace;
}

.ide-run-config input,
.ide-run-config select {
  height: 32px;
  min-width: 0;
  padding: 0 7px;
  border: 0;
  border-left: 1px solid #303833;
  border-radius: 0;
  color: #cad5ce;
  background: #101511;
  box-shadow: none;
  font: 10px/1 "IBM Plex Mono", Consolas, monospace;
}

.ide-run-config select { width: 135px; }
.ide-run-config input { width: 150px; }
.ide-ai-source select { width: 130px; }

.ide-server-button.is-running {
  color: #07100b;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 3px 3px 0 rgba(255, 107, 74, 0.75);
}

.ide-ai-button {
  color: #69dff4;
}

.ide-project-mark,
.ide-command-actions,
.ide-project-mark > span:last-child {
  min-width: 0;
  display: flex;
  align-items: center;
}

.ide-project-mark {
  gap: 10px;
}

.ide-project-mark > span:last-child {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}

.ide-project-mark strong {
  font: 700 11px/1.2 "IBM Plex Mono", Consolas, monospace;
}

.ide-project-mark small {
  color: #748079;
  font-size: 10px;
}

.ide-project-icon {
  width: 30px;
  height: 30px;
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  color: #07100b;
  background: var(--accent);
  box-shadow: 3px 3px 0 rgba(255, 107, 74, 0.65);
}

.ide-project-icon svg {
  width: 17px;
  height: 17px;
}

.ide-command-actions {
  justify-content: flex-end;
  gap: 7px;
}

.ide-run-button {
  height: 34px;
  min-width: 84px;
}

.ide-layout {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 210px minmax(360px, 1fr) minmax(340px, 42vw);
  overflow: hidden;
}

.ide-explorer,
.ide-code-pane,
.ide-preview-pane {
  min-width: 0;
  min-height: 0;
  background: rgba(11, 15, 12, 0.94);
  backdrop-filter: blur(13px);
}

.ide-explorer {
  border-right: 1px solid #29312c;
}

.ide-panel-title,
.ide-preview-head,
.ide-console-head {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 11px;
  color: #929f97;
  border-bottom: 1px solid #29312c;
  font: 650 10px/1 "IBM Plex Mono", Consolas, monospace;
}

.ide-panel-title > div,
.ide-preview-head > div {
  display: flex;
  align-items: center;
  gap: 3px;
}

.ide-panel-title button,
.ide-preview-head button,
.ide-preview-head a,
.ide-console-head button {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  color: #849088;
  background: transparent;
  cursor: pointer;
}

.ide-panel-title button:hover,
.ide-preview-head button:hover,
.ide-preview-head a:hover,
.ide-console-head button:hover {
  color: #06100a;
  border-color: var(--accent);
  background: var(--accent);
}

.ide-panel-title svg,
.ide-preview-head svg,
.ide-console-head svg {
  width: 14px;
  height: 14px;
}

.ide-folder-label {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  color: #b6c0ba;
  font: 700 10px/1 "IBM Plex Mono", Consolas, monospace;
}

.ide-folder-label svg {
  width: 14px;
  height: 14px;
}

.ide-file-list {
  padding: 1px 6px 12px;
}

.ide-file {
  width: 100%;
  height: 31px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px 0 calc(10px + var(--tree-depth, 0) * 14px);
  border: 0;
  color: #96a29a;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.ide-tree-folder {
  width: 100%;
  height: 29px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px 0 calc(6px + var(--tree-depth, 0) * 14px);
  border: 0;
  color: #abb5af;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.ide-tree-folder:hover {
  color: #e5ede8;
  background: #151b17;
}

.ide-tree-folder svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

.ide-tree-folder span {
  overflow: hidden;
  font: 600 11px/1.2 "IBM Plex Mono", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ide-file:hover {
  color: #e5ede8;
  background: #151b17;
}

.ide-file.is-active {
  color: #07100b;
  background: var(--accent);
  box-shadow: 3px 0 0 #ff6b4a;
}

.ide-file svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.ide-file span {
  overflow: hidden;
  font: 500 12px/1.2 "IBM Plex Mono", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ide-code-pane {
  display: grid;
  grid-template-rows: 39px minmax(0, 1fr) 25px;
  border-right: 1px solid #29312c;
}

.ide-tabs {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  border-bottom: 1px solid #29312c;
  background: rgba(10, 13, 11, 0.96);
  scrollbar-width: thin;
}

.ide-tab {
  min-width: 118px;
  max-width: 190px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 0;
  border-right: 1px solid #29312c;
  color: #7c8881;
  background: #0c100d;
  cursor: pointer;
}

.ide-tab.is-active {
  color: #e7eee9;
  background: #101511;
  box-shadow: inset 0 2px 0 var(--accent);
}

.ide-tab svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

.ide-tab span {
  overflow: hidden;
  font: 500 11px/1.2 "IBM Plex Mono", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ide-code-editor {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  overflow: hidden;
  background: rgba(9, 13, 10, 0.9);
}

.ide-completion {
  position: absolute;
  z-index: 4;
  right: 14px;
  bottom: 14px;
  width: min(470px, calc(100% - 72px));
  max-height: 46%;
  display: grid;
  grid-template-rows: 31px minmax(0, 1fr) 36px;
  overflow: hidden;
  border: 1px solid var(--accent);
  color: #dbe8e0;
  background: rgba(7, 11, 8, 0.97);
  box-shadow: 6px 6px 0 rgba(255, 107, 74, 0.52);
}

.ide-completion > div:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  color: var(--accent);
  border-bottom: 1px solid #29312c;
  font: 700 9px/1 "IBM Plex Mono", Consolas, monospace;
}

.ide-completion > div:first-child svg {
  width: 13px;
  height: 13px;
}

.ide-completion pre {
  margin: 0;
  padding: 10px 12px;
  overflow: auto;
  color: #cbd9d0;
  font: 11px/1.55 "IBM Plex Mono", Consolas, monospace;
  white-space: pre-wrap;
}

.ide-completion-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  padding: 4px 6px;
  border-top: 1px solid #29312c;
}

.ide-completion-actions button {
  height: 27px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid #354139;
  color: #cad6ce;
  background: #111713;
  cursor: pointer;
}

.ide-completion-actions button:hover {
  color: #07100b;
  border-color: var(--accent);
  background: var(--accent);
}

.ide-completion-actions svg {
  width: 13px;
  height: 13px;
}

.ide-line-numbers,
#ideCodeEditor {
  margin: 0;
  padding-top: 15px;
  padding-bottom: 24px;
  border: 0;
  border-radius: 0;
  font: 13px/1.7 "IBM Plex Mono", Consolas, monospace;
  tab-size: 2;
  white-space: pre;
}

.ide-line-numbers {
  padding-right: 12px;
  color: #4f5b54;
  border-right: 1px solid #1d241f;
  background: rgba(8, 11, 9, 0.72);
  text-align: right;
  user-select: none;
  overflow: hidden;
}

#ideCodeEditor {
  width: 100%;
  height: 100%;
  resize: none;
  padding-right: 20px;
  padding-left: 17px;
  color: #d7e2dc;
  background: transparent;
  outline: 0;
  overflow: auto;
}

#ideCodeEditor:focus {
  box-shadow: none;
}

#ideCodeEditor::selection {
  color: #041008;
  background: var(--accent);
}

.ide-statusbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 0 10px;
  color: #26352c;
  background: var(--accent);
  font: 700 9px/1 "IBM Plex Mono", Consolas, monospace;
}

.ide-statusbar span:first-child {
  margin-right: auto;
}

.ide-statusbar svg {
  width: 11px;
  height: 11px;
  vertical-align: -2px;
}

.ide-preview-pane {
  display: grid;
  grid-template-rows: 38px minmax(230px, 1fr) minmax(150px, 34%);
  background: rgba(8, 11, 9, 0.9);
}

.ide-preview-head > span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ide-preview-frame-wrap {
  position: relative;
  min-height: 0;
  margin: 10px;
  overflow: hidden;
  border: 1px solid #29312c;
  background: #fff;
}

#idePreview {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #fff;
}

.ide-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #7a857e;
  background: #111512;
  font: 600 11px/1 "IBM Plex Mono", Consolas, monospace;
}

.ide-preview-empty.is-loading svg {
  animation: ide-spin 0.7s steps(8, end) infinite;
}

@keyframes ide-spin {
  to { transform: rotate(360deg); }
}

.ide-console {
  min-height: 0;
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr);
  border-top: 1px solid #29312c;
  background: rgba(7, 10, 8, 0.86);
}

.ide-console-head {
  height: 34px;
}

.ide-console-head > div,
.ide-stdin-field {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ide-stdin-field span {
  color: #5f6b64;
  font-size: 8px;
}

.ide-stdin-field input {
  width: 130px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid #2a332d;
  border-radius: 0;
  color: #aebbb3;
  background: #080b09;
  box-shadow: none;
  font: 9px/1 "IBM Plex Mono", Consolas, monospace;
}

.ide-console-output {
  min-height: 0;
  padding: 5px 10px 12px;
  overflow: auto;
  color: #9ba69f;
  font: 11px/1.65 "IBM Plex Mono", Consolas, monospace;
}

.ide-console-line {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(45, 54, 48, 0.55);
  word-break: break-word;
}

.ide-console-line time {
  color: #4d5a52;
}

.ide-console-line.is-system { color: #69dff4; }
.ide-console-line.is-warn { color: #f2c766; }
.ide-console-line.is-error { color: #ff8066; }

.ide-file-modal .modal-card {
  width: min(430px, calc(100vw - 28px));
}

@media (max-width: 1180px) {
  .ide-commandbar {
    flex-wrap: wrap;
    min-height: 94px;
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .ide-run-config {
    order: 3;
    width: 100%;
  }

  .ide-run-config label {
    flex: 1;
  }

  .ide-run-config input,
  .ide-run-config select {
    width: 100%;
  }

  .ide-studio {
    height: calc(100vh - var(--topbar-height));
    min-height: calc(100vh - var(--topbar-height));
  }

  .ide-layout {
    grid-template-columns: 176px minmax(300px, 1fr) minmax(300px, 38vw);
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
  }

  .ide-preview-pane {
    grid-column: auto;
    grid-template-rows: 38px minmax(230px, 1fr) minmax(130px, 30%);
    border-top: 0;
  }
}

@media (max-width: 860px) and (min-width: 681px) {
  .ide-studio {
    height: auto;
  }

  .ide-layout {
    grid-template-columns: 176px minmax(0, 1fr);
    grid-template-rows: minmax(520px, calc(100vh - var(--topbar-height) - 94px)) 500px;
    overflow: visible;
  }

  .ide-preview-pane {
    grid-column: 1 / -1;
    grid-template-rows: 38px minmax(290px, 1fr) 150px;
    border-top: 1px solid #29312c;
  }
}

@media (max-width: 680px) {
  .connection-button .connection-copy {
    display: none;
  }

  .connection-button {
    padding: 0;
    justify-content: center;
  }

  .connection-avatar {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
  }

  .forum-account-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .forum-account-avatar {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .forum-account-card dl {
    grid-column: 1 / -1;
    padding-top: 11px;
    border-top: 1px solid var(--line);
  }

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

  .background-controls {
    grid-template-columns: 1fr;
  }

  .background-upload-row {
    align-items: stretch;
    flex-direction: column;
  }

  .background-upload-row .button {
    width: 100%;
  }

  .ide-studio {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .ide-commandbar {
    min-height: 58px;
    padding: 7px 10px;
  }

  .ide-run-config {
    gap: 4px;
    overflow-x: auto;
  }

  .ide-run-config label {
    min-width: 150px;
    flex: 0 0 auto;
  }

  .ide-ai-source {
    display: none !important;
  }

  .ide-project-mark small,
  .ide-command-actions .labeled-tool span {
    display: none;
  }

  .ide-command-actions {
    gap: 3px;
  }

  .ide-command-actions .tool-button,
  .ide-command-actions .button {
    min-width: 30px;
  }

  .ide-command-actions .labeled-tool {
    width: 32px;
  }

  .ide-layout {
    display: block;
  }

  .ide-explorer {
    border-right: 0;
    border-bottom: 1px solid #29312c;
  }

  .ide-folder-label {
    display: none;
  }

  .ide-file-list {
    display: flex;
    gap: 4px;
    padding: 7px;
    overflow-x: auto;
  }

  .ide-file {
    width: auto;
    min-width: 112px;
    padding-left: 9px;
    border: 1px solid #29312c;
  }

  .ide-tree-folder {
    min-width: 112px;
    border: 1px solid #29312c;
  }

  .ide-completion {
    right: 8px;
    bottom: 8px;
    width: calc(100% - 70px);
  }

  .ide-stdin-field {
    display: none;
  }

  .ide-code-pane {
    height: 66vh;
    min-height: 480px;
    border-right: 0;
    border-bottom: 1px solid #29312c;
  }

  .ide-preview-pane {
    height: 560px;
    grid-template-rows: 38px 330px 192px;
  }

  .ide-statusbar {
    gap: 9px;
  }

  .ide-statusbar span:nth-last-child(2) {
    display: none;
  }
}
