﻿:root {
  --bg: #f7f4ed;
  --bg-soft: #fff9ef;
  --surface: #ffffff;
  --surface-alt: #fcfaf5;
  --text: #142234;
  --muted: #5b6875;
  --border: #ddd3bf;
  --line: #e8dfcf;
  --brand: #0d3b66;
  --brand-strong: #082945;
  --accent: #d3891f;
  --accent-soft: #fff2dc;
  --success: #1f7a67;
  --shadow: 0 12px 36px rgba(13, 39, 66, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Space Grotesk", "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 10%, rgba(211, 137, 31, 0.12), transparent 32%),
    radial-gradient(circle at 92% 4%, rgba(13, 59, 102, 0.14), transparent 28%),
    linear-gradient(180deg, #fefcf7 0%, #f7f3ea 40%, #f5f0e3 100%);
  line-height: 1.45;
}

body.modal-open {
  overflow: hidden;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  background: var(--brand);
  color: #fff;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  z-index: 9999;
}

.site-shell {
  width: min(1280px, calc(100% - 2rem));
  margin: 1rem auto 2.25rem;
}

.hero {
  position: relative;
  background:
    linear-gradient(145deg, rgba(13, 59, 102, 0.95), rgba(10, 32, 54, 0.95)),
    linear-gradient(45deg, #0f4f87, #0d3b66);
  border-radius: 22px;
  color: #f9fbff;
  padding: 1.15rem 1.4rem 1.55rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 14%, rgba(255, 255, 255, 0.2), transparent 22%),
    radial-gradient(circle at 86% 78%, rgba(211, 137, 31, 0.28), transparent 28%);
  pointer-events: none;
}

.top-nav,
.hero-grid {
  position: relative;
  z-index: 1;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.brand {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: #fef7ea;
  letter-spacing: 0.02em;
}

.brand:hover {
  text-decoration: none;
}

.top-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.top-links a {
  color: rgba(248, 251, 255, 0.9);
  font-size: 0.93rem;
  border: 1px solid rgba(248, 251, 255, 0.22);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
}

.top-links a:hover {
  border-color: rgba(248, 251, 255, 0.48);
  text-decoration: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 1.1rem;
}

.hero-copy {
  animation: riseIn 0.55s ease both;
}

.eyebrow {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  font-weight: 600;
}

.hero-copy h1 {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(1.65rem, 4vw, 2.55rem);
  line-height: 1.1;
  margin: 0.45rem 0 0.8rem;
  color: #ffffff;
}

.hero-copy p {
  margin: 0;
  max-width: 62ch;
  color: rgba(246, 251, 255, 0.93);
}

.hero-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hero-note {
  margin-top: 0.95rem;
  font-size: 0.84rem;
  color: rgba(236, 246, 255, 0.82);
}

.hero-note strong {
  color: #fff;
  font-weight: 600;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  align-content: start;
  animation: riseIn 0.72s ease both;
}

.stat-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  padding: 0.75rem 0.75rem;
  color: var(--text);
  min-height: 82px;
}

.stat-card span {
  display: block;
  color: #47576a;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.stat-card strong {
  display: block;
  margin-top: 0.25rem;
  font-size: clamp(1.03rem, 2vw, 1.25rem);
  color: #0f3152;
}

.stat-card-wide {
  grid-column: 1 / -1;
}

.grade-breakdown {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.grade-breakdown span {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.15);
  color: rgba(243, 249, 255, 0.95);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.72rem;
}

.status-banner {
  margin: 0.95rem 0 0;
  border: 1px solid #d4b46b;
  background: linear-gradient(180deg, #fff4dc 0%, #ffe8ba 100%);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  box-shadow: 0 8px 20px rgba(211, 137, 31, 0.14);
}

.status-banner p {
  margin: 0;
  color: #6c4715;
  font-weight: 600;
}

.panel {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(13, 39, 66, 0.06);
}

.panel-animate {
  animation: riseIn 0.5s ease both;
}

.panel-header {
  margin-bottom: 0.8rem;
}

.panel-header h2 {
  margin: 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  color: #0d355a;
}

.panel-header p {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.admin-mode-note {
  margin-top: 0.45rem !important;
  color: #0b4a80 !important;
  font-weight: 600;
}

.admin-feedback {
  margin: 0 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.68rem;
  font-size: 0.88rem;
}

.admin-feedback-success {
  background: #ecf8f2;
  border-color: #b7dfc9;
  color: #1f6343;
}

.admin-feedback-error {
  background: #fff1f1;
  border-color: #f0c9c9;
  color: #8d2a2a;
}

input,
select,
button,
.btn {
  font-family: inherit;
  font-size: 0.94rem;
}

input,
select,
button {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

input,
select {
  width: 100%;
  padding: 0.62rem 0.72rem;
}

input:focus,
select:focus,
button:focus,
.btn:focus {
  outline: 2px solid rgba(13, 59, 102, 0.28);
  outline-offset: 1px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.83rem;
  color: var(--muted);
}

.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0.62rem 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}

.btn:hover,
button:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary,
button.btn-primary {
  background: linear-gradient(180deg, #0f4f87 0%, #0d3b66 100%);
  border-color: #0d3b66;
  color: #fff;
  box-shadow: 0 6px 16px rgba(10, 44, 74, 0.22);
}

.btn-light {
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.48);
  color: #0d355a;
}

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

.filter-grid,
.refresh-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.72rem;
}

.filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  grid-column: span 1;
}

.quick-grades {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
}

.quick-grades span {
  color: var(--muted);
  font-size: 0.85rem;
  margin-right: 0.25rem;
}

.quick-grades button {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  color: var(--brand);
  padding: 0.35rem 0.62rem;
  border-radius: 999px;
  font-size: 0.83rem;
}

.result-count,
.panel-note {
  margin: 0.78rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-review-summary {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.admin-review-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.24rem 0.56rem;
  background: #f8fafc;
  color: #3e4d5c;
  font-size: 0.82rem;
}

.admin-review-chip strong {
  color: #0f3152;
}

.admin-review-chip-checked {
  background: #e8f7ee;
  border-color: #b8dfc7;
  color: #205f40;
}

.admin-review-chip-unchecked {
  background: #f6f8fa;
  border-color: #d7dce2;
  color: #4f5e6c;
}

.refresh-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.refresh-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-alt);
  padding: 0.82rem;
}

