/* The Tights Museum · tights.fyi - 2009-style overrides. */

:root {
  --site-max-width: 42rem;
  --site-nav-height: 2.5rem;
  --site-font: Georgia, "Times New Roman", serif;
  --site-font-weight: 400;
  /* 2009 palette: white page, dark text, blue links */
  --page-bg: #fff;
  --page-text: #333;
  --page-link: #0066cc;
  --page-link-visited: #551a8b;
  --page-border: #ccc;
  --page-muted: #666;
  --filter-box-bg: #f9f9f9;
  --filter-box-border: #ccc;
  --scrollbar-track: #f0f0f0;
  --scrollbar-thumb: #bbb;
  --scrollbar-thumb-hover: #999;
}

[data-theme="dark"] {
  --page-bg: #1a1a1a;
  --page-text: #e0e0e0;
  --page-link: #6eb3f7;
  --page-link-visited: #b38fdb;
  --page-border: #444;
  --page-muted: #999;
  --filter-box-bg: #252525;
  --filter-box-border: #444;
  --scrollbar-track: #252525;
  --scrollbar-thumb: #555;
  --scrollbar-thumb-hover: #666;
}

/* Scrollbars – WebKit (Chrome, Safari, Edge) and Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 0;
  border: 2px solid var(--scrollbar-track);
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}
*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

[data-theme="dark"] .heart-like-box,
[data-theme="dark"] .item-like-box {
  background: #2a2a2a;
}

[data-theme="dark"] .icon-btn:hover {
  background: #333;
  color: #6eb3f7;
}

[data-theme="dark"] .item-details {
  background: #252525;
  border-color: #444;
}

[data-theme="dark"] .theme-toggle-sun {
  color: #f0c040;
}

[data-theme="dark"] .browse-filters input,
[data-theme="dark"] .browse-filters select,
[data-theme="dark"] .browse-filters .site-input {
  background: #1a1a1a;
  color: var(--page-text);
  border-color: #444;
}

[data-theme="dark"] .browse-filters input::placeholder {
  color: var(--page-muted);
}

[data-theme="dark"] .browse-filters label,
[data-theme="dark"] .browse-filters .browse-filters__label {
  color: var(--page-text);
}

[data-theme="dark"] .browse-filters__categories .checkbox-label {
  color: var(--page-text);
}

/* Dark mode: native checkboxes are often light/invisible; use custom box + check */
[data-theme="dark"] input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid var(--page-border);
  border-radius: 3px;
  background: var(--filter-box-bg);
  cursor: pointer;
  vertical-align: middle;
  flex-shrink: 0;
}
[data-theme="dark"] input[type="checkbox"]:checked {
  background: var(--page-link);
  border-color: var(--page-link);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 6l3 3 5-6'/%3E%3C/svg%3E");
  background-size: 0.75rem 0.75rem;
  background-position: center;
  background-repeat: no-repeat;
}
[data-theme="dark"] input[type="checkbox"]:focus {
  outline: 2px solid var(--page-link);
  outline-offset: 1px;
}

[data-theme="dark"] .autocomplete-item:hover,
[data-theme="dark"] .autocomplete-item[aria-selected="true"] {
  background: #333;
}

/* Force white, flat 2009 look over Pico. !important so site font wins over Pico. */
html,
body {
  background: var(--page-bg) !important;
  color: var(--page-text) !important;
  font-family: var(--site-font) !important;
  font-weight: var(--site-font-weight);
}

a {
  color: var(--page-link) !important;
}

a:visited {
  color: var(--page-link-visited) !important;
}

a:hover {
  text-decoration: underline;
}

/* Boxy, no rounded corners */
.card-placeholder,
.ad-slot-placeholder {
  border-radius: 0;
}

/* Constrain main content so it doesn’t feel like a giant landing page */
main .container.page-home {
  max-width: var(--site-max-width);
  padding-top: 0.5rem;
  padding-bottom: 2rem;
}

/* Smaller, calmer hero - no giant headline */
.page-home__hero {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--page-border);
}

.page-home__title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-family: var(--site-font);
  margin-bottom: 0.25rem;
}

.page-home__title a {
  color: var(--page-text);
}

.page-home__tagline {
  font-size: 0.9rem;
  color: var(--page-muted);
  margin: 0;
}

.page-home__section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--page-muted);
  margin-bottom: 0.75rem;
}

.page-home__about {
  margin-bottom: 2rem;
}
.page-home__about-body {
  font-size: 0.95rem;
  line-height: 1.6;
}
.page-home__about-body p {
  margin: 0 0 1rem;
}
.page-home__about-body p:last-of-type {
  margin-bottom: 0;
}
.page-home__about-cta {
  margin-top: 1.25rem !important;
}
.page-home__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.page-home__grid .scan-card__img-link {
  display: block;
  line-height: 0;
}
.page-home__grid .scan-card__img-link img,
.page-home__grid .scan-card__img-link .card-placeholder {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.page-home__blog-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.page-home__blog-list li {
  margin-bottom: 1rem;
}
.page-home__blog-preview-title {
  font-weight: 600;
}
.page-home__blog-preview-excerpt {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  max-width: 38rem;
}
.page-home__donate-teaser {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--page-border);
  font-size: 0.9rem;
  color: var(--page-muted);
}

/* Browse page */
.page-about__section {
  margin-top: 1.5rem;
}
.page-about__section:first-of-type {
  margin-top: 0;
}
.page-about__section h2 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.page-browse {
  max-width: var(--site-max-width);
  padding-top: 0.5rem;
  padding-bottom: 2rem;
}
.browse-filters-details {
  margin-bottom: 1.5rem;
}
.browse-filters-summary {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  border-radius: 4px;
  background: var(--filter-box-bg);
  border: 1px solid var(--filter-box-border);
  user-select: none;
}
.browse-filters-summary::-webkit-details-marker { display: none; }
.browse-filters-summary:hover {
  background: var(--page-bg-hover, rgba(0, 0, 0, 0.04));
}
.browse-filters-details[open] .browse-filters-summary {
  margin-bottom: 0.75rem;
  border-radius: 4px 4px 0 0;
}
.browse-filters {
  padding: 1rem;
  background: var(--filter-box-bg);
  border: 1px solid var(--filter-box-border);
  border-top: none;
}
.browse-filters-details[open] .browse-filters {
  border-radius: 0 0 4px 4px;
}
.browse-filters__row { margin-bottom: 0.75rem; }
.browse-filters__row label { display: block; margin-bottom: 0.25rem; font-size: 0.9rem; }
.browse-filters__input { max-width: 20rem; }
.browse-filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.browse-filters__field label { display: block; margin-bottom: 0.2rem; font-size: 0.85rem; }
.browse-filters__field .site-input { width: 100%; box-sizing: border-box; }
.browse-filters__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.admin-filter-box {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  background: var(--filter-box-bg);
  border: 1px solid var(--filter-box-border);
}
.admin-filter-box h3 { margin-top: 0; }
.admin-filter-box label,
.admin-filter-box .site-input { color: var(--page-text); }
.admin-filter-box .site-input { background: var(--page-bg); border-color: var(--page-border); }

