:root {
  --ffl-bg: #f5f7fb;
  --ffl-surface: #ffffff;
  --ffl-surface-soft: #eef3fb;
  --ffl-text: #152033;
  --ffl-muted: #5e6c84;
  --ffl-line: #d9e2ef;
  --ffl-brand: #123a63;
  --ffl-brand-dark: #0d2c4b;
  --ffl-accent: #b8872d;
  --ffl-danger: #b42318;
  --ffl-success: #027a48;
  --ffl-shadow: 0 14px 40px rgba(18, 58, 99, 0.10);
  --ffl-card-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --ffl-panel-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --ffl-radius: 18px;
  --ffl-radius-sm: 12px;
  --ffl-max: 1120px;
  --ffl-page-max: 880px;
  --ffl-results-max: 880px;
}

html,
body {
  height: 100%;
}

html,
body,
h1,
h2,
h3,
h4,
h5,
h6,
input,
textarea,
select,
button {
  font-family: "Inter", Arial, sans-serif;
}

body {
  margin: 0;
  color: var(--ffl-text);
  line-height: 1.65;
}

a {
  color: var(--ffl-brand);
  text-decoration: none;
}

a:hover {
  color: var(--ffl-brand-dark);
}

.ffl-resource-link:hover {
  text-decoration: underline;
}

p {
  margin: 0 0 18px;
  color: #314156;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--ffl-text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.w3-content,
.ffl-shell,
.ffl-topbar-inner,
.ffl-footer-inner {
  max-width: var(--ffl-max);
  margin-left: auto;
  margin-right: auto;
}

.ffl-site-wrap {
  min-height: 100%;
}

/* Header */
.ffl-topbar {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(217, 226, 239, 0.9);
  box-shadow: 0 8px 30px rgba(16, 24, 40, 0.05);
  backdrop-filter: blur(14px);
}

.ffl-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 24px;
}

.ffl-brand {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ffl-brand-mark {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ffl-accent);
}

.ffl-brand-name {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  color: var(--ffl-brand-dark);
  letter-spacing: -0.04em;
}

.ffl-brand-subtitle {
  font-size: 13px;
  color: var(--ffl-muted);
  white-space: nowrap;
}

.ffl-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ffl-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--ffl-text);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.ffl-nav a:hover,
.ffl-nav a:focus {
  background: var(--ffl-surface-soft);
  color: var(--ffl-brand-dark);
  transform: translateY(-1px);
}

.ffl-nav a.ffl-nav-cta {
  background: var(--ffl-brand);
  color: #fff;
}

.ffl-nav a.ffl-nav-cta:hover,
.ffl-nav a.ffl-nav-cta:focus {
  background: var(--ffl-brand-dark);
  color: #fff;
}

.ffl-nav .ffl-nav-secondary {
  border: 1px solid var(--ffl-line);
  background: #fff;
}

/* Hero */
.ffl-hero {
  padding: 36px 24px 0;
}

.ffl-hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #f6f9fd 100%);
  border: 1px solid var(--ffl-line);
  border-radius: 28px;
  padding: 34px 36px;
  box-shadow: var(--ffl-shadow);
}

.ffl-hero-eyebrow {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--ffl-brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ffl-hero-title {
  margin: 0 0 12px;
  font-size: 42px;
  line-height: 1.08;
  max-width: 10ch;
}

.ffl-hero-copy {
  max-width: 720px;
  font-size: 17px;
  color: #45556f;
  margin-bottom: 0;
}

/* Legacy content wrapper */
.w3-content.w3-container.w3-padding-64 {
  max-width: var(--ffl-max);
  padding: 28px 24px 72px !important;
}

.w3-content.w3-container.w3-padding-64 > :first-child {
  margin-top: 0;
}

.w3-content.w3-container.w3-padding-64 h3.w3-center {
  text-align: left !important;
  font-size: 30px;
  margin-bottom: 18px;
}

/* FIX: exclude the new page-shell from legacy card styling */
.w3-content.w3-container.w3-padding-64 > p,
.w3-content.w3-container.w3-padding-64 > div:not(.ffl-page-shell),
.w3-content.w3-container.w3-padding-64 > table,
.w3-content.w3-container.w3-padding-64 > form,
.w3-content.w3-container.w3-padding-64 > dl,
.w3-content.w3-container.w3-padding-64 > ul,
.w3-content.w3-container.w3-padding-64 > ol {
  background: var(--ffl-surface);
  border: 1px solid var(--ffl-line);
  border-radius: var(--ffl-radius);
  box-shadow: var(--ffl-shadow);
}

/* FIX: also exclude the new page-shell from legacy padding */
.w3-content.w3-container.w3-padding-64 > p,
.w3-content.w3-container.w3-padding-64 > div.body-text,
.w3-content.w3-container.w3-padding-64 > div:not(.ffl-page-shell):not(.body-text),
.w3-content.w3-container.w3-padding-64 > form,
.w3-content.w3-container.w3-padding-64 > dl,
.w3-content.w3-container.w3-padding-64 > ul,
.w3-content.w3-container.w3-padding-64 > ol {
  padding: 22px 24px;
}

.w3-content.w3-container.w3-padding-64 > table,
.w3-content.w3-container.w3-padding-64 > div.results,
.w3-content.w3-container.w3-padding-64 > div#results {
  padding: 12px;
  overflow: auto;
}

