:root {
  --ink: #121417;
  --muted: #5d5e62;
  --line: #e5e7eb;
  --paper: #f6f7f9;
  --white: #fff;
  --yellow: #f5c200;
  --yellow-soft: #ffe08f;
  --orange: #755b00;
  --green: #10b981;
  --danger: #ba1a1a;
  --asphalt: #121417;
  --shadow: 0 4px 16px -2px rgba(18, 20, 23, .06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  font-size: 14px;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
body.app-booting { display: grid; min-height: 100vh; place-items: center; }
body.app-booting::before {
  content: "Restoring your Rider Pact session…";
  color: var(--muted);
  font-weight: 700;
}
body.app-booting::after {
  content: "";
  position: fixed;
  width: 34px;
  height: 34px;
  margin-top: 64px;
  border: 4px solid var(--line);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: rp-session-spin .75s linear infinite;
}
body.app-booting #auth-view,
body.app-booting #app-view { display: none !important; }
@keyframes rp-session-spin { to { transform: rotate(360deg); } }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.wordmark {
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -1.7px;
  font-weight: 1000;
  font-style: italic;
}
.wordmark { display: inline-flex; align-items: center; gap: 8px; }
.brand-icon { display: block; width: 36px; height: 36px; flex: 0 0 auto; }
.sidebar .brand-icon { width: 30px; height: 30px; }
.brand-logo { display: block; height: 48px; width: auto; }
.sidebar .brand-logo { height: 36px; }
.auth-story .brand-logo { height: 58px; }
.mobile-brand .brand-logo { height: 44px; }
.eyebrow { margin: 0 0 7px; color: var(--orange); font-family: "Space Grotesk", Inter, sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); }

.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(420px, .85fr); }
.auth-story { position: relative; overflow: hidden; padding: 42px 54px; background: var(--yellow); color: var(--ink); display: flex; flex-direction: column; }
.auth-story .wordmark { position: relative; z-index: 2; }
.story-copy { position: relative; z-index: 2; max-width: 580px; margin-top: auto; padding-bottom: 38px; }
.story-copy h1 { margin: 0; font-size: clamp(36px, 5.4vw, 72px); line-height: .9; letter-spacing: -3px; }
.story-copy > p:last-child { max-width: 520px; font-size: 15px; line-height: 1.5; }
.route-art { position: absolute; inset: 15% -10% 13% 22%; opacity: .92; }
.sun { position: absolute; width: 210px; height: 210px; border-radius: 50%; background: #ffe886; right: 18%; top: 2%; }
.mountain { position: absolute; bottom: 19%; width: 70%; height: 43%; background: #36372f; clip-path: polygon(0 100%, 32% 20%, 49% 59%, 64% 0, 100% 100%); }
.mountain-one { left: 0; opacity: .92; }
.mountain-two { left: 37%; bottom: 16%; transform: scale(.76); background: #5e604f; }
.road { position: absolute; width: 48%; height: 74%; bottom: -25%; right: 17%; background: var(--ink); transform: perspective(440px) rotateX(52deg); clip-path: polygon(43% 0, 57% 0, 100% 100%, 0 100%); }
.road i { display: block; width: 4%; height: 12%; margin: 14% auto; background: var(--yellow); }
.auth-panel { position: relative; isolation: isolate; overflow: auto; display: grid; place-items: center; padding: 36px; background: var(--paper); }
.auth-panel::before { content: ""; position: absolute; z-index: -1; inset: 48% -10% -18% 12%; opacity: .16; background: linear-gradient(145deg, transparent 0 38%, #11120f 39% 52%, transparent 53%), radial-gradient(circle at 72% 15%, var(--yellow) 0 17%, transparent 18%), linear-gradient(25deg, #6e705f 0 35%, transparent 36%); transform: rotate(-3deg); pointer-events: none; }
.auth-card { position: relative; z-index: 1; width: min(100%, 400px); background: rgba(255,255,255,.96); border: 1px solid rgba(0,0,0,.06); border-radius: 24px; padding: 26px; box-shadow: var(--shadow); }
.auth-card h2 { margin: 0; font-size: 24px; letter-spacing: -0.8px; }
.auth-card .muted { margin: 9px 0 26px; line-height: 1.5; }
.mobile-brand { display: none; margin-bottom: 32px; }

label { display: grid; gap: 7px; color: #41423d; font-size: 13px; font-weight: 800; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); background: #fbfbf9; color: var(--ink); border-radius: 12px;
  padding: 9px 12px; outline: none; transition: border .15s, box-shadow .15s, background .15s;
}
textarea { resize: vertical; min-height: 92px; }
input, select, textarea { min-height: 48px; border-radius: 12px; background: #fff; }
textarea { min-height: 92px; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); background: #fff; }
.auth-card label + label { margin-top: 14px; }
.auth-card .primary { margin-top: 16px; width: 100%; }
.auth-links { display: flex; justify-content: flex-end; margin-top: 8px; }
.auth-links .text-button { font-weight: 750; }
.auth-or { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin: 16px 0 4px; color: var(--muted); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; height: 1px; background: var(--line); }
.password-field { position: relative; display: block; min-width: 0; }
.password-field input { padding-right: 44px; }
.password-toggle {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px;
  background: transparent; color: #64748b; cursor: pointer;
}
.password-toggle::before {
  content: ""; display: block; width: 20px; height: 20px; margin: auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.password-toggle.is-visible::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 10.6A3 3 0 0 0 12 15a3 3 0 0 0 2.4-4.4'/%3E%3Cpath d='M9.9 5.1A10.8 10.8 0 0 1 12 5c6.5 0 10 7 10 7a18.4 18.4 0 0 1-3.2 4.2'/%3E%3Cpath d='M6.1 6.1C3.8 7.8 2 12 2 12s3.5 7 10 7a10.7 10.7 0 0 0 4.1-.8'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 10.6A3 3 0 0 0 12 15a3 3 0 0 0 2.4-4.4'/%3E%3Cpath d='M9.9 5.1A10.8 10.8 0 0 1 12 5c6.5 0 10 7 10 7a18.4 18.4 0 0 1-3.2 4.2'/%3E%3Cpath d='M6.1 6.1C3.8 7.8 2 12 2 12s3.5 7 10 7a10.7 10.7 0 0 0 4.1-.8'/%3E%3C/svg%3E");
}
.password-toggle:hover, .password-toggle:focus-visible { color: var(--ink); background: #f8fafc; }
.autofill-trap { position: absolute; width: 0; height: 0; overflow: hidden; opacity: 0; pointer-events: none; }
@keyframes rp-autofill { from {} to {} }
#email-form input:-webkit-autofill, #password-form input:-webkit-autofill { animation-name: rp-autofill; animation-duration: 0.01s; }
.legal-links { margin: 16px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; }
.legal-links a { color: #854d0e; font-weight: 700; }
.auth-provider-actions { display: grid; gap: 9px; margin-top: 9px; }
.auth-provider-actions > button { width: 100%; }
.reset-password-form { display: grid; }
.reset-password-form .text-button { justify-self: center; margin-top: 8px; }
.whatsapp-otp-form { display: grid; }
.whatsapp-otp-form .text-button { justify-self: center; margin-top: 8px; }
.whatsapp-otp-form #whatsapp-otp-back { margin-top: 4px; }
.form-error { color: var(--danger); min-height: 20px; margin: 10px 0 0; font-size: 13px; }

.primary, .secondary, .quiet-button, .text-button, .link-button, .file-button, .button-link, .asphalt {
  border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 600; text-decoration: none; text-align: center;
}
.primary { background: var(--yellow); color: var(--ink); box-shadow: 0 4px 14px -2px rgba(245, 194, 0, .45); min-height: 48px; }
.primary:hover { background: #ffd700; transform: translateY(-1px); }
.primary:disabled { opacity: .55; cursor: wait; transform: none; }
.asphalt { background: var(--asphalt); color: #fff; min-height: 48px; }
.asphalt:hover { background: #1e2229; }
.secondary, .quiet-button, .file-button { min-height: 48px; }
.secondary { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
.quiet-button { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.hero-card .quiet-button { background: var(--yellow-soft); border-color: transparent; color: #241a00; }
.hero-actions .compact { min-height: 48px; }
.text-button, .link-button { background: transparent; color: var(--orange); padding-inline: 4px; font-family: "Space Grotesk", Inter, sans-serif; }
.compact { padding: 10px 15px; min-height: 40px; }

.app-layout { min-height: 100vh; display: flex; flex-direction: column; }
.sidebar { position: sticky; top: 0; z-index: 30; width: 100%; min-height: 64px; height: auto; padding: 10px 20px; background: rgba(246, 247, 249, .92); color: var(--ink); border-bottom: 1px solid var(--line); display: flex; flex-direction: row; align-items: center; gap: 12px; backdrop-filter: blur(16px); }
.sidebar .wordmark { color: var(--ink); margin: 0; flex: 0 0 auto; }
.sidebar nav { display: flex; flex-direction: row; gap: 4px; align-items: center; overflow-x: auto; flex: 1; min-width: 0; padding: 0; }
.nav-group { display: none; }
.nav-item { display: inline-flex; align-items: center; gap: 6px; width: auto; padding: 8px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); text-align: left; font-weight: 600; white-space: nowrap; font-family: "Space Grotesk", Inter, sans-serif; font-size: 13px; }
.nav-item b { display: none; }
.nav-item:hover { color: var(--ink); background: #e7e8ea; }
.nav-item.active { color: var(--ink); background: var(--yellow); font-weight: 700; }
.sidebar-foot { margin-top: 0; padding: 0; border-top: 0; display: flex; gap: 10px; align-items: center; flex: 0 0 auto; }
.sidebar-foot div:last-child { min-width: 0; display: grid; }
.sidebar-foot strong, .sidebar-foot small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot small { color: var(--muted); margin-top: 2px; }
.mini-avatar { flex: 0 0 auto; width: 39px; height: 39px; border-radius: 50%; background: var(--yellow); color: var(--ink); display: grid; place-items: center; font-weight: 800; overflow: hidden; }
.mini-avatar img { width: 100%; height: 100%; object-fit: cover; }

.workspace { min-width: 0; }
.topbar { min-height: 64px; padding: 10px clamp(16px, 3vw, 32px); display: flex; align-items: center; gap: 14px; background: rgba(246, 247, 249, .92); border-bottom: 1px solid transparent; position: sticky; top: 64px; z-index: 12; backdrop-filter: blur(16px); }
.topbar > div { min-width: 0; }
.topbar h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .eyebrow { margin-bottom: 0; }
.top-actions { margin-left: auto; display: flex; gap: 9px; flex: 0 0 auto; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 21px; box-shadow: var(--shadow); }
.menu-button { display: none; }
.mobile-tabs { display: none; }
.loading-bar { position: fixed; z-index: 80; top: 0; left: 0; right: 0; height: 3px; overflow: hidden; background: var(--yellow-soft); }
.loading-bar i { display: block; height: 100%; width: 35%; background: var(--orange); animation: load 1.15s infinite ease-in-out; }
@keyframes load { from { transform: translateX(-110%); } to { transform: translateX(390%); } }

.page { display: none; padding: 8px clamp(16px, 3vw, 48px) 40px; max-width: 1440px; margin: 0 auto; }
.page.active { display: grid; gap: 18px; align-content: start; }
.page.active > * { min-width: 0; }
.page.active > .page-intro { margin-bottom: 0; }
.hero-card { background: var(--yellow); border-radius: 24px; padding: clamp(20px, 3vw, 36px); display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 420px); gap: 24px; align-items: center; overflow: hidden; position: relative; box-shadow: var(--shadow); }
.hero-card > div:first-child { position: relative; z-index: 2; max-width: 720px; }
.hero-card .eyebrow::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(16, 185, 129, .18); vertical-align: 1px; }
.hero-card h1 { margin: 0; max-width: 680px; font-size: clamp(28px, 4vw, 48px); line-height: 1.05; letter-spacing: -.03em; font-weight: 800; }
.hero-card p:not(.eyebrow) { line-height: 1.5; max-width: 640px; }
.hero-card .metric-grid { margin: 0; }
.hero-actions, .form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero-logo { display: none; }
.hold-talk { width: 100%; min-height: 52px; margin-top: 12px; user-select: none; touch-action: none; }
.hold-talk.is-talking { background: #059669; border-color: #059669; }

.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.metric-card { background: rgba(255,255,255,.92); border: 0; border-radius: 16px; padding: 14px; display: grid; gap: 4px; box-shadow: var(--shadow); }
.metric-card small { text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; font-family: "Space Grotesk", Inter, sans-serif; font-size: 11px; }
.metric-card strong { font-family: "Space Grotesk", Inter, sans-serif; font-size: 32px; letter-spacing: -.02em; line-height: 1.1; }
.metric-card span { color: var(--muted); font-size: 12px; }
.metric-card.accent { background: var(--asphalt); color: #f0f1f3; }
.metric-card.accent small, .metric-card.accent span { color: #d9dadc; }
.page:not([data-page-panel="dashboard"]) .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.page:not([data-page-panel="dashboard"]) .metric-card { background: #fff; border: 1px solid var(--line); }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 16px; box-shadow: var(--shadow); }
.panel-head, .page-intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.panel-head h3 { margin: 0; }
.page-intro { margin-bottom: 24px; }
.page-intro h1 { margin: 0; font-size: clamp(28px, 3vw, 36px); letter-spacing: -.02em; font-weight: 800; line-height: 1.15; }
.panel h3 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.page-intro p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); }
.stack-list { display: grid; gap: 10px; margin-top: 18px; }
.data-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.data-row .entity-actions { flex: 1 0 100%; }
.data-row > .edit-action { margin-left: auto; flex: 0 0 auto; }
.data-row.notification-unread { background: #fff6c2; box-shadow: inset 3px 0 0 var(--orange); }
.data-icon { width: 43px; height: 43px; border-radius: 12px; background: var(--yellow); display: grid; place-items: center; font-size: 18px; flex: 0 0 auto; }
.data-copy { min-width: 0; display: grid; gap: 3px; flex: 1; }
.data-copy strong, .data-copy small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.data-copy small { color: var(--muted); }
.state { border-radius: 999px; padding: 5px 9px; color: var(--ink); font-family: "Space Grotesk", Inter, sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: #e7e8ea; }
.state.active { color: #fff; background: var(--green); }
.empty { padding: 30px 15px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 16px; }

.form-panel { display: grid; gap: 14px; }
.app-state { padding: 18px 14px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 14px; display: grid; gap: 6px; justify-items: center; }
.app-state strong { color: var(--ink); font-size: 14px; }
.app-state p { margin: 0; font-size: 13px; max-width: 36rem; }
.app-state-loading { border-style: solid; background: #fff8dc; }
.app-state-error, .app-state-offline, .app-state-session { border-color: #f0c2bc; background: #fff6f4; }
.app-state-success { border-color: #b7e0c8; background: #f1fbf5; }
.app-state-search { background: #f7f7f3; }
.connection-banner { position: sticky; top: 0; z-index: 40; background: var(--ink); color: #fff; text-align: center; padding: 8px 12px; font-size: 13px; font-weight: 700; }
.form-error:not(:empty) { display: block; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.profile-photo-row { display: flex; gap: 18px; align-items: center; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.profile-photo-row > div:last-child { display: grid; gap: 8px; }
.profile-photo-row small { color: var(--muted); }
.profile-avatar { width: 104px; height: 104px; flex: 0 0 auto; border-radius: 50%; background: var(--yellow); display: grid; place-items: center; font-size: 42px; font-weight: 800; overflow: hidden; border: 3px solid #fff; box-shadow: 0 0 0 3px var(--yellow); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-overview-panel, .profile-moments-panel { margin-top: 18px; }
.profile-shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; }
.profile-shortcut { min-height: 132px; display: grid; align-content: start; gap: 5px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); text-align: left; box-shadow: 0 1px 2px rgba(15, 23, 42, .03); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.profile-shortcut:hover, .profile-shortcut:focus-visible { transform: translateY(-2px); border-color: #d2ac00; box-shadow: 0 9px 20px rgba(32,33,28,.11); outline: 0; }
.profile-shortcut span { color: var(--muted); font-size: 12px; font-weight: 800; }
.profile-shortcut strong { color: var(--ink); font-size: 27px; line-height: 1.05; }
.profile-shortcut small { color: #854d0e; font-weight: 800; }
.profile-moments-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.profile-moment-tile { appearance: none; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; padding: 0; text-align: left; background: #fff; color: var(--ink); cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.profile-moment-tile:hover { transform: translateY(-2px); box-shadow: 0 9px 22px rgba(32,33,28,.12); }
.profile-moment-image { display: grid; place-items: center; width: 100%; aspect-ratio: 1; background: linear-gradient(135deg, var(--yellow), var(--orange)); color: var(--ink); font-weight: 1000; overflow: hidden; }
.profile-moment-image img { width: 100%; height: 100%; object-fit: cover; }
.profile-moment-copy { display: grid; gap: 4px; padding: 10px; }
.profile-moment-copy strong, .profile-moment-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-moment-copy small { color: var(--muted); }
.moment-viewer { border: 0; border-radius: 24px; padding: 18px; width: min(600px, 94vw); color: var(--ink); background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.34); }
.moment-viewer::backdrop { background: rgba(17,18,16,.68); }
.moment-viewer-media { min-height: 240px; max-height: 65vh; display: grid; place-items: center; overflow: hidden; border-radius: 16px; background: #efefe9; color: var(--muted); font-weight: 1000; }
.moment-viewer-media img { display: block; width: 100%; max-height: 65vh; object-fit: contain; background: #111; }
.moment-viewer-details { display: grid; gap: 10px; padding: 14px 2px 2px; }
.moment-viewer-details p { margin: 0; white-space: pre-wrap; }
.moment-tags { font-weight: 750; color: #6a5400; }
.moment-viewer-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.connection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.connection-card { min-height: 172px; display: grid; justify-items: center; align-content: center; gap: 8px; padding: 16px 12px; border: 1px solid var(--line); border-radius: 24px; background: #fff; color: var(--ink); text-align: center; box-shadow: var(--shadow); }
.connection-card:hover, .connection-card:focus-visible { border-color: #d2ac00; outline: 0; }
.connection-avatar { width: 72px; height: 72px; display: grid; place-items: center; overflow: hidden; border: 3px solid var(--yellow); border-radius: 50%; background: var(--yellow); color: var(--ink); font-size: 24px; font-weight: 950; }
.connection-avatar.mini { width: 44px; height: 44px; font-size: 16px; border-width: 2px; }
.connection-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-frame { position: relative; display: inline-grid; }
.premium-crown { position: absolute; top: -8px; right: -6px; font-size: 18px; line-height: 1; }
.rider-card-body { display: grid; gap: 12px; }
.rider-card-head { display: flex; gap: 14px; align-items: center; }
.rider-card-head h3, .rider-card-head p { margin: 0; }
.rider-card-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rider-card-metrics div { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; display: grid; }
.rider-card-metrics strong { font-family: "Space Grotesk", Inter, sans-serif; font-size: 20px; }
.rider-card-metrics small { color: var(--muted); }
.rider-card-people, .rider-card-moments { display: flex; gap: 10px; overflow-x: auto; }
.rider-card-person, .rider-card-moment { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 8px; display: grid; justify-items: center; gap: 4px; min-width: 88px; }
.rider-card-shot { width: 140px; height: 88px; border-radius: 10px; overflow: hidden; background: #f0f0eb; display: grid; place-items: center; }
.rider-card-shot img { width: 100%; height: 100%; object-fit: cover; }
.rider-card-vehicle { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: #f0f0eb; display: grid; place-items: center; flex: 0 0 auto; }
.rider-card-vehicle img { width: 100%; height: 100%; object-fit: cover; }
.quick-photo { cursor: zoom-in; }
.photo-lightbox { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 0; border: 0; background: rgba(18, 20, 23, .88); display: grid; place-items: center; cursor: zoom-out; }
.photo-lightbox::backdrop { background: transparent; }
.photo-lightbox img { max-width: min(92vw, 960px); max-height: 88vh; object-fit: contain; border-radius: 16px; transform: scale(.84); opacity: 0; transition: transform 180ms ease, opacity 180ms ease; }
.photo-lightbox.open img { transform: scale(1); opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .photo-lightbox img { transition: none; }
}
.rider-card-list { display: grid; gap: 8px; }
.connection-card strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-card small { color: var(--muted); }
.insight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(195px, 1fr)); gap: 14px; }
.insight-card { min-height: 148px; display: grid; align-content: center; gap: 7px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; color: var(--ink); }
.insight-card small { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.insight-card strong { color: var(--ink); font-family: "Space Grotesk", Inter, sans-serif; font-size: 30px; line-height: 1; letter-spacing: -.02em; }
.insight-card span { color: #854d0e; font-weight: 750; }
.milestone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.milestone-card { display: grid; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; color: var(--ink); }
.milestone-card h3, .milestone-card p { margin: 0; }
.milestone-card p { color: var(--muted); line-height: 1.45; }
.milestone-card small { color: #854d0e; font-weight: 800; }
.trip-discovery-settings { display: grid; gap: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: #fffdf0; }
.trip-discovery-settings legend { padding: 0 5px; }
.trip-discovery-settings > p { margin: -3px 0 0; }
.trip-member-limit { width: min(100%, 350px); }
.trip-member-limit small { color: var(--muted); font-weight: 650; }
.field-hint { color: var(--muted); font-weight: 650; font-size: 12px; }
.field-warning { color: var(--danger); font-weight: 750; font-size: 12px; }
.email-otp-box { display: grid; gap: 10px; align-content: start; padding: 12px; border: 1px dashed var(--line); border-radius: 16px; background: #fbfbf9; grid-column: 1 / -1; }
.file-button { display: inline-block; width: fit-content; background: var(--ink); color: #fff; cursor: pointer; }
.file-button input { display: none; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 900; margin-bottom: 11px; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: block; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; background: #fafaf8; font-size: 13px; font-weight: 750; }
.chip input:checked + span { border-color: var(--yellow); background: var(--yellow); }
.tag-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tag-badge { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--yellow); overflow: hidden; display: grid; place-items: center; background: var(--yellow); color: var(--ink); font-size: 12px; font-weight: 800; }
.tag-badge img { width: 100%; height: 100%; object-fit: cover; }
.toggle-grid { display: flex; flex-wrap: wrap; gap: 22px; }
.toggle { display: flex; grid-template-columns: none; align-items: center; gap: 9px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; }
.toggle > span:not(.help-title) { width: 40px; height: 23px; padding: 3px; border-radius: 999px; background: #d6d7d1; transition: .18s; }
.toggle > span:not(.help-title)::after { content: ""; display: block; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px #0002; transition: .18s; }
.toggle input:checked + span { background: var(--yellow); }
.toggle input:checked + span::after { transform: translateX(17px); background: var(--ink); }
.sync-badge { padding: 8px 11px; border-radius: 999px; background: #e6e6e1; color: var(--muted); font-size: 12px; font-weight: 850; }
.sync-badge.live { color: #176d48; background: #dff5e9; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.entity-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 16px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.entity-card .entity-visual { min-height: 120px; background: #f2f4f6; border-radius: 16px; display: grid; place-items: center; font-size: 44px; overflow: hidden; }
.entity-card .entity-visual img { width: 100%; height: 180px; object-fit: cover; border-radius: 0; }
[data-page-panel="circle"] > .panel { margin-bottom: 18px; }
.entity-card h3 { margin: 0; }
.entity-card p { margin: -6px 0 0; color: var(--muted); }
.entity-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.entity-meta span { padding: 5px 10px; background: #f2f4f6; color: var(--ink); border-radius: 999px; font-family: "Space Grotesk", Inter, sans-serif; font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.entity-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.entity-actions button { flex: 1 1 120px; border: 0; border-radius: 12px; padding: 10px 12px; font-weight: 700; font-family: "Space Grotesk", Inter, sans-serif; }
.place-field { position: relative; }
.place-suggest { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.place-suggest button { display: grid; gap: 2px; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
.place-suggest button:last-child { border-bottom: 0; }
.place-suggest strong { font-size: 14px; }
.place-suggest small { color: var(--muted); font-size: 12px; }
.edit-action, .delete-action, .row-action { border: 0; border-radius: 12px; padding: 10px 14px; font-weight: 700; font-family: "Space Grotesk", Inter, sans-serif; }
.edit-action { background: var(--yellow); color: var(--ink); }
.delete-action { background: #ffdad6; color: var(--danger); }

.trip-social { margin-top: 34px; display: grid; gap: 18px; }
.social-composer-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 24px; }
.highlight-row, .story-row { display: flex; gap: 14px; overflow-x: auto; padding: 12px 2px; }
.highlight-circle, .story-circle { flex: 0 0 auto; width: 78px; display: grid; gap: 7px; justify-items: center; border: 0; background: transparent; color: var(--ink); font-size: 11px; font-weight: 800; }
.highlight-circle img, .story-circle img, .story-placeholder { width: 66px; height: 66px; border-radius: 50%; object-fit: cover; padding: 3px; border: 3px solid var(--yellow); background: #fff; }
.story-circle:not(.highlighted) img { border-color: var(--orange); }
.post-feed { display: grid; gap: 18px; max-width: 820px; }
.trip-post { background: #fff; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.trip-post-head, .trip-post-copy, .trip-post-actions, .comment-composer { padding: 14px 18px; }
.trip-post-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.trip-post-head small { color: var(--muted); }
.post-collage { display: grid; gap: 3px; height: clamp(260px, 52vw, 520px); background: #ecece7; }
.post-collage.count-1 { grid-template-columns: 1fr; }
.post-collage.count-2 { grid-template-columns: repeat(2,1fr); }
.post-collage.count-3 { grid-template-columns: 1.4fr 1fr; grid-template-rows: repeat(2,1fr); }
.post-collage.count-3 img:first-child { grid-row: 1 / span 2; }
.post-collage.count-4, .post-collage.count-5 { grid-template-columns: repeat(2,1fr); grid-template-rows: repeat(2,1fr); }
.post-collage.count-5 img:first-child { grid-row: 1 / span 2; }
.post-collage img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.trip-post-actions { display: flex; gap: 8px; border-top: 1px solid var(--line); }
.trip-post-actions button { border: 0; border-radius: 999px; padding: 8px 12px; color: var(--ink); font-weight: 800; background: #f0f0ec; }
.trip-post-actions button.liked { background: #ffe3dd; color: #a72d20; }
.comments { display: grid; gap: 7px; padding: 0 18px 10px; }
.comment { font-size: 13px; }
.comment-composer { display: flex; gap: 8px; }
.comment-composer input { flex: 1; }
.danger-zone { border-color: #efc3bd; }

.mobile-stage-wrap { display: block; padding: 0; }
.mobile-stage {
  width: 100%;
  min-height: 0;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(16px, 2vw, 24px);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  align-content: start;
}
.mobile-stage-bar { display: flex; justify-content: space-between; align-items: baseline; font-family: "Space Grotesk", Inter, sans-serif; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.mobile-stage-bar small { color: var(--muted); font-weight: 600; letter-spacing: 0; text-transform: none; }
.mobile-story-row { padding: 4px 2px 8px; }
.mobile-stage .story-circle { color: var(--ink); }
.mobile-stage .story-placeholder { border-color: var(--yellow); background: #f2f4f6; color: var(--ink); }
.mobile-composer { display: grid; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.mobile-composer h3 { margin: 0; }
.mobile-composer label { color: var(--ink); }
.mobile-composer input, .mobile-composer textarea { background: #fff; color: var(--ink); border-color: var(--line); }
.mobile-composer .muted { color: var(--muted); }
.circle-trip-preview { width: 100%; max-height: 180px; border-radius: 16px; background: #000; object-fit: cover; }
.mobile-card-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mobile-cover-card {
  position: relative; min-height: 168px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: #f2f4f6; color: #fff; text-align: left; padding: 0; box-shadow: var(--shadow);
}
.mobile-cover-card img, .mobile-cover-card video { width: 100%; height: 168px; object-fit: cover; display: block; }
.mobile-cover-card span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 10px 10px;
  background: linear-gradient(transparent, #000c); font-size: 12px; font-weight: 800;
}

.google-map { position: relative; height: 280px; min-height: 280px; border-radius: 18px; background: #ecece7; overflow: hidden; }
.google-map.tall-map { height: 420px; min-height: 420px; }
.map-block { display: grid; gap: 10px; }
.friend-badge { display: inline-flex; align-items: center; width: fit-content; padding: 5px 9px; border: 1px solid #e9c93c; border-radius: 999px; background: #fff4c2; color: #6a5400; font-size: 11px; font-weight: 800; }
.place-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.place-row .place-field { margin: 0; }
.story-viewer { border: 0; border-radius: 28px; padding: 18px; width: min(420px, 92vw); background: #111; color: #fff; }
.story-viewer img, .story-viewer video { width: 100%; max-height: 70vh; object-fit: contain; background: #000; border-radius: 16px; }
.story-viewer h3, .story-viewer p { margin: 10px 0; }
.account-data-actions { margin-top: 18px; }

/* Administration control centre */
[data-page-panel="admin"] { max-width: 1700px; }
.admin-masthead { position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: clamp(26px,4vw,48px); color: #fff; background: var(--ink); border-radius: 28px 28px 8px 8px; }
.admin-masthead::after { content: ""; position: absolute; width: 280px; height: 280px; right: 17%; top: -190px; border: 55px solid var(--yellow); border-radius: 50%; opacity: .78; }
.admin-masthead > * { position: relative; z-index: 1; }
.admin-masthead h1 { margin: 0; font-size: clamp(38px,5vw,66px); line-height: .95; letter-spacing: -3px; }
.admin-masthead p:last-child { margin: 13px 0 0; color: #b8bab4; }
.admin-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px; margin-bottom: 22px; background: #fff; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 18px 18px; scrollbar-width: thin; }
.admin-tab { flex: 0 0 auto; border: 0; padding: 11px 15px; color: #62635d; background: transparent; border-radius: 11px; font-weight: 850; }
.admin-tab:hover { color: var(--ink); background: #f2f2ed; }
.admin-tab.active { color: var(--ink); background: var(--yellow); }
.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; animation: admin-in .18s ease-out; }
@keyframes admin-in { from { opacity: 0; transform: translateY(5px); } }
.admin-metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.admin-kpi { min-height: 152px; }
.admin-kpi strong { margin-top: auto; }
.cost-card { color: #fff; background: #6f451d; border-color: #6f451d; }
.cost-card small, .cost-card span { color: #e9d8c5; }
.admin-overview-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.admin-wide { grid-column: span 2; }
.alert-count { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 10px; color: #fff; background: var(--danger); border-radius: 12px; }
.rank-list, .usage-list { display: grid; gap: 7px; margin-top: 14px; }
.rank-row { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 12px; background: #f6f6f2; }
.rank-row > b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--yellow); font-size: 12px; }
.rank-row div { min-width: 0; display: grid; gap: 2px; }
.rank-row div strong, .rank-row div small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row small { color: var(--muted); }
.mini-chart { min-height: 180px; display: flex; align-items: stretch; gap: 7px; padding-top: 20px; overflow-x: auto; }
.mini-chart.tall { min-height: 250px; }
.chart-column { flex: 1 0 24px; min-width: 24px; display: grid; grid-template-rows: 1fr auto; gap: 7px; text-align: center; }
.chart-bars { min-height: 120px; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.chart-bar { width: min(13px,45%); min-height: 3px; background: var(--yellow); border-radius: 4px 4px 2px 2px; }
.chart-bar.failure { background: var(--danger); }
.chart-column small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.admin-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 28px 0 20px; }
.admin-section-head h2 { margin: 0; font-size: clamp(31px,4vw,48px); letter-spacing: -1.8px; }
.admin-section-head p:not(.eyebrow) { max-width: 760px; margin: 7px 0 0; color: var(--muted); }
.admin-filter-bar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 11px; margin-bottom: 16px; padding: 15px; }
.admin-filter-bar label { min-width: 135px; flex: 0 1 175px; }
.admin-filter-bar .admin-search-field { flex: 1 1 260px; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel > .panel-head { padding: 20px 22px; }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.admin-table th { padding: 11px 15px; color: var(--muted); background: #f4f4f0; border-block: 1px solid var(--line); text-align: left; text-transform: uppercase; letter-spacing: .55px; font-size: 10px; }
.admin-table td { padding: 14px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #fffdf5; }
.admin-user-cell { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.admin-user-cell .mini-avatar { width: 36px; height: 36px; border-radius: 10px; }
.admin-user-cell > div:last-child { display: grid; gap: 2px; }
.admin-user-cell small { color: var(--muted); }
.state.suspended, .state.cancelled, .state.failed { color: #922d24; background: #fae0dc; }
.state.trial, .state.featured { color: #785a00; background: #fff0b6; }
.state.expired, .state.inactive { color: #60615b; background: #e9e9e4; }
.row-action { border: 0; padding: 8px 11px; color: var(--ink); background: var(--yellow); border-radius: 9px; font-weight: 850; }
.admin-plan-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; margin-bottom: 18px; }
.plan-card { position: relative; overflow: hidden; min-height: 250px; display: grid; align-content: start; gap: 16px; padding: 23px; background: #fff; border: 1px solid var(--line); border-radius: 22px; }
.plan-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--yellow); }
.plan-card.inactive { opacity: .68; }
.plan-card h3 { margin: 0; font-size: 25px; }
.plan-price { display: flex; align-items: baseline; gap: 5px; }
.plan-price strong { font-size: 36px; letter-spacing: -1.5px; }
.plan-price span { color: var(--muted); }
.capability-list { display: flex; flex-wrap: wrap; gap: 6px; }
.capability-list span { padding: 6px 8px; color: #55564f; background: #f1f1ec; border-radius: 8px; font-size: 10px; font-weight: 800; }
.admin-catalog-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.catalog-card { display: grid; gap: 13px; padding: 19px; background: #fff; border: 1px solid var(--line); border-radius: 20px; }
.catalog-card.is-inactive { opacity: .62; }
.catalog-card-head { display: flex; gap: 12px; align-items: flex-start; }
.catalog-icon { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink); background: var(--yellow); border-radius: 13px; font-size: 20px; }
.catalog-card h3 { margin: 0; font-size: 18px; }
.catalog-card p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.catalog-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.catalog-meta span { padding: 5px 8px; background: #f2f2ed; border-radius: 8px; font-size: 10px; font-weight: 800; }
.catalog-actions { display: flex; gap: 7px; margin-top: auto; }
.catalog-actions button { flex: 1; border: 0; padding: 9px; border-radius: 9px; font-weight: 850; }
.rule-list { display: grid; gap: 11px; }
.rule-card { display: grid; grid-template-columns: minmax(190px,1fr) minmax(260px,2fr) auto; align-items: center; gap: 18px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.rule-card h3 { margin: 0 0 4px; }
.rule-card p { margin: 0; color: var(--muted); }
.role-create-form { display: grid; gap: 18px; padding: 18px; margin-bottom: 18px; background: #f7f7f3; border: 1px solid var(--line); border-radius: 18px; }
.role-editor-list { display: grid; gap: 14px; }
.role-editor-card { display: grid; gap: 16px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.role-editor-card h3 { margin: 0 0 4px; }
.permission-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 9px; margin-top: 10px; }
.permission-option { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fafaf7; cursor: pointer; }
.permission-option:has(input:checked) { border-color: #d5a400; background: #fff8d8; }
.permission-option:has(input:disabled) { cursor: not-allowed; opacity: .72; }
.permission-option input { margin-top: 4px; accent-color: var(--yellow); }
.permission-option span { display: grid; gap: 3px; }
.permission-option strong { text-transform: capitalize; }
.permission-option small { color: var(--muted); line-height: 1.35; }
.admin-id-cell { max-width: 190px; overflow-wrap: anywhere; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 12px; }
.rule-targets { display: flex; flex-wrap: wrap; gap: 6px; }
.rule-targets span { padding: 6px 9px; background: #f1f1ec; border-radius: 8px; font-size: 11px; }
.usage-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.usage-row:last-child { border: 0; }
.usage-row small { color: var(--muted); }
.usage-meter { grid-column: 1 / -1; height: 5px; overflow: hidden; background: #ecece6; border-radius: 999px; }
.usage-meter i { display: block; height: 100%; background: var(--yellow); border-radius: inherit; }
.compact-metrics { margin-top: 18px; }

.admin-dialog { width: min(1080px,calc(100% - 30px)); max-height: calc(100vh - 40px); padding: 0; color: var(--ink); background: var(--paper); border: 0; border-radius: 24px; box-shadow: 0 35px 100px #1118; }
.account-link-dialog { width: min(440px,calc(100% - 30px)); padding: 22px; color: var(--ink); background: #fff; border: 0; border-radius: 16px; box-shadow: 0 24px 60px #1118; }
.account-link-dialog .dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.account-link-dialog .dialog-head h2 { margin: 0; font-size: 24px; }
.account-link-dialog label { display: grid; gap: 6px; margin-top: 12px; }
.account-link-dialog .form-actions { justify-content: flex-end; }
.admin-dialog.compact-dialog { width: min(780px,calc(100% - 30px)); }
.admin-dialog::backdrop { background: rgba(20,21,18,.72); backdrop-filter: blur(5px); }
.admin-dialog > form, .admin-dialog > .dialog-content { padding: 0 26px 26px; }
.admin-dialog > .dialog-head, .admin-dialog form > .dialog-head { position: sticky; z-index: 3; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 26px; background: rgba(247,247,243,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.dialog-head h2 { margin: 0; font-size: 29px; }
.dialog-content { display: grid; gap: 16px; }
.user-summary-band { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 15px; padding: 20px; background: var(--ink); color: #fff; border-radius: 18px; }
.user-summary-band .profile-avatar { width: 68px; height: 68px; border-radius: 18px; color: var(--ink); font-size: 29px; }
.user-summary-band h3 { margin: 0; font-size: 25px; }
.user-summary-band p { margin: 4px 0 0; color: #b7b9b2; }
.user-detail-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.detail-stat { min-width: 0; padding: 13px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.detail-stat small { display: block; margin-bottom: 5px; color: var(--muted); }
.detail-stat strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.detail-section { padding: 17px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.detail-section h3 { margin: 0 0 12px; }
.detail-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.code-input { min-height: 150px; font: 12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace; }

.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 380px; padding: 14px 17px; border-radius: 14px; color: #fff; background: var(--ink); box-shadow: var(--shadow); opacity: 0; transform: translateY(18px); pointer-events: none; transition: .22s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }
.skeleton-list:empty::before { content: "Loading real data…"; display: block; padding: 25px; color: var(--muted); background: linear-gradient(100deg,#eeeeea 20%,#fafaf8 38%,#eeeeea 56%); background-size: 300% 100%; border-radius: 16px; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position-x: -300%; } }

@media (min-width: 1081px) {
  [data-page-panel="dashboard"].active {
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
    align-items: start;
  }
  [data-page-panel="dashboard"] > .hero-card,
  [data-page-panel="dashboard"] > article:first-of-type { grid-column: 1 / -1; }
  [data-page-panel="dashboard"] > .two-column { display: contents; }
}

@media (max-width: 1080px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    height: 100vh;
    height: 100dvh;
    padding: 18px 14px 20px;
    transform: translateX(-105%);
    transition: transform .2s ease;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    background: #fff;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 60;
  }
  .sidebar.open { transform: none; }
  body:has(.sidebar.open)::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(18, 20, 23, .45);
  }
  .sidebar nav { flex-direction: column; align-items: stretch; gap: 4px; overflow: auto; }
  .nav-group { display: block; margin: 14px 8px 4px; }
  .sidebar .nav-item { width: 100%; }
  .sidebar .nav-item b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #f2f4f6; font-style: normal; }
  .sidebar .nav-item.active b { background: transparent; }
  .sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
  .topbar { top: 0; border-bottom-color: var(--line); }
  .menu-button { display: grid; place-items: center; }
  .mobile-tabs {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    min-height: 64px;
    height: calc(64px + env(safe-area-inset-bottom));
    padding: 4px 6px env(safe-area-inset-bottom);
    background: rgba(248, 249, 251, .94);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(16px);
    align-items: stretch;
    justify-content: space-around;
  }
  .mobile-tabs .nav-item {
    flex: 1 1 0;
    width: auto;
    max-width: 20%;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    padding: 4px 0;
    border-radius: 12px;
    background: transparent;
    font-size: 10px;
    letter-spacing: 0;
  }
  .mobile-tabs .nav-item span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .mobile-tabs .nav-item b { display: grid; place-items: center; width: 32px; height: 22px; border-radius: 999px; font-style: normal; font-size: 15px; }
  .mobile-tabs .nav-item.active { background: transparent; color: var(--ink); }
  .mobile-tabs .nav-item.active b { background: var(--yellow); }
  .page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .toast { right: 12px; left: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); max-width: none; }
  .hero-card { grid-template-columns: 1fr; }
  .two-column, .form-grid, .social-composer-grid { grid-template-columns: 1fr; }
  .page:not([data-page-panel="dashboard"]) .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1040px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-metric-grid, .admin-overview-grid, .admin-plan-grid, .admin-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .auth-layout { display: block; background: var(--yellow); padding: 22px 15px; }
  .auth-story { display: none; }
  .auth-panel { min-height: calc(100vh - 44px); min-height: calc(100dvh - 44px); padding: 15px; border-radius: 24px; background: #fff; }
  .mobile-brand { display: flex; justify-content: center; }
  .auth-card { box-shadow: none; border: 0; padding: 8px 4px 4px; background: transparent; }
  .page-intro, .admin-masthead, .admin-section-head { align-items: flex-start; flex-direction: column; }
  .admin-masthead::after { right: -80px; }
  .admin-overview-grid, .admin-plan-grid, .admin-catalog-grid { grid-template-columns: 1fr; }
  .admin-wide { grid-column: auto; }
  .rule-card, .detail-columns { grid-template-columns: 1fr; }
  .user-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: 1fr; }
  .hero-card h1 { font-size: 32px; }
}

@media (max-width: 480px) {
  .topbar { padding-inline: 14px; }
  .topbar .eyebrow { display: none; }
  .topbar h2 { font-size: 18px; }
  .page { padding: 12px 14px calc(96px + env(safe-area-inset-bottom)); }
  .metric-grid { gap: 8px; }
  .metric-card { padding: 12px; }
  .metric-card strong { font-size: 26px; }
  .profile-photo-row { align-items: flex-start; }
  .profile-avatar { width: 82px; height: 82px; }
  .admin-metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .admin-kpi { min-height: 128px; }
  .admin-masthead { border-radius: 20px; }
  .admin-masthead h1 { font-size: 32px; letter-spacing: -.03em; }
  .user-summary-band { grid-template-columns: auto 1fr; }
  .user-summary-band > :last-child { grid-column: 1 / -1; }
  .rider-card-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.help-title { position: relative; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; justify-self: start; }
.help-trigger {
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  min-height: 28px;
  color: var(--muted);
  cursor: help;
}
.help-trigger::before {
  content: "?";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.file-button .help-trigger { color: inherit; }
.help-trigger:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; border-radius: 50%; }
.help-title .help-tip {
  position: absolute;
  z-index: 5;
  inset-block-start: 100%;
  inset-inline-start: 0;
  width: min(17rem, 75vw);
  padding: 10px 12px;
  border-radius: 8px;
  background: #262626;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 4px 14px #0003;
  cursor: auto;
  white-space: normal;
}
.help-tip[hidden] { display: none; }
