:root {
  color-scheme: light;
  --ink: #202923;
  --muted: #69756c;
  --line: #dce1d8;
  --paper: #fffefa;
  --green: #23573f;
  --soft: #eff3eb;
  --cream: #f4f4ee;
  --danger: #96392f;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-size: 14px;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
.button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  padding: 9px 13px;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}
button:hover,
.button:hover {
  background: var(--soft);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.primary:hover {
  background: #19422f;
}
.quiet {
  background: transparent;
  border-color: transparent;
}
.skip {
  position: absolute;
  left: 230px;
  top: -80px;
  background: white;
  padding: 15px;
  z-index: 5;
}
.skip:focus {
  top: 10px;
}
:focus-visible {
  outline: 3px solid #78a38c;
  outline-offset: 3px;
}
.sidebar {
  width: 218px;
  position: fixed;
  inset: 0 auto 0 0;
  border-right: 1px solid var(--line);
  padding: 27px 18px;
  background: #e9eee5;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 31px;
  font-family: Georgia, serif;
  font-weight: bold;
  color: var(--green);
  text-decoration: none;
}
.brand span {
  font-family: inherit;
  font-size: 12px;
  color: var(--ink);
}
.studio-label {
  font-size: 10px;
  letter-spacing: 1.8px;
  margin: 33px 4px 18px;
  color: var(--muted);
}
.studio-label small {
  display: block;
  letter-spacing: 0.3px;
  margin-top: 7px;
}
.sidebar nav {
  display: grid;
  gap: 6px;
}
.sidebar nav button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border-color: transparent;
  text-align: left;
  padding: 13px 10px;
}
.sidebar nav button span {
  font-size: 11px;
  color: var(--muted);
}
.sidebar nav button.active {
  background: var(--paper);
  border-color: var(--line);
  font-weight: 600;
}
.sidebar-bottom {
  margin-top: auto;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
}
.shell {
  margin-left: 218px;
}
.topbar {
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 33px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.topbar > div {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 12px;
  color: var(--muted);
}
.page {
  max-width: 1180px;
  padding: 48px 45px 65px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 600;
  color: var(--green);
  letter-spacing: 2px;
}
h1 {
  font-size: 32px;
  letter-spacing: -1px;
  line-height: 1.3;
  font-weight: 600;
  margin: 17px 0;
}
h2 {
  font-size: 18px;
  font-weight: 600;
}
h3 {
  font-size: 15px;
}
.lede {
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 25px;
}
.quick-actions {
  display: flex;
  gap: 10px;
  margin: 29px 0 34px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  margin: 0 0 37px;
}
.stats > div {
  padding: 23px 24px;
  display: grid;
  gap: 10px;
  border-right: 1px solid var(--line);
}
.stats > div:last-child {
  border: 0;
}
.stats strong {
  font-size: 24px;
  font-weight: 500;
}
.stats span {
  color: var(--muted);
  font-size: 12px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 16px;
  gap: 12px;
}
.section-heading > span {
  font-size: 12px;
  color: var(--muted);
}
.card-list {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: var(--paper);
}
.content-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  gap: 15px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 18px 20px;
}
.content-card:last-child {
  border: 0;
}
.content-card strong {
  display: block;
  font-weight: 500;
  font-size: 15px;
  margin-bottom: 6px;
}
.content-card small {
  color: var(--muted);
  font-size: 11px;
}
.badge {
  font-size: 11px;
  padding: 5px 9px;
  background: var(--soft);
  color: var(--green);
  border-radius: 20px;
  white-space: nowrap;
}
.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  line-height: 1.8;
}
.scope-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 22px;
  margin-top: 32px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.scope-note h3 {
  color: var(--ink);
  margin-top: 0;
}
.notice {
  padding: 12px 33px;
  border-bottom: 1px solid #dbba7c;
  background: #fff1d4;
  color: #604720;
  line-height: 1.7;
}
.notice.error {
  color: var(--danger);
  background: #ffefe9;
}
.writing-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--cream);
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.auth-page {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 24px;
}
.auth-card {
  width: min(100%, 520px);
  padding: 36px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.auth-card h1 {
  font-size: clamp(25px, 4vw, 34px);
}
.auth-card form,
.setup-request {
  overflow-wrap: anywhere;
  font-family: monospace;
}
.owner-form {
  display: grid;
  gap: 18px;
  max-width: 520px;
}
.auth-card label,
.owner-form label {
  display: grid;
  gap: 8px;
}
.auth-card p {
  line-height: 1.7;
}
.auth-help {
  color: var(--muted);
  font-size: 12px;
}
.writing-bar > div {
  display: flex;
  align-items: center;
  gap: 9px;
}
.writing-bar #save-state {
  font-size: 11px;
  color: var(--muted);
  max-width: 170px;
}
.writer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 275px;
  gap: 24px;
  padding: 25px 25px 40px;
  align-items: start;
}
.canvas {
  min-height: 720px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 28px 32px;
}
.article-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  margin-bottom: 18px;
}
.article-top label {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
}
.article-top select {
  padding: 4px;
  border: 0;
  background: transparent;
  font-size: 11px;
}
.title-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
#title {
  border: 0;
  padding: 12px 0;
  background: transparent;
  font-size: 29px;
  font-weight: 600;
  width: 100%;
  color: var(--ink);
}
.summary-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
#description {
  width: 100%;
  resize: vertical;
  border: 0;
  background: transparent;
  padding: 10px 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}
