:root {
  color-scheme: light;
  --bg-warm: #f2f0eb;
  --bg-base: #fafaf8;
  --bg-pure: #ffffff;
  --bg-subtle: #f0ede7;
  --text: #3a3837;
  --heading: #2c2b29;
  --secondary: #6b665f;
  --muted: #a7a198;
  --accent: #8b3525;
  --accent-hover: #a84030;
  --accent-subtle: #f5e8e5;
  --border: #e5e1da;
  --border-strong: #c8c3ba;
  --focus: rgba(139, 53, 37, 0.4);
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --font-body: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --font-ui: "SF Pro Text", system-ui, -apple-system, "Noto Sans SC", "PingFang SC", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
  --color-bg-pure: var(--bg-pure);
  --color-bg-subtle: var(--bg-subtle);
  --color-text-primary: var(--text);
  --color-text-secondary: var(--secondary);
  --color-text-muted: var(--muted);
  --color-text-heading: var(--heading);
  --color-accent: var(--accent);
  --color-accent-subtle: var(--accent-subtle);
  --color-border-subtle: var(--border);
  --color-border-strong: var(--border-strong);
  --text-xs: 0.694rem;
  --text-sm: 0.833rem;
  --text-base: 1rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.25rem;
  --leading-tight: 1.25;
  --leading-snug: 1.45;
  --tracking-wider: 0.15em;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --radius: 4px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg-warm: #1a1816;
  --bg-base: #201e1b;
  --bg-pure: #242220;
  --bg-subtle: #2a2724;
  --text: #e8e3dc;
  --heading: #f0ebe3;
  --secondary: #a9a198;
  --muted: #6d675f;
  --accent: #c4533e;
  --accent-hover: #d9614a;
  --accent-subtle: #2e1a16;
  --border: #2e2b27;
  --border-strong: #403c37;
  --focus: rgba(196, 83, 62, 0.4);
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-warm);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

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

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background: var(--bg-warm);
}

.login-screen[hidden] {
  display: none;
}

.login-panel {
  width: min(420px, 100%);
  padding: var(--space-8);
  border: 1px solid var(--border);
  background: var(--bg-pure);
}

.login-panel h1 {
  margin: 0 0 var(--space-6);
  color: var(--heading);
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1.25;
  letter-spacing: 0.08em;
}

.login-panel .primary-button {
  width: 100%;
  margin-top: var(--space-5);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-6) clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--border);
  background: var(--bg-base);
}

.topbar h1 {
  margin: 0;
  color: var(--heading);
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: 0.08em;
}

.topbar h1::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 10px;
  background: var(--accent);
  vertical-align: baseline;
}

.topbar p,
.eyebrow {
  margin: var(--space-1) 0 0;
  color: var(--secondary);
  font-size: 13px;
}

.topbar-actions,
.editor-actions,
.pager,
.body-tools,
.tabs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.input-button-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
}

.asset-status {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-pure);
  color: var(--secondary);
  font-size: 14px;
}

.asset-status.ready {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.workspace {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(330px, 430px) minmax(0, 1fr);
}

.list-panel {
  min-width: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
}

.editor-panel {
  min-width: 0;
  background: var(--bg-base);
  overflow: auto;
}

.filters {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.search-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: 32px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-pure);
}

.search-field input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  min-height: auto;
  padding: 0;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.filter-row select {
  flex: 1 1 auto;
  min-width: 60px;
}

.article-list {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-3);
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-pure);
  color: var(--text);
  font-size: 14px;
  min-height: 32px;
  padding: 4px 8px;
}

textarea {
  padding: var(--space-2) var(--space-3);
  font-size: 16px;
  min-height: auto;
}

.list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border);
  color: var(--secondary);
  font-size: 13px;
}

.list-toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
}

.list-toolbar-left select {
  width: auto;
  min-width: 44px;
}

.article-list {
  overflow: auto;
}

.article-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: var(--space-3) var(--space-5);
  transition: background 180ms ease, border-color 180ms ease;
}

.article-item:hover,
.article-item.active {
  background: var(--bg-pure);
}

.article-item.active {
  border-left: 3px solid var(--accent);
}

