:root {
  --booru-bg: #d9e2ec;
  --booru-page: #eef3f8;
  --booru-panel: #f8fbfe;
  --booru-panel-soft: #e7eef6;
  --booru-top: #244f76;
  --booru-top-dark: #1a3b59;
  --booru-text: #1e2732;
  --booru-muted: #5b6876;
  --booru-border: #9fb1c3;
  --booru-border-strong: #748ba3;
  --booru-link: #1d5f8f;
  --booru-link-hover: #9a432b;
  --booru-tag-bg: #e3ebf4;
  --booru-tag-active: #f4ded5;
  --booru-button: #2d618f;
  --booru-button-text: #ffffff;
  --booru-media-bg: #f4f7fb;
}

:root[data-theme="dark"] {
  --booru-bg: #151b22;
  --booru-page: #202a35;
  --booru-panel: #263342;
  --booru-panel-soft: #1d2732;
  --booru-top: #162f47;
  --booru-top-dark: #102537;
  --booru-text: #edf4fb;
  --booru-muted: #b5c3d0;
  --booru-border: #47586a;
  --booru-border-strong: #6a7e93;
  --booru-link: #8cc6ec;
  --booru-link-hover: #eba17f;
  --booru-tag-bg: #1f394b;
  --booru-tag-active: #4a332b;
  --booru-button: #74afd5;
  --booru-button-text: #10202d;
  --booru-media-bg: #18232d;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body.booru-body {
  margin: 0;
  min-height: 100vh;
  background: var(--booru-bg);
  color: var(--booru-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

body.booru-body.tamers-home-popup-open {
  overflow: hidden;
}

.booru-shell {
  width: min(1600px, calc(100% - 20px));
  margin: 0 auto;
  padding: 10px 0 34px;
}

.booru-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--booru-top-dark);
  border-radius: 3px;
  background: var(--booru-top);
  color: #ffffff;
}

.booru-brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.booru-brand h1 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.booru-brand p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.25;
}

.booru-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.booru-nav a {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  background: var(--booru-top-dark);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
}

.booru-nav a:hover {
  background: #ffffff;
  color: var(--booru-top-dark);
}

.booru-qa-button {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  background: var(--booru-top-dark);
  color: #ffffff;
  cursor: pointer;
  font: 700 0.78rem/1 Arial, Helvetica, sans-serif;
}

.booru-qa-button:hover,
.booru-qa-button:focus-visible {
  background: #ffffff;
  color: var(--booru-top-dark);
}

.booru-app {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.booru-sidebar,
.booru-results {
  border: 1px solid var(--booru-border);
  border-radius: 3px;
  background: var(--booru-page);
}

.booru-sidebar {
  position: sticky;
  top: 10px;
  max-height: calc(100vh - 20px);
  overflow: auto;
  padding: 8px;
}

.booru-search-panel,
.tag-section {
  border: 1px solid var(--booru-border);
  border-radius: 3px;
  background: var(--booru-panel);
  padding: 8px;
}

.booru-search-panel + .tag-section,
.tag-section + .tag-section {
  margin-top: 8px;
}

.booru-search-panel h2,
.tag-section h2 {
  margin: -8px -8px 8px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--booru-border);
  background: var(--booru-panel-soft);
  color: var(--booru-text);
  font-size: 0.9rem;
  line-height: 1.2;
}

.tag-section h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.booru-search,
.booru-filter-row label {
  display: grid;
  gap: 4px;
  color: var(--booru-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.booru-search input,
.booru-filter-row select {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--booru-border-strong);
  border-radius: 3px;
  background: #ffffff;
  color: #17212b;
  font: 400 0.9rem/1.2 Arial, Helvetica, sans-serif;
  padding: 0 7px;
}

:root[data-theme="dark"] .booru-search input,
:root[data-theme="dark"] .booru-filter-row select {
  background: #111923;
  color: var(--booru-text);
}

.booru-search input:focus,
.booru-filter-row select:focus,
.booru-nav a:focus-visible,
.booru-plain-button:focus-visible,
.booru-page-link:focus-visible,
.booru-open-image:focus-visible,
.booru-back-link:focus-visible,
.tag-button:focus-visible,
.booru-card-link:focus-visible,
.booru-tag-chip:focus-visible,
.booru-suggestion:focus-visible,
.booru-post-media-frame img:focus-visible,
.booru-post-media-frame video:focus-visible {
  outline: 2px solid var(--booru-link-hover);
  outline-offset: 1px;
}

.booru-suggestions {
  margin-top: 4px;
  border: 1px solid var(--booru-border-strong);
  border-radius: 3px;
  background: var(--booru-panel);
  overflow: hidden;
}

.booru-suggestion {
  width: 100%;
  min-height: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--booru-border);
  background: transparent;
  color: var(--booru-link);
  cursor: pointer;
  font: 700 0.82rem/1.2 Arial, Helvetica, sans-serif;
  padding: 0 7px;
  text-align: left;
}

