.admin-layout {
  --admin-bg: #f7f7f7;
  --admin-text: #191a1c;
  --admin-muted: #616369;
  --admin-border: #e3e3e6;
  --admin-focus: #41444c;
  --admin-danger: #a4262f;
  background: var(--admin-bg);
  color: var(--admin-text);
}

.admin-layout .site-header {
  background: #fff;
  border-block-end: 1px solid var(--admin-border);
}

.admin-workspace {
  width: min(calc(100% - 72px), 1100px);
  margin-inline: auto;
}

.admin-workspace h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 720;
  letter-spacing: -.045em;
  line-height: 1.15;
}

.admin-panel {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 15px;
  box-shadow: 0 1px 2px #191a1c08;
}

.admin-sign-in {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding-block: 52px;
}

.admin-sign-in-card {
  width: min(100%, 420px);
  padding: clamp(26px, 6vw, 40px);
  box-shadow: 0 8px 28px #191a1c09;
}

.admin-sign-in-header {
  margin-bottom: 27px;
}

.admin-sign-in-header h1 {
  font-size: 2rem;
}

.admin-sign-in-header p {
  margin-top: 11px;
  color: var(--admin-muted);
  line-height: 1.65;
}

.admin-sign-in-submit {
  width: 100%;
}

.admin-return-link {
  display: inline-block;
  margin-top: 21px;
  color: var(--admin-muted);
  text-decoration: none;
  font-size: .875rem;
}

.admin-return-link:hover {
  color: var(--admin-text);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.admin-dashboard {
  padding-block: clamp(37px, 5vw, 62px) 68px;
}

.admin-dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 26px;
}

.admin-dashboard-actions, .admin-pages {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-columns {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

.admin-publish {
  padding: 24px;
}

.admin-publish .admin-panel-heading {
  margin-bottom: 20px;
}

.admin-library .admin-panel-heading {
  padding: 24px 22px 17px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-panel-heading h2 {
  font-size: 1.125rem;
  font-weight: 680;
  letter-spacing: -.03em;
}

.admin-fields, .admin-field {
  display: grid;
}

.admin-fields {
  gap: 17px;
}

.admin-field {
  min-width: 0;
  gap: 7px;
}

.admin-field > span {
  color: var(--admin-text);
  font-size: .875rem;
  font-weight: 650;
}

.admin-field small {
  margin-left: 5px;
  color: var(--admin-muted);
  font-size: .75rem;
  font-weight: 450;
}

.admin-field :is(input, textarea) {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  color: var(--admin-text);
  background: #fff;
  border: 1px solid #d6d7da;
  border-radius: 7px;
  font-size: 1rem;
  line-height: 1.45;
}

.admin-field :is(input, textarea):focus {
  border-color: var(--admin-focus);
  outline: 2px solid #41444c25;
  outline-offset: 1px;
}

.admin-field textarea {
  min-height: 104px;
  resize: vertical;
}

.admin-field input[type="file"] {
  padding: 8px;
  font-size: .875rem;
  line-height: 1.4;
}

.admin-field input[type="file"]::file-selector-button {
  margin-right: 8px;
  padding: 7px 8px;
  color: var(--admin-text);
  background: #f0f0f2;
  border: 0;
  border-radius: 5px;
  font: inherit;
  font-weight: 550;
  cursor: pointer;
}

.admin-field input[type="file"]::file-selector-button:hover {
  background: #e9e9eb;
}

.admin-file-help {
  margin-top: -10px;
  color: var(--admin-muted);
  font-size: .8125rem;
  line-height: 1.55;
}

.admin-btn {
  display: inline-flex;
  min-height: 41px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  font: inherit;
  font-size: .875rem;
  font-weight: 620;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.admin-btn-primary {
  color: #fff;
  background: #191a1c;
}

.admin-btn-primary:hover {
  background: #34363a;
}

.admin-btn-secondary {
  color: var(--admin-text);
  background: #fff;
  border-color: var(--admin-border);
}

.admin-btn-secondary:hover {
  background: #f5f5f6;
  border-color: #d6d7da;
}

.admin-btn-quiet-danger {
  color: var(--admin-danger);
  background: #fff;
}

.admin-btn-quiet-danger:hover {
  background: #fdf1f2;
}

.admin-btn-danger {
  color: #fff;
  background: var(--admin-danger);
}

.admin-btn-danger:hover {
  background: #842028;
}

.admin-publish-submit {
  justify-self: start;
}

.admin-notice {
  margin-bottom: 18px;
  padding: 11px 13px;
  color: var(--admin-text);
  background: #eeeff1;
  border-radius: 7px;
  font-size: .875rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.admin-sign-in-card .admin-notice[role="alert"] {
  color: var(--admin-danger);
  background: #fdf1f2;
}

.admin-photos {
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-photo {
  --admin-photo-inset: 22px;
  position: relative;
  min-width: 0;
  padding: 14px var(--admin-photo-inset);
}

.admin-photo + .admin-photo {
  border-top: 1px solid var(--admin-border);
}

.admin-photo-link {
  display: grid;
  grid-template-columns: 75px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 60px;
  margin-right: 108px;
  text-decoration: none;
}

.admin-photo-link img {
  width: 75px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--admin-bg);
}

.admin-photo-caption {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.admin-photo-name {
  display: block;
  font-size: .9375rem;
  font-weight: 640;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.admin-photo-link:hover .admin-photo-name {
  text-decoration: underline;
  text-underline-offset: .2em;
}

.admin-photo-date, .admin-photo-date time {
  color: var(--admin-muted);
  font-size: .8125rem;
  line-height: 1.5;
}

.admin-photo-details summary {
  position: absolute;
  top: 23px;
  right: var(--admin-photo-inset);
  min-height: 42px;
  padding: 6px 8px;
  list-style: none;
}

.admin-photo-details summary::-webkit-details-marker {
  display: none;
}

.admin-edit summary {
  right: calc(var(--admin-photo-inset) + 48px);
}

.admin-edit[open] summary {
  background: #f0f0f2;
}

.admin-delete[open] summary {
  background: #fdf1f2;
}

.admin-row-form {
  margin-top: 13px;
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #f9f9fa;
}

.admin-row-form button {
  justify-self: start;
}

.admin-delete-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
}

.admin-delete-form p {
  font-size: .875rem;
  line-height: 1.55;
}

.admin-photo-pending {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-cleanup {
  flex: none;
}

.admin-empty {
  padding: 26px 22px;
  color: var(--admin-muted);
  font-size: .9375rem;
}

.admin-pages {
  justify-content: center;
  padding: 16px 14px;
  color: var(--admin-muted);
  border-top: 1px solid var(--admin-border);
  font-size: .875rem;
}

@media (max-width: 850px) {
  .admin-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .admin-workspace {
    width: calc(100% - 32px);
  }

  .admin-sign-in {
    min-height: 370px;
    padding-block: 26px;
  }

  .admin-dashboard-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-publish {
    padding: 19px;
  }

  .admin-library .admin-panel-heading {
    padding: 19px 14px 15px;
  }

  .admin-photo {
    --admin-photo-inset: 13px;
  }

  .admin-photo-link {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 8px;
    margin-right: 94px;
  }

  .admin-photo-link img {
    width: 54px;
    height: 48px;
  }

  .admin-photo-details summary {
    padding-inline: 6px;
  }

  .admin-edit summary {
    right: calc(var(--admin-photo-inset) + 42px);
  }
}