/* Shared page/card system */
.ffl-page-shell {
  max-width: var(--ffl-page-max);
  margin: 0 auto;
  padding: 32px 20px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.ffl-page-shell .ffl-card {
  padding: 28px !important;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: var(--ffl-card-shadow);
}

.ffl-page-title {
  margin: 0 0 18px;
  text-align: center;
  font-size: 2rem;
  line-height: 1.2;
  color: #0f172a;
}

.ffl-copy p {
  margin: 0 0 16px;
  font-size: 1rem;
  line-height: 1.75;
  color: #334155;
}

.ffl-alert {
  margin: 0 0 22px;
  padding: 16px 18px;
  border: 1px solid #fecaca;
  border-radius: var(--ffl-radius-sm);
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.98rem;
  line-height: 1.65;
}

.ffl-alert-soft {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.ffl-results-panel {
  margin-top: 20px;
  padding: 20px !important;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: var(--ffl-panel-shadow);
  box-sizing: border-box;
}

.ffl-results-panel-table {
  padding: 12px !important;
}

.ffl-location-card > .ffl-results-panel-table {
  padding: 0 !important;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.ffl-results-panel:empty {
  display: none;
}

.preferred-label {
  color: #b91c1c;
  font-weight: 700;
}

/* Shared form system */
.ffl-form-grid,
.ffl-confirm-form {
  margin-top: 24px;
}

.ffl-form-row {
  margin-bottom: 18px;
}

.ffl-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #0f172a;
}

.ffl-form-message {
  min-height: 18px;
  margin-top: 8px;
}

.license-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1px;
}

.license-mask {
  color: #64748b;
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.04em;
}

input.money,
input.large,
input.med_email,
input.medium,
input.small,
input.city,
input.zip,
input.l_pre,
input.l_mid,
input.l_suf,
textarea.description,
.ffl-form-row input.small,
.ffl-form-row input.l_pre,
.ffl-form-row input.l_mid,
.ffl-form-row input.l_suf,
.ffl-login-form .med_email,
.ffl-login-form .l_pre,
.ffl-login-form .l_mid,
.ffl-login-form .l_suf,
.ffl-search-input {
  border: 1px solid #c7d3e0;
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ffl-text);
  box-sizing: border-box;
  font-size: 16px;
}

input.money { width: 70px; }
input.large,
textarea.description { width: 500px; }
input.med_email { width: 100%; max-width: 420px; }
input.small { width: 200px; }
input.medium { width: 350px; }
input.city { width: 160px; }
input.zip { width: 60px; }
input.l_pre { width: 56px; text-align: center; }
input.l_mid { width: 70px; text-align: center; }
input.l_suf { width: 110px; text-align: center; }
textarea.description { height: 120px; }

.ffl-form-row input.small {
  width: 100%;
  max-width: 520px;
}

.ffl-search-form {
  margin-top: 24px;
}

.ffl-search-row,
.confirm-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ffl-search-input {
  width: 220px;
  max-width: 100%;
  height: 44px;
}

.ffl-label,
.req {
  color: #0f172a;
}

.req {
  color: var(--ffl-danger);
  margin-right: 4px;
}

.notice {
  color: var(--ffl-danger);
  font-size: 0.92rem;
}

.success {
  color: var(--ffl-success);
}

.sub_text {
  color: #98a2b3;
}

/* Buttons */
.request-actions,
.confirm-actions {
  margin-top: 18px;
}

