:root {
  --bg: #f4f5f3;
  --surface: #ffffff;
  --surface-soft: #eef2ef;
  --surface-warm: #fff6ec;
  --ink: #1d2824;
  --muted: #68736e;
  --faint: #98a19c;
  --line: #dce2de;
  --line-strong: #c8d0cb;
  --accent: #087a65;
  --accent-strong: #05624f;
  --accent-soft: #e3f3ee;
  --coral: #d45d43;
  --coral-soft: #fff0eb;
  --warning: #9c6413;
  --warning-soft: #fff4dc;
  --danger: #b33e37;
  --shadow: 0 16px 50px rgba(26, 45, 37, 0.14);
  --radius: 8px;
  --topbar-height: 66px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  background: var(--bg);
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

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

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-copy strong {
  font-size: 14px;
  line-height: 1.25;
}

.brand-copy small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.nav-tab {
  min-width: 88px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

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

.nav-tab.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(31, 48, 40, 0.1);
}

.nav-tab svg,
.connection-button svg {
  width: 16px;
  height: 16px;
}

.nav-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
}

.topbar-actions {
  justify-self: end;
}

.connection-button {
  height: 38px;
  max-width: 220px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.connection-button:hover {
  border-color: var(--line-strong);
}

.connection-button.is-connected {
  border-color: #b8d9cf;
  background: #f8fcfa;
}

.connection-button span:not(.status-dot) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #a4aca7;
  box-shadow: 0 0 0 3px #eef0ef;
}

.is-connected .status-dot {
  background: #18a77c;
  box-shadow: 0 0 0 3px #dff3ec;
}

.workspace {
  display: none;
}

.workspace.is-active {
  display: block;
}

.compose-grid {
  min-height: calc(100vh - var(--topbar-height));
  display: grid;
  grid-template-columns: 260px minmax(430px, 1fr) 302px;
  max-width: 1680px;
  margin: 0 auto;
}

.post-sidebar,
.ai-panel {
  min-width: 0;
  padding: 24px 18px;
  background: var(--surface);
}

.post-sidebar {
  border-right: 1px solid var(--line);
}

.ai-panel {
  border-left: 1px solid var(--line);
}

.sidebar-heading,
.ai-heading,
.page-header,
.settings-heading,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.sidebar-heading {
  margin-bottom: 24px;
}

.eyebrow {
  display: block;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

.sidebar-heading h1,
.page-header h1 {
  margin-top: 3px;
  font-size: 23px;
  line-height: 1.25;
}

.icon-button,
.tool-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
}

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

.icon-button svg,
.tool-button svg {
  width: 16px;
  height: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 17px;
}

.field > span,
.range-field > span {
  color: #3f4b46;
  font-size: 12px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  background: var(--surface);
}

input,
select {
  height: 40px;
  padding: 0 11px;
}

textarea {
  padding: 10px 11px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 122, 101, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: #9ba49f;
}

.post-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 23px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.post-metrics div {
  min-width: 0;
  padding: 10px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface);
}

.post-metrics strong {
  font-size: 15px;
}

.post-metrics span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.sidebar-actions {
  display: grid;
  gap: 9px;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.button svg {
  width: 16px;
  height: 16px;
}

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

.button.primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

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

.button.secondary:hover,
.button.ghost:hover {
  border-color: #b8d9cf;
  background: var(--accent-soft);
}

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

.button:disabled,
.icon-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.button.is-loading svg {
  animation: spin 850ms linear infinite;
}

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

.forum-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.summary-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
}

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

.forum-summary div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.forum-summary strong,
.forum-summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-summary strong {
  font-size: 12px;
}

.forum-summary div span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.editor-zone {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.editor-toolbar {
  position: sticky;
  z-index: 8;
  top: var(--topbar-height);
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(29, 40, 36, 0.03);
}

.toolbar-section {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

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

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

.tool-button:disabled {
  color: #b1b9b5;
  background: transparent;
}

.tool-button:focus-visible {
  outline: 3px solid rgba(8, 122, 101, 0.18);
  outline-offset: 1px;
}

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

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

.labeled-tool {
  width: auto;
  min-width: 64px;
  padding: 0 9px;
  gap: 6px;
}

.labeled-tool span {
  font-size: 11px;
  font-weight: 650;
}

.toolbar-separator {
  width: 1px;
  height: 20px;
  margin: 0 3px;
  background: var(--line);
}

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

.editor-pane,
.preview-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.editor-pane {
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.preview-pane {
  background: var(--bg);
}

.pane-label {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  font-weight: 700;
}

#markdownEditor {
  min-height: calc(100vh - var(--topbar-height) - 88px);
  flex: 1;
  padding: 24px 22px 120px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  resize: none;
  font: 13.5px/1.78 "Cascadia Code", Consolas, "Microsoft YaHei", monospace;
}

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

.markdown-body {
  min-height: 100%;
  padding: 24px 26px 120px;
  overflow-wrap: anywhere;
  color: #25302c;
  font-size: 14px;
  line-height: 1.78;
}

.markdown-body.is-empty {
  display: grid;
  place-items: center;
}

.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--faint);
}

