/* Mobile-first: owners see a phone layout with a bottom tab bar; office staff on wide screens get a sidebar. */
:root {
  /* Design system v1 (design canvas "Tokens"): harbour blue primary, sun ochre accent, mist neutrals.
     Status colours are separate from the brand and always come with a symbol and a word. */
  --bg: #F5F6F8; --surface: #FFFFFF; --surface-2: #E9ECF1; --ink: #14202E; --ink-2: #3A4757; --muted: #5B6878; --line: #E1E5EB; --line-strong: #C9D0D9;
  --accent: #18406B; --accent-hover: #0F2D4D; --accent-ink: #FFFFFF; --accent-soft: #EEF3F9; --accent-text: #18406B; --ochre: #E2A93B;
  --notice: #EEF3F9; --notice-ink: #123457;
  --ok: #1E5B38; --ok-soft: #E8F3EC; --warn: #7A4E00; --warn-soft: #FBF1DC; --warn-line: #B7791F; --bad: #B42318; --bad-ink: #8E1F1F; --bad-soft: #FBEAEA;
  --esc: #5B2C83; --esc-soft: #F3E8FA;
  /* issue status pills: background / text */
  --st-open-bg: #E8EFFC; --st-open: #1D4ED8; --st-progress-bg: #FBF1DC; --st-progress: #7A4E00; --st-wait-bg: #EEF0F3; --st-wait: #3A4757;
  --st-fixed-bg: #E8F3EC; --st-fixed: #1E5B38; --st-closed-bg: #E1E5EB; --st-closed: #24303F;
  --radius: 16px; --radius-btn: 12px; --radius-input: 8px; --radius-sheet: 24px;
  --shadow-1: 0 1px 2px rgba(20,32,46,.06);
  --font: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: Manrope, "Noto Sans", -apple-system, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E151F; --surface: #17202C; --surface-2: #1F2A38; --ink: #E8ECF2; --ink-2: #C9D0D9; --muted: #A3ADBA; --line: #2A3646; --line-strong: #3A4757;
    --accent: #2C5788; --accent-hover: #4F77A8; --accent-ink: #FFFFFF; --accent-soft: #1B2A45; --accent-text: #A9C3FF;
    --notice: #1B2A45; --notice-ink: #C9DAF5;
    --ok: #9FD6B2; --ok-soft: #16301F; --warn: #F2C976; --warn-soft: #3A2C10; --warn-line: #A87217; --bad: #E5484D; --bad-ink: #F2A3A3; --bad-soft: #3A1D1F;
    --esc: #D9B8F2; --esc-soft: #2E1F3D;
    --st-open-bg: #1C2B4A; --st-open: #A9C3FF; --st-progress-bg: #3A2C10; --st-progress: #F2C976; --st-wait-bg: #24303F; --st-wait: #C9D0D9;
    --st-fixed-bg: #16301F; --st-fixed: #9FD6B2; --st-closed-bg: #1A222D; --st-closed: #A3ADBA;
    --shadow-1: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
/* The page itself never scrolls: #app (sign-in, setup) or .main (inside the app) does, so the header and the
   bottom menu stay put and nothing bounces away on iPhone. */
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; }
#app { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
/* Owners read on phones: body text 17 px. The office is information-dense: one step smaller. */
.shell.owner .main { font-size: 17px; line-height: 1.53; }
a { color: var(--accent-text); }
a:hover { color: var(--accent-hover); }
@media (prefers-color-scheme: dark) { a:hover { color: #D6E1EF; } }
button, input, select, textarea { font: inherit; color: inherit; }
img, video { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 8px; text-wrap: balance; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.19rem; font-weight: 700; } h3 { font-size: 1rem; font-weight: 700; }
.shell.owner h1 { font-size: 28px; line-height: 1.15; }
.shell.staff h1 { font-size: 24px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 0.86rem; } .mono { font-family: ui-monospace, Menlo, monospace; font-size: 0.82rem; }
[hidden] { display: none !important; }

/* shell */
.shell { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.topbar { flex: none; position: relative; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line);
  padding: calc(var(--safe-top) + 10px) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 10px; }
.brand { flex: none; display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; white-space: nowrap; }
/* The logo never shrinks, however long the community name or the staff language picker. */
.brand img { width: 36px; height: 36px; flex: none; }
/* Name next to the logo everywhere, as in the design: "Comunidad" bold, "Connect" lighter in harbour blue. */
/* Lockup from the design: two lines, "Comunidad" bold in ink, "Connect" regular in harbour blue. */
.brand { gap: 10px; }
.brand-name { display: flex; flex-direction: column; font-size: 17px; line-height: 1.05; letter-spacing: -0.01em; color: var(--ink); }
.brand-connect { font-weight: 500; color: var(--accent-text); }
.pick { display: contents; }
.pick-icon { display: none; }
.pick.solo select { pointer-events: auto; }
/* Phones: community and language pickers become small icons beside the bell. */
@media (max-width: 599px) {
  .topbar { gap: 4px; }
  .brand { margin-right: auto; }
  .topbar > .spacer { display: none; }
  .pick { display: inline-grid; position: relative; width: 40px; height: 40px; place-items: center; border-radius: 10px; color: var(--ink); flex: none; }
  .pick.solo { display: none; }
  .pick-icon { display: inline-flex; }
  .pick select { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; opacity: 0; font-size: 16px; padding: 0; border: 0; }
  .pick:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
  .iconbtn { width: 40px; height: 40px; display: inline-grid; place-items: center; }
}
button, a, select { -webkit-tap-highlight-color: transparent; }
.topbar select { max-width: 52vw; min-width: 0; flex: 1 1 auto; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 7px 10px; }
.spacer { flex: 1; }
.iconbtn { position: relative; border: 0; background: transparent; padding: 6px; border-radius: 10px; cursor: pointer; color: var(--ink); }
.iconbtn:focus-visible, .btn:focus-visible, .tab:focus-visible, .type-tile:focus-visible, .kpi:focus-visible, .issue-card:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; }
.badge { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 4px; }
.main { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; width: 100%; max-width: 760px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-left)) 24px; }
.tabbar { flex: none; position: relative; z-index: 20; background: var(--surface); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + var(--safe-bottom)); }
.tab { flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; padding: 6px 2px; border-radius: 10px; cursor: pointer; position: relative; }
.tab svg { width: 26px; height: 26px; }
.tab.active { color: var(--accent-text); font-weight: 700; }
.tab .badge { right: 22%; }
/* Report: the one raised, round button in the middle of the owner's tab bar. */
.tab.report svg { background: var(--accent); color: var(--accent-ink); border-radius: 50%; padding: 10px; width: 46px; height: 46px; margin-top: -18px; box-shadow: 0 4px 12px rgba(24,64,107,.3); }
.tab.report.active svg { box-shadow: 0 0 0 3px var(--ochre), 0 4px 12px rgba(24,64,107,.3); }