.request_btn button,
.confirm_btn button,
.search_btn button {
  appearance: none;
  border: 0 !important;
  border-radius: 10px !important;
  background: #0f172a !important;
  color: #fff !important;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  cursor: pointer;
}

.request_btn button:hover,
.confirm_btn button:hover,
.search_btn button:hover {
  opacity: 0.92;
}

.w3-button:hover {
  color: inherit !important;
  background-color: inherit !important;
}

/* States / browse pages */
.ffl-state-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ffl-state-item {
  display: block;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 600;
  color: #0f172a;
  text-align: center;
  transition: all 0.15s ease;
}

.ffl-state-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.ffl-refine-block {
  margin: 8px 0 24px;
  padding: 18px 0 0;
  border-top: 1px solid #e5e7eb;
}

.ffl-refine-label {
  margin-bottom: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}

.ffl-city-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ffl-city-chip {
  display: inline-block;
  padding: 9px 14px;
  border: 1px solid #dbe3ec;
  border-radius: 999px;
  background: #f8fafc;
  color: #0f172a;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ffl-city-chip:hover {
  background: #fff;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

/* Misc legacy */
#logo {
  display: none;
}

#copyright {
  color: #6b778c;
}

.titleBar {
  margin-bottom: 10px;
  zoom: 1;
}

.titleBar:after {
  content: ".";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}

.titleBar h1 {
  font-size: 26px;
  overflow: hidden;
  zoom: 1;
  margin: 0 0 12px;
}

.titleBar h1 em {
  color: #6b778c;
}

.titleBar h1 .Popup {
  float: left;
}

.state_list {
  zoom: 1;
}

.state_list td {
  width: 35%;
  vertical-align: top;
  white-space: nowrap;
  padding: 8px 12px;
}

.state_list td a,
div.city_list a {
  font-size: 14px;
}

div.city_list {
  margin: 6px 0 10px 16px;
}

dl.register,
dl.description {
  display: inline;
}

dt.register,
dt.description {
  line-height: 20px;
  padding: 0;
  float: left;
  white-space: nowrap;
}

dt.register {
  min-height: 30px;
}

dt.description {
  min-height: 130px;
}

dd.register {
  min-height: 30px;
  display: block;
}

dd.description {
  min-height: 130px;
  display: block;
}

/* Responsive */
@media (max-width: 900px) {
  .ffl-topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .ffl-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .ffl-hero-title {
    font-size: 34px;
    max-width: none;
  }

  .ffl-state-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .ffl-admin-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .ffl-admin-card {
    padding: 18px;
  }

  .ffl-topbar-inner,
  .ffl-hero,
  .w3-content.w3-container.w3-padding-64 {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .ffl-hero-card {
    padding: 26px 22px;
    border-radius: 22px;
  }

  .ffl-brand-name {
    font-size: 24px;
  }

  .ffl-brand-subtitle {
    white-space: normal;
  }

  .ffl-nav a {
    padding: 9px 12px;
    font-size: 13px;
  }

  .ffl-page-title {
    font-size: 1.7rem;
  }

  .ffl-page-shell .ffl-card,
  .w3-content.w3-container.w3-padding-64 > p,
  .w3-content.w3-container.w3-padding-64 > div.body-text,
  .w3-content.w3-container.w3-padding-64 > div:not(.ffl-page-shell):not(.body-text),
  .w3-content.w3-container.w3-padding-64 > form,
  .w3-content.w3-container.w3-padding-64 > dl,
  .w3-content.w3-container.w3-padding-64 > ul,
  .w3-content.w3-container.w3-padding-64 > ol {
    padding: 18px !important;
  }

  .ffl-alert {
    padding: 14px 16px;
  }

  .ffl-form-row input.small {
    max-width: 100%;
  }

  .confirm-actions {
    align-items: stretch;
  }

  .confirm_btn button,
  .search_btn button {
    width: 100%;
  }
}

@media (max-width: 500px) {
  .ffl-state-grid {
    grid-template-columns: 1fr;
  }
}

.ffl-details-card {
  overflow: hidden;
}

.ffl-dealer-profile {
  display: block;
}

.ffl-dealer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}

.ffl-details-title {
  margin-bottom: 14px;
  text-align: left;
}

.ffl-dealer-address {
  margin-bottom: 14px;
  font-size: 1rem;
  line-height: 1.75;
  color: #334155;
}

