/* Native auth and workspace UI. Explicit CSS: this app has no Tailwind build. */
.lm-desktop-nav { display:flex; align-items:center; gap:18px; white-space:nowrap; }
.lm-desktop-nav a { display:inline-flex; align-items:center; min-height:44px; color:var(--muted); font-size:13px; font-weight:500; text-decoration:none; }
.lm-desktop-nav a:hover { color:var(--accent); }
.lm-desktop-nav a:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.lm-desktop-email { max-width:160px; overflow:hidden; text-overflow:ellipsis; color:var(--muted); font-size:11px; }
.lm-account-menu { position:relative; display:none; }
.lm-account-menu > summary { display:flex; align-items:center; justify-content:center; width:44px; height:44px; border:1px solid transparent; border-radius:5px; color:var(--muted); list-style:none; cursor:pointer; }
.lm-account-menu > summary::-webkit-details-marker { display:none; }
.lm-account-menu > summary:hover, .lm-account-menu[open] > summary { color:var(--accent); border-color:var(--line); background:var(--accent-soft); }
.lm-account-menu > summary:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
.lm-menu-icon { width:22px; height:22px; }
.hero-ellipsis-horizontal { background:currentColor; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='5' cy='12' r='1.75'/%3E%3Ccircle cx='12' cy='12' r='1.75'/%3E%3Ccircle cx='19' cy='12' r='1.75'/%3E%3C/svg%3E") center / contain no-repeat; }
.lm-account-nav { position:absolute; top:calc(100% + 8px); right:0; display:flex; flex-direction:column; width:248px; max-width:calc(100vw - 24px); max-height:calc(100dvh - var(--topbar-h) - 20px); overflow-y:auto; padding:6px; border:1px solid var(--line); border-radius:7px; background:var(--panel); box-shadow:0 12px 36px rgb(25 48 57 / 14%); }
.lm-account-nav a { display:flex; align-items:center; min-height:44px; padding:10px 12px; border-radius:3px; color:var(--ink); font-size:13px; font-weight:500; text-decoration:none; }
.lm-account-nav a:hover { color:var(--accent); background:var(--accent-soft); }
.lm-account-heading { display:grid; gap:5px; padding:12px; margin-bottom:6px; border-bottom:1px solid var(--line); font-size:10px; color:var(--muted); }
.lm-account-email { color:var(--ink); font-size:12px; overflow-wrap:anywhere; }
.lm-account-nav .lm-nav-logout { margin-top:6px; border-top:1px solid var(--line); border-radius:0 0 3px 3px; color:var(--muted); }
/* Group tabs beside the logo; many groups scroll sideways instead of wrapping the bar. */
.lm-group-tabs { position:relative; display:flex; flex:1; align-items:center; align-self:stretch; gap:4px; min-width:0; padding-right:12px; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:none; mask-image:linear-gradient(to right, #000 calc(100% - 12px), transparent); -webkit-mask-image:linear-gradient(to right, #000 calc(100% - 12px), transparent); }
.lm-topbar .lm-brand { flex:none; white-space:nowrap; min-height:44px; }
.lm-topbar:has(.lm-group-tabs) .lm-brand { padding-right:18px; border-right:1px solid var(--line); }
.lm-group-tabs::-webkit-scrollbar { display:none; }
.lm-group-tab { display:flex; align-items:center; flex:none; min-height:44px; max-width:22ch; padding:0 14px; border-bottom:2px solid transparent; border-radius:4px 4px 0 0; color:var(--muted); font-size:12px; font-weight:600; text-decoration:none; white-space:nowrap; }
.lm-group-tab > span { overflow:hidden; text-overflow:ellipsis; }
.lm-group-tab:hover { color:var(--ink); }
.lm-group-tab--active { color:var(--ink); border-bottom-color:var(--accent); }
.lm-group-tab:focus-visible { outline:3px solid var(--accent); outline-offset:-3px; }
.lm-topbar .lm-actions { flex:none; }
.lm-app-content { max-width:1240px; margin:0 auto; padding:28px 20px 64px; }
.lm-app-content h1 { font-size:28px; letter-spacing:-.025em; margin:0 0 20px; }
.lm-app-content h2 { font-size:21px; margin:24px 0 12px; }
.lm-app-content h3 { font-size:17px; margin:16px 0 10px; }
.lm-app-content p { line-height:1.65; }
.lm-app-content form { display:grid; gap:14px; margin:20px 0; max-width:640px; }
.lm-app-content label { display:block; font-size:14px; font-weight:600; margin-bottom:6px; }
.lm-app-content input:not([type=hidden]):not([type=checkbox]), .lm-app-content textarea, .lm-app-content select {
  box-sizing:border-box; width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:8px;
  background:var(--panel); color:var(--ink); font:inherit; min-height:44px;
}
:where(.lm-app-content button) { padding:9px 14px; margin:3px 4px 3px 0; border:1px solid var(--line); border-radius:8px; background:var(--panel); color:var(--ink); font:inherit; cursor:pointer; }
:where(.lm-app-content button:hover) { border-color:var(--accent); background:var(--accent-soft); }
:where(.lm-app-content button:disabled) { opacity:.5; cursor:not-allowed; }
.lm-app-content :focus-visible, .lm-account-nav :focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.lm-app-content form button[type=submit] { background:var(--accent); color:white; justify-self:start; }
.lm-app-content a { color:var(--accent); }
#groups, #research-entries { display:grid; gap:12px; }
#groups article, #research-entries article { padding:20px; border:1px solid var(--line); background:var(--panel); border-radius:12px; box-shadow:var(--shadow); }
#groups article { display:flex; align-items:center; justify-content:space-between; gap:16px; }
#research-filters { display:flex; flex-wrap:wrap; align-items:center; max-width:none; gap:8px; margin:12px 0; }
#research-filters .fieldset { margin:0; padding:0; min-width:0; }
#research-filters label { display:flex; align-items:center; gap:8px; margin:0; padding:0 12px; height:36px; border:1px solid var(--line); border-radius:999px; background:var(--panel); }
#research-filters label:focus-within { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
#research-filters .label { margin:0; color:var(--muted); font-size:11px; white-space:nowrap; }
#research-filters input, #research-filters select { width:auto; min-width:0; min-height:0; height:32px; padding:0; border:0; border-radius:0; background:transparent; font-size:13px; }
#research-filters input { width:100px; }
#research-filters #filters_query { width:200px; }
/* The shortlist tabs: one segmented control, a count on each. */
#research-filters .lm-view-tabs { display:flex; flex:none; gap:2px; padding:2px; border:1px solid var(--line); border-radius:999px; background:var(--panel); }
#research-filters .lm-view-tab { position:relative; height:30px; padding:0 12px; gap:6px; border:0; border-radius:999px; background:transparent; color:var(--muted); font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; }
#research-filters .lm-view-tab:hover { color:var(--ink); }
#research-filters .lm-view-tab--on { background:var(--accent-soft); color:var(--ink); }
#research-filters .lm-view-tab:focus-within { box-shadow:0 0 0 3px var(--accent-soft); outline:2px solid var(--accent); }
#research-filters .lm-view-tab input { position:absolute; opacity:0; width:1px; height:1px; pointer-events:none; }
#research-filters .lm-view-count { color:var(--muted); font-size:12px; font-weight:600; font-variant-numeric:tabular-nums; }
#research-filters .lm-view-tab--on .lm-view-count { color:var(--ink); }
.lm-research-page { max-width:1600px; padding-top:16px; }
.lm-research-heading, .lm-research-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px 16px; }
.lm-research-heading { justify-content:space-between; margin-bottom:12px; }
.lm-research-heading h1 { margin:0; font-size:20px; }
.lm-research-actions { font-size:13px; }
.lm-research-actions button { margin:0; }
.lm-research-disclosure, #group-reports.lm-research-disclosure { display:inline-block; vertical-align:top; margin:0 16px 12px 0; padding:0; border:0; border-radius:0; background:transparent; font-size:13px; }
.lm-research-disclosure summary { cursor:pointer; color:var(--accent); font-weight:600; padding:6px 0; }
.lm-research-disclosure[open], #group-reports.lm-research-disclosure[open] { display:block; }
#save-search { display:flex; flex-wrap:wrap; align-items:end; gap:8px; margin:8px 0; }
#save-search .fieldset { flex:1; margin:0; }
#save-search button { margin:0 0 6px; min-height:44px; }
.lm-list-heading { display:flex; align-items:baseline; flex-wrap:wrap; gap:4px 12px; margin-bottom:10px; }
.lm-list-heading h2 { font-size:15px; margin:0; }
.lm-list-heading p { margin:0; color:var(--muted); font-size:12px; }
#research-map { height:440px; background:#eef1f0; z-index:0; }
#add-entry-form, #criteria-form { max-width:none; }
.lm-research-page .lm-field .fieldset { margin:0; padding:0; min-width:0; }
.lm-research-page .lm-field label { margin-bottom:0; }
.lm-research-page .lm-read-row > .fieldset { flex:1; }
.lm-research-page .lm-input-row .lm-input { width:110px; }
.lm-research-page .lm-close { padding:6px; margin:0; }
.lm-research-page .lm-close > span { width:15px; height:15px; flex:none; }
.lm-app-content .lm-criteria-title { margin:0; font-size:15px; }
#research-listings .lm-media { display:block; }
/* OLX logo placeholder detected by app.js: show the same tile as "no photo". */
.lm-media--placeholder img { visibility:hidden; }
.lm-media--placeholder::after { content:"no photo"; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:var(--faint); font-size:11px; font-weight:600; letter-spacing:0.08em; text-transform:uppercase; }
#research-listings .lm-card-photo { position:relative; }
#research-workspace .lm-fav { padding:0; margin:0; }
#research-listings .lm-details { border:0; padding:0; margin:0; border-radius:0; background:transparent; }
#research-listings .lm-stream-empty { grid-column:1 / -1; }
#research-detail .lm-detail-title { margin:9px 0 0; font-size:16px; }
#research-detail .lm-close { margin:0; padding:6px; }
#research-detail .lm-pane-cols--report-only { grid-template-columns:minmax(0,1fr); grid-template-areas:"side"; }
#research-gallery .lm-slide-btn { margin:0; padding:0; }
#research-comments article { border-bottom:1px solid var(--line); padding:12px 0; }
#local-mail-notice { padding:14px; border:1px solid #fcd34d; background:#fffbeb; border-radius:8px; }
.lm-stream-empty { display:none; color:var(--muted); }
.lm-stream-empty:only-child { display:block; }
#group-reports { margin:20px 0; padding:16px; background:var(--panel); border:1px solid var(--line); border-radius:10px; }
#group-reports summary { cursor:pointer; font-weight:600; }
#research-reports article { display:flex; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); }
#research-reports span { color:var(--muted); font-size:13px; }
.lm-app-content form button:not([type]), .lm-app-content form button[type=submit] { background:var(--accent); color:white; justify-self:start; }
@media (min-width:1100px) {
 .lm-browse-map #research-map { flex:1; height:auto; min-height:0; }
}
@media (max-width:1100px) {
 .lm-desktop-email { display:none; }
 .lm-desktop-nav { gap:14px; }
}
@media (max-width:700px) {
 .lm-desktop-nav { display:none; }
 .lm-account-menu { display:block; }
 .lm-topbar-inner { gap:12px; }
 /* The logo mark alone; the tabs say where you are. */
 .lm-topbar:has(.lm-group-tabs) .lm-brand-text { display:none; }
 .lm-group-tab { padding:0 8px; max-width:16ch; }
 .lm-topbar:has(.lm-group-tabs) .lm-brand { min-width:44px; justify-content:center; padding-right:10px; }
 .lm-app-content { padding:20px 14px 48px; }
 #research-listings, #research-gallery { grid-template-columns:1fr; }
 /* The map sits above the list here; at 440px it pushed the first card two screens down. */
 #research-map { height:240px; }
 #research-filters .fieldset { flex:1 1 150px; }
 #research-filters label { padding:0 10px; gap:6px; }
 #research-filters input, #research-filters select, #research-filters #filters_query { flex:1; width:0; }
 #research-filters .fieldset:has(#filters_query) { flex-basis:100%; }
 #research-filters .lm-view-tabs { flex-basis:100%; overflow-x:auto; scrollbar-width:none; }
 #research-filters .lm-view-tab { flex:1 0 auto; justify-content:center; padding:0 8px; }
 .lm-research-heading { align-items:start; }
 .lm-research-actions { gap:8px; }
 #groups article { align-items:start; flex-direction:column; }
}

/* Management pages: groups, members, settings, accounts. One shared vocabulary
   (page head, panel, row, role badge, button) so they read as one app. */
.lm-manage-page { max-width:880px; }
.lm-page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:8px; }
.lm-page-head h1 { margin:0; }
.lm-page-lede { margin:6px 0 24px; color:var(--muted); font-size:14px; }
.lm-page-title { display:flex; align-items:center; gap:6px; min-width:0; }
.lm-page-title h1 { overflow-wrap:anywhere; }
.lm-crumbs { display:flex; gap:8px; margin-bottom:10px; color:var(--muted); font-size:13px; }
.lm-app-content .lm-crumbs a { color:var(--muted); text-decoration:none; }
.lm-app-content .lm-crumbs a:hover { color:var(--accent); }

.lm-app-content .lm-btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; flex:none; min-height:38px; margin:0; padding:0 14px; border:1px solid var(--line); border-radius:9px; background:var(--panel); color:var(--ink); font-size:14px; font-weight:600; text-decoration:none; white-space:nowrap; cursor:pointer; }
.lm-app-content .lm-btn:hover { border-color:var(--accent); background:var(--accent-soft); }
.lm-app-content .lm-btn--primary { background:var(--ink); border-color:var(--ink); color:#fff; }
.lm-app-content .lm-btn--primary:hover { background:var(--accent); border-color:var(--accent); }
.lm-app-content .lm-btn--quiet { border-color:transparent; background:transparent; color:var(--muted); min-height:32px; padding:0 10px; }
.lm-app-content .lm-btn--quiet:hover { color:var(--ink); background:#f5f5f4; border-color:transparent; }
.lm-app-content .lm-btn--danger { color:#b91c1c; }
.lm-app-content .lm-btn--danger:hover { color:#991b1b; background:#fef2f2; border-color:#fecaca; }
.lm-app-content .lm-btn:disabled { opacity:.45; cursor:not-allowed; }
.lm-btn-icon { width:16px; height:16px; flex:none; }
.lm-app-content .lm-icon-btn { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; margin:0; padding:0; border:0; border-radius:8px; background:transparent; color:var(--muted); }
.lm-app-content .lm-icon-btn:hover { color:var(--ink); background:#f5f5f4; }

.lm-panel { margin:0 0 16px; padding:20px 22px; border:1px solid var(--line); border-radius:14px; background:var(--panel); box-shadow:var(--shadow); }
.lm-panel--danger { border-color:#fecaca; }
.lm-panel-head { margin-bottom:14px; }
.lm-app-content .lm-panel-head h2 { margin:0; font-size:16px; }
.lm-panel-head p { margin:4px 0 0; color:var(--muted); font-size:13px; line-height:1.5; }
.lm-app-content .lm-subhead { margin:22px 0 4px; font-size:12px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.lm-empty { margin:8px 0 0; color:var(--muted); font-size:14px; }

/* Settings: label column on the left, controls on the right. */
@media (min-width:760px) {
 .lm-settings-row { display:grid; grid-template-columns:240px minmax(0,1fr); gap:28px; align-items:start; }
 .lm-settings-row .lm-panel-head { margin:0; }
}

.lm-app-content .lm-stack-form, .lm-app-content .lm-stack-form fieldset { display:grid; gap:12px; margin:0; max-width:none; }
.lm-app-content .lm-stack-form fieldset { padding:0; border:0; min-width:0; }
.lm-app-content .lm-stack-form .fieldset { margin:0; }
.lm-app-content .lm-stack-form fieldset:disabled { opacity:.55; }
.lm-app-content .lm-inline-form { display:grid; grid-template-columns:minmax(0,1fr) minmax(140px,220px) auto; align-items:end; gap:10px; margin:0; max-width:none; }
.lm-app-content .lm-inline-form .fieldset { margin:0; }
.lm-app-content .lm-inline-form .lm-btn { min-height:44px; }
.lm-app-content .lm-rename-form { display:flex; align-items:end; gap:8px; margin:0; max-width:520px; width:100%; }
.lm-app-content .lm-rename-form .fieldset { flex:1; margin:0; }
.lm-app-content .lm-rename-form .lm-btn { min-height:44px; }
.lm-manage-page .label { display:block; margin-bottom:6px; font-size:13px; font-weight:600; color:var(--ink); }

.lm-notice { display:flex; gap:10px; align-items:flex-start; margin:0 0 16px; padding:12px 16px; border:1px solid #fcd34d; border-radius:12px; background:#fffbeb; color:#78350f; font-size:14px; }
.lm-notice p { margin:0; line-height:1.5; }
.lm-notice .lm-btn-icon { margin-top:2px; }

.lm-group-list { display:grid; gap:12px; margin-bottom:28px; }
#groups.lm-group-list article { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 20px; }
.lm-group-card-main { min-width:0; }
.lm-app-content .lm-group-card-name { color:var(--ink); font-size:17px; font-weight:700; text-decoration:none; overflow-wrap:anywhere; }
.lm-app-content .lm-group-card-name:hover { color:var(--accent); }
.lm-group-card-meta { display:flex; align-items:center; gap:10px; margin:6px 0 0; color:var(--muted); font-size:13px; }
.lm-group-card-actions { display:flex; gap:8px; flex:none; }

.lm-role { display:inline-block; padding:2px 9px; border-radius:999px; background:#f5f5f4; color:var(--muted); font-size:12px; font-weight:600; line-height:1.6; text-transform:capitalize; white-space:nowrap; }
.lm-role--owner { background:#1c1917; color:#fff; }
.lm-role--admin { background:var(--accent-soft); color:var(--accent); }
.lm-role--viewer { background:#f0f9ff; color:var(--sea); }
.lm-status { font-size:12px; font-weight:600; color:var(--accent); }
.lm-status--off { color:#b91c1c; }
.lm-you { margin-left:6px; padding:1px 7px; border-radius:999px; border:1px solid var(--line); color:var(--muted); font-size:11px; font-weight:600; vertical-align:1px; }

.lm-rows { display:grid; }
.lm-row { display:flex; align-items:center; gap:12px; padding:12px 0; border-top:1px solid var(--line); }
.lm-rows > .lm-row:first-of-type, .lm-rows > p + .lm-row { border-top:0; }
.lm-avatar { display:flex; align-items:center; justify-content:center; width:36px; height:36px; flex:none; border-radius:50%; background:var(--accent-soft); color:var(--accent); font-weight:700; font-size:14px; }
.lm-avatar--pending { background:#f5f5f4; color:var(--faint); }
.lm-row-main { display:flex; flex-direction:column; min-width:0; flex:1; }
.lm-row-title { font-weight:600; font-size:14px; overflow-wrap:anywhere; }
.lm-row-sub { color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
.lm-row-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:6px; }
.lm-app-content .lm-role-select { display:block; margin:0; max-width:none; }
.lm-app-content .lm-role-select select { min-height:32px; width:auto; padding:4px 28px 4px 10px; font-size:13px; text-transform:capitalize; }
.lm-sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

@media (max-width:640px) {
 .lm-page-head { flex-direction:column; }
 #groups.lm-group-list article { flex-direction:column; align-items:stretch; }
 .lm-group-card-actions .lm-btn { flex:1; }
 .lm-app-content .lm-inline-form { grid-template-columns:1fr; }
 .lm-app-content .lm-inline-form .lm-btn { justify-self:stretch; }
 .lm-row { flex-wrap:wrap; }
 .lm-row-actions { width:100%; justify-content:flex-start; padding-left:48px; }
 .lm-panel { padding:16px; }
}
/* Beats the generic `form button[type=submit]` accent so every primary button matches. */
.lm-app-content .lm-btn.lm-btn--primary { background:var(--ink); border-color:var(--ink); color:#fff; }
.lm-app-content .lm-btn.lm-btn--primary:hover { background:var(--accent); border-color:var(--accent); }
/* Labels wrap their inputs here; the global label margin would push buttons out of line. */
.lm-manage-page .fieldset label { margin-bottom:0; }

/* Research stat bar: the match count reads as a sentence with the shared
   criteria, then the group's own numbers underneath. */
.lm-statbar { margin:0 0 6px; }
.lm-criteria-line { display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px; }
.lm-criteria-line .lm-statline-lead { margin-right:4px; }
.lm-crit { display:inline-flex; align-items:center; height:26px; padding:0 10px; border:1px solid var(--line); border-radius:999px; background:var(--panel); color:var(--ink); font-size:12.5px; white-space:nowrap; cursor:help; }
.lm-app-content .lm-crit-edit { font-size:13px; font-weight:600; text-decoration:none; }
.lm-app-content .lm-crit-edit:hover { text-decoration:underline; }
.lm-statbar-action { margin-left:auto; }
.lm-statbar .lm-statline { margin-top:8px; }

/* Group favorites: the heart grows into a pill with the member count. */
.lm-fav.lm-fav--counted { width:auto; min-width:30px; padding:0 9px 0 7px; gap:4px; border-radius:999px; }
.lm-fav-count { font-size:12px; font-weight:700; line-height:1; font-variant-numeric:tabular-nums; }

/* Admin: catalog row. */
.lm-catalog { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; }
.lm-catalog-counts { margin:0; color:var(--muted); font-size:14px; }
.lm-catalog-counts b { color:var(--ink); font-size:18px; }
.lm-admin-page #criteria-section { padding-top:6px; }
.lm-admin-page .lm-criteria { margin:0; border:0; box-shadow:none; padding:0; background:transparent; }
@media (max-width:700px) { .lm-statbar-action { margin-left:0; } }
