:root {
  --primary: #18559c; --primary-hover: #13457d; --background: #f4f7fb;
  --surface: #fff; --text: #1e293b; --muted: #64748b; --border: #e6ecf5;
  --success: #15803d; --danger: #b91c1c; --radius: 16px;
  --shadow: 0 8px 24px rgba(15,23,42,.06);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.6; }
[hidden] { display: none !important; }
a { color: var(--primary); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(32px, 4vw, 48px); line-height: 1.15; letter-spacing: -.035em; margin-bottom: 24px; }
h2 { font-size: 24px; line-height: 1.3; letter-spacing: -.02em; margin-bottom: 12px; }
.skip-link { position: absolute; top: -80px; left: 16px; background: white; padding: 12px; z-index: 5; }
.skip-link:focus { top: 8px; }
.site-header { min-height: 100px; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 20px max(24px, calc((100vw - 1200px)/2)); background: white; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; max-width: 280px; }
.brand img { display: block; width: 100%; height: auto; }
.header-label { font-size: 14px; color: var(--muted); white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 24px; }
.access-layout { max-width: 1120px; margin: 64px auto; padding: 0 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 80px; align-items: center; }
.eyebrow { display: block; color: var(--primary); font-size: 11px; font-weight: 750; letter-spacing: .12em; margin-bottom: 16px; }
.lead { color: var(--muted); font-size: 18px; line-height: 1.7; max-width: 560px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.access-card { min-width: 0; }
.tabs { display: flex; padding: 4px; background: var(--background); border-radius: 10px; gap: 4px; margin: 24px 0; }
.tab { flex: 1; min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 650; }
.tab.active { background: white; color: var(--primary); box-shadow: 0 2px 6px rgba(15,23,42,.06); }
.status-panel { display: flex; gap: 12px; align-items: center; padding: 20px; background: var(--background); border-radius: 12px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; margin-bottom: 16px; }
.status-panel[data-state="error"] { color: var(--danger); background: #fff1f2; }
.status-panel[data-state="unauthorized"] { color: var(--primary); background: #e3edf8; }
.spinner { flex: 0 0 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.button-primary, .button-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 8px; font-weight: 650; text-decoration: none; transition: background .2s; }
.button-primary { border: 1px solid var(--primary); background: var(--primary); color: white; }
.button-primary:hover { background: var(--primary-hover); }
.button-secondary { background: white; border: 1px solid var(--border); color: var(--text); }
.button-secondary:hover { border-color: var(--primary); color: var(--primary); }
.security-note { font-size: 12px; color: var(--muted); margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--border); }
.route-art { display: flex; align-items: center; margin: 36px 0; max-width: 320px; }
.route-node { width: 20px; height: 20px; border: 5px solid var(--primary); border-radius: 50%; background: white; box-shadow: 0 0 0 8px #e3edf8; }
.route-node.end { background: var(--primary); }
.route-line { flex: 1; border-top: 2px dashed #99b6d8; margin: 0 12px; }
.welcome-note { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.welcome-note p { margin: 0; font-size: 15px; }
.note-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: 0 0 32px; background: #e3edf8; color: var(--primary); border-radius: 50%; font-weight: 750; }
.site-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px; }
.site-footer span { padding: 0 8px; }
.profile-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 48px; max-width: 1120px; margin: 48px auto; padding: 0 24px; }
.profile-nav { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.profile-nav a { text-decoration: none; padding: 12px 16px; border-radius: 8px; background: #e3edf8; font-weight: 650; }
.profile-nav span { color: var(--muted); font-size: 12px; padding: 0 16px; }
.profile-main { min-width: 0; }
.profile-main h1 { font-size: 32px; margin-bottom: 12px; }
.card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.card-heading .eyebrow { margin-bottom: 8px; }
.badge { font-size: 12px; font-weight: 650; color: var(--success); background: #f0fdf4; padding: 6px 12px; border-radius: 99px; }
.profile-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 24px 0; }
dt { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.divider { border-top: 1px solid var(--border); margin: 24px 0; }
.info-card { display: flex; gap: 16px; background: #e3edf8; padding: 24px; border-radius: 12px; margin-top: 24px; }
.info-card h2 { font-size: 18px; }
.info-card p { margin-bottom: 0; font-size: 14px; }
.recovery-actions { display: flex; gap: 12px; margin-bottom: 20px; }
#auth-widget { min-width: 0; }
#auth-widget > div { width: 100%; max-width: 100%; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1199px) { .access-layout { gap: 40px; margin-top: 48px; } }
@media (max-width: 767px) {
  .site-header { min-height: 80px; padding: 16px; gap: 16px; }
  .brand { max-width: 200px; }
  .header-label { display: none; }
  .header-actions { gap: 8px; }
  .access-layout { grid-template-columns: 1fr; margin: 32px auto; padding: 0 16px; gap: 24px; }
  .welcome h1 { font-size: 36px; }
  .welcome .small, .route-art { display: none; }
  .welcome-note { margin-bottom: 0; }
  .card { padding: 24px; }
  .profile-layout { grid-template-columns: 1fr; gap: 24px; margin: 24px auto; padding: 0 16px; }
  .profile-nav { padding: 0; }
  .profile-nav span { display: none; }
  .profile-fields { grid-template-columns: 1fr; }
  .info-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* Long personal identifiers must wrap inside existing cards. */
.profile-fields dd { overflow-wrap:anywhere; min-width:0; }

/* Shared, role-driven navigation on account, business and administrative pages. */
.app-navigation{display:flex;flex-direction:column;gap:4px;min-width:0;margin-bottom:24px}
.app-navigation a{display:flex;align-items:center;gap:10px;min-height:44px;padding:10px 12px;text-decoration:none;color:var(--muted);border-radius:8px;font-size:14px;line-height:1.35;overflow-wrap:anywhere}
.app-navigation a:hover{background:#edf3fa;color:var(--primary)}
.app-navigation a[aria-current=page]{background:#e3edf8;color:var(--primary);font-weight:700}
.app-navigation svg{width:20px;height:20px;flex:0 0 20px}
.admin-marketplace>.app-navigation,.admin-verifications>.app-navigation{flex-direction:row;flex-wrap:wrap}
.dashboard-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.dashboard-summary .card{margin:0}
@media(max-width:767px){.app-navigation{flex-direction:row;flex-wrap:wrap;gap:2px}.app-navigation a{padding:8px;font-size:13px}.app-navigation svg{width:18px;height:18px;flex-basis:18px}.dashboard-summary{grid-template-columns:1fr}}

/* Sidebar presentation: override legacy profile rules without changing navigation. */
.app-navigation.m2-nav,.app-navigation.profile-nav{gap:4px;align-self:start}
.app-navigation.m2-nav>a,.app-navigation.profile-nav>a{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:10px;padding:10px 12px;min-height:44px;max-width:100%;background:transparent;font-weight:500}
.app-navigation>a>svg{display:block;box-sizing:border-box;width:20px!important;height:20px!important;min-width:20px;max-width:20px;min-height:20px;max-height:20px;flex:0 0 20px;align-self:center}
.app-navigation>a>span{display:block;flex:1 1 auto;min-width:0;padding:0;color:inherit;font-size:inherit;line-height:1.35}
.app-navigation>a[aria-current="page"]{background:#e3edf8;color:var(--primary);font-weight:700}
@media(min-width:768px){.m2-layout{grid-template-columns:210px minmax(0,1fr)}.profile-layout:has(>.app-navigation){grid-template-columns:210px minmax(0,1fr)}}
@media(max-width:767px){.app-navigation.m2-nav,.app-navigation.profile-nav{flex-direction:row;flex-wrap:wrap;width:100%}.app-navigation.m2-nav>a,.app-navigation.profile-nav>a{gap:8px;padding:8px;font-size:13px}.app-navigation>a>svg{width:18px!important;height:18px!important;min-width:18px;max-width:18px;min-height:18px;max-height:18px;flex-basis:18px}.app-navigation.profile-nav>a>span{display:block;padding:0}}

.app-navigation .admin-verification-badge{flex:none;margin-left:auto;padding:2px 6px;min-width:22px;border-radius:20px;background:#e3edf8;color:var(--primary);font-size:11px;font-weight:700;line-height:1.5;text-align:center}

/* Current organization and personal identity remain distinct at every width. */
.header-identity { min-width:0; max-width:340px; text-align:right; line-height:1.5; overflow-wrap:anywhere; }
.header-organization,.header-person { display:block; }
.header-organization { font-size:16px; color:var(--text); }
.header-person { font-size:14px; color:var(--muted); }
.site-header:has(.header-identity) .header-actions { min-width:0; }
.form-help,.field small,#organization-form .small.muted { display:block; font-size:14px; line-height:1.5; color:var(--muted); margin-top:6px; }
@media(max-width:767px) {
 .site-header:has(.header-identity) { flex-wrap:wrap; }
 .site-header:has(.header-identity) .header-actions { flex:1 1 100%; justify-content:flex-end; }
 .header-identity { flex:1; max-width:none; }
 .header-organization { font-size:14px; }
 .header-person { font-size:13px; }
}