.refresh-card h3 {
  margin: 0;
  font-size: 1rem;
  color: #0c3559;
}

.refresh-card p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.table-panel {
  padding-bottom: 0.7rem;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-x: auto;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.68rem 0.62rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.9rem;
}

th {
  font-size: 0.79rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #526171;
  background: linear-gradient(180deg, #fffdf9, #faf5ea);
  position: sticky;
  top: 0;
  z-index: 2;
}

tbody tr:nth-child(even) {
  background: #fffcf5;
}

tbody tr:hover {
  background: #fff5de;
}

tr:last-child td {
  border-bottom: none;
}

.title-text {
  display: block;
  min-width: 280px;
  max-width: 480px;
}

.table-link {
  font-weight: 600;
}

.muted {
  color: #7a8794;
}

.raw-match-number {
  margin-top: 0.22rem;
  font-size: 0.77rem;
  color: #5f6b78;
}

.empty-state {
  text-align: center;
  color: #6f7a86;
  padding: 1rem;
}

.thumb-link {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  line-height: 0;
  background: #fff;
}

.thumb-link:hover {
  text-decoration: none;
  border-color: #cbb892;
}

.thumb {
  width: 68px;
  height: 68px;
  object-fit: cover;
  display: block;
  background: #f2ece0;
}

.other-sales-trigger {
  border: 1px solid #d7c6a5;
  background: linear-gradient(180deg, #fff9ea, #ffecc8);
  color: #5f3e12;
  border-radius: 10px;
  padding: 0.3rem 0.58rem;
  font-size: 0.84rem;
}

.other-sales-trigger:hover {
  background: linear-gradient(180deg, #fff6e0, #ffe4b0);
}

.admin-filter-toggle {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.admin-filter-toggle input {
  width: auto;
  margin-top: 0.35rem;
}

.admin-review-filter {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.override-pill {
  display: inline-flex;
  margin-left: 0.32rem;
  border: 1px solid #95b7d8;
  background: #e7f1fb;
  color: #0d4a80;
  border-radius: 999px;
  padding: 0.08rem 0.42rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.admin-override-cell {
  min-width: 206px;
}

.admin-override-form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-override-form input {
  width: 92px;
  min-width: 0;
  padding: 0.34rem 0.42rem;
}

.admin-override-save {
  padding: 0.31rem 0.52rem;
  font-size: 0.78rem;
}

.admin-override-clear-form {
  margin-top: 0.34rem;
}

.admin-override-clear {
  background: #fff;
  border: 1px solid #d8c9ac;
  color: #5d3e12;
  border-radius: 8px;
  padding: 0.28rem 0.52rem;
  font-size: 0.78rem;
}

.admin-override-clear:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.review-status-cell {
  min-width: 128px;
}

.checked-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ddf5e8;
  border: 1px solid #98d5b1;
  color: #1b7a45;
  font-weight: 700;
  line-height: 1;
}

.unchecked-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #d2d7dd;
  background: #f4f6f8;
  color: #6d7782;
  font-weight: 600;
  line-height: 1;
}

.review-toggle-form {
  margin-top: 0.34rem;
}

.review-toggle-btn {
  padding: 0.28rem 0.52rem;
  font-size: 0.76rem;
}

.review-toggle-btn-light {
  background: #fff;
  border: 1px solid #cfd7df;
  color: #384553;
}

.pagination {
  margin-top: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.78rem;
}

.pagination a {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.32rem 0.68rem;
  color: var(--brand);
}

.pagination span {
  color: var(--muted);
  font-size: 0.9rem;
}

.seo-copy h2 {
  margin-bottom: 0.6rem;
}

.seo-grid {
  display: grid;
  gap: 0.78rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.seo-grid article {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-alt);
  padding: 0.82rem;
}

.seo-grid h3 {
  margin: 0;
  font-size: 1rem;
  color: #0c3559;
}

.seo-grid p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.knowledge-grid,
.faq-list {
  display: grid;
  gap: 0.78rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.knowledge-card,
.faq-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-alt);
  padding: 0.82rem;
}

.knowledge-card h3,
.faq-item h3 {
  margin: 0;
  font-size: 1rem;
  color: #0c3559;
}

.knowledge-card p,
.faq-item p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.fee-list {
  margin: 0.5rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
}

.fee-list li + li {
  margin-top: 0.3rem;
}

.site-footer {
  margin-top: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: center;
  padding: 0.82rem;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.87rem;
}

.site-footer-title {
  color: #3f4f5f;
  font-weight: 600;
}

.site-footer-copyright {
  margin-top: 0.34rem !important;
  color: #576675;
}

.site-footer-disclaimer {
  margin-top: 0.34rem !important;
  font-size: 0.82rem !important;
  color: #6a7784 !important;
  max-width: 980px;
  margin-left: auto !important;
  margin-right: auto !important;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 30, 44, 0.58);
}

.modal-card {
  position: relative;
  width: min(1040px, 100%);
  max-height: 88vh;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 42px rgba(14, 30, 46, 0.35);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fef8ed, #fbf3e4);
}

.modal-header h2 {
  margin: 0;
  font-family: "DM Serif Display", Georgia, serif;
  color: #0d355a;
  font-size: 1.18rem;
}

.modal-close {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 0.38rem 0.62rem;
}

.modal-content {
  padding: 0.9rem;
  overflow: auto;
}

.modal-filter-bar {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem;
  background: #fffdf7;
  margin-bottom: 0.78rem;
}

.modal-filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.modal-filter-label {
  color: var(--muted);
  font-size: 0.86rem;
}

.modal-grade-input {
  min-width: 120px;
}

.modal-filter-btn {
  padding: 0.42rem 0.64rem;
  font-size: 0.84rem;
  background: #0d3b66;
  border: 1px solid #0d3b66;
  color: #fff;
}

.modal-filter-btn-light {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.modal-filter-hint {
  margin-top: 0.48rem;
  color: var(--muted);
  font-size: 0.83rem;
}

.sales-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.stat-chip {
  border: 1px solid var(--line);
  background: #fffcf5;
  border-radius: 12px;
  padding: 0.52rem 0.68rem;
  min-width: 140px;
}

.stat-chip strong {
  display: block;
  margin-top: 0.2rem;
  color: #0f3559;
}

.stat-label {
  color: #5f6d7a;
  font-size: 0.8rem;
}

.grade-averages {
  border: 1px solid var(--line);
  background: #fffef8;
  border-radius: 12px;
  padding: 0.68rem;
  margin-bottom: 0.82rem;
}

.graph-title {
  color: #5d6a78;
  font-size: 0.87rem;
  margin-bottom: 0.45rem;
}

.grade-average-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
}

.grade-average-chip {
  border: 1px solid #d8c9ab;
  background: #fff5df;
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  min-width: 145px;
}

.grade-average-chip strong {
  display: block;
  margin-top: 0.15rem;
  color: #684111;
}

.modal-table {
  width: 100%;
  border-collapse: collapse;
}

.modal-table th,
.modal-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.62rem;
  text-align: left;
  vertical-align: top;
}

.modal-table th {
  background: #fff8ea;
  color: #556372;
}

.current-row {
  background: #edf6ff;
}

.modal-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.current-row-badge {
  display: inline-flex;
  border: 1px solid #b9d7f3;
  background: #e8f3ff;
  color: #0b4a80;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
}

/* ── Shared site header (non-homepage pages) ── */
.site-header {
  background: linear-gradient(145deg, rgba(13, 59, 102, 0.97), rgba(10, 32, 54, 0.97));
  border-radius: 16px 16px 0 0;
  padding: 0.85rem 1.2rem;
  margin-bottom: 0;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.site-header .brand {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: #fef7ea;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.site-header .brand:hover { text-decoration: none; }

.site-header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-header-links a {
  color: rgba(248, 251, 255, 0.9);
  font-size: 0.88rem;
  border: 1px solid rgba(248, 251, 255, 0.2);
  border-radius: 999px;
  padding: 0.32rem 0.65rem;
  text-decoration: none;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
}

.site-header-links a:hover {
  border-color: rgba(248, 251, 255, 0.45);
  text-decoration: none;
}

.site-header-links a.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  font-weight: 600;
}

/* ── Site header with hero content ── */
.site-header-hero {
  border-radius: 22px;
  padding: 1.15rem 1.4rem 1.55rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.site-header-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 14%, rgba(255, 255, 255, 0.15), transparent 22%),
    radial-gradient(circle at 86% 78%, rgba(211, 137, 31, 0.2), transparent 28%);
  pointer-events: none;
}

.site-header-hero .site-header-inner,
.site-header-hero-content {
  position: relative;
  z-index: 1;
}

.site-header-hero-content {
  margin-top: 1.2rem;
  max-width: 700px;
}

.site-header-hero-content h1 {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.1;
  margin: 0;
  color: #ffffff;
}

.site-header-hero-content p {
  margin: 0.5rem 0 0;
  color: rgba(246, 251, 255, 0.88);
  font-size: 0.95rem;
  max-width: 55ch;
}

.site-header-badge {
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #fef7ea;
  background: rgba(211, 137, 31, 0.35);
  border: 1px solid rgba(211, 137, 31, 0.5);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  margin-bottom: 0.55rem;
}

.site-header-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: rgba(246, 251, 255, 0.65);
}

