/* v6: reference-led navigation, complete capability, restrained warm surface. */
:root {
  --bg: #f8f7f5;
  --panel: #fff;
  --ink: #292724;
  --muted: #817d77;
  --line: #eae6e0;
  --brand: #e67757;
  --radius: 12px;
}
body.reference-layout {
  background: var(--bg);
  color: var(--ink);
}
.reference-layout #sidebar {
  display: none;
}
.reference-layout main {
  margin-left: 0;
}
.reference-layout main > header {
  height: 76px;
  padding: 0 max(24px, calc((100vw - 1512px) / 2));
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.97);
}
.reference-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.3px;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
}
.reference-brand b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand);
  color: white;
  font-size: 19px;
}
#referenceTop {
  display: flex;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
}
#referenceTop a {
  padding: 9px 10px;
  color: #68625b;
  font-size: 13px;
  border-radius: 7px;
  text-decoration: none;
}
#referenceTop a:hover,
#referenceTop a.active {
  color: #b64e32;
  background: #fff0e9;
}
.reference-more {
  font-size: 12px;
  white-space: nowrap;
  padding: 8px 10px;
}
#referenceBalances {
  margin-left: auto;
  display: flex;
  gap: 9px;
  white-space: nowrap;
}
#referenceBalances a {
  border: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  border-radius: 7px;
  padding: 7px;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
