.revenue-plan-page {
  display: grid;
  gap: 18px;
  color: #0d2348;
  min-width: 0;
  width: 100%;
}

.revenue-plan-page > * {
  min-width: 0;
  max-width: 100%;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.revenue-plan-heading,
.revenue-plan-detail-heading,
.revenue-plan-section-heading,
.revenue-plan-toolbar,
.revenue-plan-month-editor,
.revenue-plan-editor-actions,
.revenue-plan-bonus-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.revenue-plan-heading h1,
.revenue-plan-detail-heading h1 {
  margin: 3px 0 5px;
  font-size: 32px;
  letter-spacing: 0;
}

.revenue-plan-heading p,
.revenue-plan-section-heading p,
.revenue-plan-editor small,
.revenue-plan-detail-heading p {
  margin: 0;
  color: #6d7f9f;
}

.revenue-plan-heading-actions,
.revenue-plan-detail-heading > div > div,
.revenue-plan-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.revenue-plan-publication-overview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.revenue-plan-publication-overview > span:not(.badge) {
  padding: 6px 9px;
  border: 1px solid #dce6f3;
  border-radius: 7px;
  background: #fff;
  color: #607493;
  font-size: 12px;
  white-space: nowrap;
}

.revenue-plan-publication-overview > span strong { color: #0d2348; }

.revenue-plan-topbar-title,
.revenue-plan-month-control {
  display: grid;
  gap: 3px;
}

.revenue-plan-topbar-title small,
.revenue-plan-month-control span {
  color: #1768ff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.revenue-plan-topbar-title strong {
  font-size: 17px;
}

.revenue-plan-month-control {
  min-width: 180px;
}

.revenue-plan-month-control input {
  min-height: 42px;
  border: 1px solid #c9d8ef;
  background: #fff;
  padding: 0 12px;
  font: inherit;
  font-weight: 700;
}

.revenue-plan-metrics,
.revenue-plan-detail-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.revenue-plan-detail-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.revenue-plan-metric,
.revenue-plan-detail-metrics article {
  min-height: 108px;
  border: 1px solid #dce6f3;
  border-top: 3px solid #6aa5ff;
  background: #fff;
  padding: 16px;
  display: grid;
  align-content: center;
  gap: 7px;
}

.revenue-plan-detail-metrics article {
  min-height: 88px;
}

.revenue-plan-metric.tone-green,
.revenue-plan-detail-metrics .tone-green { border-top-color: #18af72; }
.revenue-plan-metric.tone-orange,
.revenue-plan-detail-metrics .tone-orange { border-top-color: #f0a128; }
.revenue-plan-metric.tone-violet,
.revenue-plan-detail-metrics .tone-violet { border-top-color: #8c62e8; }
.revenue-plan-metric.tone-gray,
.revenue-plan-detail-metrics .tone-gray { border-top-color: #9aa9bf; }

.revenue-plan-metric span,
.revenue-plan-detail-metrics span,
.revenue-plan-bonus-summary span {
  color: #6d7f9f;
  font-size: 13px;
}

.revenue-plan-metric strong {
  font-size: 24px;
}

.revenue-plan-detail-metrics strong {
  font-size: 19px;
}

.revenue-plan-metric small {
  color: #7f8da6;
}

.revenue-plan-band,
.revenue-plan-editor,
.revenue-plan-bonus {
  border: 1px solid #dce6f3;
  background: #fff;
  padding: 20px;
}

.revenue-plan-bulk-forecast {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #c9d9f0;
  border-radius: 10px;
  background: #f7faff;
}

.revenue-plan-bulk-forecast > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.revenue-plan-bulk-forecast h2 { margin: 3px 0 0; font-size: 20px; }
.revenue-plan-bulk-forecast > header small {
  display: block;
  margin-top: 4px;
  color: #607493;
}
.revenue-plan-bulk-safety { margin: 0; color: #405476; }

.revenue-plan-bulk-snapshot {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #bdd4f6;
  border-radius: 8px;
  background: #edf5ff;
  color: #31547e;
}

.revenue-plan-bulk-snapshot span {
  color: #607493;
  font-size: 12px;
}

.revenue-plan-bulk-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.revenue-plan-bulk-summary span {
  padding: 8px 11px;
  border: 1px solid #dce7f5;
  border-radius: 7px;
  background: #fff;
  color: #607493;
}

.revenue-plan-bulk-summary .positive { color: #08784c; }
.revenue-plan-bulk-summary .negative { color: #b3263b; }
.revenue-plan-bulk-table-shell {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.revenue-plan-bulk-table {
  min-width: 1240px;
  table-layout: fixed;
}

.revenue-plan-bulk-table td small {
  display: block;
  max-width: none;
  color: #607493;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.revenue-plan-bulk-table .revenue-plan-bulk-location-cell { width: 180px; }
.revenue-plan-bulk-table .revenue-plan-bulk-status-cell { width: 190px; }
.revenue-plan-bulk-table .revenue-plan-bulk-base-cell { width: 135px; }
.revenue-plan-bulk-table .revenue-plan-bulk-plan-cell { width: 170px; }
.revenue-plan-bulk-table .revenue-plan-bulk-confidence-cell { width: 135px; }
.revenue-plan-bulk-table .revenue-plan-bulk-warning-cell { width: 280px; }
.revenue-plan-bulk-table .revenue-plan-bulk-action-cell { width: 150px; }

.revenue-plan-bulk-location-cell,
.revenue-plan-bulk-status-cell,
.revenue-plan-bulk-warning-cell,
.revenue-plan-bulk-error-cell,
.revenue-plan-bulk-action-cell {
  min-width: 0;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

.revenue-plan-bulk-action-cell .btn {
  max-width: 100%;
  white-space: normal;
}

.revenue-plan-bulk-table tr.is-error td { background: #fff4f5; color: #b3263b; }

.revenue-plan-bulk-select-cell {
  width: 42px;
  text-align: center;
}

.revenue-plan-bulk-select-cell input,
.revenue-plan-bulk-actions input,
.revenue-plan-bulk-low-confirmation input,
.revenue-plan-bulk-provisional-calendar input {
  width: 18px;
  height: 18px;
  accent-color: #1768ff;
}

.revenue-plan-bulk-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.revenue-plan-bulk-status.tone-ready { background: #e8f8f0; color: #08784c; }
.revenue-plan-bulk-status.tone-low { background: #fff1db; color: #955900; }
.revenue-plan-bulk-status.tone-manual { background: #eef3fb; color: #405476; }
.revenue-plan-bulk-status.tone-preserved { background: #f2f4f7; color: #64748b; }
.revenue-plan-bulk-status.tone-error { background: #ffe9ec; color: #b3263b; }

.revenue-plan-bulk-money input {
  width: 150px;
  min-height: 38px;
  border: 1px solid #c9d7ea;
  border-radius: 7px;
  background: #fff;
  padding: 7px 9px;
  color: #0d2348;
  font: inherit;
  font-weight: 700;
}

.revenue-plan-bulk-money input[aria-invalid="true"] {
  border-color: #d3384b;
  box-shadow: 0 0 0 2px rgba(211, 56, 75, 0.12);
}

.revenue-plan-bulk-table tr.is-manually-adjusted td { background: #fffaf0; }

.revenue-plan-bulk-low-confirmation {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.25fr);
  gap: 14px;
  border: 1px solid #efc77f;
  border-radius: 9px;
  background: #fff9ee;
  padding: 14px;
}

.revenue-plan-bulk-low-confirmation[hidden] { display: none; }
.revenue-plan-bulk-low-confirmation > label { display: flex; gap: 10px; align-items: flex-start; }
.revenue-plan-bulk-low-confirmation > label > span { display: grid; gap: 3px; }
.revenue-plan-bulk-low-confirmation small { color: #76551c; }
.revenue-plan-bulk-low-confirmation > label:last-child { display: grid; gap: 6px; color: #654918; font-weight: 700; }
.revenue-plan-bulk-low-confirmation textarea {
  width: 100%;
  min-height: 68px;
  resize: vertical;
  border: 1px solid #d9b975;
  border-radius: 7px;
  background: #fff;
  padding: 8px 10px;
  color: #0d2348;
  font: inherit;
}

.revenue-plan-bulk-provisional-calendar {
  display: grid;
  grid-template-columns: minmax(320px, 1.4fr) minmax(260px, 1fr) minmax(280px, 1fr);
  gap: 14px;
  align-items: start;
  border: 2px solid #d88716;
  border-radius: 9px;
  background: #fff4dc;
  padding: 14px;
  color: #65420d;
}

.revenue-plan-bulk-provisional-calendar > div { display: grid; gap: 5px; }
.revenue-plan-bulk-provisional-calendar p { margin: 0; font-size: 13px; }
.revenue-plan-bulk-provisional-calendar > label { display: flex; gap: 9px; align-items: flex-start; font-weight: 700; }
.revenue-plan-bulk-provisional-calendar > label:last-child { display: grid; gap: 6px; }
.revenue-plan-bulk-provisional-calendar textarea {
  width: 100%;
  min-height: 58px;
  resize: vertical;
  border: 1px solid #d9aa61;
  border-radius: 7px;
  background: #fff;
  padding: 8px 10px;
  color: #0d2348;
  font: inherit;
}

.revenue-plan-bulk-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  border: 1px solid #c9d9f0;
  border-radius: 9px;
  background: rgba(247, 250, 255, 0.97);
  box-shadow: 0 -8px 22px rgba(13, 35, 72, 0.10);
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
}

.revenue-plan-bulk-actions > label { display: inline-flex; align-items: center; gap: 8px; color: #405476; font-weight: 700; }
.revenue-plan-bulk-actions > .btn { margin-left: auto; }
.revenue-plan-bulk-unsaved {
  padding: 6px 9px;
  border-radius: 999px;
  background: #fff0d7;
  color: #855000;
  font-size: 12px;
  white-space: nowrap;
}
.revenue-plan-bulk-selection-summary { color: #405476; }
.revenue-plan-bulk-validation { flex-basis: 100%; color: #b3263b; font-size: 13px; font-weight: 700; }

.revenue-plan-publication-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 0 18px;
  border: 1px solid #c9d9f0;
  border-radius: 9px;
  background: #f7faff;
  padding: 12px 14px;
}

.revenue-plan-publication-actions > div {
  display: grid;
  flex: 1;
  gap: 3px;
}

.revenue-plan-publication-actions small { color: #607493; }

.revenue-plan-publication-select {
  width: 42px;
  text-align: center !important;
}

.revenue-plan-publication-select input {
  width: 18px;
  height: 18px;
  accent-color: #1768ff;
}

.revenue-plan-row-actions {
  display: flex;
  align-items: stretch;
  gap: 7px;
}

.revenue-plan-row-actions .btn { white-space: normal; }

.revenue-plan-portfolio-table tr[data-rvp-open-row] { cursor: pointer; }

.revenue-plan-portfolio-table tr[data-rvp-open-row]:focus-visible {
  outline: 3px solid rgba(23, 104, 255, 0.35);
  outline-offset: -3px;
}

.revenue-plan-location-link {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.revenue-plan-location-link:hover strong,
.revenue-plan-location-link:focus-visible strong {
  color: #1768ff;
  text-decoration: underline;
}

.revenue-plan-portfolio-table th:last-child,
.revenue-plan-portfolio-table td:last-child {
  position: sticky;
  right: 0;
  min-width: 145px;
  background: #fff;
  box-shadow: -9px 0 12px -12px rgba(13, 35, 72, 0.42);
}

.revenue-plan-portfolio-table th:last-child {
  z-index: 3;
  background: #f4f7fb;
}

.revenue-plan-portfolio-table td:last-child { z-index: 2; }
.revenue-plan-portfolio-table tr:hover td:last-child { background: #f8fbff; }

.revenue-plan-toolbar {
  justify-content: flex-start;
  align-items: end;
  margin-bottom: 16px;
}

.revenue-plan-filter-groups {
  display: grid;
  gap: 12px;
  margin: -4px 0 18px;
}

.revenue-plan-filter-group {
  display: grid;
  gap: 7px;
}

.revenue-plan-filter-label {
  color: #405476;
  font-size: 13px;
}

.revenue-plan-allocation-filters {
  display: flex;
  gap: 8px;
  margin: -4px 0 18px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.revenue-plan-filter-groups .revenue-plan-allocation-filters {
  margin: 0;
}

.revenue-plan-empty .btn {
  margin-top: 10px;
}

.revenue-plan-empty span {
  display: block;
}

.revenue-plan-allocation-filters button {
  min-height: 42px;
  border: 1px solid #ccd9ec;
  border-radius: 8px;
  background: #fff;
  padding: 7px 12px;
  color: #405476;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.revenue-plan-allocation-filters button strong {
  display: inline-grid;
  min-width: 24px;
  min-height: 24px;
  margin-left: 5px;
  place-items: center;
  border-radius: 12px;
  background: #edf3fc;
  color: #1768ff;
  font-size: 12px;
}

.revenue-plan-allocation-filters button.active {
  border-color: #1768ff;
  background: #edf4ff;
  color: #1768ff;
}

.revenue-plan-toolbar label,
.revenue-plan-generator label,
.revenue-plan-month-editor label,
.revenue-plan-note,
.revenue-plan-allocation-form label {
  display: grid;
  gap: 6px;
  min-width: 220px;
  color: #405476;
  font-size: 13px;
  font-weight: 700;
}

.revenue-plan-toolbar input,
.revenue-plan-toolbar select,
.revenue-plan-generator input,
.revenue-plan-generator select,
.revenue-plan-month-editor input,
.revenue-plan-note input,
.revenue-plan-allocation-form input,
.revenue-plan-allocation-form select,
.revenue-plan-daily input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd8eb;
  background: #fff;
  padding: 8px 10px;
  color: #0d2348;
  font: inherit;
}

.revenue-plan-table-shell,
.revenue-plan-daily-shell {
  overflow: auto;
  border: 1px solid #e2e9f3;
}

.revenue-plan-table,
.revenue-plan-daily {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.revenue-plan-table th,
.revenue-plan-table td,
.revenue-plan-daily th,
.revenue-plan-daily td {
  padding: 11px 12px;
  border-bottom: 1px solid #e8eef6;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.revenue-plan-table th,
.revenue-plan-daily th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f7fb;
  color: #536887;
  font-size: 11px;
  text-transform: uppercase;
}

.revenue-plan-table td:first-child,
.revenue-plan-daily td:first-child {
  white-space: normal;
}

.revenue-plan-table td strong,
.revenue-plan-table td small,
.revenue-plan-daily td strong,
.revenue-plan-daily td small {
  display: block;
}

.revenue-plan-table td small,
.revenue-plan-daily td small {
  margin-top: 3px;
  color: #7e8da6;
}

.revenue-plan-table tr:hover td {
  background: #f8fbff;
}

.revenue-plan-daily tr.hit td {
  background: #f0fbf6;
}

.revenue-plan-table .positive,
.revenue-plan-daily .positive { color: #098555; }
.revenue-plan-table .negative,
.revenue-plan-daily .negative,
.revenue-plan-bonus .negative { color: #d3384b; }
.revenue-plan-bonus .positive { color: #098555; }

.revenue-plan-progress {
  display: inline-block;
  width: 72px;
  height: 6px;
  margin-right: 7px;
  overflow: hidden;
  background: #e4ebf4;
  vertical-align: middle;
}

.revenue-plan-progress i {
  display: block;
  height: 100%;
  background: #18af72;
}

.revenue-plan-empty,
.revenue-plan-allocation-empty {
  padding: 34px !important;
  color: #73829a;
  text-align: center !important;
}

.revenue-plan-detail-heading {
  justify-content: flex-start;
}

.revenue-plan-detail-heading > div {
  flex: 1;
}

.revenue-plan-publication-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #d7e3f3;
  border-left: 4px solid #8ca6c9;
  border-radius: 8px;
  background: #f7faff;
  padding: 14px 16px;
}

.revenue-plan-publication-panel.tone-green { border-left-color: #18af72; background: #f2fbf7; }
.revenue-plan-publication-panel.tone-orange { border-left-color: #f0a128; background: #fff9ef; }
.revenue-plan-publication-panel.tone-blue { border-left-color: #1768ff; }
.revenue-plan-publication-panel > div:first-child { display: grid; gap: 5px; }
.revenue-plan-publication-panel > div:first-child .badge { justify-self: start; }
.revenue-plan-publication-panel > div:first-child > span:last-child { color: #526987; line-height: 1.45; }
.revenue-plan-publication-panel-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.revenue-plan-unsaved-publication { flex-basis: 100%; color: #a35b00; text-align: right; }
.revenue-plan-unsaved-publication[hidden] { display: none; }

.revenue-plan-chart {
  height: 220px;
  display: grid;
  grid-template-columns: repeat(31, minmax(22px, 1fr));
  gap: 5px;
  align-items: end;
  overflow-x: auto;
  padding: 18px 4px 0;
}

.revenue-plan-chart-day {
  min-width: 22px;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr 20px;
  gap: 5px;
  text-align: center;
  color: #6d7f9f;
  font-size: 10px;
}

.revenue-plan-chart-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 2px;
}

.revenue-plan-chart-bars i {
  width: 7px;
  min-height: 0;
  background: #7caeff;
}

.revenue-plan-chart-bars i.actual { background: #efad3d; }
.revenue-plan-chart-bars i.actual.hit { background: #18af72; }

.revenue-plan-editor {
  padding: 0;
}

.revenue-plan-editor summary {
  cursor: pointer;
  list-style: none;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.revenue-plan-editor summary::-webkit-details-marker { display: none; }
.revenue-plan-editor summary span:first-child { display: grid; gap: 3px; }
.revenue-plan-editor[open] summary { border-bottom: 1px solid #e1e8f2; }

.revenue-plan-editor-body {
  padding: 20px;
  display: grid;
  gap: 18px;
}

.revenue-plan-generator {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(230px, 0.6fr) auto;
  gap: 12px;
  align-items: end;
  padding: 15px;
  background: #f5f8fc;
}

.revenue-plan-generator label small {
  color: #71809a;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.revenue-plan-generator-message {
  margin-top: 12px;
}

.revenue-plan-draft-notice {
  padding: 11px 13px;
  border: 1px solid #99d8ba;
  border-radius: 8px;
  background: #effaf5;
  color: #08784c;
  font-size: 13px;
  font-weight: 700;
}

.revenue-plan-draft-notice[hidden] { display: none; }

.revenue-plan-draft-notice.is-error {
  border-color: #efb4bd;
  background: #fff4f5;
  color: #b3263b;
}

.revenue-plan-forecast-explanation {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #c9d9f0;
  border-radius: 10px;
  background: #f7faff;
  color: #172b4d;
}

.revenue-plan-forecast-explanation > header,
.revenue-plan-forecast-explanation > footer,
.revenue-plan-forecast-components article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.revenue-plan-forecast-explanation > header > div { display: grid; gap: 3px; }
.revenue-plan-forecast-explanation > header > div > span,
.revenue-plan-forecast-explanation > footer { color: #607493; font-size: 12px; }

.revenue-plan-confidence {
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.revenue-plan-confidence.tone-high { color: #08784c; background: #e3f7ed; }
.revenue-plan-confidence.tone-medium { color: #98600a; background: #fff1cf; }
.revenue-plan-confidence.tone-low { color: #b3263b; background: #ffe9ed; }
.revenue-plan-confidence.tone-unknown { color: #607493; background: #e9eef6; }

.revenue-plan-forecast-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.revenue-plan-forecast-totals article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dce7f5;
  border-radius: 8px;
  background: #fff;
}

.revenue-plan-forecast-totals span,
.revenue-plan-forecast-totals small { color: #71809a; font-size: 12px; }
.revenue-plan-forecast-totals strong { font-size: 20px; }
.revenue-plan-forecast-components { display: grid; gap: 8px; }
.revenue-plan-forecast-components h4 { margin: 0; font-size: 13px; }

.revenue-plan-forecast-components article {
  padding: 9px 11px;
  border: 1px solid #dce7f5;
  border-radius: 7px;
  background: #fff;
}

.revenue-plan-forecast-components article > div { display: flex; align-items: center; gap: 8px; }
.revenue-plan-forecast-components article span { color: #71809a; font-size: 11px; }
.revenue-plan-forecast-components article.is-unavailable { color: #71809a; background: #f2f5f9; }
.revenue-plan-forecast-empty { margin: 0; color: #71809a; font-size: 12px; }
.revenue-plan-forecast-explanation > footer { align-items: flex-start; flex-wrap: wrap; }

.revenue-plan-forecast-warnings {
  padding: 11px 13px;
  border-left: 4px solid #ef9d28;
  background: #fff8ec;
  color: #714708;
}

.revenue-plan-forecast-warnings ul { margin: 6px 0 0; padding-left: 18px; font-size: 12px; }

.revenue-plan-forecast-stale {
  padding: 10px 12px;
  border: 1px solid #ef9d28;
  border-radius: 7px;
  background: #fff8ec;
  color: #714708;
  font-size: 12px;
  font-weight: 700;
}

.revenue-plan-month-editor {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.revenue-plan-month-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.revenue-plan-month-editor > .revenue-plan-daily-total {
  display: grid;
  gap: 3px;
  margin-left: auto;
  text-align: right;
}

.revenue-plan-month-editor > .revenue-plan-daily-total span {
  color: #71809a;
  font-size: 12px;
}

.revenue-plan-note {
  min-width: 100%;
}

.revenue-plan-editor-actions {
  justify-content: flex-start;
}

.revenue-plan-section-heading {
  align-items: flex-start;
  margin-bottom: 16px;
}

.revenue-plan-section-heading h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.revenue-plan-legend span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  background: #7caeff;
}

.revenue-plan-legend .actual::before { background: #18af72; }

.revenue-plan-daily input {
  min-width: 92px;
  min-height: 34px;
  padding: 5px 7px;
}

.revenue-plan-bonus-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.revenue-plan-bonus-summary > div {
  min-height: 76px;
  padding: 12px;
  background: #f5f8fc;
  display: grid;
  align-content: center;
  gap: 5px;
}

.revenue-plan-allocation-list {
  border-top: 1px solid #e4ebf4;
}

.revenue-plan-allocation-list > div {
  min-height: 54px;
  display: grid;
  grid-template-columns: 1fr auto 38px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #e4ebf4;
  padding: 8px 2px;
}

.revenue-plan-allocation-list > .is-unlinked {
  border-left: 3px solid #ef9d28;
  background: #fff9ef;
  padding-left: 10px;
}

.revenue-plan-allocation-person {
  min-width: 0;
}

.revenue-plan-allocation-list small {
  display: block;
  color: #71809a;
}

.revenue-plan-allocation-list small.linked { color: #098555; }
.revenue-plan-allocation-list small.unlinked { color: #b36a00; font-weight: 700; }

.revenue-plan-allocation-link {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  gap: 8px;
  max-width: 520px;
  margin-top: 8px;
}

.revenue-plan-allocation-link select,
.revenue-plan-decision-panel textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cbd8eb;
  border-radius: 6px;
  background: #fff;
  padding: 7px 9px;
  color: #0d2348;
  font: inherit;
}

.revenue-plan-allocation-form {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 0.7fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 16px;
}

.revenue-plan-allocation-form label { min-width: 0; }
.revenue-plan-bonus-actions { justify-content: flex-end; margin-top: 16px; }

.revenue-plan-submit-check {
  margin-top: 14px;
  border: 1px solid #f1cf99;
  border-radius: 7px;
  background: #fff8ec;
  padding: 12px 14px;
  color: #8c5708;
}

.revenue-plan-submit-check ul {
  margin: 6px 0 0 18px;
  padding: 0;
}

.revenue-plan-workflow-notice {
  display: grid;
  gap: 4px;
  margin: 0 0 16px;
  border-left: 4px solid #1768ff;
  border-radius: 5px;
  background: #eef5ff;
  padding: 12px 14px;
}

.revenue-plan-workflow-notice span { color: #405476; }
.revenue-plan-workflow-notice.tone-green { border-color: #18af72; background: #eefaf5; }
.revenue-plan-workflow-notice.tone-orange { border-color: #ef9d28; background: #fff8ec; }
.revenue-plan-workflow-notice.tone-red { border-color: #d3384b; background: #fff1f3; }

.revenue-plan-decision-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.4fr);
  gap: 14px 18px;
  align-items: end;
  margin-top: 18px;
  border: 1px solid #bcd2f3;
  border-radius: 8px;
  background: #f5f9ff;
  padding: 16px;
}

.revenue-plan-decision-panel.tone-warning {
  border-color: #f0cf9a;
  background: #fffaf1;
}

.revenue-plan-decision-panel h3,
.revenue-plan-workflow-history h3 {
  margin: 0 0 5px;
  font-size: 17px;
}

.revenue-plan-decision-panel p { margin: 0; color: #6d7f9f; }
.revenue-plan-decision-panel label { display: grid; gap: 6px; color: #405476; font-size: 13px; font-weight: 700; }
.revenue-plan-decision-panel textarea { min-height: 82px; resize: vertical; }
.revenue-plan-decision-panel > div:last-child { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; }

.revenue-plan-workflow-history {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  border-top: 1px solid #dfe7f2;
  padding-top: 16px;
}

.revenue-plan-workflow-history > div {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 9px;
  align-items: start;
}

.revenue-plan-workflow-history > div > span {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: #1768ff;
}

.revenue-plan-workflow-history p { display: grid; gap: 2px; margin: 0; }
.revenue-plan-workflow-history small { color: #71809a; }
.revenue-plan-workflow-history blockquote { display: grid; gap: 4px; margin: 6px 0 0; border-left: 3px solid #9db8df; padding: 8px 12px; color: #405476; }

@media (max-width: 1100px) {
  .revenue-plan-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .revenue-plan-detail-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .revenue-plan-bonus-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .revenue-plan-allocation-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .revenue-plan-portfolio-table th:last-child,
  .revenue-plan-portfolio-table td:last-child {
    position: static;
    min-width: 0;
    box-shadow: none;
  }
  .revenue-plan-topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
  }
  .revenue-plan-topbar-title { grid-column: 1 / -1; }
  .revenue-plan-month-control { min-width: 0; }
  .revenue-plan-topbar .topbar-spacer,
  .revenue-plan-topbar .profile-button { display: none; }
  .revenue-plan-topbar .help-button {
    grid-column: 1 / -1;
    max-width: none;
    width: 100%;
  }
  .revenue-plan-heading,
  .revenue-plan-detail-heading,
  .revenue-plan-section-heading,
  .revenue-plan-bulk-forecast > header,
  .revenue-plan-toolbar,
  .revenue-plan-month-editor,
  .revenue-plan-editor-actions { align-items: stretch; flex-direction: column; }
  .revenue-plan-heading h1,
  .revenue-plan-detail-heading h1 { font-size: 26px; }
  .revenue-plan-heading-actions { align-items: stretch; }
  .revenue-plan-heading-actions .btn { width: 100%; }
  .revenue-plan-publication-overview { justify-content: flex-start; }
  .revenue-plan-publication-actions,
  .revenue-plan-publication-panel { align-items: stretch; flex-direction: column; }
  .revenue-plan-publication-actions .btn,
  .revenue-plan-publication-panel-actions .btn { width: 100%; }
  .revenue-plan-publication-panel-actions { flex-direction: column; }
  .revenue-plan-bulk-forecast > header .btn { width: 100%; }
  .revenue-plan-bulk-low-confirmation { grid-template-columns: 1fr; }
  .revenue-plan-bulk-provisional-calendar { grid-template-columns: 1fr; }
  .revenue-plan-bulk-actions {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }
  .revenue-plan-bulk-actions > label { align-self: flex-start; }
  .revenue-plan-bulk-actions > .btn { width: 100%; margin-left: 0; }
  .revenue-plan-bulk-unsaved { align-self: flex-start; white-space: normal; }
  .revenue-plan-bulk-money input { width: 100%; }
  .revenue-plan-metrics,
  .revenue-plan-detail-metrics {
    display: flex;
    width: 100%;
    min-width: 0;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
  }
  .revenue-plan-metric,
  .revenue-plan-detail-metrics article {
    min-width: 156px;
    min-height: 82px;
    padding: 12px;
    scroll-snap-align: start;
  }
  .revenue-plan-metric strong { font-size: 19px; }
  .revenue-plan-band,
  .revenue-plan-bonus { padding: 14px; }
  .revenue-plan-toolbar label { min-width: 100%; }
  .revenue-plan-toolbar .btn { width: 100%; }
  .revenue-plan-table-shell,
  .revenue-plan-daily-shell { border: 0; overflow: visible; }
  .revenue-plan-bulk-table-shell { max-width: 100%; overflow: visible; }
  .revenue-plan-table thead,
  .revenue-plan-daily thead { display: none; }
  .revenue-plan-table,
  .revenue-plan-table tbody,
  .revenue-plan-daily,
  .revenue-plan-daily tbody { display: block; }
  .revenue-plan-table tr,
  .revenue-plan-daily tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 13px 0;
    border-bottom: 1px solid #dfe7f2;
  }
  .revenue-plan-table td,
  .revenue-plan-daily td {
    display: grid;
    gap: 3px;
    border: 0;
    padding: 0;
    white-space: normal;
  }
  .revenue-plan-table td::before,
  .revenue-plan-daily td::before {
    content: attr(data-label);
    color: #7a89a1;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }
  .revenue-plan-table td:first-child,
  .revenue-plan-table td:last-child,
  .revenue-plan-daily td:first-child { grid-column: 1 / -1; }
  .revenue-plan-portfolio-table td:nth-child(2) { grid-column: 1 / -1; }
  .revenue-plan-table td:last-child .btn { width: 100%; }
  .revenue-plan-row-actions { flex-direction: column; }
  .revenue-plan-bulk-table { width: 100%; min-width: 0; table-layout: auto; }
  .revenue-plan-bulk-table tr { width: 100%; }
  .revenue-plan-bulk-table td { min-width: 0; width: auto; }
  .revenue-plan-bulk-table td.revenue-plan-bulk-location-cell,
  .revenue-plan-bulk-table td.revenue-plan-bulk-status-cell,
  .revenue-plan-bulk-table td.revenue-plan-bulk-warning-cell,
  .revenue-plan-bulk-table td.revenue-plan-bulk-error-cell,
  .revenue-plan-bulk-table td.revenue-plan-bulk-action-cell {
    grid-column: 1 / -1;
    width: 100%;
  }
  .revenue-plan-progress { display: block; width: 100%; margin: 3px 0; }
  .revenue-plan-generator { grid-template-columns: 1fr; }
  .revenue-plan-generator label { min-width: 0; }
  .revenue-plan-forecast-explanation > header,
  .revenue-plan-forecast-components article { align-items: flex-start; flex-direction: column; }
  .revenue-plan-confidence { white-space: normal; }
  .revenue-plan-forecast-totals { grid-template-columns: 1fr; }
  .revenue-plan-month-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .revenue-plan-month-actions .btn { width: 100%; }
  .revenue-plan-month-editor > .revenue-plan-daily-total { margin-left: 0; text-align: left; }
  .revenue-plan-chart {
    width: 100%;
    min-width: 0;
    height: 170px;
  }
  .revenue-plan-bonus-summary {
    display: flex;
    overflow-x: auto;
  }
  .revenue-plan-bonus-summary > div { min-width: 145px; }
  .revenue-plan-allocation-form { grid-template-columns: 1fr; }
  .revenue-plan-allocation-link { grid-template-columns: 1fr; }
  .revenue-plan-bonus-actions { align-items: stretch; flex-direction: column; }
  .revenue-plan-bonus-actions .btn { width: 100%; }
  .revenue-plan-decision-panel { grid-template-columns: 1fr; }
  .revenue-plan-decision-panel > div:last-child { grid-column: auto; flex-direction: column; }
  .revenue-plan-decision-panel .btn { width: 100%; }
}