.admin-prune-box {
  border: 1px solid var(--page-border);
  padding: 1rem;
  margin-top: 2rem;
  border-radius: 4px;
  background: #fef5f5 !important;
  color: #333;
}
.admin-prune-box h3 { margin-top: 0; }
.admin-prune-box label,
.admin-prune-box .checkbox-label { color: inherit; }
.admin-prune-box a { color: var(--page-link) !important; }

[data-theme="dark"] .admin-prune-box {
  background: #2a2020 !important;
  border-color: var(--page-border);
  color: var(--page-text);
}
[data-theme="dark"] .admin-prune-box label,
[data-theme="dark"] .admin-prune-box .checkbox-label { color: var(--page-text); }
[data-theme="dark"] .admin-prune-box .icon-btn--danger {
  background: #4a2020;
  border-color: #663333;
  color: #f08;
}
[data-theme="dark"] .admin-prune-box .icon-btn--danger:hover {
  background: #5a2828;
  color: #f28;
}

.browse-results-count { margin-bottom: 1rem; font-size: 0.9rem; }
.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.browse-grid .scan-card__img-link { display: block; line-height: 0; }
.browse-grid .scan-card__img-link img,
.browse-grid .scan-card__img-link .card-placeholder {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

/* Admin mail form */
.admin-mail .admin-form label {
  display: block;
  margin-top: 0.5rem;
  margin-bottom: 0.2rem;
  font-size: 0.85rem;
}
.admin-mail .admin-form .site-input,
.admin-mail .admin-form textarea {
  width: 100%;
  max-width: 32rem;
  box-sizing: border-box;
}

/* Tighter scan cards */
.scan-card {
  font-size: 0.9rem;
  margin-top: 0rem;
  margin-bottom: 0.15rem;
}

.scan-card__title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.scan-card__meta {
    font-size: 0.75rem;
}

.scan-card__brand {
    text-transform: uppercase;
    font-weight: 500;
    line-height: 0.75rem;
    font-size: 0.7rem;
}

.scan-card__material {
  font-size: 0.8rem;
  color: var(--page-muted);
  margin-bottom: 0.35rem;
}

.scan-card__summary {
  margin: 0;
  line-height: 1.4;
  font-size: 0.75rem;
}

.scan-card__lock {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  color: var(--page-text, #333);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 4px;
  padding: 0.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.scan-card__lock iconify-icon {
  font-size: 1rem;
}

/* Nav: compact, flat white bar like 2009 */
.site-nav {
  max-width: var(--site-max-width);
  min-height: var(--site-nav-height);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  background: var(--page-bg) !important;
  border-bottom: 1px solid var(--page-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.site-nav > ul {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  /* gap: 0.5rem 1rem; */
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav > ul li {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.3;
}

.site-nav a {
  color: var(--page-link) !important;
}

.site-brand {
  font-family: var(--site-font);
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.site-logo-icon {
  /* width: 1.15em;
  height: 1.15em; */
  color: currentColor;
  flex-shrink: 0;
}

.nav-user {
  display: inline-flex;
  align-items: baseline;
}

.nav-user-text {
  font-size: 0.9rem;
}

.nav-logout-form {
  display: inline;
  margin: 0;
  transform: translateY(0.15rem);
}

.icon-down-25 {
  transform: translateY(0.25rem);
}

.icon-down-20 {
  transform: translateY(0.2rem);
}

.icon-down-15 {
  transform: translateY(0.15rem);
}

.icon-down-10 {
  transform: translateY(0.1rem);
}

.icon-down-5 {
  transform: translateY(0.05rem);
}

.icon-up-5 {
  transform: translateY(-0.05rem);
}

.icon-up-10 {
  transform: translateY(-0.1rem);
}

.icon-up-15 {
  transform: translateY(-0.15rem);
}

.nav-logout-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--page-link);
  cursor: pointer;
  font: inherit;
  font-size: inherit;
  text-decoration: underline;
}

.nav-logout-btn:hover {
  color: var(--page-link-visited);
}

/* Footer: small and contained */
.site-footer {
  max-width: var(--site-max-width);
  padding-top: 1rem;
  padding-bottom: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--page-border);
}

.site-footer small {
  font-size: 0.8rem;
  color: var(--page-muted);
}

.site-footer a {
  color: var(--page-muted);
}

.site-footer a:hover {
  color: var(--page-link);
}

.share-buttons {
  display: flex;
  align-items: center;
  gap: 0.35rem 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: var(--page-muted);
}
.share-buttons__label {
  margin-right: 0.25rem;
}
.share-buttons__link {
  color: var(--page-muted);
  text-decoration: underline;
}
.share-buttons__link:hover {
  color: var(--page-link);
}

/* Ad and secondary sections: same width, smaller text */
.site-width {
  max-width: var(--site-max-width);
  font-size: 0.9rem;
  color: var(--page-muted);
}

.site-width a {
  color: var(--page-link);
}

.site-width h1 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Form controls: smaller inputs and buttons site-wide */
main input[type="text"],
main input[type="password"],
main input[type="email"],
main button[type="submit"],
main button[type="button"] {
  font-size: 0.9rem;
  padding: 0.35rem 0.5rem;
  line-height: 1.3;
}

main button[type="submit"],
main button[type="button"] {
  padding: 0.4rem 0.65rem;
}

main label {
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.error-msg {
  color: #c00;
  font-size: 0.9rem;
}

.user-tier {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--page-muted);
  margin-left: 0.25rem;
}

.user-tier-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--page-muted);
  margin-left: 0.2rem;
  font-weight: 500;
}

.user-rank-badge {
  font-size: 0.7rem;
  text-transform: capitalize;
  letter-spacing: 0.03em;
  margin-left: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}

.password-field {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  position: relative;
}

.password-field input {
  flex: 1;
  min-width: 0;
}

.password-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--page-border);
  padding: 0.35rem;
  cursor: pointer;
  color: var(--page-muted);
  border-radius: 0;
}