.article-item-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.article-item-meta {
  color: var(--secondary);
  font-size: 11px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.article-item-meta:not(:last-of-type)::after {
  content: "·";
  margin-left: var(--space-2);
  color: var(--color-border-strong);
}

.article-item-top .badge {
}

.article-item-badges {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.article-item-title {
  display: block;
  overflow: hidden;
  color: var(--heading);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--secondary);
  padding: 1px 6px;
  font-size: 12px;
}

.badge.draft {
  color: var(--accent);
  background: var(--accent-subtle);
  border-color: transparent;
}

.badge.pinned-badge {
  color: var(--accent);
  background: var(--accent-subtle);
  border-color: transparent;
}

.editor-panel form {
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--space-8) clamp(18px, 4vw, 48px);
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.editor-header > div:first-child {
  min-width: 0;
  flex: 1;
}

.editor-header .eyebrow {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-header h2 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--heading);
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.35;
}

.form-band,
.advanced-panel {
  margin-bottom: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-pure);
}

.form-band.compact {
  margin: 0;
  padding: var(--space-4) 0 0;
  border: 0;
}

label span {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--secondary);
  font-size: 13px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.form-band > * + *,
.advanced-panel label + label {
  margin-top: var(--space-5);
}

.toggle-row {
  display: flex;
  gap: var(--space-5);
  color: var(--secondary);
}

.toggle-row label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toggle-row input {
  width: auto;
  min-height: auto;
}

.advanced-panel summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 650;
}

.body-tools {
  justify-content: space-between;
  margin-top: var(--space-6);
  border-bottom: 1px solid var(--border);
  color: var(--secondary);
}

.tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--secondary);
  padding: var(--space-3) var(--space-4);
}

.tab.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.markdown-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-top: 0;
  background: var(--bg-soft);
}

.markdown-toolbar button {
  min-width: 34px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--secondary);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
}

.markdown-toolbar button:hover,
.markdown-toolbar button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-pure);
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tag-pill {
  min-height: 30px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-pure);
  color: var(--secondary);
  font-size: 13px;
}

.tag-pill:hover,
.tag-pill:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.tag-pill.active {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
}

.form-band input,
.form-band select {
  font-size: 16px;
}

.tags-section {
  margin-top: var(--space-5) !important;
  display: block;
}

.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  min-height: 32px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-pure);
  cursor: text;
}

.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.tag-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 4px 1px 7px;
  border-radius: 3px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  line-height: 1.6;
}

.tag-pill-remove {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.tag-pill-remove:hover {
  opacity: 1;
  background: var(--accent);
  color: #fff;
}

#tagEntryInput {
  flex: 1 1 80px;
  min-width: 60px;
  min-height: 24px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  padding: 0;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

#bodyInput {
  min-height: 56vh;
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  font-family: var(--font-mono);
  line-height: 1.75;
}

.preview-panel {
  min-height: 56vh;
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--bg-pure);
}

.preview-panel .article-container {
  width: 100%;
}

.preview-panel .article-header {
  margin-bottom: var(--space-12);
}

.preview-panel .article-header-poetry {
  margin-bottom: var(--space-8);
}

.preview-panel .article-title {
  margin: 0 0 var(--space-6);
  color: var(--color-text-heading);
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
}

.preview-panel .poetry-title {
  margin: 0 0 var(--space-6);
  color: var(--color-text-heading);
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: 0.02em;
  text-align: center;
}

.preview-panel .poetry-subtitle {
  max-width: 100%;
  margin: calc(-1 * var(--space-3)) 0 var(--space-8);
  color: var(--color-text-secondary);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: var(--leading-snug);
  text-align: center;
}

.preview-panel .article-subtitle {
  max-width: 100%;
  margin: calc(-1 * var(--space-3)) 0 var(--space-6);
  padding-left: var(--space-5);
  border-left: 2px solid var(--color-border-strong);
  color: var(--color-text-secondary);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: var(--leading-snug);
}

