:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --border: #d8d8d1;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --code-bg: #f0f3f5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent-dark);
}

.shell {
  width: min(920px, calc(100% - 32px));
  margin: 48px auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
}

h1,
h2 {
  line-height: 1.2;
  margin: 0 0 12px;
}

.muted {
  color: var(--muted);
  margin-top: 0;
}

.upload-form {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 650;
}

input {
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}

button,
.button-link {
  align-items: center;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  text-decoration: none;
}

button:hover,
.button-link:hover {
  background: var(--accent-dark);
}

.button-link.secondary {
  background: #e7eceb;
  color: var(--accent-dark);
}

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

.share-link {
  overflow-wrap: anywhere;
}

.published-list {
  margin-top: 32px;
}

.published-list ul {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.published-list li {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}

.published-list span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
}

.reader {
  width: min(760px, calc(100% - 32px));
  margin: 48px auto 80px;
}

.markdown-body {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: clamp(24px, 5vw, 48px);
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin-top: 1.8em;
}

.markdown-body pre {
  background: var(--code-bg);
  border-radius: 6px;
  overflow-x: auto;
  padding: 14px 16px;
}

.markdown-body code {
  background: var(--code-bg);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  padding: 0.12em 0.28em;
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
}

.markdown-body blockquote {
  border-left: 4px solid var(--accent);
  color: #374151;
  margin-left: 0;
  padding-left: 16px;
}

.markdown-body table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  width: 100%;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--border);
  padding: 8px 10px;
}

.markdown-body img {
  border-radius: 6px;
  height: auto;
  max-width: 100%;
}

@media (max-width: 640px) {
  .shell,
  .reader {
    margin-top: 24px;
    width: min(100% - 20px, 920px);
  }

  .panel,
  .markdown-body {
    padding: 20px;
  }

  .published-list li {
    align-items: flex-start;
    flex-direction: column;
  }
}