.password-toggle:hover {
  color: var(--page-text);
}

.password-toggle iconify-icon {
  /* width: 1.1rem;
  height: 1.1rem; */
}

/* Icon buttons: compact, icon-only actions */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--page-border);
  padding: 0.35rem;
  cursor: pointer;
  color: var(--page-text);
  font: inherit;
  font-size: 0.9rem;
  min-width: 2rem;
  max-height: 2rem;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
  margin: 0;
}

.square-icon-btn {
  width: 1.5rem !important;
  height: 1.5rem !important;
  padding: 0 !important;
  border: none;
  margin-left: 0.1rem;
}

.icon-btn:hover {
  background: #f5f5f5;
  color: #7cbeff;
}

.icon-btn iconify-icon {
  flex-shrink: 0;
}

/* Pico kills animation on ::after unless element has [aria-busy=true]. We set aria-busy in JS with is-loading; hide Pico's own loading ::before so only our spinner shows. */
.icon-btn[aria-busy="true"]::before {
  display: none !important;
}

.icon-btn.is-loading {
  pointer-events: none;
  opacity: 0.8;
  position: relative;
}

.icon-btn.is-loading iconify-icon {
  opacity: 0;
}

.icon-btn.is-loading::after {
  content: '';
  display: block;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  -webkit-animation: btn-spin 0.6s linear infinite;
  will-change: transform;
  z-index: 1;
}