.sidebar { display: none; }
@media (min-width: 980px) {
  .shell.staff { display: grid; grid-template: "top top" auto "side main" minmax(0, 1fr) / 230px minmax(0, 1fr); }
  .shell.staff .topbar { grid-area: top; }
  .shell.staff .sidebar { grid-area: side; display: flex; flex-direction: column; gap: 2px; padding: 16px 10px; border-right: 1px solid var(--line); background: var(--surface); overflow: auto; }
  .shell.staff .sidebar button { text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 10px; cursor: pointer; color: var(--ink); display: flex; gap: 10px; align-items: center; }
  .shell.staff .sidebar button.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
  .shell.staff .sidebar button { min-height: 40px; font-weight: 600; }
  .shell.staff .sidebar button:hover:not(.active) { background: var(--surface-2); }
  .shell.staff .sidebar svg { width: 20px; height: 20px; }
  .shell.staff .tabbar { display: none; }
  .shell.staff .main { grid-area: main; max-width: none; padding: 20px max(24px, calc((100% - 1100px) / 2)) 48px; }
}

/* components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-1); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
/* Buttons: 48 px tall (44 pt / 48 dp touch targets), radius 12. */
.btn { min-height: 48px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 0 20px; border-radius: var(--radius-btn); cursor: pointer; font-weight: 600; font-size: 1rem; display: inline-flex; gap: 8px; align-items: center; justify-content: center; text-align: center; }
.btn:hover { border-color: var(--accent-text); }
a.btn { text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #FFFFFF; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent-text); padding-inline: 8px; text-decoration: underline; text-underline-offset: 3px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.block { width: 100%; }
.shell.staff .btn { min-height: 40px; padding: 0 14px; font-size: 0.94rem; border-width: 1px; }
.shell.staff .btn.ghost { padding-inline: 6px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.94rem; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=month], input[type=number], input[type=search], select, textarea {
  min-height: 48px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--radius-input); padding: 10px 12px; width: 100%; font-weight: 400; font-size: 1rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--ochre); outline-offset: 1px; border-color: var(--accent); }
