.policy-editor-shell {
  display: grid;
  gap: 18px;
}

.policy-editor-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.policy-editor-muted {
  margin: 6px 0 0;
  color: #5d7168;
  line-height: 1.45;
}

.policy-editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.policy-editor-save {
  background: #193c34;
  color: #fff;
}

.policy-editor-grid {
  display: grid;
  gap: 16px;
}

.policy-document-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid #c7d7cf;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.policy-document-tab {
  min-height: 38px;
  border: 1px solid #9db8ae;
  border-radius: 6px;
  background: #f7faf7;
  color: #314b42;
  font-size: .86rem;
  font-weight: 800;
}

.policy-document-tab:hover,
.policy-document-tab:focus-visible {
  border-color: #9db8ae;
  background: #eef5f0;
}

.policy-document-tab--active {
  border-color: #225c4f;
  background: #193c34;
  color: #fff;
}

.policy-editor-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #c7d7cf;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(25, 60, 52, .08);
}

.policy-editor-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.policy-editor-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.policy-editor-card-actions button {
  min-height: 36px;
  border: 1px solid #9db8ae;
  border-radius: 6px;
  background: #f7faf7;
  color: #193c34;
  font-size: .82rem;
  font-weight: 800;
}

.policy-editor-card--invalid {
  border-color: #c97878;
  box-shadow: 0 10px 26px rgba(140, 42, 42, .12);
}

.policy-editor-card h3 {
  margin: 0;
  color: #193c34;
}

.policy-editor-card a {
  color: #225c4f;
  font-size: .86rem;
  font-weight: 700;
}

.policy-editor-field {
  display: grid;
  gap: 6px;
  color: #314b42;
  font-size: .84rem;
  font-weight: 800;
}

.policy-editor-field input,
.policy-editor-field textarea {
  width: 100%;
  border: 1px solid #9db8ae;
  border-radius: 6px;
  background: #fbfcfa;
  color: #1e2a24;
}

.policy-editor-field input {
  min-height: 40px;
  padding: 0 10px;
}

.policy-editor-field textarea {
  min-height: 360px;
  padding: 12px;
  line-height: 1.45;
  resize: vertical;
}

.policy-source-textarea[hidden] {
  display: none;
}

.policy-source-textarea:not([hidden]) {
  min-height: 180px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .88rem;
}

.policy-visual-editor {
  display: grid;
  gap: 10px;
  min-height: 420px;
  max-height: 720px;
  overflow: auto;
  border: 1px solid #9db8ae;
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  color: #1e2a24;
  outline: none;
}

.policy-visual-editor:focus {
  border-color: #225c4f;
  box-shadow: 0 0 0 3px rgba(34, 92, 79, .14);
}

.policy-visual-editor h2,
.policy-visual-editor h3,
.policy-visual-editor p,
.policy-visual-editor ul {
  margin: 0;
}

.policy-visual-editor h2 {
  color: #193c34;
  font-size: 1.34rem;
  line-height: 1.2;
}

.policy-visual-editor h3 {
  color: #225c4f;
  font-size: 1.08rem;
  line-height: 1.25;
}

.policy-visual-editor p,
.policy-visual-editor li {
  color: #314b42;
  font-size: .98rem;
  font-weight: 500;
  line-height: 1.58;
}

.policy-visual-editor ul {
  display: grid;
  gap: 6px;
  padding-left: 22px;
}

.policy-visual-editor h2:focus,
.policy-visual-editor h3:focus,
.policy-visual-editor p:focus,
.policy-visual-editor li:focus {
  outline: 2px solid rgba(34, 92, 79, .22);
  outline-offset: 3px;
}

.policy-composer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.policy-composer-button {
  min-height: 34px;
  border: 1px solid #9db8ae;
  border-radius: 6px;
  background: #f7faf7;
  color: #193c34;
  font-size: .8rem;
  font-weight: 800;
}

.policy-composer-button--preview {
  margin-left: auto;
  border-color: #225c4f;
}

.policy-editor-meta {
  color: #5d7168;
  font-size: .78rem;
  font-weight: 700;
  text-align: right;
}