.booru-suggestion:last-child {
  border-bottom: 0;
}

.booru-suggestion.is-active,
.booru-suggestion:hover {
  background: var(--booru-tag-bg);
  color: var(--booru-link-hover);
}

.booru-suggestion span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booru-suggestion small {
  color: var(--booru-muted);
}

.booru-filter-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}

.booru-plain-button,
.booru-page-link,
.booru-open-image {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--booru-border-strong);
  border-radius: 3px;
  background: var(--booru-button);
  color: var(--booru-button-text);
  cursor: pointer;
  font: 700 0.86rem/1 Arial, Helvetica, sans-serif;
  padding: 0 10px;
  text-decoration: none;
}

.booru-plain-button:hover,
.booru-page-link:hover,
.booru-open-image:hover {
  filter: brightness(1.08);
}

.booru-active-tags,
.booru-post-tag-list {
  min-height: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.booru-tag-chip,
.tag-button {
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--booru-link);
  cursor: pointer;
  font: 700 0.82rem/1.15 Arial, Helvetica, sans-serif;
  text-decoration: none;
}

.booru-tag-chip {
  min-height: 24px;
  padding: 0 6px;
  border-color: var(--booru-border);
  background: var(--booru-tag-bg);
}

.booru-tag-chip:hover,
.tag-button:hover {
  color: var(--booru-link-hover);
}

.tag-list {
  display: grid;
  gap: 2px;
}

.tag-button {
  min-height: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 0 2px;
  text-align: left;
}

.tag-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-button small {
  color: var(--booru-muted);
  font-size: 0.72rem;
}

.tag-button.is-active {
  border-color: var(--booru-border);
  background: var(--booru-tag-active);
  padding-inline: 5px;
}

.booru-results {
  min-width: 0;
  padding: 8px;
}

.booru-results-bar {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 5px 7px;
  border: 1px solid var(--booru-border);
  border-radius: 3px;
  background: var(--booru-panel);
  color: var(--booru-muted);
}

.booru-results-bar strong {
  color: var(--booru-text);
}

.booru-pagination {
  min-height: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: 0 0 8px;
}

.booru-pagination:empty {
  display: none;
}

.booru-pagination:last-child {
  margin: 10px 0 0;
}

.booru-page-link {
  min-width: 32px;
  min-height: 28px;
  padding: 0 8px;
  border-color: var(--booru-border);
  background: var(--booru-panel);
  color: var(--booru-link);
}

.booru-page-link:hover {
  color: var(--booru-link-hover);
}

.booru-page-link.is-current {
  border-color: var(--booru-border-strong);
  background: var(--booru-button);
  color: var(--booru-button-text);
}

.booru-page-link:disabled {
  opacity: 0.48;
  cursor: default;
  filter: none;
}

.booru-page-gap {
  min-width: 24px;
  color: var(--booru-muted);
  text-align: center;
}

.booru-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
}

.booru-card {
  min-width: 0;
  border: 1px solid var(--booru-border);
  border-radius: 3px;
  overflow: hidden;
  background: var(--booru-panel);
}

.booru-card-link {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  border: 0;
  padding: 0;
  background: var(--booru-media-bg);
  cursor: pointer;
}

.booru-card-link img,
.booru-card-link video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.booru-card.is-broken .booru-card-link {
  display: grid;
  place-items: center;
}

.booru-card.is-broken .booru-card-link::after {
  content: "Image failed to load";
  padding: 10px;
  color: #4f5868;
  font-size: 0.78rem;
  text-align: center;
}

.booru-card.is-broken img,
.booru-card.is-broken video {
  display: none;
}

.booru-card-meta {
  min-height: 50px;
  padding: 5px 6px;
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
}

.booru-card-meta strong,
.booru-card-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booru-card-meta strong {
  color: var(--booru-link);
}

.booru-card-meta span {
  color: var(--booru-muted);
}

.booru-empty {
  margin: 24px 0;
  color: var(--booru-muted);
  text-align: center;
}

.booru-artist-links {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--booru-border);
  border-radius: 3px;
  background: var(--booru-panel);
  color: var(--booru-text);
}

.booru-artist-links h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  line-height: 1.2;
}

.booru-artist-links ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.booru-artist-links a {
  color: var(--booru-link);
  overflow-wrap: anywhere;
}

