:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #dfe4ea;
  --text: #111827;
  --muted: #667085;
  --brand: #165d5f;
  --brand-strong: #0f4446;
  --accent: #f3b545;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; }
.brand {
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0;
}
.public-header,
.app-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.market-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .04);
}
.market-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 10px 22px;
}
.market-header-main { min-height: 64px; }
.market-header-sub {
  min-height: 46px;
  border-top: 1px solid #eef1f4;
}
.market-brand {
  flex: 0 0 auto;
  color: var(--brand-strong);
  font-size: 24px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0;
}
.market-search {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 42px minmax(150px, 210px) auto;
  gap: 6px;
  min-width: 360px;
}
.market-search input,
.market-search select {
  min-height: 40px;
  border-color: #b8c4cc;
}
.icon-btn {
  min-height: 40px;
  border: 1px solid #b8c4cc;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}
.market-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.market-icons a {
  max-width: 76px;
  padding: 6px 7px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
}
.market-icons a:hover {
  color: var(--text);
  background: #eef3f5;
}
.menu-pop {
  position: relative;
  flex: 0 0 auto;
}
.menu-pop summary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.menu-pop summary::-webkit-details-marker { display: none; }
.menu-pop summary::after {
  content: "v";
  color: var(--muted);
  font-size: 11px;
}
.menu-pop-content {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 280px;
  display: grid;
  gap: 9px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .16);
}
.menu-pop-content.dashboard-pop {
  width: min(760px, calc(100vw - 36px));
  max-height: min(680px, calc(100vh - 104px));
  overflow: auto;
  padding: 16px;
}
.menu-pop-content.slim {
  width: 76px;
  padding: 8px;
}
.menu-pop-content a {
  text-decoration: none;
}
.menu-pop-content p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.menu-pop-content hr {
  width: 100%;
  border: 0;
  border-top: 1px double var(--line);
}
.wide-btn { width: 100%; }
.market-subnav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.market-subnav a {
  padding: 8px 11px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}