.site-header-stats {
  display: flex;
  gap: 0.65rem;
  margin-top: 1rem;
}

.site-header-stat {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 12px;
  padding: 0.6rem 0.85rem;
  min-width: 120px;
}

.site-header-stat span {
  display: block;
  color: #47576a;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.site-header-stat strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 1.1rem;
  color: #0f3152;
}

@media (max-width: 760px) {
  .site-header {
    border-radius: 0;
    padding: 0.7rem 0.9rem;
  }

  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .site-header-links { width: 100%; }

  .site-header-hero {
    border-radius: 0;
    padding: 0.75rem 0.9rem 1.1rem;
  }

  .site-header-hero-content {
    margin-top: 0.8rem;
  }

  .site-header-hero-content h1 {
    font-size: 1.4rem;
  }

  .site-header-stats {
    flex-wrap: wrap;
  }

  .site-header-stat {
    flex: 1;
    min-width: 0;
  }
}

/* ── Live search ── */
.live-search-prompt {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.85rem;
  padding: 1rem 1.2rem;
  background: linear-gradient(135deg, #eef3ff, #f0f7ff);
  border: 1px solid #c5d3ee;
  border-radius: 14px;
}

.live-search-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  border-radius: 12px;
}

.live-search-text p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.live-search-text p:first-child {
  color: var(--text);
  margin-bottom: 0.15rem;
}