.booru-artist-links a:hover {
  color: var(--booru-link-hover);
}

.source-add-button {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--booru-border);
  border-radius: 3px;
  background: var(--booru-panel);
  color: var(--booru-link);
  cursor: pointer;
  font: 700 1rem/1 Arial, Helvetica, sans-serif;
  padding: 0;
}

.source-add-button:hover {
  color: var(--booru-link-hover);
}

.source-list {
  display: grid;
  gap: 6px;
}

.source-list a,
.source-list span {
  color: var(--booru-link);
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.source-list a:hover {
  color: var(--booru-link-hover);
}

.source-list span {
  color: var(--booru-muted);
  font-weight: 400;
}

.booru-open-image {
  width: 100%;
  margin-top: 14px;
}

.booru-post-page {
  width: min(1600px, calc(100% - 20px));
  margin: 0 auto 34px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.booru-post-sidebar,
.booru-post-main {
  border: 1px solid var(--booru-border);
  border-radius: 3px;
  background: var(--booru-page);
}

.booru-post-sidebar {
  position: sticky;
  top: 10px;
  max-height: calc(100vh - 20px);
  overflow: auto;
  padding: 8px;
}

.booru-back-link {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px;
  color: var(--booru-link);
  font-weight: 700;
  text-decoration: none;
}

.booru-back-link:hover {
  color: var(--booru-link-hover);
}

.booru-post-main {
  min-width: 0;
  padding: 8px;
}

.booru-post-bar {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 5px 7px;
  border: 1px solid var(--booru-border);
  border-radius: 3px;
  background: var(--booru-panel);
}

.booru-post-bar h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.booru-post-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.booru-post-media-frame {
  min-height: 420px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  border: 1px solid var(--booru-border);
  border-radius: 3px;
  background: var(--booru-media-bg);
  padding: 12px;
}

.booru-post-media-frame img,
.booru-post-media-frame video {
  display: block;
  min-width: min(100%, 280px);
  max-width: 100%;
  max-height: calc(100vh - 170px);
  object-fit: contain;
}

.booru-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.booru-post-actions .booru-open-image {
  width: auto;
  margin-top: 0;
}

.booru-tag-editor {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
}

.booru-tag-editor-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
}

.booru-tag-editor-panel {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--booru-border-strong);
  border-radius: 4px;
  background: var(--booru-page);
  color: var(--booru-text);
  padding: 12px;
}

.booru-qa-panel {
  width: min(760px, calc(100vw - 32px));
}

.tamers-home-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 12, 24, 0.72);
}

.tamers-home-popup-backdrop[hidden] {
  display: none !important;
}

.tamers-home-popup {
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--booru-border-strong);
  border-radius: 4px;
  background: var(--booru-page);
  color: var(--booru-text);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  padding: 18px;
}

.tamers-home-popup-btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--booru-border);
  border-radius: 3px;
  background: var(--booru-panel);
  color: var(--booru-text);
  cursor: pointer;
  font: 700 0.82rem/1 Arial, Helvetica, sans-serif;
  text-decoration: none;
}

.tamers-home-popup-btn:hover,
.tamers-home-popup-btn:focus-visible {
  background: var(--booru-panel-soft);
}

:root[data-theme="dark"] .tamers-home-popup-backdrop {
  background: rgba(3, 7, 16, 0.8);
}

.booru-qa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.booru-qa-header h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.booru-qa-close {
  flex: 0 0 auto;
}

.booru-tag-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.booru-tag-editor-header h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.booru-qa-content {
  display: grid;
  gap: 14px;
}

.booru-qa-item {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--booru-border);
}

.booru-qa-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.booru-qa-question {
  margin: 0 0 6px;
  color: var(--booru-text);
  font-size: 0.95rem;
  line-height: 1.25;
}

.booru-qa-answer {
  margin: 0 0 8px;
  color: var(--booru-text);
  line-height: 1.45;
}

.booru-qa-answer:last-child {
  margin-bottom: 0;
}

.booru-qa-answer a {
  color: var(--booru-link);
  overflow-wrap: anywhere;
}

.booru-tag-editor-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--booru-border);
  border-radius: 3px;
  background: var(--booru-panel);
  color: var(--booru-text);
  cursor: pointer;
  font: 700 1.1rem/1 Arial, Helvetica, sans-serif;
}

.booru-tag-editor-note,
.booru-tag-editor-status {
  margin: 0 0 10px;
  color: var(--booru-muted);
  line-height: 1.35;
}

.booru-tag-editor-status.is-error {
  color: #9f1d1d;
}

:root[data-theme="dark"] .booru-tag-editor-status.is-error {
  color: #ffb4b4;
}

