/* Shared branding and intrinsic sizing; loaded after the original component styles. */
@font-face {
  font-family: 'IBM Plex Sans Condensed';
  src: url('/assets/fonts/ibm-plex-sans-condensed-semibold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
.brand { gap: 12px; margin-left: 0; white-space: nowrap; }
.brand-icons { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.brand .brand-mark { flex: none; width: 38px; height: 38px; padding: 9px; gap: 3px; border-radius: 10px; background: linear-gradient(145deg, #8c7cff, #6552d4); box-shadow: 0 5px 13px rgba(104,84,213,.22); }
.brand .brand-mark span { flex: none; width: 4px; border-radius: 3px; background: #fff; }
.brand .brand-mark span:nth-child(1) { height: 10px; }
.brand .brand-mark span:nth-child(2) { height: 17px; }
.brand .brand-mark span:nth-child(3) { height: 13px; }
.brand-wordmark { flex-direction: column; align-items: flex-start; gap: 0; }
.brand-sber-name { color: #22283a; font-family: 'IBM Plex Sans Condensed', 'Arial Narrow', sans-serif; font-size: 20px; line-height: .8; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; transform: scale(.96, .8); transform-origin: left bottom; }
.brand-ritm-name { color: #22283a; font-family: var(--display); font-size: 26px; line-height: .9; font-weight: 800; letter-spacing: -1.25px; }
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .brand-sber-name {
    background-image: linear-gradient(110deg, #b89b08 0%, #54af36 30%, #1ba880 62%, #1386c8 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}
@media (forced-colors: active) {
  .brand-sber-name { background: none; color: CanvasText; -webkit-text-fill-color: CanvasText; }
}
.sidebar .brand > .brand-wordmark, .auth-view .brand > .brand-wordmark { display: flex; }
.main-content, .view-section, .report-layout > *, .content-grid > *,
.managers-page-grid > *, .field-row > *, .goal-row > *, .metric-fields > *,
.filter-group, .period-picker, .stat-group-cards > * { min-width: 0; }
.field-row, .goal-row, .metric-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-field input, .form-field select, .number-input-wrap input { min-width: 0; width: 100%; }
.number-input-wrap span { flex: none; }
.toolbar { flex-wrap: wrap; gap: 14px; }
.period-filter-group { flex: 1 1 100%; }
.period-picker { flex-wrap: wrap; }
.date-filter { flex: none; }
.stat-foot { flex-wrap: wrap; row-gap: 8px; }
.stat-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-group-cards { grid-template-columns: minmax(0, 1fr); }
.two-gis-icon, .icon-two-gis { background: #f0edfc; color: #6553ca; }
.pill-two-gis, .chip-two-gis { background: #f0edfc; color: #6553ca; }
#twoGisProgress, .plan-metric-two-gis .mini-track i, .summary-track-two-gis i { background: #8873dc; }
.legend-two-gis { display: block; width: 8px; height: 8px; border-radius: 50%; background: #6553ca; }
.plan-metric-two-gis { background: #f8f6ff; border-color: #e9e2fc; }
.content-grid { grid-template-columns: minmax(0, 1fr); }
.plan-summary-metrics, .plan-streams { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.manager-form .goal-row { grid-template-columns: minmax(0, 1fr); }
.manager-form .goal-row label { min-height: 0; }
.metric-fields.single-metric { grid-template-columns: minmax(0, 1fr); }
.two-gis-title { padding-top: 16px; border-top: 1px solid #f0f1f4; }
.manager-item-copy span { white-space: normal; line-height: 1.5; }
.stat-value { overflow-wrap: anywhere; line-height: 1.15; }
.panel-heading { gap: 12px; }
.panel-heading > div, .entry-manager-name strong { min-width: 0; }
.panel-heading p, .stat-group-title p { line-height: 1.5; }
.plan-streams { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plan-streams > .plan-metric { display: flex; flex-direction: column; }
.plan-streams > .plan-metric > .rhythm-stat-grid { margin-top: auto; }
.plan-streams > .plan-metric > .manager-funnel { margin-bottom: 8px; }
.plan-list { padding-right: 0; }
.plan-metric-heading { flex-wrap: wrap; }
.rhythm-stat strong { max-width: 100%; overflow-wrap: anywhere; }
.rhythm-stat-runrate { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 9px; }
.rhythm-stat-runrate .runrate-heading { flex: 1 1 100%; flex-direction: row; align-items: baseline; gap: 6px; }
.rhythm-stat-runrate .runrate-heading strong { font-size: 15px; }
.rhythm-stat-runrate .runrate-heading small { font-size: 11px; }
.rhythm-stat-runrate .runrate-value { flex-wrap: wrap; white-space: normal; gap: 4px; }
.rhythm-stat-runrate .runrate-value strong, .rhythm-stat-runrate em strong { font-size: 14px; line-height: 1.4; white-space: nowrap; }
.rhythm-stat-runrate em { grid-column: auto; white-space: normal; font-size: 11px; }
.plan-summary-metric-top { flex-wrap: wrap; }
.plan-summary-metric small { white-space: normal; overflow: visible; line-height: 1.5; }
.entry-manager-name strong, .manager-item-copy strong { overflow-wrap: anywhere; }
.entry-manager-name .small-avatar { flex: none; }
.quarter-card .entry-quarter-list {
  max-height: 440px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #b9b1df #f0eef8;
  overscroll-behavior-y: contain;
}
.quarter-card .entry-quarter-list::-webkit-scrollbar { width: 6px; }
.quarter-card .entry-quarter-list::-webkit-scrollbar-track { background: #f0eef8; border-radius: 6px; }
.quarter-card .entry-quarter-list::-webkit-scrollbar-thumb { background: #b9b1df; border-radius: 6px; }
.quarter-card .entry-quarter-list::-webkit-scrollbar-thumb:hover { background: #9c8fd0; }
.quarter-card .entry-quarter-list:focus-visible { outline: 2px solid #a99cf1; outline-offset: 3px; border-radius: 4px; }
.quarter-card .entry-manager.entry-manager-self {
  position: sticky; top: 0; z-index: 1; margin: 4px 0 8px; padding: 12px;
  border: 1px solid #ded8f8; border-radius: 12px; background: #f3f0ff;
  box-shadow: 0 4px 10px rgba(92,73,170,.06);
}
.entry-manager-self .entry-manager-name strong { flex: 1; }
.entry-self-label { flex: none; padding: 3px 7px; border-radius: 6px; background: #e4ddff; color: #6550bd; font-size: 11px; font-weight: 600; }
.managers-page-grid { align-items: start; }
.managers-setup-panel { min-height: 560px; }
.managers-list-panel { display: flex; flex-direction: column; height: var(--manager-panel-height, 560px); min-height: 0; overflow: hidden; }
.managers-list-panel > .panel-heading, .managers-list-panel > .manager-list-actions, .managers-list-panel > .manager-page-note { flex: none; }
.managers-list-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 8px;
  scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #b9b1df #f0eef8;
  overscroll-behavior-y: contain;
}
.managers-list-scroll::-webkit-scrollbar { width: 6px; }
.managers-list-scroll::-webkit-scrollbar-track { background: #f0eef8; border-radius: 6px; }
.managers-list-scroll::-webkit-scrollbar-thumb { background: #b9b1df; border-radius: 6px; }
.managers-list-scroll::-webkit-scrollbar-thumb:hover { background: #9c8fd0; }
.managers-list-scroll:focus-visible { outline: 2px solid #a99cf1; outline-offset: 2px; border-radius: 4px; }
.managers-list-panel .manager-list { overflow: visible; max-height: none; margin-top: 0; }
.managers-list-panel #managerList .manager-item {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) 36px 36px; align-items: center;
  gap: 8px; min-height: 70px; padding: 10px 2px;
}
.managers-list-panel #managerList .manager-item-copy { grid-column: auto; }
.managers-list-panel #managerList .manager-edit, .managers-list-panel #managerList .manager-delete { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; font-size: 22px; }
.manager-edit svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.modal-card.manager-editor-card { width: min(960px, 100%); max-width: 960px; padding: 28px; }
.manager-editor-card .modal-heading { margin-bottom: 24px; }
.manager-editor-sections { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 28px; }
.manager-editor-sections > section { min-width: 0; }
.manager-editor-section-heading { margin-bottom: 18px; }
.manager-editor-section-heading h3 { margin: 0 0 6px; font-size: 17px; line-height: 1.4; color: var(--ink); }
.manager-editor-section-heading p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.manager-editor-card .manager-form { margin: 0; padding: 0; background: none; border: 0; gap: 16px; }
.manager-editor-card .manager-form input { height: 44px; font-size: 15px; }
.manager-editor-card .manager-form > .button { width: 100%; min-height: 44px; padding: 10px 12px; font-size: 13px; line-height: 1.4; white-space: normal; }
.manager-editor-reports { border-left: 1px solid var(--line); padding-left: 28px; }
.manager-editor-card .manager-stats-list { display: grid; gap: 12px; max-height: 450px; overflow-y: auto; padding: 0 8px 3px 0; scrollbar-width: thin; scrollbar-color: #b9b1df #f0eef8; }
.manager-editor-card .manager-stats-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.manager-editor-card .manager-stats-fields label { font-size: 11px; line-height: 1.4; }
.manager-editor-card .manager-stats-fields input { height: 40px; font-size: 14px; }
.manager-editor-footer { display: flex; justify-content: flex-end; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.chart-wrap { height: 200px; min-width: 0; }
.chart-wrap svg { display: block; overflow: hidden; }
.trend-panel .panel-heading { flex-wrap: wrap; }
.chart-legend { flex-wrap: wrap; max-width: none; justify-content: flex-start; }
.chart-legend span { white-space: nowrap; }
.table-scroll { max-width: 100%; overscroll-behavior-inline: contain; }
.modal-backdrop { overflow-y: auto; }
body:has(.modal-backdrop:not(.hidden)) { overflow: hidden; }
.modal-card { max-height: calc(100dvh - 40px); }
.modal-heading > div { min-width: 0; }
.modal-heading h2 { overflow-wrap: anywhere; }
.modal-close { flex: none; }
.toast { max-width: calc(100vw - 32px); width: max-content; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }

.analytics-period-note { margin: 18px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.product-funnel { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 10px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.product-funnel > span { display: inline-flex; align-items: baseline; gap: 6px; }
.product-funnel strong { color: var(--ink); font-size: 15px; }
.product-funnel .conversion-pending { flex-basis: 100%; color: #aa7624; font-size: 11px; }
.team-product-rhythm { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.team-rr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 10px; border-radius: 9px; background: #f5f6f9; color: #626b7c; }
.team-rr > span { font-size: 14px; font-weight: 700; }
.team-rr > span small { display: block; font-size: 10px; line-height: 1.4; font-weight: 400; }
.team-rr > strong, .team-rr > b { font-size: 14px; line-height: 1.4; white-space: nowrap; }
.team-rr > strong small { font-size: 11px; font-weight: 400; }
.team-rr-on-track { background: #eaf7ef; color: #357655; }
.team-rr-behind { background: #fff0ee; color: #af5751; }
.team-pace-details { margin-top: 10px; }
.team-pace-details > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; list-style: none; color: #6d62a0; font-size: 12px; }
.team-pace-details > summary::-webkit-details-marker { display: none; }
.team-pace-details[open] > summary > span { transform: rotate(180deg); }
.team-pace-details > p { margin: 6px 0 10px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.team-pace-grid { display: grid; grid-template-columns: minmax(0, 1fr) repeat(2, minmax(0, .8fr)); gap: 8px; align-items: center; font-size: 12px; }
.team-pace-grid > span { color: var(--muted); }
.team-pace-grid > :nth-child(3n+2), .team-pace-grid > :nth-child(3n) { text-align: right; }
.team-pace-grid > strong { font-size: 14px; }
.manager-funnel { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 10px; font-size: 11px; line-height: 1.6; color: #7c8393; }
.manager-funnel small { flex-basis: 100%; color: #aa7624; }
.weekly-conversion-section { padding: 18px; margin-bottom: 24px; border: 1px solid #e7e0fc; border-radius: 12px; background: #faf8ff; }
.weekly-conversion-section .manager-editor-section-heading { margin-bottom: 14px; }
.conversion-form { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
.conversion-form .form-field { min-width: 0; }
.conversion-form .form-field input { height: 44px; font-size: 15px; min-width: 0; }
.conversion-form .button { min-height: 44px; padding: 10px 12px; font-size: 12px; white-space: normal; line-height: 1.4; }
.manager-editor-card > .modal-heading { position: sticky; top: 0; z-index: 3; padding-block: 8px; background: #fff; border-bottom: 1px solid var(--line); }
.manager-editor-card .manager-stats-fields.daily-meetings { grid-template-columns: minmax(0, 1fr); }
.daily-product-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; padding: 12px; border: 1px solid #ece9f4; border-radius: 9px; min-width: 0; }
.daily-product-fields legend { padding: 0 6px; color: #555168; font-size: 12px; font-weight: 600; }
.daily-product-fields > label:not(.manual-deals-option) { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.daily-product-fields input[type="number"] { width: 100%; min-width: 0; height: 42px; padding: 0 9px; border: 1px solid #e5e7ed; border-radius: 6px; font-size: 14px; color: var(--ink); background: #fff; }
.daily-product-fields input[readonly] { background: #f5f6fa; color: #7d8292; }
.manual-deals-option { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: #696075; font-size: 11px; line-height: 1.5; cursor: pointer; }
.manual-deals-option input { flex: none; width: 17px; height: 17px; margin: 0; accent-color: var(--purple); }
.daily-conversion-note { grid-column: 1 / -1; color: var(--muted); font-size: 10px; line-height: 1.5; }
.chart-metric-controls { margin-bottom: 8px; }
.stat-group .stat-foot { flex-direction: row; align-items: center; }

@media (max-width: 720px) {
  .analytics-period-note { font-size: 11px; }
  .weekly-conversion-section { padding: 14px 12px; }
  .conversion-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conversion-form > :first-child, .conversion-form > .button { grid-column: 1 / -1; }
  .conversion-form .form-field input, .daily-product-fields input[type="number"] { height: 48px; font-size: 16px; }
  .conversion-form .form-field label { font-size: 10px; }
  .team-rr > strong, .team-rr > b { font-size: 15px; }
}

.forecast-nav-label { min-width: 0; white-space: normal; line-height: 1.3; }
.forecast-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px; min-height: min(520px, calc(100dvh - 230px));
  margin-top: 24px; padding: 40px 24px; text-align: center;
}
.forecast-animations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 24px; width: min(544px, 100%); }
.forecast-animation { display: block; width: 100%; min-width: 0; height: auto; aspect-ratio: 1; object-fit: contain; }
.forecast-placeholder h2 { margin: 0; color: var(--ink); font-size: 26px; line-height: 1.3; letter-spacing: -.5px; }

@media (min-width: 721px) and (max-width: 1100px) {
  .sidebar { width: 215px; padding-inline: 13px; }
  .sidebar .brand { gap: 7px; }
  .sidebar .brand-icons { gap: 6px; }
  .stat-groups { grid-template-columns: minmax(0, 1fr); }
  .plan-manager-summary { grid-template-columns: minmax(0, 1fr); }
  .plan-expand-hint { grid-column: 1; margin: 0; }
}

@media (max-width: 720px) {
  /* Full-width content with a persistent, labelled bottom navigation. */
  .app-shell { min-height: 100dvh; }
  .sidebar {
    position: sticky; inset: 0 0 auto; width: 100%; min-height: 68px;
    padding: 14px 18px; flex-direction: row; align-items: center;
    border-right: 0; border-bottom: 1px solid rgba(224,228,238,.78);
    box-shadow: 0 4px 20px rgba(37,46,74,.035);
  }
  .sidebar .brand { margin: 0; gap: 9px; }
  .sidebar-navigation {
    position: fixed; inset: auto 0 0; display: flex; align-items: stretch;
    gap: 6px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.97); border-top: 1px solid #e4e7ef;
    box-shadow: 0 -6px 24px rgba(40,47,74,.06);
  }
  /* Keep fixed navigation relative to the viewport, not a blurred ancestor. */
  .sidebar { backdrop-filter: none; -webkit-backdrop-filter: none; background: #fbfcff; }
  .sidebar .main-nav { display: contents; }
  .sidebar .nav-item {
    display: flex; flex: 1 1 0; min-width: 0; width: auto; height: 64px;
    flex-direction: column; justify-content: center; gap: 5px;
    padding: 6px 4px; font-size: 11px; line-height: 1.2; border-radius: 12px;
  }
  .sidebar .nav-item:hover { transform: none; }
  .sidebar .forecast-nav-label { max-width: 100%; text-align: center; }
  .forecast-placeholder { min-height: 370px; padding: 32px 20px; margin-top: 20px; }
  .forecast-animations { width: min(452px, 100%); gap: 12px; }
  .forecast-placeholder h2 { font-size: 23px; }
  .sidebar .nav-icon { height: 20px; width: 20px; font-size: 22px; }
  .sidebar .workspace-label, .sidebar .sidebar-divider, .sidebar-bottom { display: none; }
  .main-content { margin-left: 0; padding: 0 16px calc(100px + env(safe-area-inset-bottom)); }
  .topbar { height: 52px; gap: 10px; background: transparent; backdrop-filter: none; }
  .breadcrumbs { min-width: 0; gap: 7px; font-size: 11px; }
  #crumbSection, .crumb-slash { display: none; }
  .topbar-actions { flex: none; gap: 8px; }
  .icon-button, .mobile-logout { width: 42px; height: 42px; padding: 0; }
  .top-avatar { display: none; }
  .view-section { padding-top: 20px; }
  .heading-row { flex-wrap: wrap; align-items: center; gap: 14px; }
  .page-heading h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.8px; overflow-wrap: anywhere; }
  .eyebrow { font-size: 10px; line-height: 1.5; }
  .subtitle { font-size: 13px; max-width: none; line-height: 1.6; }
  .button { min-height: 44px; height: auto; padding: 11px 14px; font-size: 13px; }
  .heading-row .button { width: auto; padding: 10px 14px; font-size: 12px; }
  .heading-row .button-plus { font-size: 17px; }
  .panel, .stat-group, .quarter-card { border-radius: 14px; }
  .panel-heading h2, .completion-panel .panel-heading h2 { font-size: 17px; line-height: 1.3; }
  .panel-heading p, .completion-panel .panel-heading p { font-size: 12px; line-height: 1.55; }

  /* Native controls stay inside their grid cells, including Safari date inputs. */
  input, select, .form-field input, .form-field select, .number-input-wrap input,
  .date-filter input, .select-control, .auth-input, .manager-stats-fields input { font-size: 16px; }
  .form-field input, .form-field select, .manager-form .form-field input,
  .auth-input, .select-control, .manager-stats-fields input { height: 48px; max-width: 100%; }
  input[type="date"] { min-width: 0; min-inline-size: 0; text-align: left; }
  input[type="date"]::-webkit-date-and-time-value { text-align: left; }
  .form-field label, .number-field label { font-size: 11px; letter-spacing: .2px; line-height: 1.4; }
  .report-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 20px; }
  .report-form { padding: 20px 16px; }
  .report-form .field-row { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .metric-fields { gap: 12px; }
  .number-input-wrap { height: 52px; padding-inline: 12px; border-radius: 10px; }
  .number-input-wrap span { font-size: 12px; }
  .form-section-title h2 { font-size: 17px; }
  .form-section-title p { font-size: 12px; }
  .form-actions .button { width: 100%; min-height: 48px; font-size: 15px; }
  .report-aside { grid-template-columns: minmax(0, 1fr); }
  .quarter-card { padding: 20px 16px; }
  .quarter-label { font-size: 12px; letter-spacing: .3px; }
  .quarter-card > strong { font-size: 21px; }
  .quarter-card p { font-size: 12px; }
  .quarter-card .entry-quarter-list { max-height: 500px; }
  .entry-manager { padding: 14px 0; }
  .entry-manager-name strong { font-size: 14px; line-height: 1.4; }
  .entry-manager-metrics { padding-left: 29px; gap: 8px; }
  .entry-manager-metrics span { gap: 10px; flex-wrap: wrap; font-size: 12px; }
  .entry-manager-metrics b { font-size: 14px; }
  .text-button, .quarter-card .text-button { font-size: 12px; min-height: 40px; }

  .toolbar { margin-top: 20px; padding: 16px; gap: 14px 10px; }
  .toolbar .filter-group { flex: 1 1 100%; width: 100%; gap: 8px; }
  .filter-label { font-size: 10px; }
  .period-picker { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; gap: 10px; }
  .date-filter { width: 100%; height: auto; padding: 0; border: 0; background: none; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; }
  .date-filter input { width: 100%; height: 46px; padding: 6px; border: 1px solid #e4e7ef; border-radius: 8px; background: white; font-size: 16px; }
  .quarter-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .quarter-shortcuts button { width: 100%; height: 40px; padding: 0 6px; font-size: 12px; }
  .quarter-shortcuts [data-current-week] { grid-column: 1 / -1; }
  .toolbar > .button { width: auto; flex: 1 1 140px; font-size: 12px; padding-inline: 9px; }
  .manager-self-label { height: auto; min-height: 44px; padding: 10px; font-size: 14px; overflow-wrap: anywhere; }
  .stat-groups { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .stat-group { padding: 14px; }
  .stat-group-title h2 { font-size: 17px; }
  .stat-group-title p { font-size: 11px; }
  .stat-group-cards { gap: 10px; }
  .stat-group-cards .stat-card { padding: 14px 12px; min-height: 150px; }
  .stat-top { font-size: 11px; gap: 5px; }
  .stat-top > span:first-child { min-width: 0; }
  .stat-icon { flex: none; width: 24px; height: 24px; }
  .stat-value { margin: 14px 0 10px; font-size: 29px; letter-spacing: -.6px; }
  .stat-value small { display: block; margin-top: 4px; font-size: 13px; }
  .stat-foot { align-items: flex-start; flex-direction: column; gap: 8px; }
  .stat-caption { font-size: 11px; line-height: 1.4; }
  .stat-group .tiny-pill { font-size: 16px; padding: 6px 9px; }
  .progress-track { height: 4px; }
  .content-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; }
  .trend-panel, .completion-panel { min-height: 0; padding: 18px 16px; }
  .chart-legend { gap: 12px; max-width: none; justify-content: flex-start; }
  .chart-legend span { font-size: 11px; }
  .chart-controls { display: flex; padding: 3px; }
  .chart-controls button { flex: 1; height: 40px; padding-inline: 8px; font-size: 12px; }
  .chart-wrap { height: 200px; margin-top: 16px; }
  .chart-tooltip strong, .chart-tooltip span { font-size: 12px; }
  .completion-panel .plan-list {
    max-height: 560px;
    max-height: min(65dvh, 560px);
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 10px 4px 4px;
    gap: 12px;
    align-content: start;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #b9b1df #f0eef8;
  }
  .completion-panel .plan-list::-webkit-scrollbar { width: 8px; }
  .completion-panel .plan-list::-webkit-scrollbar-track { background: #f0eef8; border-radius: 8px; }
  .completion-panel .plan-list::-webkit-scrollbar-thumb { min-height: 40px; background: #b9b1df; border-radius: 8px; }
  .completion-panel .plan-list::-webkit-scrollbar-thumb:hover { background: #9c8fd0; }
  .completion-panel .plan-list:focus-visible { outline: 2px solid #a99cf1; outline-offset: 3px; border-radius: 4px; }
  .plan-manager-summary { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px; }
  .plan-manager-name-copy strong { font-size: 13px; text-transform: none; }
  .plan-manager-name-copy small { font-size: 12px; }
  .plan-summary-metrics { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .plan-summary-metric-top { display: grid; grid-template-columns: minmax(0, 1fr); align-items: flex-start; gap: 4px; }
  .plan-summary-metric-top span { font-size: 11px; white-space: normal; }
  .plan-summary-metric-top strong { font-size: 13px; white-space: normal; }
  .plan-summary-metric small { font-size: 10px; }
  .plan-expand-hint { grid-column: 1; margin: 0; font-size: 12px; }
  .plan-manager-details { padding: 0 12px 12px; }
  .plan-streams { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .plan-metric { padding: 14px 12px; }
  .plan-metric-heading strong { font-size: 14px; }
  .plan-metric-heading span { font-size: 12px; }
  .rhythm-stat-grid { gap: 0; }
  .rhythm-stat:not(.rhythm-stat-runrate) { min-height: 68px; padding: 10px 8px; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 7px; }
  .rhythm-stat:not(.rhythm-stat-runrate) > span { font-size: 11px; }
  .rhythm-stat:not(.rhythm-stat-runrate) strong { font-size: 18px; white-space: nowrap; }
  .rhythm-stat-runrate { padding: 12px; }
  .missing-reports-panel { margin-top: 14px; padding: 18px 16px; }
  .missing-report-person { flex-wrap: wrap; gap: 8px; padding: 12px; }
  .missing-report-person strong { flex: 1; white-space: normal; overflow-wrap: anywhere; font-size: 13px; }
  .missing-report-status { font-size: 11px; }

  /* Reports read as compact cards rather than a clipped desktop table. */
  .reports-panel { margin-top: 14px; }
  .reports-heading { padding: 18px 16px; flex-wrap: wrap; }
  .reports-panel table, .reports-panel tbody { display: block; min-width: 0; }
  .reports-panel thead { display: none; }
  .reports-panel tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 8px; padding: 16px; border-top: 1px solid #e9ebf0; position: relative; }
  .reports-panel td { display: block; height: auto; min-width: 0; border: 0; padding: 0; white-space: normal; font-size: 12px; }
  .reports-panel td:first-child, .reports-panel td:nth-child(2) { grid-column: 1 / -1; }
  .reports-panel td:first-child { padding-right: 36px; }
  .reports-panel .manager-cell { align-items: flex-start; overflow-wrap: anywhere; font-size: 14px; }
  .reports-panel .table-avatar { flex: none; }
  .reports-panel td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 6px; color: #858b9b; font-size: 10px; }
  .reports-panel .metric-chip { display: inline-block; padding: 6px 8px; max-width: 100%; font-size: 13px; overflow-wrap: anywhere; }
  .reports-panel td.report-actions { position: absolute; right: 12px; top: 10px; }
  .reports-panel .row-action { width: 40px; height: 40px; }
  .reports-panel .table-empty { display: block; }
  .reports-panel .table-empty td { padding: 12px 0; line-height: 1.6; }
  .page-footer { font-size: 11px; line-height: 1.5; padding-top: 16px; }

  .managers-page-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .managers-setup-panel, .managers-list-panel { padding: 18px 16px; }
  .manager-form { padding: 14px 12px; gap: 16px; }
  .goal-row { gap: 12px; }
  .goal-row label { min-height: 30px; }
  .managers-list-panel .manager-item { display: grid; grid-template-columns: 28px minmax(0,1fr) 40px 40px; gap: 10px 6px; padding: 16px 0; }
  .manager-item-copy { grid-column: 2; }
  .managers-list-panel .manager-item-copy strong { font-size: 14px; line-height: 1.5; }
  .managers-list-panel .manager-item-copy span { font-size: 12px; line-height: 1.5; }
  .manager-edit, .manager-delete { width: 40px; height: 40px; font-size: 20px; }
  .manager-edit-stats { grid-column: 2 / -1; grid-row: 2; min-height: 40px; font-size: 12px; white-space: normal; }
  .manager-clear-stats, .manager-archive-delete { grid-column: 2 / -1; white-space: normal; font-size: 12px; min-height: 40px; }
  .manager-page-note { font-size: 12px; line-height: 1.6; }
  .clear-all-reports-button { width: 100%; white-space: normal; }
  .modal-backdrop { padding: 12px; }
  .modal-card { padding: 20px 16px; border-radius: 18px; max-height: calc(100dvh - 24px); }
  .modal-heading h2 { font-size: 21px; line-height: 1.3; }
  .modal-close { width: 40px; height: 40px; }
  .modal-intro { font-size: 13px; line-height: 1.6; }
  .modal-actions { flex-wrap: wrap; gap: 8px; }
  .modal-actions .button { flex: 1 1 100%; }
  .modal-card.manager-editor-card { padding: 20px 16px; }
  .manager-editor-sections { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .manager-editor-reports { border-left: 0; border-top: 1px solid var(--line); padding: 24px 0 0; }
  .manager-editor-card .manager-stats-list { max-height: none; overflow: visible; padding-right: 0; }
  .manager-editor-card .manager-stats-fields { grid-template-columns: minmax(0, 1fr); }
  .manager-editor-card .manager-form input, .manager-editor-card .manager-stats-fields input { height: 48px; font-size: 16px; }
  .manager-editor-footer .button { width: 100%; }
  .manager-stats-list { max-height: none; overflow: visible; padding: 0; }
  .manager-stats-fields { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .manager-stats-fields label { font-size: 12px; }
  .manager-stat-row-heading { flex-wrap: wrap; }
  .auth-view { min-height: 100dvh; padding: 24px 16px; }
  .auth-card { padding: 28px 22px; }
  .auth-card h1 { font-size: 27px; line-height: 1.3; }
  .auth-card .brand { margin-bottom: 28px; }
  .auth-label { font-size: 11px; }
  .auth-choice-button, .auth-submit { min-height: 50px; font-size: 14px; }
  .auth-back { min-height: 44px; font-size: 13px; }
  .remember-option { align-items: flex-start; gap: 10px; font-size: 12px; line-height: 1.5; }
  .remember-option input { flex: none; width: 18px; height: 18px; }
  .toast { bottom: calc(90px + env(safe-area-inset-bottom)); padding: 13px 16px; font-size: 13px; line-height: 1.5; }
}

/* Pending actions keep their place in the layout and remain readable. */
.loading-spinner { display: inline-block; flex: none; width: 17px; height: 17px; box-sizing: border-box; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: loading-turn .85s linear infinite; }
.button-loading { display: inline-flex; align-items: center; justify-content: center; gap: 9px; cursor: wait; }
.button-loading:disabled { opacity: .85; }
.is-busy input:disabled, .is-busy select:disabled { cursor: wait; }
.request-progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 10000; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity .15s ease; background: #eee9ff; }
.request-progress.visible { opacity: 1; }
.request-progress > span { display: block; width: 40%; height: 100%; background: linear-gradient(90deg, #9c82ff, #7455e8, #55cba1); transform: translateX(-110%); }
.request-progress.visible > span { animation: loading-travel 1.6s ease-in-out infinite; }
.loading-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.session-loading { text-align: center; }
.session-loading .auth-brand { justify-content: center; }
.session-spinner { width: 34px; height: 34px; margin: 8px 0 18px; border-width: 3px; color: #8064e7; }
.session-loading h1 { font-size: 24px; }
.session-loading .subtitle { margin-bottom: 0; }
@keyframes loading-turn { to { transform: rotate(360deg); } }
@keyframes loading-travel { from { transform: translateX(-110%); } to { transform: translateX(360%); } }
@media (prefers-reduced-motion: reduce) {
  .loading-spinner { animation: none; }
  .request-progress { transition: none; }
  .request-progress.visible > span { animation: none; width: 100%; transform: none; }
}

@media (max-width: 360px) {
  .main-content { padding-inline: 12px; }
  .stat-group-cards { grid-template-columns: minmax(0, 1fr); }
  .stat-group-cards .stat-card { min-height: 0; }
  .stat-foot { flex-direction: row; align-items: center; }
  .stat-value small { display: inline; }
  .plan-summary-metrics { grid-template-columns: minmax(0, 1fr); }
  .date-filter { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .date-filter span { display: none; }
  .date-filter input { font-size: 16px; padding: 8px 10px; }
  .goal-row { grid-template-columns: minmax(0, 1fr); }
  .goal-row label { min-height: 0; }
  .auth-card { padding-inline: 18px; }
}