.preview-empty svg {
  width: 28px;
  height: 28px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 1.5em 0 0.55em;
  color: var(--ink);
  line-height: 1.35;
}

.markdown-body h1 { font-size: 24px; border-bottom: 1px solid var(--line); padding-bottom: 9px; }
.markdown-body h2 { font-size: 20px; border-bottom: 1px solid var(--line); padding-bottom: 7px; }
.markdown-body h3 { font-size: 17px; }
.markdown-body p { margin: 0.8em 0; }
.markdown-body a { color: var(--accent); }
.markdown-body img { max-width: 100%; border-radius: 6px; }
.markdown-body blockquote { margin: 1em 0; padding: 5px 14px; border-left: 3px solid var(--accent); color: var(--muted); background: var(--accent-soft); }
.markdown-body code { padding: 2px 5px; border-radius: 4px; color: #9d3f2d; background: var(--coral-soft); font-family: "Cascadia Code", Consolas, monospace; }
.markdown-body pre { overflow-x: auto; padding: 15px; border: 1px solid var(--line); border-radius: 6px; background: #202825; color: #e8eeeb; }
.markdown-body pre code { padding: 0; color: inherit; background: transparent; }
.markdown-body table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.markdown-body th,
.markdown-body td { padding: 8px 10px; border: 1px solid var(--line-strong); text-align: left; }
.markdown-body th { background: var(--surface-soft); }

.ai-panel {
  display: flex;
  flex-direction: column;
}

.ai-heading {
  justify-content: flex-start;
  margin-bottom: 24px;
}

.ai-heading h2 {
  margin-top: 2px;
  font-size: 18px;
}

.ai-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--coral);
}

.ai-mark svg {
  width: 18px;
  height: 18px;
}

.grow-field {
  flex: 1;
  min-height: 200px;
}

.grow-field textarea {
  min-height: 180px;
  flex: 1;
  line-height: 1.65;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.segmented button {
  min-height: 31px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.segmented button.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(31, 48, 40, 0.12);
}

.toggle-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  cursor: pointer;
}

.toggle-row > span:first-child {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.toggle-row strong {
  font-size: 12px;
  font-weight: 650;
}

.toggle-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.toggle-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
  border-radius: 12px;
  background: #c9d0cc;
  transition: background-color 130ms ease;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 37, 29, 0.25);
  transition: transform 130ms ease;
}

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

.toggle-row input:checked + .toggle::after {
  transform: translateX(16px);
}

.toggle-row input:focus-visible + .toggle {
  outline: 3px solid rgba(8, 122, 101, 0.2);
}

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

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

.ai-profile-status {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
}

.ai-profile-status svg {
  width: 14px;
  height: 14px;
}

.ai-profile-status button {
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
}

.content-workspace {
  max-width: 1180px;
  margin: 0 auto;
  padding: 42px 28px 80px;
}

.page-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.draft-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 24px;
}

