:root {
  --green: #0f4f32;
  --green-dark: #08331f;
  --gold: #c6a04d;
  --ink: #17231d;
  --muted: #607068;
  --line: #d8e0da;
  --surface: #f5f7f2;
  --white: #ffffff;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--surface);
}

a {
  color: var(--green);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--green-dark);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  margin-top: 2px;
}

.crest {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--gold);
  color: var(--green-dark);
  font-weight: 700;
  font-size: 13px;
  background: #fbfaf4;
}

.main-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
}

.main-nav a,
.link-button {
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.main-nav a:hover,
.link-button:hover {
  color: var(--green);
}

.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) clamp(18px, 4vw, 48px);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 36px;
  align-items: start;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(20px, 3vw, 30px);
  box-shadow: 0 12px 28px rgba(21, 43, 32, 0.08);
}

.narrow {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.03;
  max-width: 760px;
}

h2 {
  font-size: 23px;
}

p {
  line-height: 1.65;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

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

input[type="email"],
input[type="file"] {
  width: 100%;
  border: 1px solid #b7c4bc;
  border-radius: 6px;
  padding: 13px 14px;
  background: #fff;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  padding: 0 18px;
  cursor: pointer;
}

button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.secondary-button {
  min-height: 40px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--green-dark);
}

.auth-card button,
.admin-stack button {
  margin-top: 18px;
}

.form-status {
  min-height: 28px;
  color: var(--muted);
  margin: 14px 0 0;
}

.page-heading {
  margin-bottom: 24px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.content-card {
  display: flex;
  flex-direction: column;
  min-height: 170px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.content-card > p:not(.date) {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.content-card .date {
  color: var(--muted);
  font-size: 14px;
}

.content-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.content-card button,
.content-card a {
  align-self: flex-start;
}

.content-body {
  margin: 18px 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  line-height: 1.65;
}

.detail-layout {
  display: block;
}

.content-detail {
  max-width: 920px;
}

.content-detail .content-body {
  border-top: 0;
  padding-top: 0;
}

.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4 {
  font-size: 20px;
  line-height: 1.25;
  margin: 20px 0 10px;
}

.content-body ul,
.content-body ol {
  padding-left: 24px;
}

.content-body li {
  margin: 6px 0;
}

.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 15px;
}

.content-body th,
.content-body td {
  border: 1px solid var(--line);
  padding: 9px 10px;
  vertical-align: top;
}

.content-body th {
  background: #eef4ef;
  text-align: left;
}

.inline-document-button {
  min-height: 38px;
  margin: 4px 0;
  padding: 0 14px;
}

.document-placeholder {
  color: var(--muted);
  font-style: italic;
}

.choice-list {
  display: grid;
  gap: 12px;
}

.choice-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.admin-stack {
  display: grid;
  gap: 18px;
}

.admin-toolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

.admin-toolbar label,
.admin-editor label,
[data-document-form] label {
  display: grid;
  gap: 8px;
}

.admin-toolbar select,
.admin-editor input,
.admin-editor select,
.admin-editor textarea,
[data-document-form] input,
[data-document-form] select {
  width: 100%;
  border: 1px solid #b7c4bc;
  border-radius: 6px;
  padding: 11px 12px;
  background: #fff;
}

.editor-field {
  display: grid;
  gap: 8px;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f7f2;
}

.editor-toolbar button,
.editor-toolbar select {
  min-height: 36px;
  margin: 0;
}

.editor-toolbar button {
  padding: 0 12px;
}

.editor-toolbar button.is-active,
.editor-toolbar button[aria-pressed="true"] {
  background: var(--gold);
  color: #08251a;
  box-shadow: inset 0 0 0 2px rgba(8, 37, 26, 0.18);
}

.editor-toolbar button.is-active:hover,
.editor-toolbar button[aria-pressed="true"]:hover {
  background: #d5ad55;
}

.editor-toolbar select {
  width: auto;
}

.rich-editor {
  min-height: 260px;
  width: 100%;
  overflow: auto;
  border: 1px solid #b7c4bc;
  border-radius: 6px;
  padding: 14px;
  background: #fff;
  line-height: 1.6;
}

.rich-editor:focus {
  outline: 3px solid rgba(34, 94, 60, 0.18);
  border-color: var(--green);
}

.rich-editor h2,
.rich-editor h3 {
  margin: 16px 0 8px;
}

.rich-editor ul,
.rich-editor ol {
  padding-left: 24px;
}

.attachment-fieldset {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.attachment-fieldset legend {
  padding: 0 6px;
  font-weight: 700;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfaf4;
}

.admin-list-item h3 {
  margin-bottom: 8px;
}

.preview-results {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.preview-group {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fbfaf4;
}

.preview-group summary {
  cursor: pointer;
  font-weight: 700;
}

.preview-list {
  margin: 12px 0 0;
  padding-left: 22px;
  color: var(--muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.summary-list {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
}

.summary-list dt {
  color: var(--muted);
}

.summary-list dd {
  margin: 0;
  font-weight: 700;
}

.warning-list {
  margin: 18px 0 0;
  padding-left: 20px;
}

@media (max-width: 760px) {
  .site-header,
  .auth-layout,
  .admin-grid,
  .admin-list-item {
    display: block;
  }

  .main-nav {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .auth-card {
    margin-top: 24px;
  }
}