@keyframes btn-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@-webkit-keyframes btn-spin {
  from { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
  to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

.icon-btn--danger:hover {
  background: #fee;
  color: #c00;
}

.icon-btn--primary {
  background: #5ba3e8;
  color: #fff !important;
  border: 1px solid #5ba3e8;
}

.icon-btn--primary:hover,
.icon-btn--primary:focus {
  background: #4a8fd4;
  border-color: #4a8fd4;
  color: #fff;
}

a.icon-btn--primary:visited {
  color: #fff !important;
}

a.icon-btn--primary:hover:visited,
a.icon-btn--primary:focus:visited {
  color: #fff;
}

/* Inline icon buttons for forms */
.form-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.form-actions .icon-btn {
  margin: 0;
}

/* Upload steps: nav bar (top and bottom) */
.step-nav {
  margin: 1rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid var(--page-border, #e0e0e0);
}
.step-nav--bottom {
  border-top: 1px solid var(--page-border, #e0e0e0);
  border-bottom: 1px solid var(--page-border, #e0e0e0);
}
.step-nav__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0;
}
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}
.blog-form label { display: block; margin-top: 0.75rem; margin-bottom: 0.25rem; }
.blog-form .site-input { width: 100%; max-width: 100%; box-sizing: border-box; }
.blog-form textarea { min-height: 12rem; }

/* Blog list & post */
.page-blog { max-width: var(--site-max-width); padding-top: 0.5rem; padding-bottom: 2rem; }
.blog-list { list-style: none; padding: 0; margin: 0; }
.blog-list__item { margin-bottom: 0.75rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--page-border); }
.blog-list__title { font-weight: 600; }
.blog-list__meta { font-size: 0.85rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.15rem; margin-top: 0.2rem; }
.blog-index__actions { margin-bottom: 1rem; }
.blog-drafts__title { font-size: 1rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.blog-post__header { margin-bottom: 1rem; }
.blog-post__title { font-size: 1.5rem; margin-bottom: 0.35rem; }
.blog-post__meta { font-size: 0.9rem; margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 0.15rem; }
.blog-post__body { margin: 1rem 0; line-height: 1.55; }
.blog-post__actions { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--page-border); }

/* Compact action groups */
.action-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.action-group .icon-btn {
  margin: 0;
}

.ad-slot-placeholder {
  border: 1px dashed var(--page-border);
  padding: 0.75rem;
  text-align: center;
  color: var(--page-muted);
  font-size: 0.75rem;
}

.donate-custom-input {
  width: 6rem !important;
  height: 2rem !important;
  padding: 0 0.5rem !important;
  box-sizing: border-box;
  line-height: 1;
  border: 1px solid var(--page-border);
  border-radius: 2px;
  margin: 0 !important;
}

.card-placeholder {
  aspect-ratio: 1;
  background: #f5f5f5;
  border: 1px solid var(--page-border);
  border-radius: 0;
}

/* Uploads */
.uploads-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.uploads-list li {
  margin-bottom: 0.5rem;
}
.uploads-list .status {
  font-size: 0.75rem;
  color: var(--page-muted);
  margin-left: 0.5rem;
}
.upload-category {
  margin-bottom: 1rem;
}
.cover-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cover-option {
  display: block;
  cursor: pointer;
}
.cover-thumb {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 2px solid var(--page-border);
}
.cover-option input:checked + .cover-thumb {
  border-color: var(--page-link);
}
.item-cover {
  max-width: 100%;
  max-height: 25rem;
  display: block;
}

/* Item hero: cover image left, item details right */
.item-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
  margin: 1rem 0 1.5rem;
}

.item-hero__media {
  flex: 0 0 auto;
}

.item-hero__media .item-cover {
  max-width: 280px;
  max-height: 25rem;
  width: auto;
  height: auto;
}

.item-hero__details {
  flex: 1 1 280px;
  min-width: 0;
}

/* Screen-reader only: visible to crawlers and assistive tech, hidden visually */
.sr-only {
  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(--page-muted);
  /* font-size: 0.9rem; */
}

.meta-line {
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.short-review {
  margin-top: 0.5rem;
  font-style: italic;
  color: var(--page-text);
}

/* Step 2 storage size table */
.step2-size-table {
  margin: 0 0 1rem;
  border-collapse: collapse;
}
.step2-size-table th,
.step2-size-table td {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--page-border);
  text-align: left;
}
.step2-size-table th {
  background: var(--page-muted);
  font-weight: 600;
}
.step2-size-caption {
  caption-side: top;
  text-align: left;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* Step 2 image grid: rearrangeable, category + cover */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.image-card {
  position: relative;
  border: 1px solid var(--page-border);
  padding: 0.5rem;
  background: var(--page-bg);
  cursor: grab;
}
.image-card:active {
  cursor: grabbing;
}
.image-card.dragging {
  opacity: 0.6;
}
.image-card-thumb {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  margin-bottom: 0.35rem;
}
.image-card-category,
.image-card-cover {
  display: block;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}
.image-card-category select {
  width: 100%;
  font-size: 0.8rem;
  padding: 0.2rem;
}
.image-card-cover input {
  margin-right: 0.25rem;
}
.image-card-remove {
  margin-top: 0.5rem;
  display: block;
}
.image-card-remove .icon-btn {
  font-size: 0.85rem;
  padding: 0.25rem 0.4rem;
}
.image-card--hidden {
  opacity: 0.7;
}
.image-card-hidden-badge {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.35rem;
  background: var(--page-muted);
  color: var(--page-bg);
  border-radius: 0.2rem;
  z-index: 1;
}
.image-card-hide {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
}
.image-card-hide input {
  margin-right: 0.25rem;
}

/* Step 2 image processing subpage */
.process-image-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.process-image-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--page-border);
  padding: 0.35rem;
  border-radius: 0.35rem;
  cursor: pointer;
  background: var(--page-bg);
}
.process-image-card:has(input:checked) {
  border-color: var(--page-link);
  box-shadow: 0 0 0 2px var(--page-link);
}
.process-image-card__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}
.process-image-card input {
  margin-bottom: 0.25rem;
}
.process-image-card .process-preview-server-btn {
  margin-top: 0.35rem;
  padding: 0.25rem;
  font-size: 1rem;
  flex-shrink: 0;
}
.process-image-thumb {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 0.2rem;
}
.process-image-id {
  font-size: 0.75rem;
  color: var(--page-muted);
  margin-top: 0.2rem;
}
.process-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
  max-width: 36rem;
}
.process-control {
  display: grid;
  grid-template-columns: 14rem 12rem 4.5rem auto;
  align-items: center;
  gap: 0.75rem;
}
.process-control__label {
  margin: 0;
  min-width: 0;
}
.process-control__slider {
  width: 100%;
  min-width: 8rem;
  box-sizing: border-box;
}
.process-control__val,
.process-control__num {
  min-width: 2.75rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.process-control__num {
  width: 3.5rem;
  padding: 0.25rem 0.35rem;
}
.process-control__reset {
  justify-self: start;
  padding: 0.2rem 0.4rem;
  font-size: 1rem;
  line-height: 1;
}
.process-control__reset:not(:hover):not(:focus) {
  opacity: 0.7;
}
.process-clipboard-actions {
  margin: 0.5rem 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.process-preview-wrap {
  margin: 0.75rem 0;
  border: 1px solid var(--page-border);
  border-radius: 0.35rem;
  overflow: hidden;
  display: inline-block;
  background: #eee;
}
.process-preview-wrap canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.process-progress-panel {
  margin: 1.5rem 0;
  max-width: 28rem;
}
.process-progress-status {
  margin: 0 0 0.5rem;
  font-weight: 500;
}
.process-progress-bar-wrap {
  height: 1.25rem;
  background: var(--page-border, #ddd);
  border-radius: 0.35rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.process-progress-bar {
  height: 100%;
  background: var(--primary, #333);
  border-radius: 0.35rem;
  transition: width 0.3s ease;
}
.process-progress-eta {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

/* Step 2 – Crop page */
.page-crop { max-width: 1200px; }
.crop-layout {
  display: grid;
  grid-template-columns: 1fr minmax(18rem, 320px);
  gap: 1.5rem;
  align-items: start;
  margin-top: 1rem;
}
@media (max-width: 768px) {
  .crop-layout { grid-template-columns: 1fr; }
}
.crop-preview-area {
  position: relative;
  background: var(--page-border, #ddd);
  border-radius: 4px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.crop-canvas {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}
.crop-canvas-hint {
  position: absolute;
  margin: 0;
  padding: 1rem;
}
.crop-controls {
  padding: 1rem;
  background: var(--filter-box-bg);
  border: 1px solid var(--filter-box-border);
  border-radius: 4px;
}
.crop-controls h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.crop-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.crop-rotation { margin-bottom: 1rem; }
.crop-control-label { display: block; font-size: 0.9rem; margin-bottom: 0.35rem; }
.crop-rotation-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.crop-rotation-slider { flex: 1; min-width: 0; }
.crop-rotation-num { width: 4rem; text-align: center; }
.crop-rotation-nudges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.crop-autocrop { margin-bottom: 1rem; }
.crop-autocrop-options { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.crop-autocrop-options .crop-field-row { margin-bottom: 0; }
.crop-autocrop-options .site-input { width: 4rem; }
.crop-field-row { margin-bottom: 0.5rem; }
.crop-field-row label { display: block; font-size: 0.85rem; margin-bottom: 0.2rem; }
.crop-field-with-nudges { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.crop-field-with-nudges .site-input { width: 5rem; }
.crop-field-nudge { padding: 0.2rem 0.4rem; font-size: 0.85rem; min-width: 2rem; }
.crop-nudge { padding: 0.25rem 0.5rem; font-size: 0.9rem; }
.crop-fields {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.crop-field-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.75rem;
  align-items: center;
}
.crop-fields .site-input { max-width: 8rem; }
.crop-actions { margin-top: 0.75rem; }

/* Custom HTML autocomplete (replaces native datalist) */
.autocomplete-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 24rem;
}
.autocomplete-inner {
  position: relative;
  display: block;
  width: 100%;
}
.autocomplete-list {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--page-border);
  background: var(--page-bg);
  max-height: 12rem;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transform: translateY(-1rem);
}
.autocomplete-list.open {
  display: block;
}
.autocomplete-item {
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  border-bottom: 1px solid var(--page-border);
  font-size: 0.95rem;
}
.autocomplete-item:last-child {
  border-bottom: none;
}
.autocomplete-item:hover,
.autocomplete-item[aria-selected="true"] {
  background: #e8e8e8;
}

/* Avatars */
.avatar-img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--page-border);
}

.post-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.post-author-avatar {
  width: 40px;
  height: 40px;
}

/* Inline user with small avatar (comments, item author, blog, reviews) */
.user-line {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  vertical-align: middle;
}
.user-avatar {
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
}
.user-avatar--sm {
  width: 24px;
  height: 24px;
}
.user-avatar--placeholder {
  display: inline-block;
  font-size: 1.3rem;
  color: var(--text-muted, #666);
}

/* Item image grid on show page */
.item-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}
.item-image-card {
  border: 1px solid var(--page-border);
  padding: 0.35rem;
  background: var(--page-bg);
}
.item-image-thumb {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  margin-bottom: 0.25rem;
}
.item-image-label {
  font-size: 0.75rem;
  color: var(--page-muted);
}

/* Comments section */
.item-comments-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--page-border);
}

.item-comments-section h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.item-comments {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

.item-comment {
  margin-bottom: 1rem;
  /* padding-bottom: 1rem; */
  border-bottom: 1px solid #f0f0f0;
}

.item-comment:last-child {
  border-bottom: none;
}

.item-comment-meta {
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.item-comment-meta a {
  font-weight: 600;
}

.item-comment p {
  margin: 0.5rem 0;
  line-height: 1.5;
}

.item-rating-form {
  margin-top: 0.75rem;
}

.item-rating-form input[type="number"] {
  font-size: 0.9rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--page-border);
  width: 4rem;
}

.item-comments-help {
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.item-comment-body {
  margin: 0.5rem 0;
  line-height: 1.5;
}

.item-comment-body p:first-child { margin-top: 0; }
.item-comment-body p:last-child { margin-bottom: 0; }
.item-comment-body blockquote {
  margin: 0.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--page-border);
  color: var(--page-muted);
}
/* Stacked/nested blockquotes */
.item-comment-body blockquote blockquote {
  margin-left: 0.5rem;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  border-left-width: 2px;
  opacity: 0.95;
}
.item-comment-body code { font-size: 0.9em; padding: 0.1em 0.3em; background: #f5f5f5; color: #333; }
.item-comment-body pre { overflow-x: auto; padding: 0.5rem; background: #f5f5f5; color: #333; margin: 0.5rem 0; }
.item-comment-body pre code { padding: 0; background: none; color: inherit; }
/* Dark mode: code and code blocks */
[data-theme="dark"] .item-comment-body code,
[data-theme="dark"] .forum-post__body code {
  background: var(--filter-box-bg);
  color: var(--page-text);
  border: 1px solid var(--page-border);
}
[data-theme="dark"] .item-comment-body pre,
[data-theme="dark"] .forum-post__body pre {
  background: var(--filter-box-bg);
  color: var(--page-text);
  border: 1px solid var(--page-border);
}
[data-theme="dark"] .item-comment-body pre code,
[data-theme="dark"] .forum-post__body pre code {
  background: none;
  border: none;
  color: inherit;
}

/* Wiki (and any comment body): center divs center block-level images */
.wiki-article-body div[style*="text-align:center"] img,
.item-comment-body div[style*="text-align:center"] img,
.wiki-preview div[style*="text-align:center"] img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.wiki-article-body div[style*="text-align:center"] p,
.item-comment-body div[style*="text-align:center"] p,
.wiki-preview div[style*="text-align:center"] p {
  text-align: center;
}

/* Wiki index: category cards */
.page-wiki--index .wiki-index__header {
  margin-bottom: 1.5rem;
}
.page-wiki--index .wiki-index__header h1 {
  margin: 0 0 0.5rem 0;
}
.page-wiki--index .wiki-index__actions {
  margin: 0;
}
.page-wiki--index .wiki-category-list {
  display: grid;
  gap: 1rem;
}
.page-wiki--index .wiki-category-card {
  border: 1px solid var(--page-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--filter-box-bg);
  padding: 1.25rem 1.5rem;
}
.page-wiki--index .wiki-category-card__head {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--page-border);
}
.page-wiki--index .wiki-category-card__title {
  margin: 0;
  font-size: 1.2rem;
}
.page-wiki--index .wiki-category-card__title a {
  text-decoration: none;
}
.page-wiki--index .wiki-category-card__title a:hover {
  text-decoration: underline;
}
.page-wiki--index .wiki-category-card__count {
  font-size: 0.9rem;
}
.page-wiki--index .wiki-category-card__articles {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  font-size: 0.95rem;
}
.page-wiki--index .wiki-category-card__articles li {
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--page-border);
}
.page-wiki--index .wiki-category-card__articles li:last-child {
  border-bottom: none;
}
.page-wiki--index .wiki-category-card__empty {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
}
.page-wiki--index .wiki-category-card__actions {
  margin: 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--page-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.page-wiki--index .wiki-empty {
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--page-border);
  border-radius: 6px;
  background: var(--filter-box-bg);
}
.page-wiki--index .wiki-empty p {
  margin: 0 0 0.5rem 0;
}
.page-wiki--index .wiki-empty p:last-child {
  margin-bottom: 0;
}

/* Wiki show: sidebar + article */
.page-wiki--show {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 72rem;
  align-items: flex-start;
}
.page-wiki--show .wiki-sidebar {
  min-width: 14rem;
  flex-shrink: 0;
}
.page-wiki--show .wiki-sidebar__box {
  border: 1px solid var(--page-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--filter-box-bg);
  padding: 1.25rem;
  position: sticky;
  top: 1rem;
}
.page-wiki--show .wiki-sidebar__title {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  font-weight: 600;
}
.page-wiki--show .wiki-sidebar__title a {
  text-decoration: none;
}
.page-wiki--show .wiki-sidebar__title a:hover {
  text-decoration: underline;
}
.page-wiki--show .wiki-sidebar__nav {
  margin-bottom: 1rem;
}
.page-wiki--show .wiki-sidebar__list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.95rem;
}
.page-wiki--show .wiki-sidebar__item {
  border-bottom: 1px solid var(--page-border);
}
.page-wiki--show .wiki-sidebar__item:last-child {
  border-bottom: none;
}
.page-wiki--show .wiki-sidebar__link {
  display: block;
  padding: 0.4rem 0;
  text-decoration: none;
}
.page-wiki--show .wiki-sidebar__link:hover {
  text-decoration: underline;
}
.page-wiki--show .wiki-sidebar__link--current {
  font-weight: 600;
  color: var(--page-text);
}
.page-wiki--show .wiki-sidebar__actions {
  padding-top: 0.75rem;
  border-top: 1px solid var(--page-border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.page-wiki--show .wiki-article {
  flex: 1;
  min-width: 0;
  max-width: 72rem;
  border: 1px solid var(--page-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--filter-box-bg);
  padding: 1.5rem 2rem;
}
.page-wiki--show .wiki-article__head {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--page-border);
}
.page-wiki--show .wiki-article__title {
  margin: 0;
  font-size: 1.5rem;
}
.page-wiki--show .wiki-article__body {
  margin: 0;
  line-height: 1.55;
}
.page-wiki--show .wiki-article__body p:first-child {
  margin-top: 0;
}
.page-wiki--show .wiki-article__body p:last-child {
  margin-bottom: 0;
}
@media (max-width: 640px) {
  .page-wiki--show {
    flex-direction: column;
    gap: 1.5rem;
  }
  .page-wiki--show .wiki-sidebar {
    min-width: 0;
    width: 100%;
  }
  .page-wiki--show .wiki-sidebar__box {
    position: static;
  }
  .page-wiki--show .wiki-article {
    padding: 1.25rem;
  }
}

.item-comments--nested {
  margin-top: 0.5rem;
  margin-left: 1.25rem;
  margin-bottom: 0.5rem;
}

.item-comment-form {
  margin-top: 1rem;
}

.item-comment-form label {
  display: block;
  margin-bottom: 0.35rem;
}

.item-comment-form textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 5rem;
  max-width: 42rem;
  font-size: 0.9rem;
  padding: 0.5rem;
  border: 1px solid var(--page-border);
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.item-comment-form--main textarea {
  min-height: 6rem;
}

.item-comment-form button[type="submit"] {
  margin-top: 0.5rem;
}

.item-comment-form--reply {
  margin-top: 0.75rem;
}

.item-comment-form--reply textarea {
  min-height: 4rem;
}

.item-comment-edit-form {
  margin-top: 0.5rem;
}
.item-comment-edit-form textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 4rem;
  margin-bottom: 0.35rem;
  box-sizing: border-box;
}
.item-comment-edit-form button {
  margin-right: 0.35rem;
}

.comment-vote-row {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.comment-vote-form {
  display: inline;
  margin: 0;
}

.icon-btn--vote {
  min-width: 1.5rem;
  padding: 0.2rem;
  background: none;
  border: none;
  color: var(--page-muted);
}

.icon-btn--vote:hover {
  background: none;
  color: var(--page-text);
}

.icon-btn--vote-active {
  color: #5ba3e8;
}

.icon-btn--vote-active.icon-btn--vote-down {
  color: #c00;
}

.comment-vote-score {
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 1.25rem;
  text-align: center;
}

.item-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.item-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Rounded bg for heart like + bookmark (used globally by heart-like partial) */
.heart-like-box,
.item-like-box {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0.2rem;
  background: #f5f5f5;
  border-radius: 0.35rem;
}

.heart-like-count {
    margin-right: 0.25rem;
}

.item-like-count {
  margin-right: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.item-like-count .icon-heart-count {
  font-size: 1.1rem;
  color: #c00;
}

.item-like-form {
  display: inline;
  margin: 0;
}

.item-like-count {
  background: #f2f2f2; /* light grey */
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}


.icon-btn--heart {
    width: 1.6rem;
    height: 1.6rem;
    padding: 0;
    border: none;
    position: relative;
}

.icon-btn--heart .heart-icon-liked {
  color: #c00;
}

.icon-btn--heart .heart-icon-unliked {
  color: var(--page-muted);
}

.icon-btn--heart:hover {
  background: none;
}

.icon-btn--heart .heart-icon {
  font-size: 1.4rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%);
  transition: opacity 0.15s ease;
}

.icon-btn--heart .heart-icon--hover {
  opacity: 0;
}

.icon-btn--heart:hover .heart-icon--on {
  opacity: 0;
}

.icon-btn--heart:hover .heart-icon--hover {
  opacity: 1;
}

/* AJAX heart like: both icon sets in DOM, toggle visibility by .liked */
.heart-like-form--ajax.liked .heart-icon-unliked {
  display: none;
}
.heart-like-form--ajax:not(.liked) .heart-icon-liked {
  display: none;
}

.icon-btn--bookmark {
  min-width: auto;
  padding: 0.25rem !important;
  background: none;
  border: none;
  color: var(--page-muted);
}

.icon-btn--bookmark:hover {
  background: none;
}

.icon-btn--bookmark iconify-icon {
  font-size: 1.4rem;
}

/* AJAX bookmark: 4 icons (bookmarked default+hover, unbookmarked default+hover), like heart */
.item-bookmark-form--ajax .icon-btn--bookmark {
  position: relative;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0 !important;
  min-width: 1.6rem;
}
.item-bookmark-form--ajax .icon-btn--bookmark .bookmark-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-60%, -40%);
  transition: opacity 0.15s ease;
  font-size: 1.4rem;
}
.icon-btn--bookmark .bookmark-icon--bookmarked {
  color: #5ba3e8;
}
.icon-btn--bookmark .bookmark-icon--unbookmarked {
  color: var(--page-muted);
}
.icon-btn--bookmark .bookmark-icon--hover {
  opacity: 0;
}
.icon-btn--bookmark:hover .bookmark-icon--on {
  opacity: 0;
}
.icon-btn--bookmark:hover .bookmark-icon--hover {
  opacity: 1;
}
.item-bookmark-form--ajax.bookmarked .bookmark-icon--unbookmarked {
  display: none;
}
.item-bookmark-form--ajax:not(.bookmarked) .bookmark-icon--bookmarked {
  display: none;
}

.icon-btn-label { margin-left: 0.35rem; }

/* Item details box (denier, color, material, features, etc.) */
.item-details {
  /* margin-top: 1rem; */
  padding: 1rem 1.25rem;
  border: 1px solid var(--page-border);
  border-radius: 0.35rem;
  background: var(--page-bg-alt, #f8f9fa);
}

.item-details__heading {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.item-details__body {
  font-size: 0.9rem;
}

.item-details__body p {
  margin: 0.35rem 0;
}

.item-details__materials {
  margin: 0.5rem 0;
}

.item-details__materials > strong {
  display: block;
  margin-bottom: 0.25rem;
}

.item-details__material-row {
  margin: 0.15rem 0 0.15rem 1rem;
}

/* Star ratings */
.rating-row {
  font-size: 0.9rem;
  margin: 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.rating-label {
  font-weight: 600;
  margin-right: 0.25rem;
  min-width: 6rem;
}

.rating-stars iconify-icon {
  width: 1rem;
  height: 1rem;
  color: #f5a623;
}

.rating-value {
  margin-left: 0.35rem;
  font-size: 0.8rem;
  color: var(--page-muted);
}

.rating-row--overall {
  margin-top: 0.5rem;
  font-size: 1rem;
}

.rating-row--overall .rating-label {
  font-weight: 700;
}

.rating-row--overall .rating-stars iconify-icon {
  /* width: 1.1rem;
  height: 1.1rem; */
}

/* Individual community reviews */
.community-reviews-heading {
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
  font-weight: 600;
}
.community-reviews-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.community-review-card {
  border: 1px solid var(--page-border);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--page-bg);
  border-radius: 4px;
}
.community-review-meta {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
}
.community-review-stars {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}
.community-review-stars .rating-stars iconify-icon {
}
.community-review-text {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Your rating: clickable stars – no button chrome, just stars in a row */
.rating-form-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.35rem 0;
  font-size: 0.9rem;
}
.rating-form-row .rating-label {
  min-width: 6rem;
  font-weight: 600;
}
.star-rating-input {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
}
.star-rating-input iconify-icon {
  width: 1.1rem;
  height: 1.1rem;
  color: #f5a623;
  cursor: pointer;
  padding: 0.1rem;
  margin: 0;
  border: none;
  background: none;
  border-radius: 0;
  flex-shrink: 0;
}
.star-rating-input iconify-icon:hover {
  opacity: 0.9;
  background: none;
}
.star-rating-input iconify-icon:focus {
  outline: 1px dotted var(--page-fg);
  outline-offset: 1px;
  background: none;
}

.rating-review-label {
  display: block;
  font-weight: 600;
  margin: 0.75rem 0 0.25rem;
  font-size: 0.9rem;
}
#rating-review {
  width: 100%;
  max-width: 36rem;
  min-height: 4rem;
  box-sizing: border-box;
}
.rating-save-review-btn {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  background: none;
  border: none;
  color: var(--page-muted);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.rating-save-review-btn:hover {
  color: var(--page-fg);
}

.rating-view-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
}
.rating-view-actions form {
  display: inline-block;
  margin: 0;
  flex-shrink: 0;
}
.rating-view-actions .icon-btn,
.rating-view-actions button {
  margin: 0;
  flex-shrink: 0;
}

.rating-form-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
}
.rating-form-actions .icon-btn,
.rating-form-actions button {
  margin: 0;
  flex-shrink: 0;
  display: inline-flex;
}

/* Image lightbox */
.image-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-in-out;
}
.image-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.image-lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  background: #fff;
  border: 1px solid var(--page-border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.image-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #fff;
  border: 1px solid var(--page-border);
  padding: 0.1rem 0.4rem;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  color: black;
  padding-bottom: 0.25em;
}
.image-lightbox__prev,
.image-lightbox__prev, .image-lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--page-border);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
    z-index: 1;
    transition: background 0.15s ease;
    color: black;
    padding-top: 0;
    padding-bottom: 0.15rem;
}
.image-lightbox__prev:hover,
.image-lightbox__next:hover {
  background: #fff;
}
.image-lightbox__prev {
  left: 1rem;
}
.image-lightbox__next {
  right: 1rem;
}