.live-search-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.live-search-results {
  margin-top: 0.85rem;
}

.live-search-loading {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.live-search-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.live-search-error,
.live-search-empty {
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.live-search-error p,
.live-search-empty p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.live-search-header {
  padding: 0.75rem 1rem;
  background: #ecf8f2;
  border: 1px solid #b7dfc9;
  border-radius: 12px;
  font-size: 0.9rem;
  color: #1f6343;
  margin-bottom: 0.75rem;
}

.live-search-header a {
  font-weight: 600;
}

.live-search-cards {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.live-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.live-card-top {
  display: flex;
  gap: 0.7rem;
  padding: 0.7rem;
}

.live-card-img-wrap {
  flex-shrink: 0;
}

.live-card-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
  background: #f2ece0;
}

.live-card-info {
  flex: 1;
  min-width: 0;
}

.live-card-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.live-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.live-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.7rem;
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
}

.live-card-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.live-card-link {
  font-size: 0.82rem;
  padding: 0.38rem 0.7rem;
}

/* ── Featured highest sale ── */
.featured-sale {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(13, 39, 66, 0.08);
  position: relative;
}

.featured-sale::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #e8a840, var(--brand));
}

.featured-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  align-items: center;
}

.featured-img-wrap {
  position: relative;
}

.featured-img-link {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  line-height: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-img-link:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

.featured-img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  display: block;
}