.editor-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-top: 20px;
  padding-bottom: 10px;
}
.editor-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.editor-tabs .selected {
  color: var(--green);
  background: var(--soft);
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 76px;
  background: var(--paper);
  z-index: 1;
}
.toolbar button {
  padding: 6px 7px;
  border: 0;
  background: transparent;
  font-size: 12px;
}
.toolbar button[aria-pressed='true'] {
  background: var(--soft);
  color: var(--green);
}
.tiptap {
  outline: 0;
  min-height: 410px;
  padding: 20px 0;
  line-height: 1.95;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.tiptap p {
  margin: 0.6em 0;
}
.tiptap h2 {
  font-size: 24px;
  margin-top: 1.6em;
}
.tiptap h3 {
  font-size: 19px;
}
.tiptap a {
  color: var(--green);
  text-decoration: underline;
}
.tiptap pre {
  background: #edf0e9;
  padding: 18px;
  border-radius: 6px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.7;
}
.tiptap code {
  font-family: ui-monospace, monospace;
}
.tiptap blockquote {
  border-left: 3px solid #8ca68d;
  color: var(--muted);
  margin-left: 0;
  padding-left: 18px;
}
.tiptap img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  cursor: pointer;
}
.tiptap img.ProseMirror-selectednode {
  outline: 3px solid #78a38c;
}
.tiptap table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  margin: 15px 0;
}
.tiptap th,
.tiptap td {
  border: 1px solid var(--line);
  padding: 8px;
  vertical-align: top;
}
.tiptap th {
  background: var(--soft);
}
.studio-block {
  padding: 16px 18px;
  border: 1px solid #cbd6c8;
  border-left: 3px solid var(--green);
  border-radius: 5px;
  background: var(--soft);
  font-size: 13px;
  cursor: pointer;
}
.canvas-footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  gap: 10px;
}
.inspector {
  font-size: 12px;
}
.inspector details {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  padding: 15px;
  margin-bottom: 12px;
}
.inspector summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 10px;
}
.inspector label {
  display: block;
  margin: 13px 0 9px;
}
.inspector input,
.inspector select {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  margin-top: 6px;
  background: white;
}
.hint {
  color: var(--muted);
  line-height: 1.8;
  font-size: 11px;
}
.backup-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
  margin-top: 18px;
}
.backup-card p {
  line-height: 1.8;
}
.seo-card {
  margin-top: 17px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  overflow-wrap: anywhere;
}
.seo-card strong {
  display: block;
  color: var(--green);
  font-size: 14px;
}
.seo-card span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin: 8px 0;
}
.seo-card p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}
.relation-group {
  max-height: 190px;
  overflow: auto;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 10px;
}
.relation-group label {
  display: flex;
  gap: 6px;
  align-items: center;
  line-height: 1.5;
}
.relation-group input {
  width: auto;
  margin: 0;
}
#source {
  display: block;
  border: 0;
  min-height: 430px;
  width: 100%;
  font:
    13px/1.9 ui-monospace,
    monospace;
  padding: 20px 0;
  resize: vertical;
  background: transparent;
}
.preview-status {
  scroll-margin-top: 110px;
  margin: 0 25px 35px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
#instant-frame {
  width: 100%;
  height: 75vh;
  min-height: 420px;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}