/* Icon utility: consistent size and alignment for iconify-icon */
.icon,
iconify-icon.icon {
  display: inline-block;
  vertical-align: -0.25em;
}
.icon--sm,
iconify-icon.icon--sm {
}
.icon--lg,
iconify-icon.icon--lg {
}

/* Admin panel tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.admin-table th,
.admin-table td {
  border: 1px solid var(--page-border);
  padding: 0.35rem 0.5rem;
  text-align: left;
}
.admin-table th {
  background: var(--page-border);
  font-weight: 600;
}
.admin-nav a {
  margin-right: 0.5rem;
}

/* Stats page */
.page-stats h1 {
  margin-bottom: 1rem;
}
.stats-section {
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
}
.stats-section--items {
  background: #e8f4fc;
}
.stats-section--users {
  background: #f5f0e8;
}
[data-theme="dark"] .stats-section--items {
  background: #1a2835;
  border: 1px solid var(--page-border);
}
[data-theme="dark"] .stats-section--users {
  background: #2a2820;
  border: 1px solid var(--page-border);
}
.stats-section h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}
.stats-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.stats-tab {
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  border-radius: 0.25rem;
  background: rgba(0,0,0,0.06);
  color: inherit;
  text-decoration: none;
}
.stats-tab:hover {
  background: rgba(0,0,0,0.1);
}
.stats-tab--active {
  background: rgba(0,0,0,0.15);
  font-weight: 600;
}
.stats-list {
  margin: 0;
  padding-left: 1.5rem;
}
.stats-list li {
  margin-bottom: 0.35rem;
}
.stats-rank {
  font-weight: 600;
  margin-right: 0.35rem;
}
.stats-list .user-rank-badge {
  margin-left: 0.35rem;
}

