/* Fasilቤት responsive typography, navigation and brand refinement.
   Loaded last on every route; respects the existing light/dark theme tokens. */
:root {
  --fb-ink: #102F43;
  --fb-muted: #697985;
  --fb-line: #DCE5EC;
  --fb-surface: #FFFFFF;
  --fb-surface-soft: #F2F2F7;
  --fb-blue: #035585;
  --fb-navy: #07334F;
  --fb-gold: #FFC247;
  --fb-page-gutter: clamp(14px, 3vw, 36px);
  --fb-content-width: 1440px;
  font-size: 16px;
}
html[data-theme="dark"] {
  --fb-ink: #F4F7FA;
  --fb-muted: #A1AAB3;
  --fb-line: #383F46;
  --fb-surface: #1C1C1E;
  --fb-surface-soft: #111820;
  --fb-blue: #54B6EC;
  --fb-navy: #0A3854;
  --fb-gold: #FFC247;
}
html { scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, button, input, select, textarea {
  font-family: "DM Sans", "Noto Sans Ethiopic", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body { color: var(--fb-ink); font-size: 16px; line-height: 1.58; letter-spacing: 0; }
html.bf-amharic body,
html.bf-amharic body :not(svg):not(path) {
  font-family: "Noto Sans Ethiopic", "Abyssinica SIL", "Nyala", "Ebrima", system-ui, sans-serif !important;
  letter-spacing: 0 !important;
}
html.bf-amharic body { line-height: 1.72; }
html.bf-amharic button, html.bf-amharic input, html.bf-amharic select,
html.bf-amharic textarea { line-height: 1.55; }
html.bf-amharic h1, html.bf-amharic h2, html.bf-amharic h3,
html.bf-amharic .brand, html.bf-amharic .workspace-brand { letter-spacing: 0 !important; line-height: 1.45; }

/* Legible type scale: eliminate legacy 8–10px body copy on mobile. */
h1 { font-size: clamp(2rem, 4.3vw, 3.45rem); line-height: 1.13; }
h2 { font-size: clamp(1.45rem, 2.5vw, 2rem); line-height: 1.25; }
h3 { font-size: clamp(1.08rem, 1.7vw, 1.35rem); line-height: 1.35; }
p, li { font-size: 0.96rem; line-height: 1.68; }
small, .muted, .eyebrow, .field-hint { line-height: 1.5; }
.eyebrow { font-size: .73rem; letter-spacing: .10em; }
.brand { font-size: 1.1rem !important; font-weight: 850; letter-spacing: -.02em; gap: 11px; }
.brand > span > small { font-size: .68rem !important; letter-spacing: .07em; line-height: 1.35; }
.brand-logo { width: 44px !important; height: 44px !important; min-width: 44px; object-fit: contain !important; object-position: center; border-radius: 12px !important; background: #fff; padding: 2px; box-shadow: 0 3px 12px rgba(7,51,79,.12); }
.workspace-brand-logo { display: block; width: 44px !important; height: 44px !important; min-width: 44px; object-fit: contain; border-radius: 12px; background: #fff; padding: 2px; box-shadow: 0 3px 12px rgba(0,0,0,.16); }
.system-brand-logo { width: 68px; height: 68px; object-fit: contain; background: #fff; padding: 3px; border-radius: 16px; box-shadow: 0 7px 22px rgba(7,51,79,.13); }

/* Top navigation: compact desktop, wrapping tablet and touch-friendly mobile. */
.topbar { min-height: 72px; width: min(var(--fb-content-width), calc(100% - 2 * var(--fb-page-gutter))); margin-inline: auto; padding: 10px clamp(14px, 2vw, 26px) !important; gap: clamp(12px, 2vw, 26px); border-radius: 18px !important; }
.desktop-nav { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: clamp(12px, 1.8vw, 26px) !important; min-width: 0; }
.desktop-nav a { font-size: .9rem !important; font-weight: 750; line-height: 1.35; white-space: nowrap; padding: 8px 1px; }
.header-actions { gap: 8px !important; flex: 0 0 auto; }
.header-actions > button { min-height: 42px; }
.lang-btn, .icon-btn, .theme-icon-button, .avatar-btn { min-width: 42px; min-height: 42px; border-radius: 12px; }
.btn, button.btn, .btn-primary, .btn-outline { min-height: 44px; font-size: .9rem; line-height: 1.35; }
button, a, input, select, textarea { touch-action: manipulation; }
input, select, textarea { font-size: 16px !important; }

/* Workspace shell and navigation share exactly the mobile palette. */
.workspace-route .topbar { margin-bottom: 10px; }
.workspace-route .workspace-sidebar { background: linear-gradient(165deg, #07334F 0%, #035585 100%) !important; color: #F5FAFF !important; border-color: rgba(255,255,255,.12) !important; }
.workspace-route .workspace-brand { color: #fff !important; font-size: 1.18rem !important; letter-spacing: 0 !important; gap: 12px; }
.workspace-route .workspace-brand small { color: rgba(255,255,255,.76) !important; font-size: .68rem !important; letter-spacing: .09em !important; }
.workspace-route .workspace-navigation { gap: 7px; }
.workspace-route .workspace-nav-item { min-height: 44px; border-radius: 11px; font-size: .86rem !important; line-height: 1.4; padding: 10px 12px; }
.workspace-route .workspace-nav-item > span { font-size: 1.05rem !important; }
.workspace-route .workspace-nav-item.active,
.workspace-route .workspace-nav-item[aria-current="page"] { background: rgba(255,194,71,.18) !important; color: #FFC247 !important; border-color: rgba(255,194,71,.25) !important; }
.workspace-route .workspace-topline { min-height: 68px; padding: 12px clamp(15px,2vw,28px); }
.workspace-route .workspace-topline > div > span { font-size: .76rem !important; }
.workspace-route .workspace-topline > div > small { font-size: .82rem !important; }
.workspace-route .workspace-page { width: min(100%, 1500px); margin-inline: auto; padding: clamp(22px,3vw,38px) var(--fb-page-gutter) 56px; }
.workspace-route .dashboard-welcome h1 { font-size: clamp(1.8rem,3.2vw,2.5rem) !important; line-height: 1.2; }
.workspace-route .dashboard-welcome p { font-size: .96rem !important; }
.workspace-route .dashboard-card-heading h2 { font-size: 1.12rem !important; }
.workspace-route .dashboard-card-heading p { font-size: .88rem !important; }
.workspace-route .dashboard-stat span { font-size: .82rem !important; }
.workspace-route .dashboard-stat small { font-size: .76rem !important; }
.workspace-route .dashboard-listing-copy strong { font-size: .95rem !important; }
.workspace-route .dashboard-listing-copy > span { font-size: .82rem !important; }
.workspace-route .workspace-help, .workspace-route .workspace-support { font-size: .88rem; }

/* Marketplace layouts: consistent card widths and no clipped controls. */
.app-shell { width: 100%; max-width: none; }
.content-section, .how-section, .contact-section { width: min(var(--fb-content-width), calc(100% - 2 * var(--fb-page-gutter))); margin-inline: auto; }
.property-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.7vw, 22px); }
.property-card { min-width: 0; }
.card-title { font-size: 1rem !important; line-height: 1.4; }
.card-location, .card-specific-place, .card-meta { font-size: .82rem !important; line-height: 1.5; }
.card-price strong { font-size: 1.15rem !important; }
.card-price small { font-size: .8rem !important; }
.search-panel, .advanced-filter-row, .discovery-tools, .browse-toolbar { min-width: 0; }
.search-panel input, .search-panel select, .search-select-trigger { min-width: 0; }
.market-mode-tab, .market-mode-sell { min-height: 44px; font-size: .88rem !important; }
.section-heading p, .browse-toolbar p, .discovery-tools-copy span { font-size: .92rem !important; }

/* Uniform icon/logo usage on standalone system pages. */
.bf-system-back { display: inline-flex !important; align-items: center; gap: 10px; color: var(--fb-blue) !important; font-size: .9rem !important; font-weight: 800; }
.bf-system-back img { width: 34px; height: 34px; object-fit: contain; border-radius: 9px; background: #fff; padding: 2px; box-shadow: 0 3px 10px rgba(7,51,79,.12); }
.bf-system-kicker { color: var(--fb-blue) !important; letter-spacing: .1em; }
.bf-system-card, .bf-legal { width: min(920px, calc(100% - 28px)); }
.bf-legal h1 { font-size: clamp(1.8rem,4vw,2.5rem); }
.bf-legal h2 { font-size: clamp(1.15rem,2.5vw,1.45rem); }
.bf-legal p, .bf-legal li { font-size: .96rem; line-height: 1.75; }

/* Tablet. Keep primary navigation visible but give it a second row. */
@media (max-width: 1080px) {
  .topbar { flex-wrap: wrap; justify-content: space-between; row-gap: 6px; }
  .topbar .desktop-nav { order: 3; flex: 1 0 100%; justify-content: flex-start; padding: 2px 4px 0; }
  .topbar .header-actions { margin-inline-start: auto; }
  .property-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  :root { font-size: 15.5px; --fb-page-gutter: 12px; }
  html { scroll-padding-top: 76px; }
  body { padding-bottom: env(safe-area-inset-bottom); }
  .topbar { width: calc(100% - 16px); min-height: 62px; margin: 8px auto 10px; padding: 8px 10px !important; border-radius: 15px !important; flex-wrap: nowrap; gap: 8px; }
  .brand { gap: 8px; font-size: 1rem !important; min-width: 0; }
  .brand-logo { width: 38px !important; height: 38px !important; min-width: 38px; border-radius: 10px !important; }
  .brand > span > small { font-size: .61rem !important; }
  .topbar .desktop-nav { display: none !important; }
  .header-actions { gap: 5px !important; }
  .header-actions > button { min-height: 38px; }
  .lang-btn, .icon-btn, .theme-icon-button, .avatar-btn { min-width: 38px; width: 38px; height: 38px; border-radius: 10px; }
  .login-trigger { padding: 0 10px !important; min-height: 38px !important; font-size: .8rem !important; }
  .public-marketplace-page .hero, .workspace-route .hero { width: calc(100% - 16px); margin: 12px auto 16px; padding: 23px 15px 17px; border-radius: 21px; grid-template-columns: minmax(0,1fr); grid-template-rows: auto auto auto; gap: 12px; }
  .public-marketplace-page .hero-copy, .workspace-route .hero-copy { grid-column: 1; grid-row: 1; }
  .public-marketplace-page .market-mode-row, .workspace-route .market-mode-row { grid-column: 1; grid-row: 2; }
  .public-marketplace-page .search-panel, .workspace-route .search-panel { grid-column: 1; grid-row: 3; grid-template-columns: minmax(0,1fr); padding: 11px; gap: 8px; }
  .public-marketplace-page .hero h1, .workspace-route .hero h1 { font-size: clamp(1.85rem,8vw,2.65rem); line-height: 1.16; }
  .public-marketplace-page .hero-copy > p, .workspace-route .hero-copy > p { font-size: .94rem; line-height: 1.6; }
  .market-mode-row { flex-wrap: nowrap; gap: 6px; }
  .market-mode-switch { flex: 1 1 50%; min-width: 0; }
  .market-mode-tab { flex: 1; min-width: 0; padding: 0 9px; }
  .market-mode-sell { flex: 1 1 50%; min-width: 0; justify-content: center; padding: 0 9px; white-space: normal; line-height: 1.25; }
  .public-marketplace-page .search-field, .workspace-route .search-field { min-height: 52px; padding: 8px 9px; }
  .search-filter-row { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; }
  .public-marketplace-page .content-section, .public-marketplace-page .how-section, .public-marketplace-page .contact-section,
  .workspace-route .content-section, .workspace-route .how-section, .workspace-route .contact-section {
    width: calc(100% - 16px); margin: 10px auto; padding: 20px 13px; border-radius: 18px;
  }
  .section-heading { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
  .section-heading h2 { font-size: 1.45rem !important; }
  .property-grid { grid-template-columns: minmax(0,1fr); gap: 13px; }
  .property-card { display: grid; grid-template-columns: minmax(112px, 38%) minmax(0,1fr); min-height: 150px; overflow: hidden; }
  .property-card .card-image { min-height: 150px; height: 100%; }
  .property-card .card-content { padding: 12px; min-width: 0; }
  .card-title { font-size: .95rem !important; }
  .advanced-filter-row { grid-template-columns: minmax(0,1fr); gap: 9px; }
  .advanced-filter-row label { min-width: 0; }
  .advanced-filter-row select { width: 100%; min-width: 0; }
  .discovery-tools, .browse-toolbar { flex-wrap: wrap; gap: 10px; }
  .discovery-tools > button, .browse-toolbar > button { width: 100%; }
  .mobile-nav { display: flex !important; position: fixed; z-index: 60; inset-inline: 0; bottom: 0; width: 100%; min-height: calc(62px + env(safe-area-inset-bottom)); padding: 7px 6px calc(7px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 94%, transparent) !important; border-top: 1px solid var(--line) !important; box-shadow: 0 -8px 24px rgba(7,51,79,.10) !important; backdrop-filter: blur(18px); }
  .mobile-nav a { min-height: 48px; flex: 1 1 20%; gap: 3px; font-size: .82rem !important; color: var(--muted) !important; }
  .mobile-nav a small { font-size: .68rem !important; line-height: 1.2; }
  .app-shell { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .workspace-route .workspace-page { padding: 17px 12px calc(84px + env(safe-area-inset-bottom)); }
  .workspace-route .workspace-sidebar { padding: 10px 10px 8px !important; }
  .workspace-route .workspace-brand { padding: 0 3px 9px !important; font-size: 1rem !important; }
  .workspace-route .workspace-brand-logo { width: 36px !important; height: 36px !important; min-width: 36px; }
  .workspace-route .workspace-navigation { gap: 6px; padding: 5px 0 7px; }
  .workspace-route .workspace-nav-item { min-height: 42px; padding: 8px 10px; font-size: .78rem !important; }
  .workspace-route .workspace-topline { top: 0; min-height: 58px; padding: 8px 11px; }
  .workspace-route .dashboard-welcome h1 { font-size: 1.65rem !important; }
  .workspace-route .dashboard-welcome p { font-size: .88rem !important; }
  .workspace-route .dashboard-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .workspace-route .dashboard-stat { min-width: 0; }
  .workspace-route .dashboard-card { padding: 14px 12px; }
  .workspace-route .dashboard-card-heading h2 { font-size: 1.03rem !important; }
  .workspace-route .dashboard-listing-copy strong { font-size: .88rem !important; }
  .workspace-route .dashboard-listing-copy > span { font-size: .76rem !important; }
  .auth-dialog { width: min(calc(100vw - 20px), 490px); max-height: calc(100dvh - 22px); overflow-y: auto; }
  .bf-legal { margin: 20px auto; padding: 20px 16px; }
  .bf-system-back { margin-bottom: 20px; }
}
@media (max-width: 390px) {
  .brand > span > small { display: none; }
  .login-trigger { padding: 0 8px !important; }
  .market-mode-sell { font-size: .76rem !important; }
  .property-card { grid-template-columns: minmax(100px, 36%) minmax(0,1fr); }
  .property-card .card-content { padding: 10px; }
  .card-meta { flex-wrap: wrap; gap: 5px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