.draft-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.draft-card-header,
.draft-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.draft-card h2 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.draft-card p {
  height: 43px;
  margin: 11px 0 15px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.draft-card-footer {
  color: var(--faint);
  font-size: 10px;
}

.draft-actions {
  display: flex;
  gap: 5px;
}

.draft-actions .icon-button {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 320px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-state div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.empty-state svg {
  width: 36px;
  height: 36px;
  color: var(--faint);
}

.settings-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 560px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.provider-list {
  padding: 12px;
  border-right: 1px solid var(--line);
  background: #f0f3f1;
}

.provider-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

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

.provider-item.is-active {
  box-shadow: 0 1px 3px rgba(31, 48, 40, 0.1);
}

.provider-symbol {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: var(--provider-color, var(--accent));
  font-size: 10px;
  font-weight: 750;
}

.provider-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.provider-copy strong,
.provider-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-copy strong { font-size: 12px; }
.provider-copy small { color: var(--faint); font-size: 9px; margin-top: 2px; }

.settings-form {
  padding: 30px;
}

.settings-heading {
  justify-content: flex-start;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.settings-heading h2 {
  font-size: 18px;
}

.settings-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.provider-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 750;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  max-width: 720px;
  padding-top: 24px;
}

.full-width {
  grid-column: 1 / -1;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 44px;
}

.password-field .icon-button {
  position: absolute;
  top: 3px;
  right: 3px;
  border-color: transparent;
}

.range-field > span {
  display: flex;
  justify-content: space-between;
}

.range-field output {
  color: var(--accent);
}

input[type="range"] {
  height: 22px;
  padding: 0;
  border: 0;
  accent-color: var(--accent);
  box-shadow: none;
}

.compact-toggle {
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  max-width: 720px;
  margin-top: 8px;
}

.local-only {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.local-only svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.modal {
  width: min(460px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(20, 30, 26, 0.48);
  backdrop-filter: blur(2px);
}

.modal-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.modal-header {
  margin-bottom: 22px;
}

.modal-header h2,
.confirm-modal h2,
.success-modal h2 {
  margin-top: 3px;
  font-size: 20px;
}

.security-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d5e8e1;
  border-radius: 6px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 11px;
}

.security-note svg {
  width: 15px;
  height: 15px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.modal-actions .button {
  min-width: 120px;
}

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

.confirm-modal,
.success-modal {
  width: min(430px, calc(100vw - 28px));
  text-align: center;
}

.confirm-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  color: var(--warning);
  background: var(--warning-soft);
}

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

.confirm-icon svg {
  width: 21px;
  height: 21px;
}

.confirm-modal p,
.success-modal p {
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.6;
}

.confirm-summary {
  margin: 18px 0 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  text-align: left;
}

.confirm-summary div {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 8px;
  padding: 4px 0;
}

.confirm-summary dt {
  color: var(--muted);
}

.confirm-summary dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  width: min(360px, calc(100vw - 36px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(26, 45, 37, 0.16);
  pointer-events: auto;
}

.toast svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.toast.is-error svg {
  color: var(--danger);
}

.toast button {
  padding: 0;
  border: 0;
  color: var(--faint);
  background: transparent;
  cursor: pointer;
}

@media (max-width: 1180px) {
  .compose-grid {
    grid-template-columns: 230px minmax(390px, 1fr) 270px;
  }

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

  .editor-split {
    grid-template-columns: 1fr;
  }

  .preview-pane {
    display: none;
  }
}

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

  .brand-copy {
    display: none;
  }

  .main-nav {
    justify-self: center;
  }

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

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

  .nav-count {
    position: absolute;
    margin: -24px -27px 0 0;
  }

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

  .connection-button #connectionLabel,
  .connection-button svg {
    display: none;
  }

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

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

  .grow-field {
    min-height: 170px;
  }

  .settings-layout {
    grid-template-columns: 180px minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  :root {
    --topbar-height: 58px;
  }

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

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

  .main-nav {
    gap: 2px;
  }

  .nav-tab {
    width: 38px;
    min-width: 38px;
  }

  .compose-grid {
    display: block;
  }

  .post-sidebar,
  .ai-panel {
    border: 0;
  }

  .post-sidebar {
    border-bottom: 1px solid var(--line);
  }

  .post-metrics,
  .forum-summary {
    display: none;
  }

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

  .editor-toolbar {
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: thin;
  }

  .toolbar-section,
  .toolbar-group {
    flex: 0 0 auto;
  }

  .file-tools {
    padding-right: 6px;
  }

  .labeled-tool {
    width: 32px;
    min-width: 32px;
    padding: 0;
  }

  .labeled-tool span {
    display: none;
  }

  #markdownEditor {
    min-height: 65vh;
    padding: 20px 16px 80px;
  }

  .ai-panel {
    min-height: 480px;
  }

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

  .page-header {
    align-items: flex-end;
  }

  .draft-list {
    grid-template-columns: 1fr;
  }

  .settings-layout {
    display: block;
    border: 0;
    background: transparent;
  }

  .provider-list {
    display: flex;
    gap: 6px;
    padding: 0 0 12px;
    overflow-x: auto;
    border: 0;
    background: transparent;
  }

  .provider-item {
    width: auto;
    min-width: 105px;
    border: 1px solid var(--line);
    background: var(--surface);
  }

  .provider-copy small {
    display: none;
  }

  .settings-form {
    padding: 20px 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

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

  .full-width {
    grid-column: auto;
  }

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

  .modal-card {
    padding: 20px;
  }
}

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