.stat-rating--author iconify-icon {
  color: #f5a623;
}

.stat-rating--community iconify-icon {
  color: #5ba3e8;
}

.author-activity-list {
  list-style: none;
  padding-left: 0;
}

.author-activity-list li {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--page-border);
}

.author-activity-list li:last-child {
  border-bottom: none;
}

.author-activity-snippet {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--page-muted);
}

.comment-rate-limit-msg {
  color: #c00;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.nav-notifications {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem;
}
.nav-notifications iconify-icon {
  font-size: 1rem;
}
.nav-notifications-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
  background: #c00;
  color: #fff;
  border-radius: 999px;
}

.notifications-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--page-border);
}
.notification-item--read .notification-title {
  font-weight: normal;
  color: var(--page-muted);
}
.notification-link {
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  display: block;
}
.notification-link:hover .notification-title {
  text-decoration: underline;
}
.notification-title {
  display: block;
  font-weight: 600;
}
.notification-body {
  display: block;
  font-size: 0.9rem;
  margin-top: 0.2rem;
}
.notification-date {
  display: block;
  font-size: 0.8rem;
  margin-top: 0.2rem;
}
.notification-mark,
.notification-actions {
  flex-shrink: 0;
}
.notification-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.notification-actions .notification-action-form {
  display: inline;
}
.icon-btn--sm {
  min-width: 1.5rem;
  padding: 0.2rem;
  font-size: 0.85rem;
}

