:root {
  font-family: "Instrument Sans", system-ui, sans-serif;
  color: #272820;
  background: #f7f7f1;
  --ink: #272820;
  --muted: #64675b;
  --line: #dedfd3;
  --paper: #fffef9;
  --accent: #d9ec9b;
  --soft: #eef2df;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: #43571e; text-underline-offset: 3px; overflow-wrap: anywhere; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.03; letter-spacing: -.06em; overflow-wrap: anywhere; }
h2 { font-size: 1.15rem; letter-spacing: -.025em; }
h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
p { line-height: 1.55; overflow-wrap: anywhere; }
button, input, textarea { font: inherit; }
button {
  min-height: 38px;
  padding: .5rem .8rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
}
button:hover { background: var(--soft); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid #577032; outline-offset: 3px; }
.primary { background: var(--accent); border-color: #bfd475; }
.primary:hover { background: #cfe682; }
.text-button { background: transparent; border-color: transparent; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: .65rem .75rem;
  color: var(--ink);
  background: #fdfdf8;
}
textarea { resize: vertical; }
label { font-size: .9rem; font-weight: 650; }
label span, .muted { color: var(--muted); }
.topbar {
  min-height: 68px;
  padding: 0 clamp(1rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.brand {
  display: inline-flex;
  gap: .65rem;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 750;
  letter-spacing: -.04em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: #303b21;
  color: var(--accent);
  font-family: Georgia, serif;
  font-weight: normal;
}
.login { max-width: 440px; padding: 0 1rem; margin: clamp(3rem, 12vh, 8rem) auto; }
.login h1 { font-size: 2.2rem; margin-bottom: .75rem; }
.workspace {
  display: grid;
  grid-template-columns: minmax(190px, 235px) minmax(0, 1fr);
  min-height: calc(100dvh - 68px);
}
.sidebar { border-right: 1px solid var(--line); background: #f0f1e8; padding: 1.6rem 1rem; }
.sidebar-heading, .dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sidebar-heading { margin: 0 .25rem .7rem; }
.sidebar-heading button, .dialog-heading button { min-width: 38px; padding: .25rem; font-size: 1.2rem; }
.site-list { display: grid; gap: .2rem; }
.site-list button {
  text-align: left;
  overflow-wrap: anywhere;
  border-color: transparent;
  background: transparent;
  color: #495043;
}
.site-list button:hover, .site-list button[aria-current] { background: #e2e7d4; color: var(--ink); }
.main-panel { width: 100%; max-width: 1250px; padding: clamp(1rem, 4vw, 3.5rem); }
.empty { border: 1px dashed #c9ccba; padding: clamp(2rem, 6vw, 5rem) 1.3rem; border-radius: 14px; text-align: center; }
.empty p { margin: .9rem 0 1.2rem; color: var(--muted); }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.site-actions { display: flex; flex-wrap: wrap; gap: .5rem; flex-shrink: 0; }
.site-url { display: inline-block; margin-top: .5rem; }
.site-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1rem; align-items: start; }
.card { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: clamp(1rem, 3vw, 1.5rem); min-width: 0; }
.stack { display: flex; flex-direction: column; align-items: stretch; gap: .65rem; }
.stack > button { align-self: start; margin-top: .2rem; }
.card h2 { margin-bottom: .3rem; }
.profile dl { margin: .8rem 0 0; font-size: .92rem; }
.profile dt { font-weight: 650; }
.profile dd { margin: .15rem 0 .55rem; color: var(--muted); overflow-wrap: anywhere; }
.preferences { margin-top: .45rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.schedule-form { margin-top: .45rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.schedule-form p { font-size: .9rem; }
.check-label, .interval-label { display: flex; align-items: center; gap: .5rem; }
.check-label input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: #587534; }
.interval-label input { width: 5rem; padding: .35rem .45rem; }
.interval-label input:disabled { opacity: .55; }
summary { cursor: pointer; font-weight: 650; }
.notice { padding: .75rem .9rem; background: var(--soft); border: 1px solid #d8dfc1; border-radius: 8px; margin-bottom: 1rem; }
form .notice { margin: 0; }
.posts { margin-top: 2rem; }
.posts h2 { margin-bottom: .5rem; }
.post-row { border-bottom: 1px solid var(--line); padding: .9rem 0; display: flex; justify-content: space-between; gap: 1rem; }
.post-controls { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; align-content: center; }
.post-controls > * { white-space: nowrap; }
.post-state { color: var(--muted); font-size: .85rem; }
.integration { margin-top: 1.5rem; }
.integration label { display: block; margin-top: .75rem; }
.integration input, .integration p { margin-top: .5rem; }
dialog {
  width: min(480px, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
}
dialog::backdrop { background: #1b241b70; }
.preview-dialog { width: min(780px, calc(100% - 2rem)); }
.preview-dialog .article-body { margin: 1.5rem 0 0; }
.article-page { background: var(--paper); }
.article-nav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .75rem; padding: 1.25rem clamp(1rem, 5vw, 4rem); border-bottom: 1px solid var(--line); }
.article-nav a { font-weight: 700; }
.article { max-width: 960px; padding: clamp(2rem, 7vw, 5rem) 1.25rem; margin: 0 auto; }
.article time { display: block; color: var(--muted); margin-bottom: 1rem; font-size: .9rem; }
.article h1, .preview-dialog h1 { font-family: Georgia, serif; font-weight: normal; letter-spacing: -.05em; }
.article-excerpt { font-size: 1.16rem; color: var(--muted); margin-top: .85rem; }
.article-cover { width: 100%; height: auto; display: block; margin: 1.6rem 0; border-radius: 10px; }
.article-cover:not([src]) { display: none; }
.article-body { font-size: 1.05rem; max-width: 68ch; margin: 0 auto; }
.article-body p { margin-bottom: 1rem; }
.article-body h2 { margin: 1.6rem 0 .6rem; font-size: 1.4rem; }
.archive-posts { list-style: none; padding: 0; margin: 1.5rem 0; }
.archive-posts li { padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.archive-posts time { margin: .3rem 0 .55rem; }
.archive-pagination { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.edit-section { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: .8rem; }
.edit-section legend { color: var(--muted); font-size: .85rem; padding: 0 .3rem; }
.edit-section label > :is(input, textarea) { display: block; margin-top: .25rem; }
@media (max-width: 850px) {
  .site-grid { grid-template-columns: minmax(0, 1fr); }
  .post-row { flex-direction: column; }
}
@media (max-width: 600px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .sidebar { padding: .75rem 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .site-list { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .site-list button { max-width: 15rem; }
  .site-header { align-items: flex-start; flex-direction: column; }
}