.shell.staff input[type=text], .shell.staff input[type=email], .shell.staff input[type=date], .shell.staff input[type=month], .shell.staff input[type=number], .shell.staff input[type=search], .shell.staff select, .shell.staff textarea { min-height: 40px; border-width: 1px; font-size: 0.94rem; }
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; }
.check input { margin-top: 4px; width: 18px; height: 18px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface-2); border-radius: var(--radius-btn); padding: 4px; gap: 4px; }
.seg button { min-height: 40px; border: 0; background: transparent; padding: 6px 8px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button.active { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(20,32,46,.1); }

/* Pills: colour + symbol + word, never colour alone. */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); line-height: 1.2; }
.pill .sym { font-weight: 700; }
.pill.open { background: var(--st-open-bg); color: var(--st-open); }
.pill.in_progress { background: var(--st-progress-bg); color: var(--st-progress); }
.pill.waiting { background: var(--st-wait-bg); color: var(--st-wait); }
.pill.resolved { background: var(--st-fixed-bg); color: var(--st-fixed); }
.pill.closed { background: var(--st-closed-bg); color: var(--st-closed); }
.pill.bad { background: var(--bad-soft); color: var(--bad-ink); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.esc { background: var(--esc-soft); color: var(--esc); }
.pill.info { background: var(--accent-soft); color: var(--accent-text); }
.pill.band-urgent { background: #B42318; color: #FFFFFF; }
.pill.band-high { background: var(--bad-soft); color: var(--bad-ink); }
.pill.band-medium { background: var(--warn-soft); color: var(--warn); }
.pill.band-low { background: var(--st-wait-bg); color: var(--st-wait); }

.issue-card { display: flex; flex-direction: column; gap: 8px; cursor: pointer; text-align: left; width: 100%; color: var(--ink); }
.issue-card:hover { border-color: var(--accent-text); }
.issue-card .title-row { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.issue-card .title { font-weight: 700; font-size: 1.05rem; line-height: 1.3; }
.issue-card .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 0.82rem; color: var(--muted); }
.reporters { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--ink); font-size: 0.9rem; }
.reporters svg { width: 18px; height: 18px; }

.notice-card { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; padding: 14px; border: 0; border-radius: var(--radius); background: var(--notice); color: var(--notice-ink); cursor: pointer; }
.notice-card svg { flex: none; width: 22px; height: 22px; margin-top: 2px; }
.notice-card b { display: block; font-size: 1rem; }
.notice-card span.body { font-size: 0.9rem; line-height: 1.4; }

.similar { border: 1.5px solid var(--warn-line); background: var(--warn-soft); border-radius: var(--radius); padding: 14px; }
.similar .card { background: var(--surface); }

.timeline { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.msg.mine { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.msg.staff { border-left: 4px solid var(--accent-text); }
.msg.internal { background: var(--warn-soft); border: 1px dashed var(--warn-line); }
.msg.internal .who { color: var(--warn); }
.msg .who { font-size: 0.78rem; font-weight: 700; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.event { align-self: center; font-size: 0.82rem; color: var(--muted); text-align: center; max-width: 92%; padding: 4px 6px; }
.event.escalation { color: var(--bad-ink); font-weight: 600; background: var(--bad-soft); border-radius: 10px; padding: 8px 12px; }
.orig-toggle { font-size: 0.82rem; border: 0; background: none; color: var(--accent-text); padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 44px; height: 44px; }
.media { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.media img, .media video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.media a.file { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; background: var(--surface-2); font-size: 0.8rem; padding: 6px; text-align: center; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-btn); padding: 12px 14px; cursor: pointer; text-align: left; color: var(--ink); }
.kpi:hover { border-color: var(--accent-text); }
.kpi b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .small { color: var(--ink-2); }
.kpi.alert b { color: var(--bad); }
.table-wrap { overflow-x: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--surface-2); }
td.num { font-variant-numeric: tabular-nums; }
.main { overflow-x: hidden; }
/* Phones: every table becomes a list of cards, so nothing scrolls sideways. */
@media (max-width: 699px) {
  .table-wrap { border: 0; background: transparent; border-radius: 0; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 10px; }
  .table-wrap td { border: 0; padding: 4px 0; display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); column-gap: 12px; align-items: center; text-align: right; overflow-wrap: break-word; }
  .table-wrap td > * { grid-column: 2; justify-self: end; }
  .table-wrap td::before { content: attr(data-label); grid-column: 1; grid-row: 1 / span 6; text-align: left; font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .table-wrap td[data-label=""] { display: block; text-align: left; }
  .table-wrap td[data-label=""]::before { display: none; }
  .table-wrap td[data-label=""] > * { justify-self: start; }
  .table-wrap td:first-child { font-weight: 600; }
  .table-wrap td:empty { display: none; }
  .table-wrap .row { justify-content: flex-end; }
  .table-wrap td[data-label=""] .row { justify-content: flex-start; }
  .table-wrap td input:not([type=checkbox]), .table-wrap td select { max-width: 60%; }
}

.progress { list-style: none; margin: 4px 0 0; padding: 0; display: flex; gap: 6px; }
.progress .step { flex: 1; font-size: 0.82rem; font-weight: 600; color: var(--muted); padding-top: 8px; border-top: 5px solid var(--line); }
.progress .step.done { border-top-color: var(--st-fixed); color: var(--st-fixed); font-weight: 700; }
.progress .step.done::before { content: "✓ "; }
.progress .step.current { border-top-color: var(--accent-text); color: var(--accent-text); font-weight: 700; }
.progress .step.current::before { content: "● "; }
.next { font-size: 1.02rem; margin: 0; }
.next.warn { color: var(--warn); }
@media (max-width: 340px) { .brand-name { display: none; } }
.banner { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-btn); padding: 12px 14px; font-size: 0.9rem; }
.banner.info { background: var(--notice); color: var(--notice-ink); }
.list-item { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-weight: 700; flex: none; }
.chatbox { display: flex; flex-direction: column; height: calc(100vh - 220px - var(--safe-bottom)); min-height: 320px; }
.chatbox .timeline { flex: 1; overflow-y: auto; padding: 4px 2px 12px; }
.drawer { position: fixed; inset: 0; z-index: 40; background: rgba(10, 15, 25, .45); display: flex; justify-content: flex-end; }
.drawer .panel { width: min(420px, 100%); height: 100%; background: var(--bg); overflow: auto; padding: calc(var(--safe-top) + 16px) 16px calc(var(--safe-bottom) + 16px); }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(10, 15, 25, .45); display: grid; place-items: end center; }
.modal .panel { width: min(560px, 100%); background: var(--surface); border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; padding: 22px 18px calc(var(--safe-bottom) + 22px); }
@media (min-width: 640px) { .modal { place-items: center; } .modal .panel { border-radius: var(--radius-sheet); } }
#toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 60; max-width: calc(100% - 32px); font-size: 0.92rem; }
.login { max-width: 420px; margin: 0 auto; padding: calc(var(--safe-top) + 40px) 16px 40px; }
.login .logo { width: 56px; height: 56px; }
.login-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.or-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.passkey-btn { min-height: 48px; font-size: 16px; }
.login-top .login-lang { width: auto; min-width: 140px; }
.demo-accounts button { text-align: left; }
@media (prefers-reduced-motion: no-preference) { .card, .btn, .kpi { transition: border-color .15s, background .15s; } }

/* report: ten issue-type tiles */
.type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.type-tile { min-height: 96px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 12px 14px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; font-size: 1rem; font-weight: 700; line-height: 1.25; box-shadow: var(--shadow-1); }
.type-tile:hover { border-color: var(--accent-text); }
.type-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.type-tile.urgent .type-icon { background: var(--bad-soft); color: var(--bad); }
@media (min-width: 700px) { .type-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* top bar language picker (office) */
.lang-picker { flex: 0 0 auto !important; max-width: 140px !important; }

/* analytics */
.small-btn { padding: 6px 10px; font-size: 0.85rem; min-height: 36px; }
.legend::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend.created::before { background: var(--accent); }
.legend.resolved::before { background: var(--ok); }
.bar-chart { display: grid; gap: 6px; height: 200px; align-items: end; border-bottom: 1px solid var(--line); }
.bar-col { height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border: 0; background: transparent; padding: 0; cursor: pointer; border-radius: 6px; }
.bar-col:hover, .bar-col:focus-visible { background: var(--surface-2); outline: none; }
.bar { width: 40%; min-height: 2px; border-radius: 4px 4px 0 0; }
.bar.created { background: var(--accent); }
.bar.resolved { background: var(--ok); }
.bar-labels { display: grid; gap: 6px; font-size: 0.75rem; color: var(--muted); text-align: center; }
.grid-wide { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 2.5rem; gap: 10px; align-items: center; min-height: 34px; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; border-radius: 8px; padding: 2px 4px; }
.hbar:hover, .hbar:focus-visible { background: var(--surface-2); outline: none; }
.hbar b { text-align: right; }
.hbar-track { height: 12px; border-radius: 6px; background: var(--surface-2); }
.hbar-track span { display: block; height: 12px; border-radius: 6px; background: var(--accent); }
.list-item.linkish { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; color: inherit; }
.good { color: var(--ok); font-weight: 600; }
.warn-text { color: var(--warn); font-weight: 600; }
.small-btn svg { width: 18px; height: 18px; }

/* owner home: fixed and closed issues collapsed into one group */
.done-group > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.done-group > summary::-webkit-details-marker { display: none; }
.done-group > summary::after { content: "›"; display: inline-block; margin-left: auto; font-size: 1.4rem; color: var(--muted); transition: transform .15s; }
.done-group[open] > summary::after { transform: rotate(90deg); }
.done-group[open] > summary { margin-bottom: 12px; }

/* sign out at the bottom of the office side menu */
.shell.staff .sidebar .sign-out { margin-top: auto; color: var(--muted); border-top: 1px solid var(--line); border-radius: 0; padding-top: 14px; }
.sidebar .sign-out { display: none; }
@media (min-width: 980px) { .shell.staff .sidebar .sign-out { display: flex; } }

/* Office dashboard: greeting and "Needs your attention" */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dash-head h1 { margin: 0; }
.att-card { padding: 20px; border-radius: 16px; }
.att-card h2 { margin: 0 0 6px; font-family: Manrope, var(--font); font-size: 19px; font-weight: 800; }
.att-row { display: grid; grid-template-columns: minmax(150px, auto) 1fr auto auto; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.att-row:first-of-type { border-top: 0; }
.att-row:hover .att-title { text-decoration: underline; }
.att-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.att-row .pill { justify-self: start; }
.att-title { font-weight: 700; }
.att-main { min-width: 0; }
.att-main > * { overflow: hidden; text-overflow: ellipsis; }
.att-btn { min-height: 40px; }
@media (max-width: 640px) {
  .att-row { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .att-row .pill { grid-column: 1 / -1; }
  .att-row .reporters { grid-row: 2; grid-column: 2; }
  .att-btn { grid-column: 1 / -1; width: 100%; }
}

/* Office team page and the first-run card for a new office */
.team-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1fr) auto; gap: 14px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.team-row:first-of-type { border-top: 0; padding-top: 0; }
.team-who > div { overflow-wrap: anywhere; }
.team-actions { justify-content: flex-end; }
.comm-pick { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.comm-pick legend { padding: 0; margin-bottom: 4px; }
.danger-text { color: var(--danger, #8E1F1F); }
.empty-start { padding: 24px; border-radius: 16px; }
@media (max-width: 640px) {
  .team-row { grid-template-columns: 1fr; gap: 10px; }
  .team-actions { justify-content: flex-start; }
}
.team-invite { border-top: 1px solid var(--line); padding-top: 16px; }