.moderate-user-section {
  background: #f5f5f5;
  border-radius: 0.5rem;
  border: 1px solid var(--page-border);
  margin-top: 1rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.moderate-user-section h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.theme-toggle-btn {
    padding: 0;
}

.theme-toggle-moon, .theme-toggle-sun {
    font-size: 1rem;
}

/* Forum */
.page-forum .forum-intro,
.page-forum .forum-subforum-intro,
.page-forum .forum-admin-intro,
.page-forum .forum-replies-intro {
  margin-bottom: 1.25rem;
}
.page-forum .forum-intro h2,
.page-forum .forum-subforum-intro h2,
.page-forum .forum-admin-intro h2 {
  font-size: 1.1rem;
  margin-top: 0;
}
.page-forum .forum-breadcrumb {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
.page-forum .forum-breadcrumb a {
  color: var(--page-link);
}
.page-forum .forum-subforum-cards {
  list-style: none;
  padding: 0;
  margin: 0;
}
.page-forum .forum-subforum-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--page-border);
  border-radius: 0.5rem;
  background: var(--filter-box-bg);
}
.page-forum .forum-subforum-card__icon {
  flex-shrink: 0;
  font-size: 1.75rem;
  opacity: 0.85;
}
.page-forum .forum-subforum-card__title {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
}
.page-forum .forum-subforum-card__desc {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}
.page-forum .forum-subforum-card__meta {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
}
.page-forum .forum-thread-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.page-forum .forum-thread-list__item {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--page-border);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}
.page-forum .forum-thread-list__sticky {
  flex-shrink: 0;
}
.page-forum .forum-thread-list__title {
  font-weight: 600;
  flex-shrink: 0;
}