.featured-details {
  min-width: 0;
}

.featured-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #e8d9b5;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  margin-bottom: 0.6rem;
}

.featured-title {
  margin: 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  line-height: 1.2;
  color: var(--text);
}

.featured-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.featured-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  color: var(--muted);
}

.featured-chip-grade {
  background: #eef3ff;
  border-color: #c5d3ee;
  color: var(--brand);
}

.featured-chip-date {
  background: #f0f7ed;
  border-color: #c5dbb8;
  color: #3d6b2e;
}

.featured-price-row {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.85rem;
}

.featured-price-block {
  display: flex;
  flex-direction: column;
}

.featured-price-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.featured-price-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 0.1rem;
}

.featured-price-raw {
  color: var(--muted);
  font-size: 1.2rem;
}

.featured-profit-pos { color: var(--success); }
.featured-profit-neg { color: #c0392b; }

.featured-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
  position: relative;
}

@media (max-width: 760px) {
  .featured-inner {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 1rem;
  }

  .featured-img-wrap {
    display: flex;
    justify-content: center;
  }

  .featured-img {
    width: 160px;
    height: 160px;
  }

  .featured-sale {
    margin: 0.5rem;
    border-radius: 14px;
  }

  .featured-price-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .featured-price-value {
    font-size: 1.15rem;
  }

  .featured-price-raw {
    font-size: 1rem;
  }

  .featured-actions {
    flex-direction: column;
  }

  .featured-actions .btn {
    text-align: center;
    justify-content: center;
  }
}

/* ── Share button & dropdown ── */
.share-btn-table {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  color: var(--brand);
  border-radius: 8px;
  padding: 0.28rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.share-btn-table:hover {
  background: #eef3ff;
  border-color: #b3c5e6;
}

.share-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100;
  min-width: 200px;
  padding: 4px;
  animation: riseIn 0.15s ease both;
}

.share-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  transition: background 0.12s;
}

.share-option:hover {
  background: var(--surface-alt);
  text-decoration: none;
}

.share-option svg {
  flex-shrink: 0;
  opacity: 0.7;
}

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

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

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

  .filter-actions {
    grid-column: span 2;
  }

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

  .knowledge-grid,
  .faq-list {
    grid-template-columns: 1fr;
  }
}

/* ── Mobile / Desktop visibility ── */
.mobile-only { display: none; }
.desktop-only { display: block; }

table.desktop-only,
div.desktop-only { display: block; }

