:root {
  color-scheme: dark;
  --bg: #181916;
  --panel: #22241f;
  --text: #f2f3ed;
  --muted: #bdc6b6;
  --line: #3a4035;
  --accent: #ffb19c;
  --accent-hover: #ffc5b5;
  --soft: #3b2a24;
  --good: #b2d7b0;
  --good-bg: #263a27;
  --pending: #dec988;
  --pending-bg: #373226;
  --neutral: #bdd2dd;
  --neutral-bg: #29373d;
  --shadow: 0 8px 32px #00000020;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button, a, input, select, summary { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select { color: var(--text); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
main:focus, h1:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 650; line-height: 1.2; letter-spacing: -.035em; }
h1 { font-size: clamp(27px, 4vw, 36px); }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
svg { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 5; top: -70px; left: 16px; background: var(--panel); padding: 12px 18px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.app-shell { max-width: 1080px; min-height: 100svh; margin: 0 auto; display: flex; flex-direction: column; padding: 0 36px; }
.site-header { min-height: 114px; display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-logo, .access-logo { filter: invert(1); }
.brand-logo { width: 64px; height: 64px; object-fit: contain; }
.brand strong { display: block; font-size: 17px; font-weight: 650; }
.account { margin-left: auto; position: relative; }
.account summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-size: 13px; color: var(--muted); }
.account summary::-webkit-details-marker { display: none; }
.avatar { display: grid; place-items: center; height: 32px; width: 32px; border-radius: 50%; background: var(--soft); color: var(--accent); font-weight: 650; }
.account summary svg { width: 14px; height: 14px; }
.account-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu { position: absolute; right: 0; top: 50px; padding: 16px; min-width: 240px; max-width: calc(100vw - 40px); z-index: 3; background: var(--panel); box-shadow: 0 16px 44px #00000060; border: 1px solid var(--line); border-radius: 14px; }
.account-email { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; margin: 3px 0 12px; }
.account-menu button { width: 100%; }
main { flex: 1; padding: 32px 0 50px; min-width: 0; }
.app-shell:has(.bottom-nav) main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.bottom-nav { position: fixed; z-index: 5; inset: auto 0 0; margin: 0 auto; max-width: 1080px; display: grid; grid-template-columns: repeat(3, 1fr); padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.bottom-nav a { min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 11px; border-radius: 12px; }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a[aria-current="page"] { color: var(--accent); background: var(--soft); font-weight: 600; }
.bottom-nav a:hover { color: var(--accent); }
.stats-period { margin-bottom: 24px; }
.stats-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.site-footer { padding: 20px 0 max(20px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 14px; justify-content: space-between; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.site-footer nav { display: flex; gap: 16px; }
.site-footer a { color: var(--muted); }
.heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.eyebrow { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin-bottom: 8px; }
.subtitle { font-size: 14px; color: var(--muted); margin-top: 7px; }
.heading-actions { display: flex; gap: 8px; align-items: center; padding-top: 6px; }
.icon-button, .secondary-button, .text-button { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-height: 44px; padding: 10px 13px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; text-decoration: none; font-size: 13px; font-weight: 500; color: var(--text); }
.icon-button { width: 44px; padding: 10px; }
.text-button { color: var(--accent); background: transparent; border-color: transparent; }
.secondary-button:hover, .icon-button:hover { background: #2d3029; }
.primary-button { background: var(--accent); color: var(--bg); border: 0; border-radius: 11px; min-height: 48px; padding: 13px 18px; font-size: 14px; font-weight: 600; display: inline-flex; gap: 10px; align-items: center; justify-content: center; text-decoration: none; }
.primary-button:hover { background: var(--accent-hover); }
.sync-label { font-size: 11px; color: var(--muted); margin-top: 5px; text-align: right; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 25px; }
.metric { padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; }
.metric strong { display: block; font-weight: 650; font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.metric span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.filters-panel { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); margin-bottom: 22px; }
.search { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; padding: 0 13px; background: var(--bg); }
.search svg { color: var(--muted); width: 18px; }
.search input { background: transparent; border: 0; outline: none; padding: 12px 0; min-width: 0; flex: 1; font-size: 16px; color: var(--text); }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search input:focus-visible { outline: none; }
.search input::placeholder { color: #91988a; opacity: 1; font-size: 14px; }
.segments { display: inline-flex; background: var(--bg); padding: 3px; border: 1px solid var(--line); border-radius: 10px; }
.segments button { min-height: 40px; border: 0; background: transparent; padding: 8px 13px; border-radius: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.segments button[aria-pressed="true"] { background: var(--soft); color: var(--accent); font-weight: 600; }
.view-switch { display: flex; gap: 3px; }
.view-switch button { padding: 9px 11px; }
.view-switch button[aria-pressed="true"] { background: var(--soft); color: var(--accent); }
.view-switch svg { width: 17px; height: 17px; }
.month-navigation { display: flex; align-items: center; gap: 4px; }
.month-title { min-width: 145px; text-align: center; font-weight: 600; font-size: 14px; }
.results-count { margin: 0 0 15px; font-size: 12px; color: var(--muted); }
.event-list { display: grid; gap: 10px; }
.event-card { width: 100%; display: flex; align-items: flex-start; gap: 16px; text-align: left; padding: 18px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.event-card:hover { border-color: #716257; background: #282b24; }
.event-date { min-width: 39px; text-align: center; font-size: 10px; text-transform: uppercase; color: var(--muted); padding: 4px 0; }
.event-date strong { display: block; color: var(--text); font-size: 25px; line-height: 1.1; font-weight: 600; margin-top: 3px; }
.event-info { flex: 1; min-width: 0; }
.event-title { display: block; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.event-meta { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.event-service { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.event-bottom { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: 10px; }
.status { display: inline-flex; align-items: center; gap: 5px; border-radius: 6px; padding: 4px 7px; font-size: 12px; color: var(--pending); background: var(--pending-bg); line-height: 1.35; }
.status::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.status.confirmed { color: var(--good); background: var(--good-bg); }
.status.neutral { color: var(--neutral); background: var(--neutral-bg); }
.status.cancelled { color: #f1aaa3; background: #422b2a; }
.event-money { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.event-chevron { color: var(--muted); align-self: center; width: 17px; }
.calendar-wrap { margin-bottom: 22px; padding: 20px; border: 1px solid var(--line); background: var(--panel); border-radius: 16px; }
.weekdays, .calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.weekdays { margin-bottom: 9px; text-align: center; color: var(--muted); font-size: 11px; }
.calendar-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 63px; border: 1px solid transparent; border-radius: 10px; background: transparent; font-size: 14px; }
.calendar-day.has-events { background: var(--soft); color: var(--accent); font-weight: 600; }
.calendar-day.today { border-color: var(--accent); }
.calendar-day[aria-pressed="true"] { background: var(--accent); color: var(--bg); }
.calendar-indicator { height: 12px; line-height: 12px; font-size: 9px; }
.calendar-help { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 11px; }
.back-button { min-height: 44px; display: inline-flex; gap: 6px; align-items: center; border: 0; padding: 7px 0; background: transparent; color: var(--accent); font-size: 13px; margin-bottom: 17px; }
.detail-heading { margin-bottom: 24px; }
.detail-heading h1 { overflow-wrap: anywhere; }
.detail-heading .status { margin-top: 13px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.section-card { padding: 23px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.section-card + .section-card { margin-top: 18px; }
.section-card h2 { margin-bottom: 18px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 0; }
.facts .full-width { grid-column: 1 / -1; }
.facts dt, .label { display: block; margin-bottom: 5px; font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.notes { border-left: 3px solid var(--accent); padding-left: 13px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.amount-card { background: var(--soft); border: 1px solid #604238; border-radius: 16px; padding: 23px; }
.amount-card .label { color: #eac0af; }
.total { font-size: clamp(28px, 5vw, 36px); font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1.25; overflow-wrap: anywhere; }
.amount-card .primary-button { width: 100%; margin-top: 20px; }
.quote-line { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 12px 0; font-size: 13px; border-top: 1px solid var(--line); }
.quote-line strong { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.amount-card .quote-line { border-color: #604238; margin-top: 12px; padding-bottom: 0; }
.source-link { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; font-size: 12px; margin-top: 12px; }
.source-link svg { width: 14px; height: 14px; }
.source-footer { margin-top: 20px; font-size: 11px; color: var(--muted); }
.source-footer .source-link { margin-right: 16px; }
.products { margin-top: 25px; }
.products-heading { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.products-heading span { color: var(--muted); font-size: 12px; }
.product-list { display: grid; gap: 10px; }
.product { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 15px 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; }
.product h3 { font-size: 14px; font-weight: 550; letter-spacing: 0; overflow-wrap: anywhere; }
.product-category { color: var(--muted); font-size: 11px; margin-top: 3px; }
.product-quantity { font-size: 13px; font-weight: 550; text-align: right; }
.product-costs { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); padding-top: 8px; }
.product-costs strong { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.notice { display: flex; align-items: flex-start; gap: 11px; padding: 15px 17px; border: 1px solid #5e5136; background: #373226; border-radius: 12px; margin-bottom: 22px; font-size: 13px; }
.notice svg { margin-top: 1px; color: #dec988; }
.notice p { flex: 1; }
.notice button { border: 0; background: transparent; padding: 0; min-width: 32px; min-height: 32px; }
.notice.error { border-color: #65423e; background: #382725; }
.notice.error svg { color: #f1aaa3; }
.empty-state { text-align: center; padding: 42px 20px; background: var(--panel); border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); font-size: 14px; }
.empty-state svg { width: 32px; height: 32px; color: #929d89; margin-bottom: 14px; }
.empty-state h2 { color: var(--text); font-size: 18px; margin-bottom: 8px; }
.empty-state .secondary-button { margin-top: 17px; }
/* The access check is the entire entry screen. */
.auth-gated .site-header, .auth-gated .skip-link, .auth-gated .bottom-nav { display: none; }
.auth-gated .app-shell { width: 100%; padding: 0 24px; }
.auth-gated .app-shell main { display: grid; place-items: center; padding: 32px 0; }
.access-gate { width: 100%; max-width: 300px; text-align: center; display: flex; flex-direction: column; align-items: center; padding-bottom: 8vh; }
.access-logo { width: 168px; height: 168px; object-fit: contain; margin-bottom: 22px; }
.access-message { font-size: 13px; line-height: 1.65; color: var(--muted); text-wrap: pretty; }
.access-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 12px; padding: 8px 12px; border: 0; background: transparent; color: var(--text); font-size: 13px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.access-action:hover { color: var(--accent); }
.initial-loading { display: flex; justify-content: center; align-items: center; gap: 10px; color: var(--muted); min-height: 360px; font-size: 14px; }
.spinner { display: inline-block; width: 17px; height: 17px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.spinning { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #30352b 25%, #3a4035 50%, #30352b 75%); background-size: 200% 100%; animation: shimmer 1.6s infinite; border-radius: 7px; height: 13px; }
.skeleton-short { width: 34%; }
.skeleton-medium { width: 50%; }
.skeleton-long { width: 74%; }
.skeleton-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-bottom: 12px; }
.skeleton-card .skeleton + .skeleton { margin-top: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.legal-page { max-width: 700px; padding: 10px 0 35px; }
.legal-page h1 { margin-bottom: 14px; }
.legal-page h2 { font-size: 19px; margin: 27px 0 10px; }
.legal-page p { font-size: 14px; line-height: 1.8; color: var(--muted); margin-bottom: 10px; }
.legal-page strong { color: var(--text); }
.legal-page .updated { font-size: 12px; margin-bottom: 28px; }
@media (min-width: 760px) {
  .event-card { align-items: center; }
  .event-bottom { margin-top: 0; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
  .event-info { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 24px; }
  .event-title, .event-meta, .event-service { grid-column: 1; }
  .event-bottom { grid-column: 2; grid-row: 1 / 4; justify-content: center; }
  .product-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 759px) {
  .app-shell { padding: 0 22px; }
  .site-header { min-height: 86px; gap: 10px; }
  .brand { gap: 8px; }
  .brand-logo { width: 55px; height: 61px; }
  .brand strong { font-size: 15px; }
  .account-name { display: none; }
  main { padding-top: 22px; padding-bottom: 35px; }
  .heading { margin-bottom: 17px; }
  .heading .eyebrow { display: none; }
  .heading-actions { padding-top: 2px; }
  .refresh-label { display: none; }
  .refresh-button { width: 44px; padding: 10px; }
  .sync-label { max-width: 100px; font-size: 10px; }
  .subtitle { font-size: 13px; }
  .metrics { gap: 8px; margin-bottom: 18px; }
  .metric { padding: 11px 10px; }
  .metric strong { font-size: 21px; }
  .metric span { font-size: 10px; }
  .filters-panel { padding: 0; border: 0; background: transparent; margin-bottom: 17px; }
  .search { background: var(--panel); }
  .segments { background: var(--panel); display: flex; width: 100%; }
  .segments button { flex: 1; padding: 8px; }
  .view-switch button { padding: 9px; }
  .view-switch button span { display: none; }
  .month-title { min-width: 114px; font-size: 13px; }
  .month-navigation { gap: 0; }
  .month-navigation .icon-button { width: 38px; }
  .event-card { gap: 12px; padding: 15px 12px; }
  .event-date { min-width: 32px; }
  .event-date strong { font-size: 23px; }
  .event-title { font-size: 15px; }
  .event-service { font-size: 11px; }
  .event-money { font-size: 13px; }
  .calendar-wrap { padding: 14px 10px; }
  .weekdays, .calendar { gap: 3px; }
  .calendar-day { min-height: 48px; border-radius: 8px; font-size: 13px; }
  .detail-grid { grid-template-columns: 1fr; gap: 17px; }
  .detail-heading { margin-bottom: 19px; }
  .detail-heading h1 { font-size: 28px; }
  .section-card, .amount-card { padding: 19px; }
  .section-card h2 { font-size: 19px; }
  .amount-card .total { font-size: 32px; }
  .product { padding: 14px; gap: 8px 12px; }
  .site-footer { gap: 10px; font-size: 10px; }
  .site-footer nav { gap: 13px; }
  .initial-loading { min-height: 280px; }
}
@media (max-width: 359px) {
  .app-shell { padding: 0 16px; }
  .brand strong { font-size: 14px; }
  .brand-logo { width: 45px; height: 54px; }
  .metric span { font-size: 9px; }
  .month-title { min-width: 105px; font-size: 12px; }
  .month-navigation .icon-button { width: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner, .spinning, .skeleton { animation: none; }
}

/* Statistics retain the sheet's monthly results and both rankings. */
.stats-block, .stats-chart { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.stats-block h2, .stats-chart h2 { font-size: 18px; line-height: 1.4; letter-spacing: -.02em; }
.stats-caption { color: var(--muted); font-size: 12px; margin: 6px 0 18px; }
.monthly-list { display: grid; }
.monthly-row { border-top: 1px solid var(--line); padding: 18px 0; }
.monthly-row:last-child { padding-bottom: 0; }
.monthly-row h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; font-size: 15px; letter-spacing: 0; }
.record-label { color: #8bd5c5; font-size: 10px; font-weight: 500; text-transform: none; }
.monthly-row dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 13px 0 0; }
.monthly-row dt, .ranking-details dt { color: var(--muted); font-size: 11px; }
.monthly-row dd { margin: 4px 0 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats-charts, .stats-rankings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 20px; }
.stats-chart { padding: 20px 12px 10px; }
.stats-chart h2 { padding: 0 8px; min-height: 52px; }
.chart-scroll { overflow-x: auto; margin-top: 14px; }
.trend-chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-gridline { stroke: var(--line); stroke-width: 1; }
.chart-axis { stroke: var(--muted); stroke-width: 1; }
.chart-tick { font-size: 14px; fill: var(--muted); }
.chart-value { font-size: 12px; fill: var(--text); font-weight: 600; }
.chart-line { fill: none; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; stroke: currentColor; }
.chart-dot { fill: currentColor; stroke: var(--panel); stroke-width: 2; }
.guests-trend { color: #8eb6ff; }
.margin-trend { color: #8bd5b1; }
.ranking-list { list-style: none; margin: 0; padding: 0; }
.ranking-list li { padding: 17px 0; border-top: 1px solid var(--line); }
.ranking-list li:last-child { padding-bottom: 0; }
.ranking-heading { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 9px; align-items: baseline; }
.ranking-position { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ranking-heading h3 { font-size: 14px; letter-spacing: 0; line-height: 1.4; overflow-wrap: anywhere; }
.ranking-heading strong { font-size: 15px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.ranking-heading small { display: block; color: var(--muted); font-size: 10px; font-weight: 400; }
.ranking-details { display: flex; gap: 18px; flex-wrap: wrap; margin: 9px 0 0 29px; }
.ranking-details div { display: flex; align-items: baseline; gap: 6px; }
.ranking-details dd { font-size: 12px; margin: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 759px) {
  .stats-charts, .stats-rankings { grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
  .stats-block { padding: 18px 16px; }
  .monthly-row dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .monthly-row dd { font-size: 16px; }
  .stats-chart h2 { min-height: 0; }
}
@media (max-width: 359px) {
  .stats-block { padding: 16px 12px; }
  .ranking-heading { gap: 6px; grid-template-columns: 16px minmax(0, 1fr) auto; }
  .ranking-heading strong { font-size: 13px; }
  .ranking-details { margin-left: 22px; gap: 8px; }
  .monthly-row dd { font-size: 15px; }
}

.stats-charts + .monthly-block { margin-top: 20px; }
.heading + .stats-charts { margin-top: 0; }

.month-summary { padding: 24px; background: #24231f; border: 1px solid #514039; border-radius: 20px; }
.month-summary-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.stats-eyebrow { color: var(--accent); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; margin-bottom: 7px; }
.month-summary h2 { font-size: 24px; line-height: 1.25; letter-spacing: -.03em; }
.month-summary h2::first-letter { text-transform: uppercase; }
.month-record { color: #8bd5c5; font-size: 11px; line-height: 1.5; text-align: right; max-width: 90px; padding-top: 5px; }
.month-profit span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 3px; }
.month-profit strong { display: block; color: #ffd4c7; font-size: clamp(32px, 6vw, 46px); font-weight: 600; letter-spacing: -.045em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.month-numbers { display: grid; grid-template-columns: 1.5fr 1fr .7fr; gap: 14px; border-top: 1px solid #514039; margin: 24px 0 0; padding-top: 18px; }
.month-numbers dt { color: var(--muted); font-size: 12px; }
.month-numbers dd { margin: 6px 0 0; font-size: 22px; line-height: 1.2; font-weight: 600; font-variant-numeric: tabular-nums; }
.monthly-history { margin-top: 18px; }
.monthly-history > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 12px 16px; color: var(--muted); font-size: 13px; cursor: pointer; list-style: none; border: 1px solid var(--line); border-radius: 12px; }
.monthly-history > summary::-webkit-details-marker { display: none; }
.monthly-history[open] > summary { color: var(--accent); margin-bottom: 12px; }
.monthly-history[open] > summary span { transform: rotate(45deg); }
.ranking-module { margin-top: 28px; }
.ranking-switch { display: flex; gap: 6px; width: fit-content; max-width: 100%; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin-bottom: 14px; }
.ranking-switch button { min-height: 40px; padding: 8px 20px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; }
.ranking-switch button[aria-pressed="true"] { color: var(--accent); background: var(--soft); font-weight: 600; }
.ranking-heading { grid-template-columns: 27px minmax(0, 1fr) auto; gap: 10px; }
.ranking-position { display: inline-grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; background: var(--bg); }
.leading-rank .ranking-position { background: var(--soft); color: var(--accent); }
.ranking-heading h3 { font-size: 15px; }
.ranking-heading strong { font-size: 17px; }
.ranking-details { margin-left: 37px; }
.ranking-bar { appearance: none; display: block; height: 3px; width: calc(100% - 37px); margin: 12px 0 0 37px; border: 0; background: var(--bg); border-radius: 3px; }
.ranking-bar::-webkit-progress-bar { background: var(--bg); border-radius: 3px; }
.ranking-bar::-webkit-progress-value { background: #786255; border-radius: 3px; }
.ranking-bar::-moz-progress-bar { background: #786255; border-radius: 3px; }
.leading-rank .ranking-bar::-webkit-progress-value { background: var(--accent); }
.leading-rank .ranking-bar::-moz-progress-bar { background: var(--accent); }
.chart-dot-selected { stroke: currentColor; stroke-width: 7; stroke-opacity: .25; fill: var(--text); }
@media (min-width: 760px) {
  .month-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 36px; }
  .month-profit { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .month-numbers { grid-column: 1 / -1; }
  .ranking-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
  .ranking-list li:last-child { padding-bottom: 17px; }
}
@media (max-width: 759px) {
  .month-summary { padding: 20px 16px; }
  .month-summary h2 { font-size: 23px; }
  .month-numbers { gap: 8px; }
  .month-numbers dt { font-size: 10px; }
  .month-numbers dd { font-size: 20px; }
  .month-numbers div:first-child dd { font-size: 16px; padding-top: 3px; }
  .ranking-heading h3 { font-size: 14px; }
  .ranking-heading strong { font-size: 15px; }
}
@media (max-width: 359px) {
  .month-summary { padding: 18px 12px; }
  .month-numbers { grid-template-columns: 1.4fr 1fr .7fr; gap: 5px; }
  .month-numbers div:first-child dd { font-size: 14px; }
  .month-profit strong { font-size: 32px; }
  .ranking-heading { grid-template-columns: 23px minmax(0, 1fr) auto; gap: 6px; }
  .ranking-position { width: 22px; height: 24px; }
  .ranking-heading strong { font-size: 13px; }
  .ranking-heading h3 { font-size: 13px; }
}

.month-title-select { display: block; max-width: 100%; padding: 0 23px 0 0; border: 0; background: transparent; color: var(--text); font-size: 23px; font-weight: 600; letter-spacing: -.035em; cursor: pointer; }
.month-title-select option { background: var(--panel); font-size: 16px; }
.month-event-count { margin-top: 7px; color: var(--muted); font-size: 12px; }
.month-arrows { display: flex; gap: 3px; margin-top: 15px; }
.month-arrows button { display: grid; place-items: center; border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 9px; width: 32px; height: 36px; font-size: 25px; line-height: 1; }
.month-arrows button:disabled { opacity: .25; cursor: default; }
.month-profit { margin-top: 24px; }
.month-profit .month-record { display: inline; padding: 0; margin-left: 12px; font-size: 11px; color: #8bd5c5; }
.stats-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 26px 0 12px; }
.stats-section-heading h2 { font-size: 18px; letter-spacing: -.02em; }
.stats-section-heading > span { color: var(--muted); font-size: 11px; }
.stats-section-heading select { min-height: 38px; padding: 7px 11px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); border-radius: 9px; font-size: 12px; }
.stats-section-heading + .stats-charts { margin-top: 0; }
.stats-chart h2 { font-size: 16px; min-height: 0; }
@media (min-width: 760px) {
  .month-profit { margin-top: 0; }
  .month-summary-heading { grid-column: 1; }
}
@media (max-width: 359px) {
  .month-title-select { font-size: 19px; padding-right: 16px; }
  .month-arrows button { width: 27px; height: 32px; }
  .month-summary-heading { gap: 6px; }
}

/* Compact event lists share the same controls in Agenda and Terminados. */
.events-heading { align-items: center; flex-wrap: wrap; }
.events-heading .heading-actions { padding-top: 0; margin-left: auto; }
.events-heading .view-switch { padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.events-heading .view-switch button { min-width: 44px; min-height: 42px; padding: 9px 11px; border-radius: 8px; }
.events-heading .view-switch svg { width: 19px; height: 19px; }
#month-navigation { justify-content: center; gap: 18px; margin-bottom: 18px; }
#month-navigation .icon-button { flex-shrink: 0; width: 44px; }
.event-date { display: flex; flex-direction: column; align-items: center; min-width: 42px; }
.event-month { display: block; margin-top: 4px; color: var(--text); font-size: 10px; font-weight: 600; letter-spacing: .08em; }
.event-year { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.brand-logo { width: 46px; height: 58px; }
.brand { gap: 14px; }
.access-logo { width: 120px; height: 148px; }
@media (max-width: 759px) {
  .brand-logo { width: 38px; height: 48px; }
  .brand { gap: 12px; }
  .event-date { min-width: 35px; }
  .event-list { gap: 12px; }
  .events-heading { gap: 12px; }
}
@media (max-width: 359px) {
  .brand-logo { width: 33px; height: 43px; }
  .events-heading h1 { font-size: 26px; }
  .events-heading .view-switch button { padding: 8px; }
}

/* Event type menu keeps the same touch targets as the view switch. */
.custom-select { position: relative; }
.custom-select-toggle { display: flex; align-items: center; justify-content: space-between; gap: 7px; min-height: 50px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--muted); font-size: 13px; white-space: nowrap; }
.custom-select-toggle svg { width: 15px; height: 15px; }
.custom-select-toggle[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.custom-select-menu { position: absolute; z-index: 6; top: calc(100% + 8px); right: 0; min-width: 168px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: #292c25; box-shadow: 0 12px 36px #0006; }
.custom-select-menu button { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; min-height: 44px; padding: 11px 13px; border: 0; border-radius: 9px; background: transparent; color: var(--text); font-size: 14px; text-align: left; }
.custom-select-menu button[aria-checked="true"] { background: var(--soft); color: var(--accent); }
.custom-select-menu button:hover { background: #363b30; }
.custom-select-menu button svg { width: 16px; height: 16px; }
@media (max-width: 379px) {
  .events-heading:has(.custom-select) .heading-actions { width: 100%; justify-content: flex-end; }
}

.ranking-period { margin-left: auto; max-width: 100%; }
.ranking-period .custom-select-toggle { min-height: 44px; font-size: 12px; }
.ranking-period .custom-select-menu { width: max-content; min-width: 100%; max-width: calc(100vw - 32px); }

.events-title { display: flex; align-items: center; gap: 2px; }
.agenda-reload { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; min-height: 44px; padding: 10px; border: 0; border-radius: 10px; background: transparent; color: #91988a; }
.agenda-reload svg { width: 18px; height: 18px; }
.agenda-reload:hover:not(:disabled) { color: var(--text); background: var(--panel); }