/* Traditional post boxes: side (author) + main (content) */
.page-forum .forum-post {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--page-border);
  border-radius: 4px;
  margin-bottom: 1rem;
  overflow: hidden;
  background: var(--filter-box-bg);
}
.page-forum .forum-post--op {
  border-width: 1px 1px 1px 4px;
  border-left-color: var(--page-link);
}
.page-forum .forum-post__side {
  width: 10rem;
  min-width: 10rem;
  padding: 1rem;
  border-right: 1px solid var(--page-border);
  background: var(--page-bg);
  text-align: center;
}
.page-forum .forum-post__avatar {
  width: 4.2rem;
  height: 4.2rem;
  margin: 0 auto 0.5rem;
  border-radius: 4px;
  overflow: hidden;
  background: var(--page-border);
}
.page-forum .forum-post__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.page-forum .forum-post__avatar-placeholder {
  font-size: 4.2rem;
  display: block;
  width: 100%;
  height: 100%;
  color: var(--page-muted);
  box-sizing: border-box;
}
.page-forum .forum-post__author-name {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  word-break: break-word;
}
.page-forum .forum-post__author-name .user-line {
  display: block;
}
.page-forum .forum-post__date {
  margin: 0;
  font-size: 0.8rem;
}
.page-forum .forum-post__main {
  flex: 1;
  min-width: 0;
  padding: 1rem 1.25rem;
}
.page-forum .forum-post__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--page-border);
}
.page-forum .forum-post__title {
  margin: 0;
  font-size: 1.25rem;
  flex: 1;
  min-width: 0;
}
.page-forum .forum-post__head--reply {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0.35rem;
}
.page-forum .forum-post__head--reply .forum-post__date-inline {
  font-size: 0.85rem;
}
.page-forum .forum-post__reply-num {
  color: var(--page-muted);
  text-decoration: none;
}
.page-forum .forum-post__reply-num:hover {
  text-decoration: underline;
}
.page-forum .forum-post__reply-link {
  font-size: 0.9rem;
  margin-left: 0.5rem;
}
.page-forum .forum-post__quote-btn {
  font-size: 0.85rem;
  margin-left: 0.25rem;
  padding: 0.2rem 0.4rem;
}
.page-forum .forum-post__edit-link {
  font-size: 0.9rem;
  margin-left: 0.5rem;
}
.page-forum .forum-post__actions,
.page-forum .forum-post__head--reply .forum-post__action-btn {
  margin-left: auto;
}
.page-forum .forum-post__action-btn {
  font-size: 0.85rem;
  padding: 0.2rem 0.4rem;
}
.page-forum .forum-post__body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
}
.page-forum .forum-post__body p:first-child {
  margin-top: 0;
}
.page-forum .forum-post__body p:last-child {
  margin-bottom: 0;
}
.page-forum .forum-reply-list {
  margin-top: 0.5rem;
}
@media (max-width: 520px) {
  .page-forum .forum-post__side {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--page-border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    text-align: left;
  }
  .page-forum .forum-post__avatar {
    width: 48px;
    height: 48px;
    margin: 0;
  }
  .page-forum .forum-post__avatar img {
    width: 48px;
    height: 48px;
  }
  .page-forum .forum-post__avatar-placeholder {
    width: 100%;
    height: 100%;
    font-size: 48px;
    max-width: 48px;
    max-height: 48px;
  }
  .page-forum .forum-post__author-name {
    flex: 1;
    margin: 0;
  }
  .page-forum .forum-post__date {
    width: 100%;
    margin: 0;
  }
}
.page-forum .forum-reply-form textarea,
.page-forum .forum-thread-form textarea {
  width: 100%;
  max-width: 36rem;
  min-height: 8rem;
}
.page-forum .forum-admin-link {
  margin-bottom: 1rem;
}
.page-forum .forum-admin-subforum-list {
  margin-top: 1rem;
}
.page-forum .forum-admin-subforum-list li {
  margin-bottom: 0.5rem;
}

/* Report modal */
.report-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.report-modal[hidden] {
  display: none;
}
.report-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
.report-modal__box {
  position: relative;
  background: var(--page-bg, #fff);
  border: 1px solid var(--page-border, #ccc);
  border-radius: 0.5rem;
  padding: 1.25rem;
  max-width: 22rem;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.report-modal__box h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}
.report-modal__form label {
  display: block;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}
.report-modal__form select,
.report-modal__form textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  font: inherit;
  border: 1px solid var(--page-border, #ccc);
  border-radius: 0.25rem;
  background: var(--page-bg, #fff);
  color: var(--page-text, #333);
}
.report-modal__form textarea {
  min-height: 4rem;
  resize: vertical;
}
.report-modal__custom {
  margin-top: 0.5rem;
}
.report-modal__actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.report-btn {
  opacity: 0.75;
}
.report-btn:hover {
  opacity: 1;
}

/* Admin link blink when mod queue has unseen reports */
.nav-admin-link--blink {
  animation: nav-admin-blink 1.2s ease-in-out infinite;
}
.nav-admin-badge {
  display: inline-block;
  min-width: 1.1em;
  padding: 0.1em 0.35em;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  background: #c00;
  color: #fff;
  border-radius: 0.35rem;
  margin-left: 0.2em;
}
[data-theme="dark"] .nav-admin-badge {
  background: #e55;
  color: #fff;
}
@keyframes nav-admin-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Mod queue admin page */
.mod-queue-filters {
  margin-bottom: 1rem;
}
.mod-queue-filters a {
  margin-right: 0.25rem;
}
.mod-queue-filters a.mod-queue-filter--active {
  font-weight: 700;
  text-decoration: none;
  color: var(--page-text);
}
.mod-queue-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mod-queue-item {
  border: 1px solid var(--page-border, #ccc);
  border-radius: 0.35rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--filter-box-bg, #f9f9f9);
}
.mod-queue-item--pending {
  border-left: 3px solid #c00;
}
.mod-queue-item__meta {
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}
.mod-queue-item__type {
  text-transform: capitalize;
}
.mod-queue-item__reason {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
.mod-queue-item__context {
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}
.mod-queue-item__actions {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

p {
  font-weight: var(--site-font-weight);
}