@media (max-width: 760px) {
  .mobile-only { display: block; }
  .desktop-only { display: none !important; }

  .site-shell {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  /* ── Hero: compact mobile version ── */
  .hero {
    border-radius: 0;
    padding: 0.75rem 0.9rem 1rem;
  }

  .hero-overlay { display: none; }

  .top-nav {
    flex-direction: row;
    align-items: center;
    margin-bottom: 0.6rem;
  }

  .top-links { display: none; }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .hero-copy h1 {
    font-size: 1.35rem;
    line-height: 1.15;
  }

  .hero-copy p { font-size: 0.85rem; }

  .hero-actions { gap: 0.5rem; }
  .hero-actions .btn { padding: 0.55rem 0.75rem; font-size: 0.85rem; }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
  }

  .stat-card {
    padding: 0.55rem;
    min-height: 60px;
    border-radius: 10px;
  }

  .stat-card span { font-size: 0.68rem; }
  .stat-card strong { font-size: 0.95rem; }

  /* ── Search: simplified mobile ── */
  .panel {
    margin: 0.5rem;
    border-radius: 14px;
    padding: 0.75rem;
  }

  .panel-header h2 { font-size: 1.15rem; }
  .panel-header p { font-size: 0.82rem; }

  .filter-grid {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .filter-actions {
    grid-column: span 1;
  }

  .quick-grades { margin-top: 0.5rem; }

  /* ── Hide non-essential sections on mobile ── */
  #data-refresh,
  #ace-grading-fees,
  #ace-grading-overview,
  #about-tracker,
  #raw-trend-prices-source,
  #ace-grading-faq {
    display: none;
  }

  /* ── Mobile card results ── */
  .mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.1rem;
  }

  .mobile-result-count {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
    margin: 0;
  }

  .m-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    overflow: hidden;
  }

  .m-card-top {
    display: flex;
    gap: 0.65rem;
    padding: 0.7rem;
  }

  .m-card-img-link {
    flex-shrink: 0;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--line);
    line-height: 0;
  }

  .m-card-img-link:hover { text-decoration: none; }

  .m-card-img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    display: block;
    background: #f2ece0;
  }

  .m-card-info {
    flex: 1;
    min-width: 0;
  }

  .m-card-title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .m-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
  }

  .m-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.42rem;
    border-radius: 999px;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    color: var(--muted);
  }

  .m-chip-grade {
    background: var(--accent-soft);
    border-color: #e8d9b5;
    color: #6c4715;
  }

  .m-chip-date {
    background: #eef3ff;
    border-color: #c5d3ee;
    color: #3b5998;
  }

  .m-card-prices {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .m-price-item {
    padding: 0.45rem 0.5rem;
    text-align: center;
    border-right: 1px solid var(--line);
  }

  .m-price-item:last-child { border-right: none; }

  .m-price-label {
    display: block;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
  }

  .m-price-value {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 0.1rem;
  }

  .m-profit-pos { color: var(--success); }
  .m-profit-neg { color: #c0392b; }

  .m-card-actions {
    display: flex;
    gap: 0.4rem;
    padding: 0.5rem 0.7rem;
  }

  .m-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
  }

  .m-btn:hover { text-decoration: none; }

  .m-btn-sales {
    background: linear-gradient(180deg, #fff9ea, #ffecc8);
    border-color: #d7c6a5;
    color: #5f3e12;
  }

  .m-btn-view {
    background: linear-gradient(180deg, #0f4f87 0%, #0d3b66 100%);
    border-color: #0d3b66;
    color: #fff;
  }

  .m-btn-share {
    background: var(--surface-alt);
    border: 1px solid var(--line);
    color: var(--brand);
    flex: 0 0 auto;
    padding: 0.5rem 0.7rem;
  }

  .share-dropdown {
    left: auto;
    right: 0;
    bottom: 100%;
    top: auto;
    margin-bottom: 4px;
    margin-top: 0;
  }

  .m-empty {
    text-align: center;
    color: var(--muted);
    padding: 1.5rem 0.5rem;
  }

  /* ── Live search mobile ── */
  .live-search-prompt {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.85rem;
  }

  .live-search-icon { display: none; }
  .live-search-btn { width: 100%; }

  .live-card-img {
    width: 56px;
    height: 56px;
  }

  /* ── Pagination mobile ── */
  .pagination {
    margin: 0.6rem 0.5rem;
    gap: 0.5rem;
  }

  .pagination a { font-size: 0.85rem; padding: 0.42rem 0.8rem; }
  .pagination span { font-size: 0.82rem; }

  /* ── Footer mobile ── */
  .site-footer {
    margin: 0.5rem;
    border-radius: 10px;
    padding: 0.7rem;
  }

  .site-footer p { font-size: 0.78rem; }
  .site-footer-disclaimer { font-size: 0.72rem !important; }

  /* ── Modal mobile ── */
  .modal { padding: 0; }

  .modal-card {
    border-radius: 14px 14px 0 0;
    max-height: 92vh;
    align-self: flex-end;
    width: 100%;
  }

  .modal-header { padding: 0.65rem 0.72rem; }
  .modal-header h2 { font-size: 1rem; }
  .modal-content { padding: 0.6rem; }
  .modal-table th, .modal-table td { font-size: 0.78rem; padding: 0.45rem; }

  .sales-stats { gap: 0.4rem; }
  .stat-chip { min-width: 0; flex: 1; padding: 0.4rem; }
  .grade-average-grid { gap: 0.3rem; }
  .grade-average-chip { min-width: 0; flex: 1; padding: 0.35rem; }
}
