/* Civvie Blog Post Styles */

@font-face {
  font-family: 'Fraunces Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('./fonts/fraunces-latin-full-normal.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Fraunces Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url('./fonts/fraunces-latin-full-italic.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('./fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('./fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}

.civvie-post {
  --font-serif: 'Fraunces Variable', Garamond, Georgia, serif;
  --civvie-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

.civvie-post .post-page-title,
.civvie-post .post-prose h2,
.civvie-post .post-prose h3 {
  font-variation-settings: 'opsz' 72, 'SOFT' 8, 'WONK' 1;
}

.civvie-post .post-page-title {
  max-width: 15ch;
  font-size: clamp(2.7rem, 6vw, 4.8rem);
  font-weight: 560;
  line-height: 0.99;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.civvie-post .post-prose h2 {
  margin-top: clamp(3.5rem, 8vw, 5.5rem);
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 530;
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.post-figure-chat-crop {
  aspect-ratio: 1536 / 705;
  overflow: hidden;
  border-radius: 14px;
  background: #fbf8f0;
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.08), 0 10px 24px rgba(26, 26, 26, 0.08);
}

.post-figure-chat-crop img {
  width: 100%;
  height: auto;
  border-radius: 0;
}

.post-figure--chat figcaption {
  margin-top: 0.75rem;
  color: #4d4d4d;
  font: 400 0.72rem/1.6 var(--civvie-mono);
}

.post-figure--chat figcaption button {
  display: inline;
  margin-left: 0.4rem;
  border: 0;
  border-radius: 0;
  overflow: visible;
  color: #1f5e42;
  background: none;
  background-image: none;
  padding: 0 0 0.1rem;
  font: inherit;
  border-bottom: 1px dotted currentColor;
  cursor: pointer;
}

.post-figure--chat figcaption cite {
  font-style: normal;
}

.post-figure--chat figcaption button:hover {
  color: #174a34;
}

.post-figure--chat figcaption button:focus-visible {
  outline: 2px solid #1f5e42;
  outline-offset: 4px;
}

/* Finder Widget */
.finder-widget {
  margin: 3rem 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.finder-window {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
}

.finder-titlebar {
  background: linear-gradient(180deg, #ebebeb 0%, #d5d5d5 100%);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #b3b3b3;
  position: relative;
}

.finder-traffic-lights {
  display: flex;
  gap: 8px;
  margin-right: 12px;
}

.traffic-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0.5px solid rgba(0, 0, 0, 0.15);
}

.traffic-light-close {
  background: #ff5f57;
}

.traffic-light-minimize {
  background: #ffbd2e;
}

.traffic-light-zoom {
  background: #28c840;
}

.finder-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.finder-content {
  background: #fff;
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
}

.finder-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.finder-table thead {
  background: #f7f7f7;
  border-bottom: 1px solid #d9d9d9;
  position: sticky;
  top: 0;
  z-index: 10;
}

.finder-table th {
  text-align: left;
  padding: 6px 12px;
  font-weight: 600;
  color: #333;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.finder-col-name {
  width: 60%;
}

.finder-col-kind {
  width: 40%;
}

.finder-row {
  border-bottom: 1px solid #e8e8e8;
  transition: background 0.1s;
  cursor: pointer;
  user-select: none;
}

.finder-row:hover {
  background: #e8f0fe;
}

.finder-row td {
  padding: 4px 12px;
  color: #333;
  user-select: none;
}

.finder-row-folder {
  font-weight: 500;
}

.finder-row-folder.folder-expanded {
  background: #f5f5f5;
}

.folder-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 14px;
  color: #4a4a4a;
  margin-right: 2px;
  transition: transform 0.15s ease;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}

.folder-arrow.expanded {
  transform: rotate(90deg);
}

.file-icon {
  margin-right: 6px;
  font-size: 14px;
  flex-shrink: 0;
}

.file-name {
  white-space: nowrap;
  user-select: none;
}

.finder-widget-hint {
  text-align: center;
  font-size: 13px;
  color: #666;
  font-style: italic;
  margin-top: 12px;
  font-family: 'Sorts Mill Goudy', Georgia, serif;
}

/* File Viewer Modal */
.file-viewer-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(18, 20, 17, 0.82);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.file-viewer-modal:not([hidden]) {
  display: flex;
}

.file-viewer-content {
  width: min(1180px, calc(100vw - 32px));
  height: min(92vh, 960px);
  overflow: hidden;
  border: 1px solid #d4cec1;
  border-radius: 14px;
  background: #fbf8f0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.42);
  outline: none;
}

.file-viewer-header {
  min-height: 58px;
  padding: 12px 16px 12px 22px;
  border-bottom: 1px solid #d4cec1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f2ede2;
}

.file-viewer-title {
  color: #1f5e42;
  font: 500 0.72rem/1.3 var(--civvie-mono);
  letter-spacing: 0.06em;
}

.file-viewer-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.file-viewer-close:hover {
  background: #e0e0e0;
}

.file-viewer-close:focus-visible {
  outline: 2px solid #1f5e42;
  outline-offset: 2px;
}

.file-viewer-body {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: clamp(24px, 4vw, 56px);
}

.file-viewer-iframe {
  width: 100%;
  height: 100%;
  min-height: 640px;
  border: none;
  background: #fff;
}

.file-viewer-markdown {
  max-width: 850px;
  margin: 0 auto;
  color: #24231f;
  font-family: var(--font-serif);
  font-size: 1.04rem;
  line-height: 1.72;
}

.file-viewer-markdown h1 {
  margin: 0 0 1.5rem;
  color: #1a1a1a;
  font-size: clamp(2rem, 4vw, 3.3rem);
  font-weight: 540;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.file-viewer-markdown h2 {
  margin: 2.8rem 0 1rem;
  color: #1a1a1a;
  font-size: 1.7rem;
  font-weight: 540;
  line-height: 1.15;
}

.file-viewer-markdown h3 {
  margin: 2rem 0 0.75rem;
  color: #1a1a1a;
  font-size: 1.2rem;
  font-weight: 600;
}

.file-viewer-markdown p {
  margin: 0 0 16px 0;
}

.file-viewer-markdown ul,
.file-viewer-markdown ol {
  margin: 0 0 16px 0;
  padding-left: 1.5rem;
}

.file-viewer-markdown li {
  margin: 8px 0;
}

.file-viewer-markdown code {
  background: #eee8dc;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: var(--civvie-mono);
}

.file-viewer-markdown pre {
  background: #24231f;
  color: #f8f3e8;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0 0 16px 0;
}

.file-viewer-markdown pre code {
  background: none;
  padding: 0;
}

.file-viewer-markdown a {
  color: #1f5e42;
  text-decoration-color: color-mix(in srgb, #1f5e42 45%, transparent);
  text-underline-offset: 0.16em;
}

.file-viewer-markdown a:hover {
  text-decoration: underline;
}

.file-viewer-markdown strong {
  font-weight: 600;
}

.file-viewer-markdown hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px dotted #c7c1b5;
}

.file-viewer-markdown blockquote {
  margin: 1.5rem 0;
  padding-left: 1.2rem;
  border-left: 3px solid #c89b21;
  color: #4d4d4d;
}

.markdown-table-wrap {
  width: 100%;
  margin: 1.5rem 0 2.5rem;
  overflow-x: auto;
  border: 1px solid #c7c1b5;
  border-radius: 8px;
}

.file-viewer-markdown table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.86rem;
  line-height: 1.45;
}

.file-viewer-markdown th,
.file-viewer-markdown td {
  padding: 0.9rem 1rem;
  border-right: 1px solid #d8d2c6;
  border-bottom: 1px solid #d8d2c6;
  text-align: left;
  vertical-align: top;
}

.file-viewer-markdown th:last-child,
.file-viewer-markdown td:last-child {
  border-right: 0;
}

.file-viewer-markdown tbody tr:last-child td {
  border-bottom: 0;
}

.file-viewer-markdown th {
  color: #1f5e42;
  background: #eee8dc;
  font: 500 0.68rem/1.4 var(--civvie-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.file-viewer-loading,
.file-viewer-error {
  color: #68645c;
  font-family: var(--civvie-mono);
  font-size: 0.78rem;
}

.file-viewer-figure {
  display: grid;
  width: 100%;
  min-height: 100%;
  margin: 0;
  place-items: center;
}

.file-viewer-figure[hidden] {
  display: none;
}

.file-viewer-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 50px rgb(26 26 26 / 14%);
}

.file-viewer-caption {
  width: min(100%, 900px);
  margin: 1rem auto 0;
  color: #4d4d4d;
  font: 400 0.72rem/1.5 var(--civvie-mono);
  text-align: center;
}

.file-viewer-modal[data-mode="image"] .file-viewer-content {
  position: relative;
  width: calc(100vw - 32px);
  height: auto;
  max-height: calc(100dvh - 32px);
  max-width: 1600px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.file-viewer-modal[data-mode="image"] .file-viewer-header {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: block;
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.file-viewer-modal[data-mode="image"] .file-viewer-title {
  display: none;
}

.file-viewer-modal[data-mode="image"] .file-viewer-close {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: #fff;
  background: rgb(18 20 17 / 72%);
  box-shadow: 0 4px 18px rgb(0 0 0 / 24%);
}

.file-viewer-modal[data-mode="image"] .file-viewer-close:hover {
  background: rgb(18 20 17 / 90%);
}

.file-viewer-modal[data-mode="image"] .file-viewer-body {
  display: block;
  flex: none;
  min-height: 0;
  overflow: visible;
  padding: 0;
}

.file-viewer-modal[data-mode="image"] .file-viewer-figure {
  display: flex;
  min-height: 0;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 0.8rem;
}

.file-viewer-modal[data-mode="image"] .file-viewer-image {
  width: auto;
  height: auto;
  max-height: calc(100dvh - 96px);
  box-shadow: 0 18px 60px rgb(0 0 0 / 32%);
}

.file-viewer-modal[data-mode="image"] .file-viewer-caption {
  margin: 0;
  color: rgb(255 255 255 / 84%);
  text-shadow: 0 1px 8px rgb(0 0 0 / 45%);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .finder-window {
    border-radius: 6px;
  }
  
  .finder-content {
    max-height: 400px;
  }
  
  .finder-table {
    font-size: 11px;
  }
  
  .finder-col-name {
    width: 65%;
  }
  
  .finder-col-kind {
    width: 35%;
  }
  
  .file-viewer-content {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    border-radius: 10px;
  }
  
  .file-viewer-iframe {
    min-height: 70vh;
  }

  .file-viewer-body {
    padding: 22px 18px 40px;
  }

  .file-viewer-modal[data-mode="image"] .file-viewer-content {
    width: calc(100vw - 24px);
    height: auto;
    max-height: calc(100dvh - 24px);
  }
  
  .edit-toolbar {
    top: 60px;
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .edit-toolbar button {
    font-size: 12px;
    padding: 5px 10px;
  }
}

@media (max-width: 640px) {
  .civvie-post .post-page-title {
    max-width: none;
    font-size: clamp(2.25rem, 9.5vw, 2.6rem);
    line-height: 1.02;
  }
}

/* Admin Edit Styles */
.edit-password-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.edit-password-form {
  background: white;
  padding: 32px;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

.edit-password-form h3 {
  margin: 0 0 20px 0;
  font-size: 20px;
}

.edit-password-form input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.edit-password-form button {
  width: 100%;
  padding: 12px;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 8px;
}

.edit-password-form button:hover {
  background: #0052a3;
}

.edit-password-form .cancel-btn {
  background: #666;
}

.edit-password-form .cancel-btn:hover {
  background: #555;
}

.edit-password-error {
  color: #d32f2f;
  font-size: 13px;
  margin-bottom: 12px;
}

/* Edit Mode Styles */
.edit-mode .post-page-title[contenteditable="true"],
.edit-mode .post-prose[contenteditable="true"] {
  outline: 2px solid #1f5e42;
  outline-offset: 4px;
  border-radius: 4px;
}

.edit-toolbar {
  position: sticky;
  top: 72px;
  background: #fbf8f0;
  border-bottom: 1px solid #c7c1b5;
  padding: 12px;
  z-index: 1000;
  display: flex;
  gap: 8px;
  align-items: center;
  box-shadow: 0 4px 14px rgba(26, 26, 26, 0.12);
  color: #1a1a1a;
  font-family: var(--civvie-mono);
}

.edit-toolbar button,
.edit-toolbar input,
.edit-settings-dialog button,
.edit-settings-dialog input,
.edit-settings-dialog textarea {
  font-family: inherit;
}

.edit-toolbar button {
  padding: 6px 12px;
  background: #f2ede2;
  border: 1px solid #c7c1b5;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.edit-toolbar button:hover {
  background: #e6e0cb;
}

.edit-formatting,
.edit-toolbar-actions,
.edit-publish-control {
  display: flex;
  align-items: center;
}

.edit-formatting,
.edit-toolbar-actions {
  gap: 6px;
}

.edit-toolbar-actions {
  margin-left: auto;
}

.edit-status {
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  background: #e6e0cb;
  color: #4d4d4d;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.edit-status[data-status="published"] {
  background: #dff2e4;
  color: #0f3d2e;
}

.edit-publish-control {
  gap: 0.4rem;
  color: #4d4d4d;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.edit-publish-input {
  width: 1rem;
  height: 1rem;
  accent-color: #1f5e42;
}

.edit-toolbar .save-btn {
  background: #1f5e42;
  color: #fbf8f0;
  border-color: #1f5e42;
  font-weight: 600;
}

.edit-toolbar .save-btn:hover {
  background: #0f3d2e;
}

.edit-toolbar .cancel-edit-btn {
  background: transparent;
  color: #4d4d4d;
  border-color: transparent;
}

.edit-toolbar .cancel-edit-btn:hover {
  background: #f2ede2;
}

.edit-settings-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(820px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #c7c1b5;
  border-radius: 12px;
  color: #1a1a1a;
  background: #fbf8f0;
  box-shadow: 0 24px 70px rgba(26, 26, 26, 0.28);
  font-family: var(--civvie-mono);
}

.edit-settings-dialog::backdrop {
  background: rgba(26, 26, 26, 0.52);
  backdrop-filter: blur(3px);
}

.edit-settings-form {
  display: flex;
  max-height: inherit;
  flex-direction: column;
}

.edit-settings-header,
.edit-settings-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-color: #d9d3c8;
  background: #fbf8f0;
}

.edit-settings-header {
  border-bottom: 1px solid #d9d3c8;
}

.edit-settings-header span {
  color: #1f5e42;
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.edit-settings-header h2 {
  margin: 0.15rem 0 0;
  font: 560 1.65rem/1.1 var(--font-serif);
}

.edit-settings-header button,
.edit-settings-footer button {
  padding: 0.5rem 0.75rem;
  border: 1px solid #c7c1b5;
  border-radius: 4px;
  color: #1a1a1a;
  background: #f2ede2;
  cursor: pointer;
}

.edit-settings-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.25rem;
  overflow-y: auto;
}

.edit-field,
.edit-featured-field {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.edit-field--wide {
  grid-column: 1 / -1;
}

.edit-field > span,
.edit-featured-field legend {
  color: #4d4d4d;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.edit-field input,
.edit-field textarea {
  width: 100%;
  min-height: 40px;
  padding: 0.65rem 0.75rem;
  border: 1px solid #c7c1b5;
  border-radius: 6px;
  color: #1a1a1a;
  background: #fff;
  font: 400 0.88rem/1.5 var(--font-sans);
}

.edit-field textarea {
  min-height: 84px;
  resize: vertical;
}

.edit-field input:focus,
.edit-field textarea:focus {
  border-color: #1f5e42;
  outline: 2px solid rgba(31, 94, 66, 0.18);
}

.edit-field small,
.edit-featured-field > p {
  margin: 0;
  color: #6a655c;
  font: 400 0.7rem/1.45 var(--font-sans);
}

.edit-settings-dialog .edit-publish-control {
  align-self: end;
  min-height: 40px;
  padding: 0.65rem 0.75rem;
  border: 1px solid #c7c1b5;
  border-radius: 6px;
  background: #fff;
}

.edit-featured-field {
  min-width: 0;
  margin: 0;
  padding: 1.1rem;
  border: 1px solid #d9d3c8;
  border-radius: 8px;
}

.edit-featured-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.edit-featured-option {
  position: relative;
  display: grid;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.4rem;
  border: 1px solid #c7c1b5;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.edit-featured-option:has(input:checked) {
  border-color: #1f5e42;
  box-shadow: 0 0 0 2px rgba(31, 94, 66, 0.18);
}

.edit-featured-option input {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  width: 1rem;
  height: 1rem;
  accent-color: #1f5e42;
}

.edit-featured-option img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: #e6e0cb;
}

.edit-featured-option span {
  overflow: hidden;
  color: #4d4d4d;
  font-size: 0.65rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-featured-custom {
  margin-top: 0.4rem;
}

.edit-settings-footer {
  justify-content: flex-end;
  border-top: 1px solid #d9d3c8;
}

.edit-settings-footer .edit-settings-done {
  border-color: #1f5e42;
  color: #fbf8f0;
  background: #1f5e42;
  font-weight: 600;
}

.save-status {
  padding: 12px;
  border-radius: 4px;
  margin: 16px 0;
  font-size: 14px;
}

.save-status.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.save-status.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

@media (max-width: 900px) {
  .edit-toolbar {
    top: 60px;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
  }

  .edit-formatting {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .edit-formatting button {
    flex: 0 0 auto;
  }

  .edit-toolbar-actions {
    margin-left: 0;
    flex: 1 1 100%;
    flex-wrap: wrap;
  }

  .edit-toolbar .save-btn {
    margin-left: auto;
  }
}

@media (max-width: 520px) {
  .edit-toolbar-actions {
    display: grid;
    grid-template-columns: auto 1fr auto;
    width: 100%;
  }

  .edit-toolbar .save-btn {
    margin-left: 0;
  }

  .edit-toolbar .cancel-edit-btn {
    grid-column: 1 / -1;
  }

  .edit-settings-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .edit-settings-fields {
    grid-template-columns: minmax(0, 1fr);
    padding: 1rem;
  }

  .edit-field--wide {
    grid-column: 1;
  }

  .edit-featured-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
