* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font:
    14px/1.5 Inter,
    system-ui,
    -apple-system,
    sans-serif;
  color: #24332f;
  background: #f5f6f2;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -1px;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.5px;
}
a {
  color: #17664e;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  border: 1px solid transparent;
  background: #185943;
  color: #fff;
  padding: 9px 15px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
button:hover {
  filter: brightness(0.95);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.secondary {
  color: #344d43;
  background: #fff;
  border-color: #d3dcd5;
}
button.danger {
  background: #fff0eb;
  color: #a53e24;
}
button.small {
  font-size: 12px;
  padding: 5px 9px;
}
input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #bccbc3;
  background: white;
  border-radius: 5px;
  color: #20382d;
}
textarea {
  min-height: 90px;
  resize: vertical;
}
input[type='checkbox'] {
  width: auto;
}
label {
  display: block;
  font-weight: 500;
  margin-bottom: 15px;
}
label input,
label select,
label textarea {
  display: block;
  margin-top: 5px;
}
label:has(input[type='checkbox']) {
  display: flex;
  gap: 8px;
  align-items: center;
}
label input[type='checkbox'] {
  margin: 0;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #ce843e;
  outline-offset: 2px;
}
.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #fff;
  border-right: 1px solid #dce3dc;
  padding: 25px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand {
  font-size: 23px;
  letter-spacing: -1px;
  font-weight: 750;
  display: block;
  margin-bottom: 30px;
}
.brand > span {
  background: #daeb8b;
  padding: 0 5px;
  border-radius: 4px;
  margin-right: 6px;
}
.sidebar small {
  color: #526149;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 25px 10px 10px;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar nav button {
  background: transparent;
  color: #536359;
  text-align: left;
  border-radius: 5px;
  padding: 9px 12px;
  white-space: normal;
}
.sidebar nav button.active {
  background: #edf3e7;
  color: #164c36;
  font-weight: 650;
}
.sidebar footer {
  margin-top: auto;
  border-top: 1px solid #e2e7df;
  padding-top: 15px;
  color: #526149;
}
.main {
  min-width: 0;
}
.topbar {
  height: 76px;
  border-bottom: 1px solid #dce3dc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  background: #fafbf8;
  gap: 15px;
}
.topbar select {
  width: auto;
  max-width: 280px;
}
.content {
  padding: 30px 34px;
}
.heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 25px;
}
.muted {
  color: #526149;
}
.eyebrow {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #526149;
  margin-bottom: 10px;
}
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.toolbar input {
  max-width: 240px;
}
.panel {
  background: #fff;
  border: 1px solid #dce3dc;
  border-radius: 10px;
  padding: 23px;
  margin-bottom: 20px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 25px;
}
.stat {
  background: #fff;
  border: 1px solid #dce3dc;
  border-radius: 8px;
  padding: 20px;
}
.stat strong {
  display: block;
  font-size: 30px;
  margin-top: 12px;
  font-weight: 550;
}
.stat small {
  color: #526149;
}
.welcome {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 30px;
  background: #e9efdd;
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 25px;
}
.welcome h2 {
  font-size: 26px;
  max-width: 450px;
}
.welcome .mark {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 90px;
  color: #23553d;
  letter-spacing: -14px;
  transform: rotate(-8deg);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid #e7ebe5;
  vertical-align: middle;
}
th {
  color: #526149;
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-weight: 600;
}
td.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.table-wrap {
  overflow: auto;
}
.badge {
  display: inline-block;
  background: #edf3e7;
  color: #316045;
  font-size: 11px;
  border-radius: 4px;
  padding: 3px 7px;
}
.empty {
  padding: 45px;
  text-align: center;
  color: #66766b;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.login,
.install {
  max-width: 540px;
  margin: 7vh auto;
  padding: 32px;
  background: #fff;
  border: 1px solid #dce3dc;
  border-radius: 12px;
}
.login h1 {
  font-size: 34px;
}
.error {
  color: #a23822;
  background: #fff1e9;
  padding: 10px;
  border-radius: 5px;
}
.help {
  font-size: 12px;
  color: #526149;
}
dialog {
  border: 1px solid #c5d0c7;
  border-radius: 12px;
  padding: 26px;
  max-width: 900px;
  width: 90vw;
  max-height: 90vh;
  overflow: auto;
}
dialog::backdrop {
  background: #12251b88;
}
#toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: #203d2d;
  color: #fff;
  padding: 13px 20px;
  border-radius: 7px;
  display: none;
  z-index: 99;
  max-width: 500px;
}
pre {
  overflow: auto;
  background: #f0f3ed;
  padding: 16px;
  font-size: 12px;
  white-space: pre-wrap;
}
code {
  font-size: 12px;
}
.editor-top {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.editor-grid {
  display: grid;
  grid-template-columns: 210px minmax(280px, 1fr) 340px;
  gap: 12px;
  height: calc(100vh - 225px);
  min-height: 550px;
}
.section-tree,
.properties {
  background: white;
  border: 1px solid #d9e1d8;
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
}
.section-item {
  padding: 9px;
  border: 1px solid #dce3da;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
}
.section-item.selected {
  border-color: #24664a;
  background: #f1f6ea;
}
.section-item .tools {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.preview-wrap {
  background: #e2e6df;
  border: 1px solid #cdd6cb;
  border-radius: 8px;
  overflow: auto;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: start;
}
.preview-wrap iframe {
  border: 0;
  background: white;
  width: 100%;
  height: 100%;
  min-height: 500px;
  flex-shrink: 0;
}
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tabs button {
  padding: 6px 8px;
  font-size: 11px;
  background: #eff2eb;
  color: #52644f;
}
.tabs button.active {
  background: #205b40;
  color: white;
}
.cm-editor {
  border: 1px solid #ccd6ca;
  border-radius: 4px;
  height: 360px;
  font-size: 12px;
}
.cm-scroller {
  overflow: auto;
}
.code-wide .editor-grid {
  grid-template-columns: 170px 1fr 1fr;
}
.section-tree h3 {
  font-size: 12px;
  text-transform: uppercase;
  color: #526149;
}
.unsaved {
  color: #9e5a21;
}
.metric-bars div {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid #e3e8df;
}
.form-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 14px;
  display: flex;
  gap: 8px;
}
#modal-body .grid {
  align-items: start;
}
.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
}
.project-card {
  border: 1px solid #d5dfcf;
  border-radius: 8px;
  padding: 20px;
  background: white;
}
.project-card h2 {
  margin-bottom: 6px;
}
@media (max-width: 1200px) {
  .editor-grid {
    grid-template-columns: 160px 1fr 290px;
  }
  .content {
    padding: 22px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 180px 1fr;
  }
  .sidebar {
    padding: 18px 10px;
  }
  .editor-grid,
  .code-wide .editor-grid {
    grid-template-columns: 150px 1fr;
    height: auto;
  }
  .properties {
    grid-column: 1/-1;
  }
  .preview-wrap {
    height: 500px;
  }
  .topbar {
    padding: 0 20px;
  }
  .welcome {
    grid-template-columns: 1fr;
  }
  .welcome .mark {
    display: none;
  }
}
@media (max-width: 640px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }
  .brand {
    margin-bottom: 10px;
  }
  .sidebar small,
  .sidebar footer {
    display: none;
  }
  .sidebar nav {
    flex-direction: row;
    overflow: auto;
  }
  .sidebar nav button {
    white-space: nowrap;
    font-size: 12px;
  }
  .sidebar > select {
    margin-bottom: 10px;
  }
  .topbar {
    height: auto;
    padding: 12px;
    flex-wrap: wrap;
  }
  .content {
    padding: 18px 12px;
  }
  .heading {
    flex-direction: column;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 12px;
  }
  .stat strong {
    font-size: 24px;
  }
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .section-tree {
    max-height: 220px;
  }
  .properties {
    grid-column: auto;
  }
  .preview-wrap {
    height: 450px;
  }
  .login,
  .install {
    margin: 12px;
  }
  .toolbar {
    gap: 6px;
  }
  h1 {
    font-size: 26px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
  }
}

.editor-top select {
  width: auto;
}
.editor-top {
  margin-bottom: 14px;
}