.preview-status p {
  line-height: 1.8;
}
.preview-status pre {
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 11px;
}
.preview-status details {
  margin-top: 18px;
}
.search-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 20px;
}
.search-label input {
  display: block;
  width: min(450px, 100%);
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 8px;
  background: var(--paper);
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}
.media-card {
  padding: 0;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.media-card img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: #e7ebe3;
  display: block;
}
.media-card .media-meta {
  padding: 13px;
  line-height: 1.6;
}
.media-card strong {
  font-size: 12px;
  display: block;
  overflow-wrap: anywhere;
}
.media-card small {
  font-size: 10px;
  color: var(--muted);
}
.media-card .used {
  font-size: 10px;
  color: var(--green);
}
.help-list {
  padding-left: 25px;
  max-width: 730px;
}
.help-list li {
  padding: 13px 10px;
}
.help-list p {
  line-height: 1.9;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  width: min(680px, calc(100% - 32px));
  padding: 25px;
  background: var(--paper);
  color: var(--ink);
  max-height: 85vh;
}
dialog::backdrop {
  background: #25382b66;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.dialog-heading h2 {
  margin: 0 0 20px;
}
.dialog-heading button {
  margin-bottom: 20px;
}
#modal-body label {
  display: block;
  margin-bottom: 14px;
}
#modal-body input,
#modal-body select,
#modal-body textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  margin-top: 7px;
  background: white;
}
#modal-body textarea {
  min-height: 120px;
}
#modal-body .media-grid {
  max-height: 330px;
  overflow: auto;
}
#modal-body .media-card input {
  width: auto;
}
#modal-body .media-card {
  cursor: pointer;
}
#modal-body .media-card.selected {
  outline: 3px solid var(--green);
}
#modal-body .dialog-image {
  display: block;
  max-width: 100%;
  max-height: 190px;
  object-fit: contain;
  margin-bottom: 15px;
}
#modal-error {
  color: var(--danger);
  line-height: 1.7;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}
[hidden] {
  display: none !important;
}
.offline {
  color: var(--danger) !important;
}
.danger {
  color: var(--danger);
}
@media (min-width: 1600px) {
  .writer-layout {
    max-width: 1450px;
    margin: 0 auto;
  }
  .canvas {
    padding: 35px 50px;
  }
}
@media (max-width: 1180px) {
  .sidebar {
    width: 180px;
    padding: 24px 12px;
  }
  .shell {
    margin-left: 180px;
  }
  .writer-layout {
    grid-template-columns: minmax(0, 1fr) 235px;
    padding: 18px;
    gap: 16px;
  }
  .canvas {
    padding: 23px;
  }
  .page {
    padding: 34px 30px;
  }
  .brand span {
    font-size: 10px;
  }
}
@media (max-width: 900px) {
  .sidebar {
    width: 150px;
  }
  .shell {
    margin-left: 150px;
  }
  .brand {
    font-size: 25px;
  }
  .brand span {
    font-size: 9px;
  }
  .sidebar nav button {
    font-size: 12px;
    padding: 11px 6px;
  }
  .sidebar nav button span {
    display: none;
  }
  .writer-layout {
    grid-template-columns: 1fr;
  }
  .inspector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .inspector details {
    margin: 0;
  }
  .topbar {
    padding: 0 18px;
  }
  .writing-bar {
    flex-wrap: wrap;
  }
  h1 {
    font-size: 27px;
  }
  .stats strong {
    font-size: 20px;
  }
}
@media (max-width: 600px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 12px 15px;
    display: block;
    border-bottom: 1px solid var(--line);
  }
  .sidebar .brand {
    font-size: 23px;
  }
  .brand span {
    font-size: 11px;
  }
  .studio-label,
  .sidebar-bottom {
    display: none;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
    margin-top: 12px;
  }
  .sidebar nav button {
    white-space: nowrap;
  }
  .shell {
    margin: 0;
  }
  .topbar {
    height: 54px;
    font-size: 12px;
  }
  .topbar > div {
    gap: 4px;
    font-size: 10px;
  }
  .page {
    padding: 27px 20px;
  }
  .quick-actions {
    flex-wrap: wrap;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .stats > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
  }
  .section-heading > span {
    display: none;
  }
  .writer-layout {
    padding: 12px;
    gap: 12px;
  }
  .canvas {
    padding: 20px 18px;
  }
  .writing-bar {
    padding: 12px;
  }
  .writing-bar > div {
    flex-wrap: wrap;
    gap: 6px;
  }
  .writing-bar #save-state {
    width: 100%;
    max-width: none;
  }
  .inspector {
    grid-template-columns: 1fr;
  }
  .article-top {
    flex-wrap: wrap;
  }
  #title {
    font-size: 25px;
  }
  .canvas-footer {
    flex-direction: column;
  }
  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .media-card img {
    height: 100px;
  }
  .notice {
    padding: 10px 18px;
  }
  .preview-status {
    margin: 0 12px 25px;
  }
  .skip {
    left: 10px;
  }
}
