.hfa-shell {
  --hfa-ink: #241f19;
  --hfa-muted: #746b61;
  --hfa-line: #e5dbce;
  --hfa-paper: #fffdf9;
  --hfa-soft: #f7f2eb;
  --hfa-gold: #a56e25;
  --hfa-gold-soft: #f4e7d2;
  --hfa-green: #326a47;
  --hfa-red: #943d34;
  color: var(--hfa-ink);
}

.hfa-shell ::selection { background: #ead3ad; color: #241f19; }
.hfa-shell button,
.hfa-shell input,
.hfa-shell select,
.hfa-shell textarea { font: inherit; }
.hfa-shell button,
.hfa-button { min-height: 40px; border: 1px solid #cdbca5; border-radius: 9px; background: #fff; color: #65461e; padding: 8px 14px; font-weight: 650; line-height: 1.3; cursor: pointer; }
.hfa-shell button:hover,
.hfa-button:hover { border-color: #a97938; background: #fbf6ee; }
.hfa-shell button:focus-visible,
.hfa-button:focus-visible,
.hfa-shell summary:focus-visible,
.hfa-shell input:focus-visible,
.hfa-shell select:focus-visible,
.hfa-shell textarea:focus-visible { outline: 3px solid rgba(165, 110, 37, .2); outline-offset: 2px; }
.hfa-shell button.primary,
.hfa-button.primary { border-color: var(--hfa-gold); background: var(--hfa-gold); color: #fff; text-decoration: none; }
.hfa-shell button.danger { border-color: var(--hfa-red); color: var(--hfa-red); }
.hfa-shell button:disabled { cursor: not-allowed; opacity: .48; }
.hfa-shell[aria-busy="true"] { cursor: progress; }

.hfa-command { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 28px; border-radius: 15px; background: #211c16; color: #fff; box-shadow: 0 16px 38px rgba(40, 29, 17, .17); }
.hfa-command h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.02em; }
.hfa-command p { max-width: 70ch; margin: 0; color: #d9cdbf; line-height: 1.6; }
.hfa-command-state { display: grid; min-width: 132px; gap: 3px; padding-left: 22px; border-left: 1px solid #655744; }
.hfa-command-state span { color: #cbbca9; font-size: 12px; }
.hfa-command-state strong { color: #efca88; font-size: 18px; }

.hfa-boundary { display: flex; align-items: flex-start; gap: 12px; margin: 14px 0; padding: 12px 15px; border: 1px solid #dbc8aa; border-radius: 11px; background: #f5ecde; color: #58472f; }
.hfa-boundary strong { flex: none; color: #795321; }
.hfa-boundary span { line-height: 1.55; }

.hfa-overview { display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)) auto; align-items: stretch; gap: 1px; margin-bottom: 14px; overflow: hidden; border: 1px solid var(--hfa-line); border-radius: 13px; background: var(--hfa-line); }
.hfa-overview > div { display: grid; gap: 3px; padding: 14px 16px; background: var(--hfa-paper); }
.hfa-overview span { color: var(--hfa-muted); font-size: 12px; }
.hfa-overview strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.hfa-overview button { margin: 9px; align-self: center; }

.hfa-operation-layout { display: grid; grid-template-columns: minmax(230px, 280px) minmax(0, 1fr); align-items: start; gap: 14px; }
.hfa-store-rail,
.hfa-store-workbench,
.hfa-page-details { border: 1px solid var(--hfa-line); border-radius: 14px; background: var(--hfa-paper); }
.hfa-store-rail { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: hidden; }
.hfa-rail-head { padding: 16px; border-bottom: 1px solid var(--hfa-line); }
.hfa-rail-head h2 { margin: 0 0 11px; font-size: 17px; }
.hfa-rail-head input { box-sizing: border-box; width: 100%; min-height: 40px; border: 1px solid #d2c4b2; border-radius: 9px; background: #fff; padding: 8px 11px; color: var(--hfa-ink); }
.hfa-store-list { max-height: calc(100vh - 124px); overflow: auto; scrollbar-color: #b89a70 #f0e9df; scrollbar-width: thin; }
.hfa-merchant-group { border-bottom: 1px solid #e5dbce; }
.hfa-merchant-group:last-child { border-bottom: 0; }
.hfa-merchant-group > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; background: #f4eee6; color: #514438; }
.hfa-merchant-group > header strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.hfa-merchant-group > header span { flex: none; color: var(--hfa-muted); font-size: 11px; }
.hfa-store-choice { display: grid; width: 100%; min-height: 76px !important; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; border: 0 !important; border-bottom: 1px solid #eee5da !important; border-radius: 0 !important; background: transparent !important; padding: 13px 15px !important; color: var(--hfa-ink) !important; text-align: left; }
.hfa-store-choice:hover { background: #faf6f0 !important; }
.hfa-store-choice.active { background: var(--hfa-gold-soft) !important; box-shadow: inset 2px 0 0 var(--hfa-gold); }
.hfa-store-choice > span { display: grid; min-width: 0; gap: 4px; }
.hfa-store-choice > span:last-child { justify-items: end; }
.hfa-store-choice strong,
.hfa-store-choice small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hfa-store-choice small { max-width: 150px; color: var(--hfa-muted); font-size: 11px; }

.hfa-store-workbench { min-width: 0; overflow: hidden; }
.hfa-store-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px 21px; border-bottom: 1px solid var(--hfa-line); }
.hfa-store-heading h2 { margin: 0 0 4px; font-size: 21px; }
.hfa-store-heading p { margin: 0; color: var(--hfa-muted); }
.hfa-store-heading > div:last-child { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.hfa-live-state { padding: 4px 8px; border-radius: 999px; background: #eee9e3; color: #6d645a; font-size: 12px; }
.hfa-live-state.live { background: #e3efe5; color: var(--hfa-green); }

.hfa-progress { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 17px 21px; border-bottom: 1px solid var(--hfa-line); list-style: none; }
.hfa-progress li { position: relative; display: grid; justify-items: center; gap: 7px; color: #847a6e; font-size: 12px; text-align: center; }
.hfa-progress li:not(:last-child)::after { content: ""; position: absolute; top: 7px; left: calc(50% + 12px); width: calc(100% - 24px); height: 1px; background: #d9cec0; }
.hfa-progress li span { z-index: 1; width: 15px; height: 15px; border: 2px solid #c9bba8; border-radius: 50%; background: var(--hfa-paper); }
.hfa-progress li.done { color: var(--hfa-green); }
.hfa-progress li.done span { border-color: var(--hfa-green); background: var(--hfa-green); box-shadow: inset 0 0 0 3px var(--hfa-paper); }

.hfa-panel { padding: 20px 21px; border-bottom: 1px solid var(--hfa-line); }
.hfa-panel:last-child { border-bottom: 0; }
.hfa-primary-panel { background: #fffcf7; }
.hfa-scope-panel { background: #f7fbf7; }
.hfa-scope-panel.needs-choice { background: #fff9ef; }
.hfa-inherit-note { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 15px; padding: 12px 14px; border: 1px solid #cfe2d3; border-radius: 10px; background: #edf7ef; color: #355c40; }
.hfa-inherit-note strong { flex: none; }
.hfa-inherit-note.warning { border-color: #ead1a5; background: #fff5e4; color: #77531c; }
.hfa-subject-count { flex: none; color: #2f6840; font-weight: 750; }
.hfa-scope-explain { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 14px; border: 1px solid #d7e5da; border-radius: 10px; background: #fff; color: #4c5f50; }
.hfa-scope-explain > div { display: grid; min-width: 0; gap: 4px; }
.hfa-scope-explain strong { color: #2f6840; }
.hfa-scope-explain span { max-width: 82ch; line-height: 1.55; }
.hfa-scope-explain button { flex: none; }
.hfa-scope-store-list { overflow: hidden; margin-top: 14px; border: 1px solid var(--hfa-line); border-radius: 10px; background: #fff; }
.hfa-scope-list-head,.hfa-scope-store-row { display: grid; grid-template-columns: minmax(150px,.8fr) minmax(220px,1.2fr) minmax(190px,1fr); align-items: center; gap: 14px; padding: 11px 13px; border-bottom: 1px solid var(--hfa-line); }
.hfa-scope-store-row:last-child { border-bottom: 0; }
.hfa-scope-list-head { background: #f3eee7; color: var(--hfa-muted); font-size: 11px; }
.hfa-scope-list-head i { font-style: normal; text-align: right; }
.hfa-scope-store-name strong,.hfa-scope-store-name small { display: block; overflow-wrap: anywhere; }
.hfa-scope-store-name small,.hfa-scope-store-row label small { margin-top: 3px; color: var(--hfa-muted); font-size: 11px; line-height: 1.4; }
.hfa-scope-store-row label { display: grid; min-width: 0; gap: 3px; }
.hfa-scope-store-row select { box-sizing: border-box; width: 100%; min-height: 40px; border: 1px solid #cfc0ad; border-radius: 9px; background: #fff; padding: 8px 10px; color: var(--hfa-ink); }
.hfa-scope-store-row select:disabled { background: #f1eee9; color: #6f675e; opacity: 1; }
.hfa-scope-row-action { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px 10px; text-align: right; }
.hfa-scope-row-action strong { color: #3e704c; font-size: 12px; overflow-wrap: anywhere; }
.hfa-scope-row-action button { min-height: 34px; padding: 6px 10px; }
.hfa-scope-store-row.is-primary { background: #f1f8f2; }
.hfa-scope-store-row.is-primary .hfa-scope-row-action strong { color: #235f36; }
.hfa-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.hfa-panel-head h2,
.hfa-panel-head h3 { margin: 0 0 5px; font-size: 17px; letter-spacing: -.01em; }
.hfa-panel-head p { max-width: 72ch; margin: 0; color: var(--hfa-muted); line-height: 1.55; }
.hfa-next-action { display: grid; gap: 4px; margin-bottom: 14px; padding: 14px 15px; border-radius: 10px; background: #252019; color: #fff; }
.hfa-next-action span { color: #cbbba7; font-size: 12px; }
.hfa-next-action strong { color: #efc984; font-size: 16px; }
.hfa-next-action p { margin: 0; color: #d9cdbf; line-height: 1.5; }
.hfa-action-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.hfa-button { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }

.hfa-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 16px 0 0; overflow: hidden; border: 1px solid var(--hfa-line); border-radius: 10px; background: var(--hfa-line); }
.hfa-facts div { display: grid; min-width: 0; gap: 4px; padding: 11px 12px; background: #fff; }
.hfa-facts dt { color: var(--hfa-muted); font-size: 11px; }
.hfa-facts dd { margin: 0; overflow-wrap: anywhere; font-weight: 650; }

.hfa-materials,
.hfa-inner-details { margin-top: 14px; border: 1px solid var(--hfa-line); border-radius: 10px; background: var(--hfa-soft); }
.hfa-materials summary,
.hfa-inner-details summary { padding: 12px 14px; color: #64471f; font-weight: 650; cursor: pointer; }
.hfa-materials ul { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 16px; margin: 0; padding: 0 14px 14px; list-style: none; }
.hfa-materials li { display: grid; gap: 2px; }
.hfa-materials li span { color: var(--hfa-muted); font-size: 12px; line-height: 1.45; }

.hfa-assistance-simple { display: grid; grid-template-columns: minmax(170px, .7fr) minmax(280px, 1.5fr) auto; align-items: end; gap: 12px; }
.hfa-assistance-simple label,
.hfa-form-grid label,
.hfa-query-grid label { display: grid; min-width: 0; gap: 6px; color: #43382d; font-weight: 650; }
.hfa-assistance-simple input,
.hfa-assistance-simple select,
.hfa-assistance-simple textarea,
.hfa-form-grid input,
.hfa-form-grid select,
.hfa-form-grid textarea,
.hfa-query-grid input { box-sizing: border-box; width: 100%; min-height: 40px; border: 1px solid #cfc0ad; border-radius: 9px; background: #fff; padding: 9px 11px; color: var(--hfa-ink); }
.hfa-assistance-simple textarea,
.hfa-form-grid textarea { resize: vertical; }
.hfa-footnote { margin: 9px 0 0; color: var(--hfa-muted); font-size: 12px; }
.hfa-contract-markers { display: none; }

.hfa-channel-count { flex: none; color: var(--hfa-gold); font-weight: 750; }
.hfa-channel-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--hfa-line); border-radius: 10px; background: var(--hfa-line); }
.hfa-channel-status > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; background: #fff; }
.hfa-rate-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; color: var(--hfa-muted); }
.hfa-rate-summary > strong { color: var(--hfa-ink); }
.hfa-rate-summary details { width: 100%; }

.hfa-finance-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hfa-finance-list article { display: grid; align-content: start; gap: 10px; padding: 14px; border: 1px solid var(--hfa-line); border-radius: 10px; background: var(--hfa-soft); }
.hfa-finance-list article > div { display: grid; gap: 3px; }
.hfa-finance-list small { color: var(--hfa-muted); }
.hfa-finance-list pre,
.hfa-rate-summary pre { max-height: 240px; overflow: auto; margin: 9px 0 0; padding: 10px; border-radius: 8px; background: #29241e; color: #f7f1e8; font: 12px/1.5 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

.hfa-advanced { border-bottom: 1px solid var(--hfa-line); background: #fbf9f5; }
.hfa-advanced > summary,
.hfa-page-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 21px; cursor: pointer; }
.hfa-advanced > summary > span:first-child,
.hfa-page-details > summary > span:first-child { display: grid; gap: 3px; }
.hfa-advanced > summary strong,
.hfa-page-details > summary strong { font-size: 16px; }
.hfa-advanced > summary small,
.hfa-page-details > summary small { color: var(--hfa-muted); font-weight: 400; }
.hfa-advanced > form,
.hfa-advanced > .hfa-query-grid,
.hfa-advanced > .hfa-activation { margin: 0 21px 18px; }
.hfa-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 15px; }
.hfa-form-grid .wide { grid-column: 1 / -1; }
.hfa-form-grid small { color: var(--hfa-muted); font-weight: 400; }
.hfa-check { display: flex !important; min-height: 40px; flex-direction: row !important; align-items: center; gap: 8px !important; }
.hfa-check input { width: 17px !important; height: 17px !important; min-height: 17px !important; flex: 0 0 17px; margin: 0; accent-color: var(--hfa-gold); }
.hfa-trade-fieldset { margin: 14px 0 0; padding: 13px; border: 1px solid var(--hfa-line); border-radius: 10px; }
.hfa-trade-fieldset legend { padding: 0 5px; font-weight: 650; }
.hfa-trade-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.hfa-trade-types label { display: flex; align-items: center; gap: 7px; padding: 8px; border-radius: 8px; background: var(--hfa-soft); }
.hfa-trade-types input { width: 17px; height: 17px; flex: 0 0 17px; margin: 0; accent-color: var(--hfa-gold); }
.hfa-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hfa-line); }
.hfa-form-actions span { margin-right: auto; color: var(--hfa-muted); }

.hfa-query-grid { display: grid; grid-template-columns: 150px minmax(220px, 1fr) auto; align-items: end; gap: 11px; padding-top: 2px; }
.hfa-activation { display: grid; gap: 14px; padding: 14px; border-radius: 10px; background: #f3ede5; }
.hfa-activation.live { background: #e7f0e8; }
.hfa-activation p { margin: 4px 0 0; color: var(--hfa-muted); line-height: 1.5; }

.hfa-page-details { margin-top: 14px; overflow: hidden; }
.hfa-page-details > summary { background: var(--hfa-paper); }
.hfa-page-details[open] > summary { border-bottom: 1px solid var(--hfa-line); }
.hfa-metrics { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding: 14px 18px; border-bottom: 1px solid var(--hfa-line); }
.hfa-metrics span { color: var(--hfa-muted); }
.hfa-metrics b { margin-right: 4px; color: var(--hfa-ink); font-size: 18px; font-variant-numeric: tabular-nums; }
.hfa-metrics button { margin-left: auto; }
.hfa-table-wrap { overflow: auto; scrollbar-color: #b89a70 #f0e9df; scrollbar-width: thin; }
.hfa-table-wrap table { width: 100%; min-width: 980px; border-collapse: collapse; }
.hfa-table-wrap th { padding: 10px; background: var(--hfa-soft); color: #675d52; text-align: left; font-size: 12px; }
.hfa-table-wrap td { padding: 12px 10px; border-bottom: 1px solid #eee5da; vertical-align: middle; }
.hfa-table-wrap td strong,
.hfa-table-wrap td small { display: block; }
.hfa-table-wrap td small { margin-top: 4px; color: var(--hfa-muted); }
.hfa-table-wrap .empty { padding: 28px; text-align: center; }

.hfa-platform-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr); gap: 18px; padding: 20px 21px; }
.hfa-platform-layout aside { padding: 15px; border-radius: 10px; background: var(--hfa-soft); }
.hfa-platform-layout aside h3 { margin: 0 0 10px; }
.hfa-section-copy { margin: 0 0 16px; color: var(--hfa-muted); line-height: 1.55; }
.hfa-section-copy a { color: #76501f; text-underline-offset: 3px; }
.hfa-secret-state { display: grid; align-content: center; gap: 3px; padding: 9px 11px; border-radius: 9px; background: var(--hfa-soft); }
.hfa-secret-state span,
.hfa-secret-state small { color: var(--hfa-muted); font-size: 12px; }
.hfa-readiness-list { margin: 0; padding: 0; list-style: none; }
.hfa-readiness-list li { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px solid #e5dace; }
.hfa-readiness-list li > span { display: grid; width: 20px; height: 20px; flex: none; place-items: center; border-radius: 50%; background: #e5dfd7; color: #81776c; }
.hfa-readiness-list li.done > span { background: #dcebdd; color: var(--hfa-green); }
.hfa-readiness-list li div { display: grid; gap: 1px; }
.hfa-readiness-list small { color: var(--hfa-muted); }
.hfa-check-mark::after { content: ""; display: block; width: 7px; height: 3px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }
.hfa-readiness-list li:not(.done) .hfa-check-mark::after { width: 8px; height: 0; border-left: 0; border-bottom-width: 1px; transform: none; }

.hfa-pill { display: inline-flex; width: max-content; align-items: center; padding: 4px 8px; border-radius: 999px; background: #eee9e3; color: #6e655b; font-size: 12px; white-space: nowrap; }
.hfa-pill.good { background: #e3efe5; color: var(--hfa-green); }
.hfa-pill.warn { background: #f6ead7; color: #805719; }
.hfa-pill.bad { background: #f6e4e1; color: var(--hfa-red); }
.hfa-empty,
.hfa-empty-page { padding: 24px; color: var(--hfa-muted); text-align: center; }
.hfa-loading,
.hfa-error { display: grid; min-height: 360px; place-items: center; align-content: center; gap: 9px; border: 1px solid var(--hfa-line); border-radius: 14px; background: #fff; color: var(--hfa-muted); }
.hfa-error strong { color: var(--hfa-red); font-size: 18px; }
.hfa-error span { max-width: 65ch; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (max-width: 1180px) {
  .hfa-overview { grid-template-columns: repeat(4, 1fr); }
  .hfa-overview button { grid-column: 1 / -1; }
  .hfa-operation-layout { grid-template-columns: 1fr; }
  .hfa-store-rail { position: static; max-height: none; }
  .hfa-store-list { display: grid; max-height: 270px; grid-template-columns: 1fr 1fr; }
  .hfa-store-choice { border-right: 1px solid #eee5da !important; }
  .hfa-platform-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .hfa-command,
  .hfa-store-heading,
  .hfa-panel-head,
  .hfa-boundary { align-items: stretch; flex-direction: column; }
  .hfa-command-state { padding: 12px 0 0; border-top: 1px solid #655744; border-left: 0; }
  .hfa-overview { grid-template-columns: 1fr 1fr; }
  .hfa-store-list { grid-template-columns: 1fr; }
  .hfa-progress { padding-inline: 12px; }
  .hfa-progress li strong { font-size: 11px; }
  .hfa-panel,
  .hfa-advanced > summary,
  .hfa-page-details > summary,
  .hfa-platform-layout { padding-inline: 15px; }
  .hfa-facts,
  .hfa-channel-status,
  .hfa-finance-list,
  .hfa-form-grid,
  .hfa-trade-types,
  .hfa-materials ul { grid-template-columns: 1fr; }
  .hfa-form-grid .wide { grid-column: auto; }
  .hfa-assistance-simple,
  .hfa-query-grid { grid-template-columns: 1fr; }
  .hfa-assistance-simple button,
  .hfa-query-grid button { width: 100%; }
  .hfa-store-heading > div:last-child { justify-content: flex-start; }
  .hfa-form-actions { align-items: stretch; flex-direction: column; }
  .hfa-form-actions span { margin-right: 0; }
  .hfa-scope-explain { align-items: stretch; flex-direction: column; }
  .hfa-scope-list-head { display: none; }
  .hfa-scope-store-row { grid-template-columns: 1fr; gap: 9px; padding-block: 14px; }
  .hfa-scope-row-action { justify-content: flex-start; text-align: left; }
}

@media (prefers-reduced-motion: no-preference) {
  .hfa-store-choice,
  .hfa-shell button,
  .hfa-button { transition: background-color 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out; }
}