.booru-editor-section {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--booru-border);
  border-radius: 3px;
  background: var(--booru-panel);
}

.booru-editor-section h3 {
  margin: 0;
  color: var(--booru-text);
  font-size: 0.92rem;
  line-height: 1.2;
}

.booru-editor-section .booru-tag-editor-field {
  margin-bottom: 0;
}

.booru-tag-editor-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--booru-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.booru-tag-editor-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.booru-tag-editor-add input {
  min-height: 32px;
  border: 1px solid var(--booru-border-strong);
  border-radius: 3px;
  background: #ffffff;
  color: #17212b;
  font: 400 0.9rem/1.2 Arial, Helvetica, sans-serif;
  padding: 0 8px;
}

.booru-tag-editor-field > input.booru-editor-text-input {
  padding: 0 8px;
}

.booru-editor-text-input {
  min-height: 32px;
  border: 1px solid var(--booru-border-strong);
  border-radius: 3px;
  background: #ffffff;
  color: #17212b;
  font: 400 0.9rem/1.2 Arial, Helvetica, sans-serif;
  padding: 0 8px;
}

textarea.booru-editor-text-input {
  min-height: 110px;
  resize: vertical;
  padding: 8px;
  line-height: 1.35;
}

:root[data-theme="dark"] .booru-tag-editor-add input {
  background: #111923;
  color: var(--booru-text);
}

:root[data-theme="dark"] .booru-editor-text-input {
  background: #111923;
  color: var(--booru-text);
}

.booru-category-picker {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--booru-border-strong);
  border-radius: 3px;
  background: var(--booru-panel-soft);
  color: var(--booru-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.booru-category-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.booru-category-option {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--booru-border);
  border-radius: 3px;
  background: var(--booru-page);
  color: var(--booru-link);
  cursor: pointer;
  font: 700 0.78rem/1 Arial, Helvetica, sans-serif;
}

.booru-category-option:hover,
.booru-category-option:focus-visible {
  color: var(--booru-link-hover);
  border-color: var(--booru-border-strong);
}

.booru-edit-tag-list {
  min-height: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  padding: 7px;
  border: 1px solid var(--booru-border);
  border-radius: 3px;
  background: var(--booru-panel);
}

.booru-edit-tag-list .booru-tag-chip.is-removed {
  opacity: 0.55;
  text-decoration: line-through;
}

.booru-edit-tag-list .booru-tag-chip.is-added {
  border-color: var(--booru-border-strong);
  background: var(--booru-tag-active);
}

.booru-tag-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.booru-turnstile {
  min-height: 65px;
}

.booru-post-meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 10px;
  margin: 10px 0 0;
  padding: 8px;
  border: 1px solid var(--booru-border);
  border-radius: 3px;
  background: var(--booru-panel);
}

.booru-post-meta dt {
  color: var(--booru-muted);
  font-weight: 700;
}

.booru-post-meta dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.booru-post-relationships {
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--booru-border);
  border-radius: 3px;
  background: var(--booru-panel);
}

.booru-post-relationships h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.booru-relation-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.booru-relation-list:last-child {
  margin-bottom: 0;
}

.booru-relation-card {
  min-width: 0;
  display: grid;
  gap: 4px;
  color: var(--booru-link);
  font-weight: 700;
  text-decoration: none;
}

.booru-relation-card:hover {
  color: var(--booru-link-hover);
}

.booru-relation-card img,
.booru-relation-card video {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: contain;
  border: 1px solid var(--booru-border);
  background: var(--booru-media-bg);
}

.booru-relation-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .booru-app,
  .booru-post-page {
    grid-template-columns: 1fr;
  }

  .booru-sidebar,
  .booru-post-sidebar {
    position: static;
    max-height: none;
  }

  .artist-tags {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }

  .booru-post-media-frame {
    min-height: 300px;
  }
}

@media (max-width: 720px) {
  .booru-shell {
    width: min(100% - 12px, 1600px);
    padding-top: 6px;
  }

  .booru-header {
    flex-direction: column;
    align-items: stretch;
  }

  .booru-nav {
    justify-content: flex-start;
  }

  .booru-grid {
    grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
    gap: 6px;
  }

  .booru-results,
  .booru-sidebar,
  .booru-post-main,
  .booru-post-sidebar {
    padding: 6px;
  }

  .booru-results-bar,
  .booru-post-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .booru-post-page {
    width: min(100% - 12px, 1600px);
  }

  .booru-post-media-frame {
    min-height: 220px;
    padding: 8px;
  }

  .booru-post-meta {
    grid-template-columns: 1fr;
  }
}
