:root {
  color-scheme: light;
  --bg: #f6f7f7;
  --panel: #ffffff;
  --ink: #1d2327;
  --muted: #646970;
  --line: #dcdcde;
  --brand: #0a6f6f;
  --accent: #b85c00;
  --danger: #b32d2e;
  --success: #008a20;
  --focus: #2271b1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 14px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.admin {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 240px minmax(0, 1fr);
}

.admin-sidebar {
  background: #182326;
  color: #fff;
  padding: 18px 14px;
}

.admin-sidebar h1 {
  margin: 0 0 18px;
  font-size: 20px;
}

.admin-sidebar nav {
  display: grid;
  gap: 4px;
}

.admin-sidebar a {
  color: #f4f7f7;
  padding: 9px 10px;
  border-radius: 6px;
  text-decoration: none;
}

.admin-sidebar a[aria-current="page"],
.admin-sidebar a:hover {
  background: #294247;
}

.admin-main {
  min-width: 0;
  padding: 22px;
}

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.admin-top h2 {
  margin: 0;
  font-size: 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric,
.panel,
.toolbar,
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}

.metric strong {
  display: block;
  font-size: 18px;
}

.panel {
  margin: 0 0 16px;
  padding: 16px;
}

.toolbar {
  margin-bottom: 16px;
  padding: 12px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.button {
  min-height: 34px;
  border: 1px solid #8c8f94;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 6px 12px;
  cursor: pointer;
}

.button-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.inline-form {
  display: inline;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
}

.pagination span {
  color: var(--muted);
  margin-right: auto;
}

.notice {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-left: 4px solid var(--focus);
  background: #fff;
}

.notice-success {
  border-left-color: var(--success);
}

.notice-error {
  border-left-color: var(--danger);
}

.empty {
  color: var(--muted);
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-weight: 600;
}

input,
select,
textarea {
  width: min(100%, 420px);
  min-height: 36px;
  border: 1px solid #8c8f94;
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
}

textarea {
  width: 100%;
  resize: vertical;
}

.form-grid,
.cache-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.cache-section-grid fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.cache-section-grid legend {
  color: var(--muted);
  font-weight: 700;
}

.editor-shell {
  width: min(100%, 1120px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  position: relative;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #f9fbfb;
}

.editor-toolbar .button {
  min-width: 36px;
  padding-inline: 10px;
}

.wysiwyg-surface {
  min-height: 560px;
  padding: 24px;
  font-size: 18px;
  line-height: 1.72;
  outline: 0;
}

.wysiwyg-surface h1,
.wysiwyg-surface h2,
.wysiwyg-surface h3 {
  line-height: 1.15;
}

.wysiwyg-surface img {
  max-width: 100%;
  height: auto;
}

.wysiwyg-surface table {
  min-width: 0;
  border: 1px solid var(--line);
}

.wysiwyg-surface td {
  min-width: 120px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--muted);
}

.dropzone {
  width: min(100%, 680px);
  min-height: 120px;
  border: 2px dashed #8c8f94;
  border-radius: 8px;
  place-items: center;
  padding: 18px;
  color: var(--muted);
}

.dropzone input {
  width: 100%;
}

.media-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.media-browser-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.media-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 4px 0;
}

.media-breadcrumbs a {
  text-decoration: none;
}

.media-browser {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.media-tile {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  text-decoration: none;
  color: var(--ink);
}

.media-tile img,
.media-icon {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f7f7;
  object-fit: cover;
  margin-bottom: 8px;
}

.media-icon {
  color: var(--muted);
  font-weight: 700;
}

.media-folder .media-icon {
  background: #fff4e6;
  color: var(--accent);
}

.media-tile strong,
.media-tile small {
  display: block;
  overflow-wrap: anywhere;
}

.media-tile small {
  color: var(--muted);
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.wpfast-modal[hidden] {
  display: none;
}

.wpfast-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(0 0 0 / 0.45);
}

.wpfast-modal-box {
  width: min(100%, 940px);
  max-height: min(760px, 86vh);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 16px 60px rgb(0 0 0 / 0.24);
  padding: 16px;
}

.wpfast-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.wpfast-modal-head h3 {
  margin: 0;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.picker-item,
.picker-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.picker-item {
  cursor: pointer;
}

.picker-item img,
.picker-item .media-icon {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  margin-bottom: 8px;
}

.picker-item strong,
.picker-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.picker-card {
  display: grid;
  gap: 8px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: #fff;
  padding: 8px;
}

.skip-link:focus {
  left: 8px;
  z-index: 10;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(100%, 380px);
  padding: 24px;
}

.login-card h1 {
  margin-top: 0;
}

@media (max-width: 760px) {
  .admin {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .admin-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-main {
    padding: 14px;
  }
}