.ffl-dealer-contact {
  display: grid;
  gap: 8px;
  color: #334155;
}

.ffl-contact-label {
  display: inline-block;
  min-width: 78px;
  font-weight: 700;
  color: #0f172a;
}

.ffl-dealer-actions {
  flex: 0 0 auto;
}

.ffl-primary-link,
.ffl-cta-row a {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.ffl-primary-link:hover,
.ffl-cta-row a:hover {
  opacity: 0.92;
  color: #ffffff;
}

.ffl-details-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.ffl-details-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.ffl-section-title {
  margin: 0 0 14px;
  font-size: 1.1rem;
  color: #0f172a;
}

.ffl-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ffl-detail-item {
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
}

.ffl-detail-label {
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
}

.ffl-detail-value {
  color: #0f172a;
  line-height: 1.6;
}

.ffl-cta-row {
  margin-top: 16px;
}

.detail_table {
  width: 100%;
  border-collapse: collapse;
}

.detail_table td {
  padding: 8px 0;
  vertical-align: top;
}



/* Admin */
.ffl-admin-shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 24px 56px;
}

.ffl-admin-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: var(--ffl-card-shadow);
  padding: 24px;
}

.ffl-admin-title {
  text-align: left;
}

.ffl-admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.ffl-admin-results:empty {
  display: none;
}

.ffl-admin-empty {
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
}

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

.ffl-admin-table thead th {
  background: #eff4fb;
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid #cbd5e1;
}

.ffl-admin-table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid #e5e7eb;
  color: #334155;
  font-size: 0.92rem;
  vertical-align: top;
}

.ffl-admin-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  padding: 0;
  cursor: pointer;
}

.ffl-admin-sort:hover {
  color: var(--ffl-brand);
}

.ffl-admin-license {
  font-weight: 700;
  color: #0f172a;
}

.ffl-admin-expander {
  width: 34px;
  text-align: center;
}

.ffl-admin-detail-row td {
  background: #f8fafc;
}

.ffl-admin-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.ffl-admin-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-weight: 600;
}

.ffl-admin-link:hover,
.ffl-admin-link:visited {
  color: #fff;
}

.ffl-admin-link-secondary {
  background: #fff;
  color: #0f172a !important;
  border: 1px solid #cbd5e1;
}

.ffl-admin-link-danger {
  background: #991b1b;
}

.ffl-admin-meta {
  color: #334155;
  line-height: 1.7;
}

.ffl-admin-meta strong {
  color: #0f172a;
}

@media (max-width: 1080px) {
  .ffl-page-shell-wide {
    padding-left: 16px;
    padding-right: 16px;
  }

  .ffl-results-table thead th,
  .ffl-results-table tbody td {
    padding: 10px 10px;
    font-size: 0.88rem;
  }

  .ffl-results-state-col,
  .ffl-results-state-cell {
    display: none;
  }
}

@media (max-width: 760px) {
  .ffl-admin-table th:nth-child(4),
  .ffl-admin-table td:nth-child(4),
  .ffl-admin-table th:nth-child(5),
  .ffl-admin-table td:nth-child(5) {
    display: none;
  }


  .ffl-dealer-header {
    flex-direction: column;
    align-items: stretch;
  }

  .ffl-primary-link,
  .ffl-cta-row a {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  .ffl-details-grid {
    grid-template-columns: 1fr;
  }

  .ffl-details-title {
    text-align: left;
  }
}

.ffl-error-card {
  max-width: 760px;
  margin: 0 auto;
}

.ffl-error-title {
  margin-bottom: 14px;
}

.ffl-error-copy p {
  margin: 0 0 16px;
}

.ffl-error-actions {
  margin-top: 22px;
}


/* Footer */
.ffl-footer {
  padding: 0 24px 40px;
}

.ffl-footer-card {
  background: #0f2239;
  color: #d9e3f0;
  border-radius: 28px;
  padding: 34px 36px;
  box-shadow: 0 20px 40px rgba(15,34,57,0.18);
}

.ffl-footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: space-between;
  align-items: flex-start;
}

.ffl-footer-brand {
  max-width: 420px;
  min-width: 240px;
}

.ffl-footer-kicker {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 800;
  color: #b8872d;
  margin-bottom: 10px;
}