.market-subnav a:first-child {
  color: #fff;
  background: var(--brand);
}
.market-subnav a:hover { background: #eef3f5; }
.market-page {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 18px 22px 28px;
}
.market-hero-banner {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px;
  border-radius: 8px;
  background: linear-gradient(105deg, #115e59, #0f766e 48%, #f59e0b);
  color: #fff;
}
.market-hero-banner span {
  color: #fde68a;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
}
.market-hero-banner h1 {
  max-width: 760px;
  margin-top: 8px;
  font-size: clamp(30px, 4vw, 56px);
  line-height: 1.02;
}
.market-hero-banner p {
  max-width: 680px;
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
}
.promo-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.promo-tile {
  min-height: 108px;
  display: grid;
  align-content: end;
  gap: 5px;
  padding: 16px;
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
}
.promo-tile span {
  font-size: 13px;
  line-height: 1.25;
}
.tile-teal { background: #0f766e; }
.tile-amber { background: #b45309; }
.tile-rose { background: #be185d; }
.tile-blue { background: #1d4ed8; }
.tile-lime { background: #4d7c0f; }
.product-row {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.product-row-lead {
  min-height: 260px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 20px;
  border-radius: 8px;
  color: #fff;
}
.product-row-lead span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: #fde68a;
}
.product-row-lead p { margin: 0; line-height: 1.38; }
.product-row-lead .btn {
  width: max-content;
  margin-top: 8px;
}
.row-teal { background: #115e59; }
.row-amber { background: #92400e; }
.row-blue { background: #1e3a8a; }
.product-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 180px;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scroll-snap-type: x proximity;
}
.product-card {
  min-height: 260px;
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
  scroll-snap-align: start;
}
.product-thumb {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 7px;
  background: linear-gradient(135deg, #e2e8f0, #f8fafc);
  border: 1px solid #eef1f4;
}
.ghost-product strong {
  font-size: 14px;
  line-height: 1.25;
}
.ghost-product small { color: var(--muted); }
.market-footer {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 22px;
  border-top: 1px solid var(--line);
}
.market-footer nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.market-footer a {
  color: var(--muted);
  text-decoration: none;
}
.header-left,
.header-right,
.nav-inline,
.main-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.main-nav a,
.nav-inline a,
.user-link {
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--muted);
}
.main-nav a.active,
.main-nav a:hover,
.nav-inline a:hover {
  color: var(--text);
  background: #eef3f5;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}
.btn.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.public-shell { background: #eef3f1; }
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  padding: 48px 24px;
  background:
    linear-gradient(90deg, rgba(15,68,70,.92), rgba(22,93,95,.74)),
    url('/assets/images/client-portal-bg.svg') center/cover no-repeat;
}
.hero-copy {
  width: min(720px, 100%);
  color: #fff;
}
.hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(38px, 7vw, 78px);
  line-height: 1;
}
.hero p {
  max-width: 620px;
  font-size: 20px;
  line-height: 1.45;
}
.hero-actions { display: flex; gap: 10px; margin-top: 24px; }
.quick-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.eyebrow {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
}
.auth-main {
  min-height: calc(100vh - 64px);
  display: grid;
  align-items: start;
  justify-items: start;
  padding: 48px 24px;
  background:
    linear-gradient(90deg, rgba(15,68,70,.92), rgba(22,93,95,.74)),
    url('/assets/images/client-portal-bg.svg') center/cover no-repeat;
}
.auth-wrap { width: min(720px, 100%); }
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.lang-switch a {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  background: #fff;
}
.lang-switch a:hover {
  color: var(--text);
  border-color: var(--brand);
}
.auth-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}
.auth-card { width: min(460px, 100%); margin: 0; }
.auth-card.wide { width: min(720px, 100%); }
.stack { display: grid; gap: 12px; }
label { display: grid; gap: 5px; font-weight: 700; font-size: 13px; }
input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  background: #fff;
}
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}
.alert {
  padding: 10px 12px;
  border-radius: 6px;
  margin: 10px 0;
}
.alert.error {
  border: 1px solid #f2b8b5;
  background: #fff0ef;
  color: var(--danger);
}
.alert.success {
  border: 1px solid #a7d7c5;
  background: #effaf5;
  color: #116149;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}
.choice-option {
  display: grid;
  align-content: start;
  gap: 10px;
}
.choice-button {
  width: 100%;
  min-height: 42px;
}
.choice-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.business-fields,
.notify-note {
  display: grid;
  gap: 12px;
}
[hidden] { display: none !important; }
.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.check-row input {
  width: auto;
  min-height: 0;
}
.panel.soft { background: #f8fafc; }
.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.auth-code-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.app-main { padding: 22px; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  margin-bottom: 16px;
}
.page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.dashboard-panel {
  display: grid;
  grid-template-columns: minmax(260px, 38%) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.dashboard-info,
.dashboard-work {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.dashboard-info {
  display: grid;
  align-content: start;
  gap: 14px;
}
.dashboard-info h1 {
  margin-bottom: 2px;
}
.profile-card-mini {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.profile-avatar {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e6f3f1;
  color: var(--brand-strong);
  font-size: 28px;
  font-weight: 800;
}
.profile-card-mini h2 {
  margin: 0 0 4px;
}
.dashboard-contact {
  display: grid;
  gap: 8px;
  margin: 0;
}
.dashboard-contact div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
}
.dashboard-contact dt {
  color: var(--muted);
  font-weight: 700;
}
.dashboard-contact dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.trophy-strip {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}
.dashboard-work {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
}
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.dashboard-tile {
  min-height: 132px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
}
.dashboard-tile.active {
  border-color: #b9ddd6;
  background: #eef9f6;
}
.dashboard-tile span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.dashboard-tile b {
  font-size: 34px;
}
.dashboard-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.dashboard-footer a,
.dashboard-footer button {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.dashboard-panel-compact {
  grid-template-columns: minmax(210px, 34%) minmax(0, 1fr);
  gap: 10px;
  font-size: 12px;
}
.dashboard-panel-compact .dashboard-info,
.dashboard-panel-compact .dashboard-work {
  padding: 12px;
}
.dashboard-panel-compact .profile-card-mini {
  grid-template-columns: 44px minmax(0, 1fr);
}
.dashboard-panel-compact .profile-avatar {
  width: 44px;
  height: 44px;
  font-size: 20px;
}
.dashboard-panel-compact .dashboard-contact div {
  grid-template-columns: 58px minmax(0, 1fr);
}
.dashboard-panel-compact .dashboard-tile {
  min-height: 92px;
  padding: 10px;
}
.dashboard-panel-compact .dashboard-tile b {
  font-size: 26px;
}
.dashboard-panel-compact .trophy-strip {
  min-height: 38px;
  padding: 8px;
}
h1, h2 { margin: 0 0 8px; }
.muted { color: var(--muted); }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.kpi span { display: block; color: var(--muted); font-size: 13px; }
.kpi b { display: block; font-size: 30px; margin-top: 6px; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 9px 8px;
  border-bottom: 1px solid #eef1f4;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}
th { color: #344054; background: #f8fafc; }
.details { display: grid; gap: 8px; }
.details div { display: flex; gap: 8px; }
.details dt { font-weight: 700; min-width: 120px; }
.details dd { margin: 0; }

@media (max-width: 680px) {
  .public-header,
  .app-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }
  .grid.two { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
  .hero { align-items: flex-start; }
  .hero p { font-size: 17px; }
}

@media (max-width: 1100px) {
  .market-header-main {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .market-search {
    order: 3;
    flex-basis: 100%;
  }
  .market-icons {
    margin-left: auto;
  }
  .promo-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .market-header-row {
    padding: 10px 14px;
  }
  .market-brand {
    font-size: 22px;
  }
  .market-search {
    grid-template-columns: 1fr 38px;
    min-width: 0;
  }
  .market-search select,
  .market-search .btn {
    grid-column: span 1;
  }
  .market-icons {
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
  }
  .market-icons a {
    min-width: 62px;
  }
  .account-menu .menu-pop-content {
    right: auto;
    left: 0;
  }
  .market-hero-banner {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
  }
  .promo-strip {
    grid-template-columns: 1fr;
  }
  .product-row {
    grid-template-columns: 1fr;
  }
  .product-row-lead {
    min-height: 180px;
  }
  .dashboard-panel,
  .dashboard-panel-compact {
    grid-template-columns: 1fr;
  }
  .dashboard-kpis {
    grid-template-columns: 1fr;
  }
  .menu-pop-content.dashboard-pop {
    left: auto;
    right: 0;
    width: min(520px, calc(100vw - 28px));
  }
}
