:root {
  --ink: #153d38;
  --ink-deep: #0d2d29;
  --muted: #667875;
  --paper: #f4f5f0;
  --surface: #ffffff;
  --line: #dfe7e3;
  --teal: #087f72;
  --yellow: #f3c95d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.market-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(220px, 460px) auto;
  align-items: center;
  gap: 22px;
  width: 100%;
  min-height: 72px;
  padding: 12px max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(21, 61, 56, .1);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(16px);
}
.market-brand { display: flex; min-width: 0; align-items: center; gap: 11px; }
.market-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 2px solid var(--yellow);
  color: var(--ink);
  font: 700 24px Georgia, serif;
}
.market-brand > span:last-child { display: grid; min-width: 0; line-height: 1.05; }
.market-brand strong { font: 700 16px Georgia, serif; }
.market-brand small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--teal);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 1.4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-search {
  display: flex;
  height: 42px;
  min-width: 0;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}
.search-mark {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-left: 12px;
  border: 1.8px solid #677571;
  border-radius: 50%;
}
.market-search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  padding: 0 12px;
  font-size: 13px;
}
.market-actions { display: flex; align-items: center; justify-content: end; gap: 8px; }
.language-toggle {
  min-width: 42px;
  border: 0;
  color: var(--ink);
  background: transparent;
  padding: 9px 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}
.market-login { padding: 9px 8px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.market-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--teal);
  border-radius: 5px;
  color: #fff;
  background: var(--teal);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}
.market-button:hover { background: #066e63; }
.market-button-small { min-height: 36px; }
.market-button-ghost { color: var(--ink); background: #fff; }
.market-button-ghost:hover { color: #fff; }

.aisle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.aisles { display: flex; min-width: 0; gap: 8px; overflow-x: auto; }
.aisles button {
  min-height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  background: #fff;
  padding: 0 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.aisles button[aria-pressed="true"] { border-color: var(--teal); color: #fff; background: var(--teal); }
.aisle-bar p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 750; white-space: nowrap; }

.catalog { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 22px 0 48px; }
.catalog-note { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.listing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.listing-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.listing-card[hidden] { display: none; }
.listing-cover {
  display: grid;
  height: 92px;
  place-items: center;
  color: #fff;
  font: 700 22px Georgia, serif;
  letter-spacing: 1px;
}
.cover-ged { background: linear-gradient(135deg, #0c6f64, #174f48); }
.cover-ielts { background: linear-gradient(135deg, #b8881d, #8d6410); }
.cover-apply { background: linear-gradient(135deg, #627da8, #3d5278); }
.listing-body { display: grid; min-width: 0; padding: 16px 16px 14px; }
.listing-category { margin: 0; color: var(--teal); font-size: 11px; font-weight: 850; }
.cover-ielts + .listing-body .listing-category { color: #8d6410; }
.cover-apply + .listing-body .listing-category { color: #4c628c; }
.listing-body h2 {
  min-height: 52px;
  margin: 6px 0 0;
  font: 700 18px/1.35 Georgia, "Noto Serif SC", serif;
}
.listing-seller { margin: 8px 0 0; font-size: 13px; font-weight: 800; }
.listing-meta { min-height: 40px; margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.listing-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.listing-foot strong { font-size: 16px; }
.listing-foot a { color: var(--teal); font-size: 13px; font-weight: 850; }
.market-empty {
  margin: 28px 0;
  padding: 36px 16px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: #fff;
  text-align: center;
}
.market-empty[hidden] { display: none; }

.seller-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 48px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.market-eyebrow { margin: 0 0 6px; color: var(--teal); font-size: 11px; font-weight: 850; letter-spacing: 1px; }
.seller-strip h2 { margin: 0; font: 700 22px/1.35 Georgia, "Noto Serif SC", serif; }

.market-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 28px max(20px, calc((100vw - 1180px) / 2));
  color: #bed0cc;
  background: var(--ink-deep);
  font-size: 12px;
}
.footer-brand .market-brand-mark { color: var(--yellow); }
.footer-brand strong { color: #fff; }
.footer-brand small { color: var(--yellow); }
.market-footer p { margin: 0; }
.market-footer > div:last-child { display: flex; justify-content: end; gap: 22px; }
.market-footer > div:last-child a { color: #fff; font-weight: 800; }

@media (max-width: 980px) {
  .market-header { grid-template-columns: 1fr auto; }
  .market-search { grid-column: 1 / -1; grid-row: 2; }
  .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .market-header { gap: 10px; min-height: 0; padding: 10px 16px; }
  .market-brand small { display: none; }
  .market-brand-mark { width: 34px; height: 34px; flex-basis: 34px; font-size: 20px; }
  .market-login { display: none; }
  .market-button-small { min-height: 34px; padding: 0 10px; font-size: 12px; }
  .aisle-bar { align-items: stretch; flex-direction: column; padding: 12px 16px; }
  .catalog, .seller-strip { width: min(100% - 32px, 1180px); }
  .listing-grid { grid-template-columns: 1fr; }
  .listing-body h2, .listing-meta { min-height: 0; }
  .seller-strip { align-items: start; flex-direction: column; }
  .market-footer { grid-template-columns: 1fr; }
  .market-footer > div:last-child { justify-content: start; }
}