.ffl-footer-title {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.ffl-footer-copy,
.ffl-footer-copy a {
  font-size: 15px;
  line-height: 1.7;
  color: #b9c7d8;
}

.ffl-footer-copy a:hover {
  text-decoration: underline;
}

.ffl-footer-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

.ffl-footer-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #8ea2ba;
  margin-bottom: 12px;
}

.ffl-footer-links {
  display: grid;
  gap: 10px;
}

.ffl-footer-links a,
.ffl-footer-links a:visited {
  color: #fff;
}

.ffl-footer-divider {
  height: 1px;
  background: rgba(217,227,240,0.14);
  margin: 28px 0 18px;
}

.ffl-footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  color: #9fb1c4;
  font-size: 14px;
}

@media (max-width: 640px) {
  .ffl-footer {
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 28px;
  }

  .ffl-footer-card {
    padding: 24px 22px;
    border-radius: 22px;
  }

  .ffl-footer-title {
    font-size: 24px;
  }
}

.ffl-manage-card {
  max-width: 980px;
  margin: 0 auto;
}

.ffl-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ffl-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.ffl-form-help {
  margin-top: 8px;
  color: #64748b;
  font-size: 0.92rem;
}

.ffl-location-row,
.ffl-url-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ffl-input-prefix,
.ffl-money-prefix {
  color: #475569;
  font-weight: 600;
}

.ffl-fee-grid {
  display: grid;
  grid-template-columns: 160px 120px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 20px;
}

.ffl-fee-head {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}

.ffl-fee-label {
  font-weight: 600;
  color: #0f172a;
}

.ffl-fee-money,
.ffl-fee-desc {
  display: flex;
  align-items: center;
  gap: 8px;
}

.changes_btn button {
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  cursor: pointer;
}

.changes_btn button:hover {
  opacity: 0.92;
}

.ffl-search-results-wrap {
  width: 100%;
  overflow-x: visible;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #ffffff;
}

.ffl-results-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ffl-results-table thead th {
  background: #eff4fb;
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid #cbd5e1;
  white-space: nowrap;
}

.ffl-results-table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
  color: #334155;
  font-size: 0.92rem;
}

.ffl-results-summary-row:hover {
  background: #f8fafc;
}

.ffl-results-holder-cell {
  width: 42%;
}

.ffl-results-preferred-cell,
.ffl-results-type-cell,
.ffl-results-city-cell,
.ffl-results-state-cell,
.ffl-results-phone-cell,
.ffl-results-distance-cell {
  white-space: nowrap;
}

.ffl-results-type-cell,
.ffl-results-city-cell {
  white-space: normal;
}

.ffl-results-toggle-heading,
.ffl-results-toggle-cell {
  width: 34px;
  text-align: center;
  padding-left: 8px !important;
  padding-right: 4px !important;
}

.ffl-results-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  padding: 0;
  cursor: pointer;
}

.ffl-results-sort:hover {
  color: var(--ffl-brand);
}

.ffl-sort-indicator {
  font-size: 0.8rem;
  color: #64748b;
}

.ffl-row-toggle {
  width: 20px;
  height: 20px;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  background: #ffffff;
  color: #123a63;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.ffl-row-toggle:hover {
  background: #eff6ff;
}

.ffl-row-toggle-icon {
  display: inline-block;
  transform: translateY(-1px);
}

.ffl-result-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
}

.ffl-result-title:hover {
  text-decoration: underline;
  color: blue;
}

.ffl-results-detail-row[hidden] {
  display: none;
}

.ffl-results-detail-row td {
  background: #fbfdff;
  padding: 0 !important;
}

.ffl-result-body {
  padding: 18px 22px;
}

.ffl-result-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.ffl-result-column {
  color: #334155;
  line-height: 1.7;
}

.ffl-result-column a {
  word-break: break-word;
}

.ffl-result-detail-table {
  width: 100%;
  border-collapse: collapse;
}

.ffl-result-detail-table td {
  padding: 4px 0 !important;
  border: 0 !important;
  vertical-align: top;
  white-space: normal;
}

.ffl-result-detail-label {
  width: 140px;
  color: #64748b;
  font-weight: 700;
  padding-right: 12px !important;
}

.ffl-result-description {
  margin-top: 16px;
  color: #334155;
}

.ffl-result-description p {
  margin: 0;
}