.preview-panel .article-meta {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.preview-panel .article-meta > *:not(:last-child)::after {
  content: "·";
  margin-left: var(--space-2);
  color: var(--color-border-strong);
}

.preview-panel .article-content {
  --article-indent: calc(var(--text-md) + var(--text-md));
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 2;
  letter-spacing: 0.025em;
  overflow-wrap: break-word;
  word-break: break-word;
}

.article-content p {
  margin: 0 0 var(--space-5);
  text-align: justify;
  text-align-last: left;
  text-indent: var(--article-indent);
  text-justify: inter-ideograph;
}

.article-container.is-poetry .article-content {
  max-width: min(100%, 560px);
  margin-inline: auto;
  text-align: center;
}

.article-container.is-poetry .article-content p {
  margin-bottom: var(--space-8);
  text-align: center;
  text-align-last: center;
  text-indent: 0;
  line-height: 2.15;
}

.article-container.is-poetry .article-content h1,
.article-container.is-poetry .article-content h2,
.article-container.is-poetry .article-content h3,
.article-container.is-poetry .article-content h4 {
  padding-left: 0;
  text-align: center;
}

.article-container.is-poetry .heading-marker {
  display: none;
}

.article-container.is-poetry .article-content blockquote p {
  margin-bottom: 0;
  text-indent: 0;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  position: relative;
  padding-left: var(--article-indent);
  text-indent: 0;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--color-text-heading);
}

.article-content h1 {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  margin: var(--space-16) 0 var(--space-6);
}

.article-content h2 {
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  margin: var(--space-16) 0 var(--space-6);
}

.article-content h3 {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  margin: var(--space-12) 0 var(--space-4);
}

.article-content h1:first-child,
.article-content h2:first-child,
.article-content h3:first-child {
  margin-top: 0;
}

.heading-marker {
  position: absolute;
  left: var(--article-indent);
  top: 50%;
  transform: translate(calc(-100% - var(--space-2)), -50%);
  font-family: var(--font-ui);
  color: var(--color-accent);
  font-weight: 500;
  font-size: 0.42em;
  line-height: 1;
  letter-spacing: 0.05em;
  opacity: 0.5;
  pointer-events: none;
  white-space: nowrap;
}

.article-content blockquote {
  border-left: 2px solid var(--color-accent);
  background: var(--color-bg-subtle);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-8) 0;
  color: var(--color-text-secondary);
  line-height: 2;
}

.article-content blockquote p {
  text-indent: 0;
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

.article-content ul,
.article-content ol {
  margin: 0 0 var(--space-5);
  padding-left: var(--article-indent);
  list-style-position: outside;
}

.article-content li {
  margin-bottom: var(--space-2);
}

.article-content li::marker {
  color: var(--color-text-muted);
}

.article-content hr {
  border: none;
  text-align: center;
  margin: var(--space-16) 0;
}

.article-content hr::after {
  content: "***";
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-border-strong);
  letter-spacing: 0.5em;
}

.article-content a {
  color: var(--color-text-primary);
  text-decoration: underline;
  text-decoration-color: var(--color-border-strong);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.article-content strong,
.article-content b {
  font-weight: 700;
  color: var(--color-text-heading);
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.article-content em {
  font-style: italic;
}

.article-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-bg-subtle);
  padding: 2px 6px;
  border-radius: 3px;
}

.article-content pre {
  margin: var(--space-8) 0;
  padding: var(--space-4);
  overflow-x: auto;
  background: var(--color-bg-subtle);
  border-left: 3px solid var(--color-border-strong);
}

.article-content pre code {
  padding: 0;
  background: none;
  border-radius: 0;
  font-size: var(--text-sm);
  line-height: 1.6;
}

.article-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: var(--space-8) 0;
  border-radius: 2px;
}

.article-figure {
  margin: var(--space-8) 0;
}

.article-figure img {
  width: 100%;
  margin: 0;
}

.article-figure figcaption {
  margin-top: var(--space-3);
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  text-align: center;
}

.article-content table {
  width: 100%;
  margin: var(--space-6) 0 var(--space-8);
  border-collapse: collapse;
  border: 1px solid var(--color-border-subtle);
  font-size: var(--text-sm);
}

.article-content thead {
  border-bottom: 2px solid var(--color-border-strong);
}

.article-content th,
.article-content td {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-subtle);
  text-align: left;
  vertical-align: top;
}

.article-content th {
  color: var(--color-text-heading);
  font-family: var(--font-ui);
  font-weight: 600;
  background: var(--color-bg-subtle);
}