#referenceBalances .glyph {
  width: 14px;
  height: 14px;
  color: var(--muted);
}
.reference-layout header #breadcrumb,
.reference-layout header .header-spacer,
.reference-layout header .command-trigger,
.reference-layout #menuButton {
  display: none;
}
.reference-layout #noticeButton {
  font-size: 16px;
  min-width: 30px;
  width: 30px;
}
.reference-layout .account-button {
  padding: 8px 10px;
  font-size: 12px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reference-layout #content {
  width: 100%;
  max-width: 1464px;
  padding: 28px 32px 48px;
  margin: 0 auto;
  min-height: calc(100vh - 150px);
}
.reference-layout #connectionBanner {
  text-align: center;
}
.reference-layout .page-head {
  margin: 0 0 23px;
}
.reference-layout .page-head h1 {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.5px;
}
.reference-layout .page-head p {
  font-size: 12px;
  line-height: 1.8;
}
.reference-layout .button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}
.reference-layout .button.primary:hover {
  background: #d66848;
  border-color: #d66848;
}
.reference-layout .button.selected {
  color: #b6573c;
  border-color: #f2bba6;
  background: #fff1eb;
}
.reference-layout .panel {
  box-shadow: 0 2px 5px #24211b02;
  border-color: var(--line);
  padding: 22px;
}
.reference-layout h2 {
  font-size: 15px;
  letter-spacing: 0;
}
.reference-layout h3 {
  font-size: 14px;
}
.reference-layout p {
  line-height: 1.75;
}
.reference-layout .stats-strip {
  background: var(--panel);
  border-color: var(--line);
}
.reference-layout .stat-icon,
.reference-layout .section-kicker {
  color: #c57557;
}
.reference-layout .context-nav a.active {
  color: #bd6346;
  background: #fff0e8;
}
.ref-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 20px;
  margin-top: 22px;
}
.business-directory {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.business-directory a {
  padding: 14px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
}
.business-directory a:hover {
  background: #fcf7f1;
  border-color: #f1e9df;
}
.business-directory a > .glyph {
  width: 19px;
  height: 19px;
  color: #a29484;
  flex: none;
}
.business-directory a > .glyph:last-child:not(:first-child) {
  margin-left: auto;
  width: 13px;
  opacity: 0.45;
}
.ref-announcement {
  border-bottom: 1px solid var(--line);
  padding: 0 0 12px;
  margin-bottom: 16px;
}
.ref-announcement:last-child {
  border: 0;
  margin: 0;
}
.ref-announcement p {
  color: var(--muted);
  font-size: 12px;
}
.ref-family-tabs {
  display: flex;
  gap: 8px;
  margin: 5px 0 16px;
  flex-wrap: wrap;
}
.ref-family-tabs .button {
  min-width: 112px;
}
.ref-business-tabs {
  display: flex;
  gap: 24px;
  padding: 0 3px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 24px;
  overflow-x: auto;
}
.ref-business-tabs a {
  padding: 11px 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  border-radius: 0;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}
.ref-business-tabs a.selected {
  color: #c5694b !important;
  background: none !important;
  border-color: #e67757 !important;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  margin: 18px 0;
  flex-wrap: wrap;
}
.section-heading small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}
.direct-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 20px;
  margin-top: 22px;
}
.ref-direct-fields {
  gap: 16px;
  margin: 20px 0;
}
.ref-direct-fields input,
.ref-direct-fields select {
  background: #fdfcfa;
}
.local-session-check {
  border-top: 1px solid var(--line);
  margin: 18px 0;
  padding-top: 16px;
}
.local-session-check summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}
.local-session-check textarea {
  width: 100%;
  margin-bottom: 12px;
}
.local-session-check p {
  font-size: 12px;
  color: var(--muted);
}
.plan-menu {
  margin-top: 12px;
}
.plan-menu button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 16px 3px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.plan-menu button:hover {
  background: #fff9f5;
}
.plan-menu button > span:last-child {
  white-space: nowrap;
  text-align: right;
  font-weight: 600;
}
.plan-menu small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  font-weight: 400;
  margin-top: 6px;
}
.ref-batch-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
}
.ref-batch-card .section-heading {
  margin-top: 0;
}
.rule-summary {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.rule-summary:last-child {
  border: 0;
  padding-bottom: 0;
}
.rule-summary p,
.rule-summary small {
  color: var(--muted);
  font-size: 12px;
}
.proxy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 24px;
  align-items: start;
}
.proxy-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.proxy-controls > span {
  color: var(--muted);
  font-size: 12px;
  margin-right: 4px;
}
.proxy-controls > span:nth-of-type(2) {
  margin-left: 8px;
}
.proxy-controls .button {
  padding: 8px 12px;
  font-size: 12px;
}
.proxy-catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.proxy-catalog article {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
}
.country-code {
  background: #f6f3ed;
  color: #a78f6d;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 650;
  border-radius: 8px;
  flex: none;
}
.proxy-catalog h3 {
  margin: 0 0 6px;
}
.proxy-catalog small {
  color: var(--muted);
  font-size: 10px;
}
.proxy-price {
  margin-left: auto;
  text-align: right;
}
.proxy-price strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.proxy-price strong small {
  margin-left: 4px;
  font-weight: 400;
}
.proxy-price .actions {
  justify-content: flex-end;
  margin: 8px 0 0;
  flex-wrap: nowrap;
  gap: 9px;
}
.proxy-price .button.small {
  min-width: 23px;
  min-height: 23px;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12px;
}
.proxy-checkout {
  position: sticky;
  top: 100px;
}
.proxy-checkout .button {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 20px;
}
.proxy-checkout p,
.proxy-features {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.9;
}
.proxy-features {
  padding: 20px 0;
  text-align: center;
}
.ref-tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.member-service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.member-service-grid p {
  font-size: 12px;
  color: var(--muted);
}
.ref-card-filters {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.ref-card-filters .field {
  min-width: 110px;
  flex: 1;
  margin: 0;
}
.ref-card-filters .field.search {
  flex: 2;
}
.ref-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.ref-card-tile {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}
.ref-card-tile .card-face {
  background: linear-gradient(120deg, #fbf8f1, #f1ede4);
  padding: 20px;
  border-radius: 9px;
  margin-bottom: 16px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.ref-card-tile .card-face strong {
  font-size: 24px;
  font-weight: 550;
  letter-spacing: 0.5px;
}
.ref-card-tile .card-face small {
  color: #94856d;
}
.reference-layout .detail-row {
  overflow-wrap: anywhere;
}
.reference-layout #dialog pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
body.dark.reference-layout {
  --bg: #1d1f20;
  --panel: #25282a;
  --ink: #e6e3df;
  --muted: #aaa69f;
  --line: #363a3d;
}
body.dark.reference-layout main > header {
  background: var(--panel);
}
body.dark .ref-direct-fields input,
body.dark .ref-direct-fields select,
body.dark .ref-card-tile {
  background: var(--panel);
}
body.dark #referenceTop a.active,
body.dark .business-directory a:hover,
body.dark .plan-menu button:hover {
  background: #40332c;
}
body.dark .ref-card-tile .card-face {
  background: linear-gradient(120deg, #333938, #282e2d);
}
@media (min-width: 1350px) {
  .reference-layout main > header {
    gap: 14px;
  }
  #referenceTop {
    gap: 3px;
  }
}
@media (max-width: 1349px) {
  .reference-layout main > header {
    height: auto;
    min-height: 72px;
    flex-wrap: wrap;
    padding: 15px 24px 0;
    gap: 10px;
  }
  .reference-brand {
    margin-right: auto;
  }
  #referenceTop {
    order: 10;
    width: 100%;
    justify-content: center;
    gap: 14px;
    border-top: 1px solid var(--line);
    padding: 8px 0;
  }
  #referenceBalances {
    margin-left: 8px;
  }
  .proxy-checkout {
    top: 135px;
  }
}
@media (max-width: 900px) {
  .ref-home-grid,
  .direct-layout {
    grid-template-columns: 1fr;
  }
  .ref-home-grid > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .proxy-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
  .proxy-catalog {
    grid-template-columns: 1fr;
  }
  .member-service-grid {
    grid-template-columns: 1fr 1fr;
  }
  .ref-card-grid {
    grid-template-columns: 1fr 1fr;
  }
  .reference-layout #content {
    padding: 24px;
  }
  .reference-layout .page-head {
    align-items: flex-start;
  }
}
@media (max-width: 600px) {
  .reference-layout main > header {
    padding: 12px 16px 0;
    gap: 8px;
  }
  .reference-brand {
    font-size: 13px;
  }
  .reference-brand b {
    width: 26px;
    height: 26px;
  }
  .reference-more {
    font-size: 11px;
    padding: 6px 8px;
  }
  .reference-layout #noticeButton {
    display: none;
  }
  .reference-layout .account-button {
    font-size: 11px;
    max-width: 112px;
    padding: 6px 8px;
  }
  #referenceTop {
    justify-content: flex-start;
    gap: 3px;
    overflow-x: auto;
    padding: 7px 0;
  }
  #referenceTop a {
    font-size: 12px;
    padding: 8px 10px;
  }
  #referenceBalances {
    display: none;
  }
  .reference-layout #content {
    padding: 20px 16px 32px;
  }
  .reference-layout .page-head h1 {
    font-size: 22px;
  }
  .reference-layout .page-head p {
    font-size: 11px;
  }
  .reference-layout .panel {
    padding: 18px;
  }
  .business-directory {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
  .business-directory a {
    font-size: 12px;
    padding: 13px 7px;
    gap: 8px;
  }
  .ref-home-grid > div,
  .ref-tools-grid,
  .proxy-layout,
  .ref-card-grid {
    grid-template-columns: 1fr;
  }
  .proxy-catalog {
    grid-template-columns: 1fr;
  }
  .proxy-checkout {
    position: static;
  }
  .ref-family-tabs {
    gap: 6px;
  }
  .ref-family-tabs .button {
    min-width: 0;
    padding: 9px 11px;
    font-size: 12px;
  }
  .ref-business-tabs {
    gap: 20px;
  }
  .ref-business-tabs a {
    font-size: 12px;
  }
  .section-heading .actions {
    gap: 5px;
  }
  .section-heading .button {
    font-size: 11px;
    padding: 6px 9px;
  }
  .rule-summary {
    align-items: flex-start;
  }
  .rule-summary .button {
    flex: none;
  }
  .member-service-grid {
    gap: 16px;
  }
  .ref-card-filters .field {
    min-width: 100px;
  }
  .ref-card-filters .field.search {
    flex-basis: 100%;
  }
  .reference-layout .table-actions {
    gap: 6px;
    flex-wrap: wrap;
  }
  .reference-layout .table-actions .button {
    font-size: 11px;
    padding: 7px 9px;
  }
  .reference-layout footer {
    padding: 18px 16px;
    flex-direction: column;
    gap: 8px;
  }
}
.ref-direct-fields .field[hidden] {
  display: none !important;
}
@media (max-width: 1349px) {
  .reference-layout header .business-search {
    display: none;
  }
}
.reference-layout .tabs a.active {
  background: #fff0e8;
  color: #b65d40;
}
.card-advanced {
  margin: 8px 0 18px;
  font-size: 12px;
  color: var(--muted);
}
.card-advanced summary {
  cursor: pointer;
  padding: 8px 0;
}
.card-advanced .filters {
  margin: 8px 0;
}
.card-advanced #tableSearch,
.card-advanced [data-command="export"] {
  display: none;
}
@media (max-width: 1349px) {
  #referenceTop {
    flex: 0 0 100%;
    min-width: 0;
    width: 100%;
  }
  .reference-layout main > header {
    height: auto;
  }
}
@media (max-width: 600px) {
  .reference-layout header .global-search {
    display: none;
  }
  #referenceTop a {
    flex: none;
  }
  .reference-layout .reference-brand {
    margin-right: auto;
  }
}