@media (max-width: 1080px) {
  .ffl-page-shell-wide {
    padding-left: 16px;
    padding-right: 16px;
  }

  .ffl-results-table thead th,
  .ffl-results-table tbody td {
    padding: 10px 10px;
    font-size: 0.88rem;
  }

  .ffl-results-state-col,
  .ffl-results-state-cell {
    display: none;
  }
}

@media (max-width: 760px) {
  .ffl-fee-grid {
    grid-template-columns: 1fr;
  }

  .ffl-fee-head {
    display: none;
  }

  .ffl-fee-label {
    margin-top: 10px;
  }

  .ffl-fee-money,
  .ffl-fee-desc,
  .ffl-url-row,
  .ffl-location-row {
    width: 100%;
  }

  .ffl-search-results-wrap {
    overflow-x: auto;
  }

  .ffl-results-table {
    min-width: 720px;
  }

  .ffl-results-phone-col,
  .ffl-results-phone-cell {
    display: none;
  }

  .ffl-result-columns {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .changes_btn button {
    width: 100%;
  }
}

/* Runtime-light UI replacements */
.ffl-results-shell {
  max-width: var(--ffl-page-max);
  margin: 22px auto 0;
  padding: 0 20px 56px;
}

.ffl-results-shell-dynamic {
  display: none;
  margin-top: 0;
  padding-bottom: 0;
}

.ffl-results-shell-dynamic.has-results {
  display: block;
  margin-top: 22px;
  padding-bottom: 56px;
}

.ffl-results-shell-wide,
.ffl-page-shell-wide {
  max-width: var(--ffl-page-max);
}

.ffl-results-shell .ffl-results-panel {
  margin-top: 0;
}

.ffl-search-results-wrap {
  overflow-x: visible;
}

.ffl-results-table {
  table-layout: auto;
}

.ffl-results-table thead th,
.ffl-results-table tbody td {
  padding: 10px 11px;
  font-size: 0.88rem;
}

.ffl-results-holder-cell {
  width: 43%;
}

.ffl-results-preferred-cell {
  width: 14%;
}

.ffl-results-type-cell {
  width: 14%;
}

.ffl-results-city-cell {
  width: 17%;
}

.ffl-results-distance-cell,
.ffl-results-distance-col {
  width: 12%;
  white-space: nowrap;
}

.ffl-preferred-inline {
  display: none;
  margin-left: 6px;
  color: #b91c1c;
  font-weight: 700;
  white-space: nowrap;
}

.ffl-results-sort {
  gap: 4px;
  font-size: inherit;
}

.ffl-results-panel-table {
  padding: 0 !important;
}

.ffl-autocomplete {
  position: absolute;
  z-index: 1100;
  width: min(420px, calc(100vw - 40px));
  max-height: 320px;
  overflow: auto;
  margin-top: 8px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.ffl-search-form {
  position: relative;
}

.ffl-autocomplete-category {
  padding: 10px 14px 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.ffl-autocomplete-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: #fff;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}

.ffl-autocomplete-item:hover,
.ffl-autocomplete-item.is-active {
  background: #eff4fb;
}

.ui-loading-bar,
.ui-login-bar {
  min-height: 54px;
}

.ui-loading-bar::after,
.ui-login-bar::after {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  margin: 10px auto;
  border: 3px solid #d9e2ef;
  border-top-color: var(--ffl-brand);
  border-radius: 50%;
  animation: ffl-spin 0.8s linear infinite;
}

@keyframes ffl-spin {
  to { transform: rotate(360deg); }
}

body.ffl-modal-open {
  overflow: hidden;
}

.ffl-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  z-index: 1200;
}

.ffl-modal-instance {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1201;
  width: min(92vw, 640px);
  max-height: min(88vh, 780px);
  overflow: auto;
  background: #fff;
  border: 1px solid #dbe3ec;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  padding: 20px;
}

.ffl-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -20px -20px 18px;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.ffl-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.ffl-modal-close {
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.ffl-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 18px -20px -20px;
  padding: 12px 20px;
  border-top: 1px solid #e5e7eb;
}

.ffl-modal-btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.ffl-modal-btn-primary {
  background: #0f172a;
  color: #fff;
}

.ffl-modal-btn-secondary {
  background: #eef2f7;
  color: #0f172a;
}

@media (max-width: 1080px) {
  .ffl-results-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .ffl-results-holder-cell {
    width: 36%;
  }
}

@media (max-width: 760px) {
  .ffl-results-shell {
    padding-bottom: 40px;
  }

  .ffl-results-shell-dynamic.has-results {
    padding-bottom: 40px;
  }

  .ffl-search-results-wrap {
    overflow-x: visible;
  }

  .ffl-results-table {
    width: 100%;
    table-layout: fixed;
  }

  .ffl-results-table thead th,
  .ffl-results-table tbody td {
    padding: 9px 8px;
    font-size: 0.82rem;
  }

  .ffl-results-toggle-heading,
  .ffl-results-toggle-cell {
    width: 40px;
  }

  .ffl-results-holder-cell {
    width: 40%;
  }

  .ffl-results-preferred-col,
  .ffl-results-preferred-cell {
    display: none;
  }

  .ffl-preferred-inline {
    display: inline;
  }

  .ffl-results-type-cell {
    width: 18%;
  }

  .ffl-results-city-cell {
    width: 24%;
  }

  .ffl-results-distance-cell,
  .ffl-results-distance-col {
    width: 18%;
    white-space: nowrap;
  }

  .ffl-results-holder-cell,
  .ffl-results-type-cell,
  .ffl-results-city-cell,
  .ffl-results-distance-cell {
    white-space: normal;
    word-break: break-word;
  }

  .ffl-result-title {
    display: inline;
  }

  .ffl-results-detail-row td {
    padding: 14px;
  }

  .ffl-modal-instance {
    width: 94vw !important;
    padding: 18px;
  }

  .ffl-modal-header {
    margin: -18px -18px 16px;
    padding: 14px 18px;
  }

  .ffl-modal-actions {
    margin: 16px -18px -18px;
    padding: 12px 18px;
    flex-wrap: wrap;
  }

  .ffl-modal-btn {
    flex: 1 1 140px;
  }
}


@media (max-width: 540px) {
  .ffl-results-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .ffl-results-table thead th,
  .ffl-results-table tbody td {
    padding: 8px 6px;
    font-size: 0.76rem;
  }

  .ffl-results-holder-cell {
    width: 44%;
  }

  .ffl-results-type-cell {
    width: 17%;
  }

  .ffl-results-city-cell {
    width: 23%;
  }

  .ffl-results-distance-cell,
  .ffl-results-distance-col {
    width: 16%;
  }

  .ffl-result-columns {
    grid-template-columns: 1fr;
  }
}


/* Mobile search result list */
.ffl-mobile-results {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0;
}

.ffl-mobile-result-item {
  border: 1px solid #dbe3ec;
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ffl-mobile-result-main {
  padding: 14px 14px 10px;
}

.ffl-mobile-result-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ffl-mobile-result-title-row .ffl-result-title {
  font-size: 1rem;
  line-height: 1.35;
  word-break: break-word;
}

.ffl-mobile-preferred {
  color: #b91c1c;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.ffl-mobile-result-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.ffl-mobile-result-meta div {
  min-width: 0;
}

.ffl-mobile-result-meta dt {
  margin: 0 0 2px;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ffl-mobile-result-meta dd {
  margin: 0;
  color: #0f172a;
  font-size: 0.93rem;
  line-height: 1.35;
  word-break: break-word;
}

.ffl-mobile-result-details {
  padding: 10px 14px 14px;
  border-top: 1px solid #e5e7eb;
  background: #fbfdff;
}

.ffl-mobile-result-block {
  color: #334155;
  line-height: 1.55;
}

.ffl-mobile-result-block + .ffl-mobile-result-block,
.ffl-mobile-result-description {
  margin-top: 10px;
}

.ffl-mobile-result-details a {
  word-break: break-word;
}

@media (max-width: 760px) {
  .ffl-results-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .ffl-results-panel {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .ffl-search-results-wrap {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  .ffl-results-table {
    display: none;
  }
}

@media (min-width: 761px) {
  .ffl-mobile-results {
    display: none;
  }
}

@media (max-width: 420px) {
  .ffl-mobile-result-main,
  .ffl-mobile-result-details {
    padding-left: 12px;
    padding-right: 12px;
  }

  .ffl-mobile-result-title-row .ffl-result-title {
    font-size: 0.96rem;
  }

  .ffl-mobile-result-meta {
    gap: 8px;
  }

  .ffl-mobile-result-meta dt {
    font-size: 0.7rem;
  }

  .ffl-mobile-result-meta dd {
    font-size: 0.88rem;
  }
}
