:root {
  color-scheme: light dark;
  --bg: #f5f7fb;
  --card-bg: #ffffff;
  --panel-border: rgba(11, 61, 145, 0.12);
  --accent: #0b3d91;
  --muted: #5b6171;
  --shadow: 0 20px 45px rgba(16, 42, 111, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  background: var(--bg);
  color: #111322;
}

header {
  padding: 2.5rem clamp(1rem, 5vw, 4rem);
  background: linear-gradient(135deg, #0b3d91, #1b73d1);
  color: #fff;
}

header .status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

main {
  max-width: 1100px;
  margin: -2rem auto 4rem;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

.panel {
  background: var(--card-bg);
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.25rem clamp(1rem, 4vw, 2rem);
}

.panel-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.panel-body {
  padding: 0 clamp(1rem, 4vw, 2rem) clamp(1.25rem, 4vw, 2rem);
  display: grid;
  gap: 1rem;
}

.panel.collapsible .panel-body {
  display: none;
}

.panel.collapsible.open .panel-body {
  display: grid;
}

.panel-toggle {
  border: none;
  background: rgba(11, 61, 145, 0.08);
  color: var(--accent);
  border-radius: 999px;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-content: center;
  cursor: pointer;
}

.panel-toggle:focus-visible {
  outline: 2px solid #1b73d1;
  outline-offset: 2px;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid.cards {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.listing-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.listing-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.listing-card header {
  background: rgba(11, 61, 145, 0.08);
  color: #0b3d91;
  padding: 1rem 1.25rem;
}

.listing-card img {
  width: 100%;
  height: auto;
  display: block;
}

.listing-card .body {
  padding: 1rem 1.25rem 1.25rem;
  flex: 1;
}

.listing-card footer {
  padding: 0.85rem 1.25rem;
  background: rgba(11, 61, 145, 0.05);
  font-size: 0.9rem;
  color: var(--muted);
}

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

.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table-scroll th,
.table-scroll td {
  padding: 0.65rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  text-align: left;
}

.table-scroll th {
  background: rgba(11, 61, 145, 0.08);
}

ul {
  padding-left: 1.2rem;
  margin: 0;
}

footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  header {
    text-align: center;
  }

  header h1 {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
  }

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

  .panel-toggle {
    align-self: flex-end;
  }

  .listing-grid {
    grid-template-columns: 1fr;
  }

  .table-scroll table {
    font-size: 0.85rem;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1018;
    --card-bg: #151929;
    --panel-border: rgba(255, 255, 255, 0.08);
    --shadow: none;
  }

  body {
    color: #e9edf8;
  }

  header {
    background: linear-gradient(135deg, #051a43, #0e3277);
  }

  .listing-card header {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }

  .listing-card footer,
  .panel {
    background: #1b2233;
  }

  .table-scroll th {
    background: rgba(255, 255, 255, 0.08);
  }
}

.listing-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.listing-gallery img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.08);
  object-fit: cover;
  max-height: 110px;
}

@media (prefers-color-scheme: dark) {
  .listing-gallery img {
    border-color: rgba(255,255,255,0.1);
  }
}

.listing-content {
  display: grid;
  gap: 1rem;
}

@media (min-width: 700px) {
  .listing-content {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.gallery-main {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  min-height: 200px;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.gallery-thumb {
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 0;
  background: none;
  cursor: pointer;
}

.gallery-thumb img {
  width: 75px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.1);
}

.gallery-thumb.active {
  border-color: var(--accent);
}

@media (prefers-color-scheme: dark) {
  .gallery-main {
    border-color: rgba(255,255,255,0.08);
  }
  .gallery-thumb img {
    border-color: rgba(255,255,255,0.12);
  }
}

.listing-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.25rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.meta-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  display: block;
}

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

.table-accordion th,
.table-accordion td {
  padding: 0.65rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.table-accordion-row {
  cursor: pointer;
}

.table-accordion-details {
  display: none;
}

.table-accordion-details.open {
  display: table-row;
  background: rgba(11,61,145,0.05);
}

.table-accordion-details td {
  border-bottom: none;
  padding-top: 0;
  padding-bottom: 1rem;
}

.table-accordion-details p {
  margin: 0;
}

@media (prefers-color-scheme: dark) {
  .table-accordion-details.open {
    background: rgba(255,255,255,0.05);
  }
}

.listing-card .body {
  background: #f9fbff;
}

@media (prefers-color-scheme: dark) {
  .listing-card .body {
    background: #1b2233;
  }
}

.listing-details ul {
  margin: 0;
}

.listing-details li {
  color: #1a1c26;
}

.listing-card header,
.listing-card .muted {
  color: #0d1c3f;
}

@media (prefers-color-scheme: dark) {
  .listing-details li {
    color: #e6ebff;
  }
  .listing-card header,
  .listing-card .muted {
    color: #d8e2ff;
  }
}

.listing-card header {
  background: #0b254a;
  color: #f4f7ff;
}

.listing-card .muted {
  color: rgba(255,255,255,0.8);
}

.listing-card footer {
  background: #eaf1ff;
}

@media (prefers-color-scheme: dark) {
  .listing-card header {
    background: #122647;
    color: #f4f7ff;
  }
  .listing-card footer {
    background: rgba(255,255,255,0.08);
  }
}

.meta-label {
  font-weight: 600;
  color: #0b254a;
}

@media (prefers-color-scheme: dark) {
  .meta-label {
    color: #a8c0ff;
  }
}

@media (max-width: 640px) {
  header {
    padding: 2rem 1.25rem;
    text-align: left;
  }
  .panel {
    border-radius: 14px;
  }
  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }
  .panel-toggle {
    align-self: flex-end;
  }
  .listing-content {
    grid-template-columns: 1fr;
  }
  .listing-meta {
    grid-template-columns: 1fr;
  }
  .gallery-thumbs {
    justify-content: flex-start;
  }
}

@media (min-width: 1000px) {
  .listing-content {
    grid-template-columns: 1.1fr 0.9fr;
  }
}