.article-content tbody tr:nth-child(even) {
  background: var(--color-bg-subtle);
}

.article-content mark {
  padding: 2px 4px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 2px;
  background: var(--color-accent-subtle);
  color: var(--color-text-primary);
}

.article-content kbd {
  padding: 2px 6px;
  border: 1px solid var(--color-border-strong);
  border-radius: 3px;
  background: var(--color-bg-subtle);
  box-shadow: 0 1px 0 var(--color-border-strong);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.article-content details {
  margin: var(--space-6) 0;
  padding: var(--space-4);
  background: var(--color-bg-subtle);
  border-radius: 4px;
}

.article-content summary {
  color: var(--color-text-heading);
  font-family: var(--font-ui);
  font-weight: 500;
  cursor: pointer;
}

.pull-quote {
  margin: var(--space-24) 0;
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
  padding: var(--space-12) 0;
}

.pull-quote-label {
  display: block;
  margin-bottom: var(--space-6);
  color: var(--color-text-secondary);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wider);
}

.pull-quote-text {
  margin-bottom: var(--space-8);
  color: var(--color-text-heading);
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-style: italic;
  font-weight: 500;
  line-height: var(--leading-snug);
  text-indent: 0;
}

.pull-quote-attribution {
  width: 40px;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-strong);
}

.pull-quote-author {
  color: var(--color-text-heading);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  white-space: nowrap;
}

.callout {
  margin: var(--space-8) 0;
  padding: var(--space-5) var(--space-6);
  border-left: 3px solid var(--color-border-strong);
  background-color: var(--color-bg-subtle);
}

.callout-note {
  border-left-color: var(--color-border-strong);
}

.callout-tip {
  border-left-color: var(--color-text-muted);
}

.callout-warning {
  border-left-color: var(--color-accent);
  background-color: var(--color-accent-subtle);
}

.callout-content > *:first-child {
  margin-top: 0;
}

.callout-content > *:last-child {
  margin-bottom: 0;
}

.primary-button,
.icon-button,
.icon-only {
  min-height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  background: var(--bg-pure);
  color: var(--text);
  font-size: 14px;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

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

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

.icon-button:hover,
.icon-only:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-button.danger {
  color: var(--accent);
}

.icon-only {
  width: 32px;
  padding: 0;
}

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

.toast {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  max-width: min(420px, calc(100vw - 40px));
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  background: var(--bg-pure);
  color: var(--text);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 920px) {
  body {
    overflow-x: hidden;
  }

  .topbar,
  .editor-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: var(--space-3) var(--space-4);
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
  }

  .topbar h1 {
    font-size: 18px;
  }

  .topbar p {
    display: none;
  }

  .topbar-actions {
    display: flex;
    flex-direction: row;
    gap: 4px;
    width: auto;
    margin-left: auto;
  }

  .editor-actions {
    display: flex;
    gap: var(--space-2);
  }

  .workspace {
    grid-template-columns: 1fr;
    min-height: 100dvh;
    overflow: hidden;
  }

  .list-panel {
    max-height: 45vh;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .editor-panel {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .editor-panel form {
    max-width: none;
    padding: var(--space-4);
  }

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

  .filter-row select {
    flex: 1 1 56px;
    min-width: 48px;
  }

  .body-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
  }

  .markdown-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    max-height: 104px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #bodyInput,
  .preview-panel {
    min-height: 62vh;
  }
}

@media (max-width: 560px) {
  .topbar h1 {
    font-size: 16px;
  }

  .topbar-actions {
    gap: 2px;
  }

  .editor-actions {
    display: flex;
    gap: var(--space-2);
  }

  .editor-actions > * {
    flex: 1;
  }
  }

  .filters {
    padding: var(--space-3);
  }

  .list-toolbar {
    padding: var(--space-2) var(--space-3);
  }

  .filter-row select {
    flex: 1 1 48px;
    min-width: 44px;
  }

  .article-item {
    padding: var(--space-2) var(--space-3);
  }

  .form-band {
    padding: var(--space-4);
  }

  .preview-panel {
    padding: var(--space-4);
  }

  .preview-panel .article-title {
    font-size: 2rem;
  }
}
