@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-semibold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Inter Tight";
  src: url("/static/fonts/inter-tight-black.ttf") format("truetype");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

* { box-sizing: border-box; }

:root {
  color-scheme: dark;
  --ink: #f4f3ed;
  --muted: #9b9e96;
  --surface: #191d19;
  --surface-2: #212621;
  --line: rgba(244, 243, 237, 0.13);
  --red: #e22734;
  --red-dark: #b91622;
  --green: #0f6a43;
  --lime: #badf4c;
  --paper: #eceae1;
  --black: #101310;
  --panel-padding: clamp(22px, 3vw, 34px);
  --panel-radius: 18px;
  --panel-border: 1px solid var(--line);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(244, 243, 237, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 243, 237, 0.025) 1px, transparent 1px),
    var(--black);
  background-size: 42px 42px;
  font-family: "Inter", Arial, sans-serif;
  font-size: 15px;
}

button,
input,
select,
textarea { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(186, 223, 76, 0.45);
  outline-offset: 3px;
}

.dashboard-kicker {
  color: var(--lime);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.dashboard-login-page {
  min-height: 100vh;
  background: var(--black);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  min-height: 100vh;
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(28px, 5vw, 68px);
  color: var(--black);
  background: var(--paper);
}

.login-brand > img {
  width: 220px;
  filter: brightness(0);
}

.login-brand-copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.login-brand-copy .dashboard-kicker { color: var(--red); }

.login-brand h1 {
  margin: 18px 0 28px;
  font-family: "Inter Tight", "Arial Black", sans-serif;
  font-size: clamp(78px, 10vw, 160px);
  font-weight: 900;
  letter-spacing: -0.075em;
  line-height: 0.74;
  text-transform: uppercase;
}

.login-brand p {
  max-width: 480px;
  margin: 0;
  color: #555951;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.5;
}

.login-index {
  position: absolute;
  right: -26px;
  bottom: -70px;
  color: rgba(16, 19, 16, 0.055);
  font-family: "Inter Tight", sans-serif;
  font-size: clamp(260px, 37vw, 580px);
  font-weight: 900;
  letter-spacing: -0.11em;
  line-height: 0.7;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: clamp(24px, 6vw, 88px);
  border-left: 1px solid var(--line);
}

.login-card {
  width: min(100%, 490px);
  padding: clamp(28px, 5vw, 52px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 18px 18px 0 rgba(226, 39, 52, 0.75);
}

.login-card h2 {
  margin: 14px 0 16px;
  font-family: "Inter Tight", sans-serif;
  font-size: clamp(42px, 5vw, 62px);
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.login-card > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.dashboard-login-form {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

.dashboard-login-form label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dashboard-login-form input {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  color: var(--ink);
  background: var(--black);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.dashboard-login-form input:focus { border-color: var(--lime); }

.dashboard-login-form button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  margin-top: 6px;
  padding: 0 20px;
  color: #101310;
  background: var(--lime);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.dashboard-login-form button:hover { background: #cbea66; }

.login-error {
  margin-top: 24px;
  padding: 14px 16px;
  color: #ffd8db;
  background: rgba(226, 39, 52, 0.12);
  border: 1px solid rgba(226, 39, 52, 0.42);
  border-radius: 12px;
  line-height: 1.5;
}

.login-error code {
  color: var(--ink);
  font-size: 12px;
}

.login-security {
  margin-top: 24px !important;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.dashboard-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px clamp(20px, 4vw, 58px);
  background: rgba(16, 19, 16, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.dashboard-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--ink);
  text-decoration: none;
}

.dashboard-brand img,
.month-brand img {
  width: 168px;
  filter: brightness(0) invert(1);
}

.dashboard-brand span {
  padding-left: 18px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.dashboard-navigation {
  position: absolute;
  left: 50%;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  transform: translateX(-50%);
}

.dashboard-navigation a {
  padding: 9px 15px;
  color: var(--muted);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.dashboard-navigation a:hover { color: var(--ink); }

.dashboard-navigation a[aria-current="page"] {
  color: var(--black);
  background: var(--lime);
}

.live-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.live-status i {
  width: 8px;
  height: 8px;
  background: var(--lime);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(186, 223, 76, 0.1);
}

.logout-button {
  min-height: 38px;
  padding: 0 16px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 99px;
  cursor: pointer;
  font-size: 12px;
}

.logout-button:hover {
  color: var(--black);
  background: var(--paper);
}

.dashboard-account-link {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--ink);
  border: 1px solid currentColor;
  border-radius: 50%;
  text-decoration: none;
}

.dashboard-account-link svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.dashboard-account-link:hover {
  color: var(--black);
  background: var(--paper);
}

.dashboard-main {
  width: min(1540px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(42px, 6vw, 84px) 0 54px;
}

.dashboard-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}

.dashboard-intro h1 {
  margin: 13px 0 8px;
  font-family: "Inter Tight", sans-serif;
  font-size: clamp(60px, 8vw, 118px);
  font-weight: 900;
  letter-spacing: -0.075em;
  line-height: 0.78;
}

.dashboard-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.period-switcher {
  display: flex;
  gap: 5px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
}

.period-switcher a {
  padding: 11px 16px;
  color: var(--muted);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.period-switcher a[aria-current="page"] {
  color: var(--black);
  background: var(--lime);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.metric-card {
  min-height: 190px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.metric-card > span,
.channel-metric > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric-card strong,
.channel-metric strong {
  display: block;
  margin-top: 32px;
  font-family: "Inter Tight", sans-serif;
  font-size: clamp(42px, 4vw, 64px);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.85;
}

.metric-card strong small {
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.metric-card p {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.metric-primary {
  color: var(--black);
  background: var(--lime);
  border-color: var(--lime);
}

.metric-primary > span,
.metric-primary p { color: rgba(16, 19, 16, 0.64); }

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(340px, 0.85fr);
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-page .panel--dark,
.dashboard-card {
  min-width: 0;
  padding: var(--panel-padding);
  background: var(--surface);
  border: var(--panel-border);
  border-radius: var(--panel-radius);
}

.dashboard-page .panel--flush { padding: 0; overflow: hidden; }
.dashboard-page .panel--flush.records-table-shell { overflow-x: auto; }
.dashboard-page .panel__header { margin-bottom: 28px; padding-bottom: 22px; border-bottom: var(--panel-border); }
.dashboard-page .panel__footer { margin-top: 22px; padding-top: 22px; border-top: var(--panel-border); }

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.card-heading h2,
.channel-heading h2 {
  margin: 8px 0 0;
  font-family: "Inter Tight", sans-serif;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.chart-total {
  font-family: "Inter Tight", sans-serif;
  font-size: 22px;
  font-weight: 900;
}

.column-chart-scroll { overflow-x: auto; }

.column-chart {
  display: grid;
  grid-template-columns: repeat(var(--days), minmax(12px, 1fr));
  align-items: end;
  gap: clamp(4px, 0.6vw, 10px);
  min-width: calc(var(--days) * 18px);
  height: 270px;
  padding-top: 26px;
  border-bottom: 1px solid var(--line);
}

.chart-column {
  position: relative;
  display: grid;
  grid-template-rows: 18px minmax(0, 1fr) 28px;
  align-items: end;
  height: 100%;
}

.chart-column > i {
  display: block;
  width: 100%;
  height: var(--height);
  min-height: 1px;
  background: var(--lime);
  border-radius: 5px 5px 0 0;
  transition: opacity 150ms ease;
}

.chart-column:hover > i { opacity: 0.74; }

.chart-value {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-column > small {
  align-self: center;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.horizontal-bars {
  display: grid;
  gap: 21px;
}

.horizontal-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 7px 12px;
}

.horizontal-bar > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  grid-column: 1 / -1;
  font-size: 12px;
}

.horizontal-bar > div span { color: var(--muted); }

.horizontal-bar > i {
  display: block;
  height: 8px;
  overflow: hidden;
  background: var(--black);
  border-radius: 99px;
}

.horizontal-bar > i b {
  display: block;
  height: 100%;
  background: var(--red);
  border-radius: inherit;
}

.horizontal-bar > small {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.channel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(60px, 8vw, 110px) 0 28px;
}

.channel-heading > p {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.channel-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.channel-metric {
  min-height: 166px;
  padding: 22px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.channel-metric strong {
  margin-top: 27px;
  font-size: clamp(36px, 3vw, 50px);
}

.channel-metric small {
  display: block;
  margin-top: 15px;
  color: var(--muted);
  font-size: 11px;
}

.channel-web { border-top: 4px solid var(--lime); }
.channel-telegram { border-top: 4px solid var(--red); }

.chart-legend {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.legend-web { background: var(--lime); }
.legend-telegram { background: var(--red); }

.activity-stack {
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  height: var(--height) !important;
  background: transparent !important;
}

.activity-stack b { display: block; min-height: 1px; }
.activity-web { background: var(--lime); }
.activity-telegram { background: var(--red); }

.funnel {
  display: grid;
  gap: 18px;
}

.funnel > div {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
}

.funnel span,
.funnel strong { font-size: 12px; }
.funnel strong { text-align: right; }

.funnel i {
  position: relative;
  display: block;
  height: 24px;
  overflow: hidden;
  background: var(--black);
  border-radius: 6px;
}

.funnel i::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--width);
  background: var(--lime);
  border-radius: inherit;
  content: "";
}

.compact-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.ranked-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rank;
}

.ranked-list li {
  display: grid;
  grid-template-columns: minmax(140px, 0.7fr) minmax(90px, 1fr) 40px;
  align-items: center;
  gap: 14px;
  counter-increment: rank;
}

.ranked-list li > span {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranked-list li > span::before {
  margin-right: 10px;
  color: var(--muted);
  content: "0" counter(rank);
  font-size: 9px;
}

.ranked-list li > i {
  height: 6px;
  overflow: hidden;
  background: var(--black);
  border-radius: 99px;
}

.ranked-list li > i b {
  display: block;
  height: 100%;
  background: var(--red);
}

.ranked-list li > strong {
  font-family: "Inter Tight", sans-serif;
  font-size: 18px;
  text-align: right;
}

.empty-metric {
  margin: 0;
  padding: 28px 0;
  color: var(--muted);
}

.dashboard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 34px 4px 0;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-footer p {
  max-width: 720px;
  margin: 0;
  line-height: 1.6;
}

.dashboard-footer a {
  color: var(--lime);
  text-decoration: none;
}

.messages-main {
  width: min(1720px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 40px;
}

.messages-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.messages-heading h1 {
  margin: 10px 0 0;
  font-family: "Inter Tight", sans-serif;
  font-size: clamp(48px, 6vw, 82px);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 0.82;
}

.messages-heading p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: right;
}

.messenger-shell {
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
  height: max(620px, calc(100vh - 222px));
  max-height: 900px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.conversation-sidebar {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: #151915;
  border-right: 1px solid var(--line);
}

.conversation-search {
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.conversation-search label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.conversation-search > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 13px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 11px;
}

.conversation-search > div:focus-within {
  border-color: rgba(186, 223, 76, 0.65);
}

.conversation-search span {
  color: var(--muted);
  font-size: 20px;
}

.conversation-search input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12px;
}

.conversation-search input::placeholder { color: #6f736b; }

.conversation-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.conversation-item {
  display: grid;
  width: 100%;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(244, 243, 237, 0.07);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.conversation-item[hidden] { display: none !important; }
.conversation-item:hover { background: rgba(244, 243, 237, 0.04); }
.conversation-item.is-active { background: rgba(186, 223, 76, 0.1); }

.conversation-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--black);
  background: var(--lime);
  border-radius: 50%;
  font-family: "Inter Tight", sans-serif;
  font-size: 21px;
  font-weight: 900;
  text-transform: uppercase;
}

.visitor-avatar {
  color: var(--ink);
  background: var(--red);
}

.conversation-copy { min-width: 0; }

.conversation-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.conversation-line strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-line time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
}

.conversation-preview,
.conversation-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-preview {
  margin-top: 6px;
  color: #b8bbb3;
  font-size: 11px;
}

.conversation-meta {
  margin-top: 7px;
  color: #777b73;
  font-size: 9px;
}

.conversation-limit,
.conversation-search-empty {
  margin: 0;
  padding: 14px 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.5;
}

.conversation-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  background:
    radial-gradient(circle at center, rgba(244, 243, 237, 0.035) 1px, transparent 1.5px),
    #111511;
  background-size: 24px 24px;
}

.visitor-stage {
  background:
    linear-gradient(rgba(186, 223, 76, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(186, 223, 76, 0.025) 1px, transparent 1px),
    #111511;
  background-size: 32px 32px;
}

.conversation-panel {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

.conversation-panel[hidden] { display: none !important; }

.conversation-panel-header {
  display: grid;
  min-height: 76px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 13px 22px;
  background: rgba(25, 29, 25, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(15px);
}

.conversation-panel-header h2 {
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-panel-header p {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-counts {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.conversation-back {
  display: none;
  color: var(--lime);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 12px;
}

.message-timeline {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 28px clamp(20px, 5vw, 70px);
  overscroll-behavior: contain;
}

.message-day {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

.message-day span,
.timeline-notice {
  padding: 7px 11px;
  color: #a8aca3;
  background: rgba(33, 38, 33, 0.92);
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 9px;
}

.timeline-notice {
  width: fit-content;
  margin: 0 auto 18px;
  text-align: center;
}

.message-row {
  display: flex;
  margin: 5px 0;
}

.message-incoming { justify-content: flex-start; }
.message-outgoing { justify-content: flex-end; }
.message-action,
.message-error { justify-content: center; }

.message-bubble {
  max-width: min(72%, 720px);
  padding: 10px 12px 7px;
  background: var(--surface-2);
  border: 1px solid rgba(244, 243, 237, 0.08);
  border-radius: 6px 15px 15px;
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.12);
}

.message-outgoing .message-bubble {
  color: var(--black);
  background: var(--lime);
  border-color: var(--lime);
  border-radius: 15px 6px 15px 15px;
}

.message-action .message-bubble,
.message-error .message-bubble {
  max-width: min(88%, 760px);
  padding: 7px 12px;
  color: #aaaea5;
  background: rgba(25, 29, 25, 0.9);
  border-radius: 99px;
  box-shadow: none;
  text-align: center;
}

.message-error .message-bubble {
  color: #ffd6d9;
  background: rgba(226, 39, 52, 0.16);
  border-color: rgba(226, 39, 52, 0.3);
}

.message-bubble p {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.visitor-event .message-bubble > strong {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.visitor-event.event-page .message-bubble { border-left: 3px solid var(--lime); }
.visitor-event.event-click .message-bubble { border-right: 3px solid var(--red); }

.visitor-event.event-form .message-bubble {
  border-right: 3px solid var(--green);
}

.visitor-event.event-details .message-bubble {
  border-right: 3px solid #e3a92f;
}

.visitor-event.event-scroll .message-bubble {
  color: #c4c7bf;
  border-color: rgba(186, 223, 76, 0.24);
}

.message-bubble footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 5px;
  color: #858980;
  font-size: 8px;
}

.message-outgoing .message-bubble footer { color: rgba(16, 19, 16, 0.62); }

.conversation-placeholder,
.messages-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 520px;
  color: var(--muted);
  text-align: center;
}

.conversation-placeholder > span,
.messages-empty > span {
  color: var(--lime);
  font-size: 54px;
}

.conversation-placeholder h2,
.messages-empty h2 {
  margin: 14px 0 6px;
  color: var(--ink);
  font-family: "Inter Tight", sans-serif;
  font-size: 32px;
}

.conversation-placeholder p,
.messages-empty p {
  max-width: 440px;
  margin: 0;
  line-height: 1.6;
}

.messages-empty {
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.records-main {
  width: min(1720px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 54px;
}

.records-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.records-heading h1 {
  margin: 10px 0 0;
  font-family: "Inter Tight", sans-serif;
  font-size: clamp(48px, 6vw, 82px);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 0.82;
}

.records-heading p {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: right;
}

.records-table-shell {
  overflow-x: auto;
  background: var(--surface);
  border: var(--panel-border);
  border-radius: var(--panel-radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
}

.records-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  text-align: left;
}

.records-table th {
  padding: 16px 18px;
  color: var(--muted);
  background: #151915;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.records-table td {
  max-width: 330px;
  padding: 17px 18px;
  border-bottom: 1px solid rgba(244, 243, 237, 0.07);
  vertical-align: top;
}

.records-table tbody tr:last-child td { border-bottom: 0; }
.records-table tbody tr:hover { background: rgba(244, 243, 237, 0.025); }

.records-table td > strong,
.records-table td > span,
.records-table td > small {
  display: block;
}

.records-table td > strong { font-size: 13px; line-height: 1.45; }
.records-table td > span { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.records-table td > small { margin-top: 7px; color: #747970; font-size: 10px; line-height: 1.45; }
.record-comment { min-width: 180px; white-space: pre-wrap; }

.record-actions-cell { width: 64px; text-align: right; }

.dashboard-record-edit {
  display: inline-grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

.dashboard-record-edit:hover,
.dashboard-record-edit:focus-visible {
  color: var(--black);
  background: var(--lime);
  border-color: var(--lime);
}

.dashboard-record-edit svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.dashboard-record-editor-row[hidden] { display: none; }
.dashboard-record-editor-row > td { padding: 0 !important; background: #111511; }

.dashboard-record-editor {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.dashboard-record-editor--compact {
  grid-template-columns: minmax(140px, 220px) auto;
  padding: 0;
  border: 0;
}

.records-table--compact { min-width: 0; }
.records-table--compact th { white-space: normal; }

.dashboard-record-editor label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-record-editor input:not([type="checkbox"]),
.dashboard-record-editor select,
.dashboard-record-editor textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  resize: vertical;
}

.dashboard-record-editor select { cursor: pointer; }
.dashboard-record-editor input[type="checkbox"] { accent-color: var(--lime); }

.dashboard-table-scroll { overflow-x: auto; }
.dashboard-table-scroll table { width: 100%; min-width: 760px; border-collapse: collapse; }
.dashboard-table-scroll th,
.dashboard-table-scroll td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.dashboard-table-scroll th { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.dashboard-table-scroll tbody tr:last-child td { border-bottom: 0; }

.dashboard-editor-comment { grid-column: span 2; }
.dashboard-editor-actions { display: flex; align-items: end; gap: 10px; }

.dashboard-editor-actions button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  font-weight: 600;
}

.dashboard-editor-cancel { color: var(--ink); background: transparent; }
.dashboard-editor-save { color: var(--black); background: var(--lime); border-color: var(--lime) !important; }
.dashboard-editor-save:disabled { cursor: wait; opacity: 0.6; }

.dashboard-editor-status {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-editor-status.error { color: #ff9ca3; }
.dashboard-editor-status.success { color: var(--lime); }

.record-badge {
  display: inline-block !important;
  margin: 0 !important;
  padding: 6px 9px;
  color: var(--ink) !important;
  background: rgba(244, 243, 237, 0.08);
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 10px !important;
  font-weight: 600;
  white-space: nowrap;
}

.status-confirmed,
.status-created { color: var(--black) !important; background: var(--lime); border-color: var(--lime); }
.status-in_progress { background: rgba(226, 39, 52, 0.18); border-color: rgba(226, 39, 52, 0.5); }
.status-completed { background: rgba(15, 106, 67, 0.45); border-color: rgba(186, 223, 76, 0.28); }
.status-cancelled_by_client,
.status-cancelled_by_owner,
.status-cancelled_by_washer,
.status-no_show { color: var(--muted) !important; }

.record-cars {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.record-cars li { font-size: 12px; line-height: 1.45; }
.record-cars li + li { padding-top: 6px; border-top: 1px solid rgba(244, 243, 237, 0.07); }

.records-empty {
  display: grid;
  min-height: 420px;
  place-items: center;
  align-content: center;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: center;
}

.records-empty > span {
  color: rgba(186, 223, 76, 0.14);
  font-family: "Inter Tight", sans-serif;
  font-size: 110px;
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 0.75;
}

.records-empty h2 { margin: 22px 0 10px; font-family: "Inter Tight", sans-serif; font-size: 36px; }
.records-empty p { max-width: 460px; margin: 0; color: var(--muted); line-height: 1.6; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .channel-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-brand span { display: none; }
  .messenger-shell { grid-template-columns: minmax(270px, 320px) minmax(0, 1fr); }
  .dashboard-record-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; border: 0; }
  .dashboard-layout,
  .compact-layout { grid-template-columns: 1fr; }
  .dashboard-intro,
  .channel-heading,
  .messages-heading,
  .records-heading { align-items: flex-start; flex-direction: column; }
  .messages-heading p,
  .records-heading p { text-align: left; }
  .dashboard-navigation {
    position: static;
    max-width: 56vw;
    overflow-x: auto;
    transform: none;
  }
}

@media (max-width: 680px) {
  .dashboard-record-editor { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .dashboard-editor-comment { grid-column: 1 / -1; }
  .dashboard-header { min-height: 66px; }
  .dashboard-brand img { width: 132px; }
  .dashboard-brand span,
  .live-status { display: none; }
  .dashboard-header { gap: 8px; padding-right: 12px; padding-left: 12px; }
  .dashboard-brand img { width: 112px; }
  .dashboard-navigation { max-width: calc(100vw - 190px); }
  .dashboard-navigation a { padding: 8px 10px; font-size: 10px; }
  .dashboard-header-actions { gap: 8px; }
  .logout-button { min-height: 34px; padding: 0 11px; font-size: 10px; }
  .dashboard-main { width: min(100% - 24px, 1540px); padding-top: 44px; }
  .dashboard-intro h1 { font-size: clamp(56px, 20vw, 82px); }
  .period-switcher { width: 100%; }
  .period-switcher a { flex: 1; text-align: center; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 158px; padding: 19px; }
  .metric-card strong { margin-top: 25px; font-size: 42px; }
  .channel-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .channel-heading { padding-top: 72px; }
  .card-heading { flex-direction: column; }
  .dashboard-footer { align-items: flex-start; flex-direction: column; }
  .messages-main { width: 100%; padding: 28px 12px 12px; }
  .records-main { width: 100%; padding: 28px 12px 24px; }
  .messages-heading { padding: 0 3px; }
  .messenger-shell {
    display: block;
    height: calc(100vh - 190px);
    min-height: 560px;
    border-radius: 16px;
  }
  .conversation-sidebar { height: 100%; border-right: 0; }
  .conversation-stage { display: none; height: 100%; }
  .messenger-shell.is-thread-open .conversation-sidebar { display: none; }
  .messenger-shell.is-thread-open .conversation-stage { display: block; }
  .conversation-panel-header {
    grid-template-columns: auto 38px minmax(0, 1fr);
    min-height: 68px;
    padding: 10px 13px;
  }
  .conversation-panel-header .conversation-avatar { width: 38px; height: 38px; }
  .conversation-back { display: block; }
  .conversation-counts { display: none; }
  .message-timeline { padding: 20px 12px; }
  .message-bubble { max-width: 86%; }
}

@media (max-width: 430px) {
  .dashboard-brand { display: none; }
  .dashboard-navigation { max-width: calc(100vw - 82px); }
  .metric-grid,
  .channel-metrics { grid-template-columns: 1fr 1fr; }
  .metric-card,
  .channel-metric { min-height: 144px; padding: 17px; }
  .metric-card > span,
  .channel-metric > span { font-size: 9px; }
  .metric-card strong,
  .channel-metric strong { font-size: 36px; }
  .ranked-list li { grid-template-columns: minmax(120px, 1fr) 34px; }
  .ranked-list li > i { display: none; }
}

/* Monthly owner preview: shared panels and fields, separate analytical layout. */
.monthly-dashboard {
  color-scheme: light;
  --surface: #ffffff;
  --surface-2: #eaf0f4;
  --black: #f3f6f8;
  --ink: #192b3a;
  --muted: #607384;
  --line: rgba(31, 57, 78, 0.14);
  --lime: #176f54;
  --panel-radius: 14px;
  --panel-padding: 24px;
  background: var(--black);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.month-shell { display: grid; grid-template-columns: 222px minmax(0, 1fr); min-height: 100vh; }
.month-sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 36px 18px 24px; border-right: 1px solid var(--line); }
.month-brand { padding: 0 12px; margin-bottom: 55px; }
.month-brand img { display: block; max-width: 100%; object-fit: contain; }
.month-sidebar-label, .month-eyebrow { color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.month-sidebar-label { padding-left: 12px; margin-bottom: 16px; }
.month-tabs { display: grid; gap: 5px; }
.month-tabs button { display: flex; align-items: center; gap: 13px; min-height: 44px; padding: 0 12px; color: var(--muted); background: transparent; border: 0; border-radius: 8px; cursor: pointer; text-align: left; font-size: 12px; }
.month-tabs button > span { font-size: 10px; opacity: .5; }
.month-tabs button:hover { color: var(--ink); background: var(--surface); }
.month-tabs button[aria-selected="true"] { color: var(--ink); background: var(--surface-2); box-shadow: inset 2px 0 var(--red); }
.month-sidebar-footer { display: grid; gap: 15px; margin-top: auto; padding: 32px 12px 0; }
.month-sidebar-footer p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.month-sidebar-footer a, .month-footer a { color: var(--muted); font-size: 11px; text-decoration: none; }
.month-sidebar-footer a:hover, .month-footer a:hover { color: var(--ink); }
.month-main { width: 100%; max-width: 1600px; min-width: 0; margin: 0 auto; padding: 38px 38px 20px; }
.month-topbar { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.month-topbar h1 { margin: 12px 0 8px; font-size: clamp(26px, 3vw, 38px); font-weight: 600; letter-spacing: -.06em; line-height: 1.1; }
.month-topbar p { margin: 0; color: var(--muted); font-size: 11px; }
.month-picker { flex-shrink: 0; }
.month-period-context { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 26px 0 22px; padding-top: 20px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }
.month-pane { display: grid; gap: 20px; }
.month-pane[hidden] { display: none; }
.month-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.monthly-dashboard .channel-metric { min-height: 128px; padding: 21px; border-radius: var(--panel-radius); background: var(--surface); box-shadow: none; }
.monthly-dashboard .channel-metric > span { font-size: 10px; letter-spacing: .02em; text-transform: none; }
.monthly-dashboard .channel-metric strong { margin: 17px 0 9px; font-family: "Inter", sans-serif; font-size: clamp(25px, 2.5vw, 37px); font-weight: 600; letter-spacing: -.06em; }
.monthly-dashboard .channel-metric small { font-size: 10px; line-height: 1.5; }
.month-chart-card { min-width: 0; }
.month-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 20px; }
.month-card-heading h2, .month-section-title h2, .month-table-heading h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.025em; line-height: 1.4; }
.month-card-heading p, .month-section-title p, .month-table-heading p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.month-card-heading > span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.month-chart-legend { display: flex; flex-wrap: wrap; gap: 9px 22px; margin-bottom: 10px; }
.month-legend-button { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0; color: var(--ink); background: transparent; border: 0; font-size: 11px; cursor: pointer; }
.month-legend-button i { width: 7px; height: 7px; border-radius: 50%; }
.month-legend-button[aria-pressed="false"] { opacity: .35; text-decoration: line-through; }
.month-chart { position: relative; width: 100%; height: 260px; min-width: 0; }
.month-chart > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.month-chart rect[role="button"] { cursor: crosshair; }
.month-chart rect[role="button"]:focus-visible { outline: 1px solid var(--muted); }
.month-grid-line { stroke: var(--line); stroke-dasharray: 3 5; }
.month-axis { fill: var(--muted); font: 10px "Inter", sans-serif; }
.month-crosshair { stroke: var(--ink); stroke-dasharray: 3 4; stroke-width: 1; opacity: .6; pointer-events: none; }
.month-tooltip { position: absolute; z-index: 3; top: 15px; width: 215px; padding: 14px; background: #24292d; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 10px 30px #0006; pointer-events: none; }
.month-tooltip > strong { display: block; margin-bottom: 12px; font-size: 12px; }
.month-tooltip > div { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 10px; }
.month-tooltip small { display: block; margin-top: 12px; color: var(--muted); font-size: 10px; }
.month-chart-hint { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.month-reset { flex-shrink: 0; min-height: 30px; padding: 0 10px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 10px; }
.month-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.month-two-col > * { min-width: 0; }
.month-ranking-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 20px; width: 100%; padding: 13px 0; color: var(--ink); background: transparent; border: 0; text-align: left; font-size: 12px; }
button.month-ranking-row { cursor: pointer; }
button.month-ranking-row:hover { background: #ffffff04; }
.month-ranking-row > span { overflow-wrap: anywhere; }
.month-ranking-row > strong { font-weight: 600; }
.month-ranking-row > i { grid-column: 1 / -1; height: 3px; overflow: hidden; background: #ffffff05; border-radius: 3px; }
.month-ranking-row > i b { display: block; height: 100%; border-radius: inherit; opacity: .7; transition: width .2s ease; }
.month-muted, .month-empty { margin: 18px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.month-empty { padding: 12px 0; }
.month-badge { display: inline-flex; align-items: center; padding: 5px 8px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; font-size: 10px; line-height: 1.4; white-space: nowrap; }
.month-badge-blue { color: #235d9e; border-color: #78a9f426; background: #78a9f40a; }
.month-badge-green { color: #176f54; border-color: #75cbb726; background: #75cbb70a; }
.month-section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 4px 0 0; }
.month-section-title > .month-badge { flex-shrink: 0; }
.month-table-panel { min-width: 0; }
.month-table-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px; }
.month-table-heading p { margin: 0; }
.month-table-scroll { max-width: 100%; overflow-x: auto; }
.month-table { min-width: 800px; }
.monthly-dashboard .records-table th { padding: 13px 20px; font-size: 9px; letter-spacing: .05em; background: #edf2f6; }
.monthly-dashboard .records-table td { padding: 17px 20px; font-size: 11px; line-height: 1.6; }
.monthly-dashboard .records-table td small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.month-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.month-check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.month-check input { accent-color: var(--red); }
.month-text-link { padding: 0; color: #235d9e; background: transparent; border: 0; cursor: pointer; font-size: 11px; }
.month-text-link:hover { color: var(--ink); }
.month-more { display: block; width: 100%; padding: 16px; color: var(--muted); background: transparent; border: 0; border-top: 1px solid var(--line); cursor: pointer; font-size: 11px; }
.month-more[hidden] { display: none; }
.month-more:hover { color: var(--ink); background: var(--surface-2); }
.month-table-footnote { margin: 0; padding: 20px 24px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.month-details { margin-top: 0; }
.month-details > summary { display: flex; justify-content: space-between; align-items: center; gap: 15px; cursor: pointer; font-size: 12px; }
.month-details > summary::before { content: '+'; color: var(--muted); }
.month-details[open] > summary::before { content: '−'; }
.month-details[open] > summary { margin-bottom: 22px; }
.month-details h3 { margin: 12px 0; font-size: 13px; }
.month-methodology { margin-top: 25px; }
.month-methodology-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.month-methodology p, .month-methodology li { color: var(--muted); font-size: 11px; line-height: 1.8; }
.month-methodology ul { padding-left: 18px; }
.month-methodology li + li { margin-top: 10px; }
.month-segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; }
.month-segmented button { min-height: 32px; padding: 0 10px; color: var(--muted); background: transparent; border: 0; border-radius: 5px; cursor: pointer; font-size: 10px; }
.month-segmented button[aria-pressed="true"] { color: var(--ink); background: var(--surface-2); }
.month-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 15px; padding: 28px 0 0; color: var(--muted); font-size: 10px; }
.month-dialog { width: min(520px, calc(100vw - 28px)); max-height: 85vh; padding: 28px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.month-dialog::backdrop { background: #000a; backdrop-filter: blur(4px); }
.month-dialog > form { display: flex; justify-content: end; }
.month-dialog > form button { width: 32px; height: 32px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; font-size: 20px; }
.month-dialog h2 { margin: 5px 0 28px; font-size: 22px; }
.month-dialog dl { display: grid; grid-template-columns: minmax(100px, 1fr) 2fr; gap: 16px; font-size: 12px; }
.month-dialog dt { color: var(--muted); }
.month-dialog dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 1180px) {
  .month-shell { grid-template-columns: 185px minmax(0, 1fr); }
  .month-main { padding: 28px 22px 20px; }
  .month-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .month-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .month-shell { grid-template-columns: minmax(0, 1fr); }
  .month-sidebar { z-index: 5; height: auto; padding: 15px 16px 10px; background: #f3f6f8f5; border-right: 0; border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
  .month-brand { margin: 0 0 12px; padding: 0; }
  .month-brand img { width: 130px; height: 25px; }
  .month-sidebar-label, .month-sidebar-footer { display: none; }
  .month-tabs { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .month-tabs button { flex-shrink: 0; min-height: 38px; padding: 0 12px; font-size: 11px; }
  .month-tabs button > span { display: none; }
  .month-tabs button[aria-selected="true"] { box-shadow: inset 0 -2px var(--red); }
  .month-main { padding: 26px 16px 20px; }
  .month-topbar { flex-direction: column; align-items: stretch; gap: 22px; }
  .month-picker { grid-template-columns: minmax(0, 1fr) auto; }
  .month-period-context { margin: 20px 0; font-size: 10px; line-height: 1.6; }
  .month-two-col, .month-methodology-grid { grid-template-columns: minmax(0, 1fr); }
  .month-kpis { gap: 10px; }
  .monthly-dashboard { --panel-padding: 18px; }
  .monthly-dashboard .channel-metric { min-height: 118px; padding: 17px; }
  .monthly-dashboard .channel-metric > span { font-size: 10px; line-height: 1.5; }
  .month-section-title { flex-direction: column; gap: 12px; }
  .month-table-heading { align-items: flex-start; flex-direction: column; padding: 18px; }
  .month-table-heading > .month-badge { white-space: normal; }
  .month-details > summary { flex-wrap: wrap; justify-content: flex-start; }
  .month-card-heading { gap: 10px; }
  .month-reset { font-size: 9px; }
  .month-chart-legend { gap: 6px 15px; }
  .month-legend-button { font-size: 10px; }
  .month-dialog dl { grid-template-columns: 1fr 1.6fr; }
}
@media (prefers-reduced-motion: reduce) {
  .month-ranking-row > i b { transition: none; }
}

/* Period charts keep one daily/weekly slot readable on narrow screens. */
.period-chart-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
.period-chart {
  height: 330px;
  width: max-content;
  min-width: 100%;
}
.period-chart svg {
  max-width: none;
  height: 330px;
}
.period-chart .month-tooltip {
  width: 260px;
  max-width: calc(100vw - 80px);
  pointer-events: none;
}
.month-chart-legend span.month-legend-button {
  cursor: default;
}

.month-chart canvas:focus-visible {
  outline: 1px solid var(--muted);
  outline-offset: -2px;
}

.monthly-dashboard .records-table td { border-bottom-color: var(--line); }
.monthly-dashboard .records-table tbody tr:hover { background: var(--surface-2); }
.monthly-dashboard .month-ranking-row > i { background: var(--surface-2); }
.month-annotation-key { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 0 0 18px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.month-annotation-key span { display: inline-flex; align-items: center; gap: 8px; }
.month-annotation-key i { display: inline-block; width: 20px; height: 13px; border: 1px solid var(--line); border-radius: 2px; }
.month-annotation-key .rain-key { background: rgba(37, 54, 74, .13); }
.month-annotation-key .staff-key { background: repeating-linear-gradient(135deg, transparent 0 4px, rgba(200, 80, 90, .22) 4px 5px); }