.policy-editor-format-status {
  display: grid;
  gap: 6px;
}

.policy-editor-format-status:empty {
  display: none;
}

.policy-editor-format-status p {
  margin: 0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: .8rem;
  line-height: 1.35;
}

.policy-editor-format-error {
  border: 1px solid #cf8888;
  background: #fff1f1;
  color: #8c2a2a;
}

.policy-editor-format-warning {
  border: 1px solid #d8c67b;
  background: #fff9dd;
  color: #6e5810;
}

.policy-editor-error,
.policy-editor-success {
  margin: 0;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 800;
}

.policy-editor-error {
  border: 1px solid #cf8888;
  background: #fff1f1;
  color: #8c2a2a;
}

.policy-editor-success {
  border: 1px solid #83b99f;
  background: #edf9f2;
  color: #1d5d3e;
}

.policy-preview-open {
  overflow: hidden;
}

.policy-preview-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow: auto;
  background: rgba(7, 17, 15, .72);
  padding: 24px;
}

.policy-preview-page {
  width: min(980px, 100%);
  min-height: calc(100vh - 48px);
  margin: 0 auto;
  border-radius: 8px;
  background: #f7faf7;
  color: #1e2a24;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .36);
}

.policy-preview-page-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #c7d7cf;
  border-radius: 8px 8px 0 0;
  background: #fff;
  padding: 12px 16px;
}

.policy-preview-page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.policy-preview-page-actions a,
.policy-preview-page-actions button {
  min-height: 36px;
  border: 1px solid #9db8ae;
  border-radius: 6px;
  background: #f7faf7;
  color: #193c34;
  font-size: .82rem;
  font-weight: 800;
  text-decoration: none;
}

.policy-preview-page-actions a {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
}

.policy-preview-document {
  display: grid;
  gap: 24px;
  max-width: 820px;
  margin: 0 auto;
  padding: 30px 22px 48px;
}

.policy-preview-site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #d8e3de;
  padding-bottom: 14px;
  color: #193c34;
  font-weight: 900;
}

.policy-preview-document-header {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid #d8e3de;
  padding-bottom: 22px;
}

.policy-preview-eyebrow,
.policy-preview-updated {
  margin: 0;
  color: #5d7168;
  font-size: .86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.policy-preview-document-header h1 {
  margin: 0;
  color: #193c34;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.05;
}

.policy-preview-document-header p:not(.policy-preview-eyebrow):not(.policy-preview-updated),
.policy-preview-document-section p,
.policy-preview-document-section li {
  color: #314b42;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.65;
}

.policy-preview-document-section {
  display: grid;
  gap: 12px;
}

.policy-preview-document-section h2,
.policy-preview-document-section h3,
.policy-preview-document-section p,
.policy-preview-document-section ul {
  margin: 0;
}

.policy-preview-document-section h2 {
  color: #193c34;
  font-size: 1.45rem;
}

.policy-preview-document-section h3 {
  color: #225c4f;
  font-size: 1.08rem;
}

.policy-preview-document-section ul {
  padding-left: 22px;
}

@media (max-width: 720px) {
  .policy-editor-header,
  .policy-editor-card > header {
    align-items: stretch;
    flex-direction: column;
  }

  .policy-editor-actions {
    justify-content: stretch;
  }

  .policy-editor-actions button,
  .policy-editor-card-actions button,
  .policy-editor-card-actions a,
  .policy-composer-button {
    flex: 1 1 auto;
  }

  .policy-editor-card-actions {
    justify-content: stretch;
  }

  .policy-composer-button--preview {
    margin-left: 0;
  }

  .policy-preview-screen {
    padding: 0;
  }

  .policy-preview-page {
    min-height: 100vh;
    border-radius: 0;
  }

  .policy-preview-page-toolbar {
    align-items: stretch;
    flex-direction: column;
    border-radius: 0;
  }

  .policy-preview-page-actions a,
  .policy-preview-page-actions button {
    flex: 1 1 auto;
    justify-content: center;
  }

  .policy-preview-document {
    padding: 24px 16px 40px;
  }
}
