:root {
  --ji-green: #3dbc8c;
  --ji-yellow: #fbaa00;
  --ji-black: #000000;
  --ji-ink: #0a0c0c;
  --ji-muted: #68706d;
  --ji-border: #e5e5e5;
  --ji-soft: #f7faf9;
  --ji-white: #ffffff;
  --ji-danger: #b82105;
  --ji-radius: 8px;
  color-scheme: light;
  font-family: "Figtree", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--ji-white);
  color: var(--ji-ink);
}

button,
input {
  font: inherit;
}

.ji-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(90deg, rgba(61, 188, 140, 0.08), transparent 40%),
    var(--ji-white);
}

.ji-topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--ji-border);
  background: rgba(255, 255, 255, 0.94);
  position: sticky;
  top: 0;
  z-index: 4;
  backdrop-filter: blur(12px);
}

.ji-brand {
  display: inline-flex;
  align-items: center;
  min-width: 160px;
}

.ji-brand img {
  display: block;
  width: 188px;
  max-width: 45vw;
  height: auto;
}

.ji-status {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid rgba(61, 188, 140, 0.35);
  border-radius: 999px;
  color: #13612e;
  background: rgba(61, 188, 140, 0.09);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.ji-workspace {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 44px);
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: clamp(22px, 3vw, 40px);
  align-items: start;
}

.ji-upload {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 106px;
}

.ji-eyebrow {
  margin: 0 0 8px;
  color: #13612e;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 48px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0;
}

.ji-copy {
  max-width: 34ch;
  margin-bottom: 0;
  color: var(--ji-muted);
  font-size: 16px;
  line-height: 1.55;
}

.dropzone {
  min-height: 152px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 22px;
  border: 1.5px dashed rgba(61, 188, 140, 0.58);
  border-radius: var(--ji-radius);
  background: linear-gradient(180deg, #ffffff, #f7fbfa);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.dropzone.is-dragging {
  border-color: var(--ji-yellow);
  background: #fffaf0;
  transform: translateY(-1px);
}

.dropzone strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
}

.dropzone span:last-child {
  color: var(--ji-muted);
  font-size: 13px;
}

.dropzone-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ji-green);
  background: rgba(61, 188, 140, 0.12);
}

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

.ji-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ji-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--ji-border);
  border-radius: var(--ji-radius);
  background: var(--ji-white);
  color: var(--ji-ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.ji-button:hover {
  border-color: rgba(61, 188, 140, 0.55);
  box-shadow: 0 10px 24px rgba(10, 12, 12, 0.08);
  transform: translateY(-1px);
}

.ji-button.primary {
  color: var(--ji-white);
  border-color: var(--ji-black);
  background: var(--ji-black);
}

.ji-button.primary:hover {
  border-color: var(--ji-green);
  background: #0d1512;
}

.ji-button.ghost {
  background: transparent;
}

.ji-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

input:focus {
  border-color: var(--ji-green);
  box-shadow: 0 0 0 3px rgba(61, 188, 140, 0.18);
}

.valuation-settings,
.manual-entry,
.loaded-position {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--ji-border);
}

.assumptions-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settlement-field {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.settlement-field legend {
  margin-bottom: 6px;
  color: var(--ji-muted);
  font-size: 12px;
  font-weight: 800;
}

.settlement-segments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px;
  border: 1px solid var(--ji-border);
  border-radius: var(--ji-radius);
  background: #f3f6f5;
}

.settlement-segments label {
  position: relative;
  min-width: 0;
}

.settlement-segments input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settlement-segments span {
  min-height: 36px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--ji-muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.settlement-segments input:checked + span {
  color: var(--ji-ink);
  background: var(--ji-white);
  box-shadow: 0 1px 4px rgba(10, 12, 12, 0.12);
}

.settlement-segments input:focus-visible + span {
  outline: 3px solid rgba(61, 188, 140, 0.24);
  outline-offset: 1px;
}

.settlement-field small {
  display: block;
  margin-top: 6px;
  color: var(--ji-muted);
  font-size: 12px;
  font-weight: 700;
}

.manual-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.manual-heading span {
  color: var(--ji-muted);
  font-size: 12px;
  font-weight: 700;
}

.manual-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.manual-field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.manual-field span {
  color: var(--ji-muted);
  font-size: 12px;
  font-weight: 800;
}

.manual-field input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--ji-border);
  border-radius: var(--ji-radius);
  outline: none;
  color: var(--ji-ink);
  background: var(--ji-white);
}

.input-with-suffix {
  position: relative;
  display: block;
}

.input-with-suffix input {
  padding-right: 34px;
}

.input-with-suffix b {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--ji-muted);
  font-size: 12px;
  pointer-events: none;
}

.assumptions-submit,
.manual-submit {
  grid-column: 1 / -1;
}

.manual-position-list {
  display: grid;
  gap: 7px;
}

.manual-position-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 11px;
  border: 1px solid var(--ji-border);
  border-radius: var(--ji-radius);
  background: #fbfdfc;
}

.manual-position-row strong,
.manual-position-row span {
  display: block;
}

.manual-position-row strong {
  font-size: 13px;
}

.manual-position-row span {
  margin-top: 2px;
  color: var(--ji-muted);
  font-size: 11px;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--ji-border);
  border-radius: 6px;
  color: var(--ji-muted);
  background: var(--ji-white);
  cursor: pointer;
}

.icon-button:hover {
  border-color: rgba(184, 33, 5, 0.35);
  color: var(--ji-danger);
}

.ji-results {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.metric {
  min-height: 124px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--ji-border);
  border-radius: var(--ji-radius);
  background: rgba(255, 255, 255, 0.92);
}

.metric-label {
  color: var(--ji-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.metric-value {
  color: var(--ji-black);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.05;
}

.metric-note {
  color: var(--ji-muted);
  font-size: 12px;
  line-height: 1.35;
}

.currency-stack {
  display: grid;
  gap: 4px;
  font-size: 17px;
}

.ji-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 5px;
  border: 1px solid var(--ji-border);
  border-radius: var(--ji-radius);
  background: #f7faf9;
}

.tab-button {
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ji-muted);
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.tab-button.active {
  color: var(--ji-black);
  background: var(--ji-white);
  box-shadow: 0 6px 16px rgba(10, 12, 12, 0.07);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.summary-filter-bar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.summary-filter-bar > span {
  color: var(--ji-muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.summary-segments {
  display: inline-flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid var(--ji-border);
  border-radius: var(--ji-radius);
  background: #f7faf9;
}

.summary-segment {
  min-height: 34px;
  padding: 7px 11px;
  border: 0;
  border-radius: 5px;
  color: var(--ji-muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.summary-segment.active {
  color: var(--ji-black);
  background: var(--ji-white);
  box-shadow: 0 4px 12px rgba(10, 12, 12, 0.07);
}

.insight-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.insight-block,
.portfolio-card,
.history-main,
.history-side {
  border: 1px solid var(--ji-border);
  border-radius: var(--ji-radius);
  background: var(--ji-white);
}

.insight-block,
.portfolio-card,
.history-side {
  padding: 18px;
}

.wide {
  grid-column: 1 / -1;
}

.block-heading,
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.block-heading span,
.table-toolbar span {
  color: var(--ji-muted);
  font-size: 13px;
  font-weight: 700;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.metric-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--ji-border);
  border-radius: var(--ji-radius);
  overflow: hidden;
  background: var(--ji-white);
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ji-border);
}

.metric-row:last-child {
  border-bottom: 0;
}

.metric-row span {
  color: var(--ji-ink);
  font-size: 14px;
}

.metric-row strong {
  color: var(--ji-black);
  font-size: 15px;
  font-weight: 800;
  text-align: right;
}

.metric-row.highlight {
  background: #fbfdfc;
}

.metric-row.highlight strong {
  color: #13612e;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 190px) minmax(130px, 1fr) minmax(60px, auto);
  gap: 12px;
  align-items: center;
}

.bar-label {
  min-width: 0;
  color: var(--ji-ink);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f0;
}

.bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ji-green), var(--ji-yellow));
}

.bar-value {
  text-align: right;
  color: var(--ji-muted);
  font-size: 13px;
  font-weight: 800;
}

.table-toolbar {
  min-height: 62px;
  padding: 4px 2px 0;
}

.table-toolbar input {
  width: min(280px, 42vw);
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--ji-border);
  border-radius: var(--ji-radius);
  outline: none;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--ji-border);
  border-radius: var(--ji-radius);
  background: var(--ji-white);
}

table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--ji-border);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--ji-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #f7faf9;
}

td {
  font-size: 14px;
}

tr:last-child td {
  border-bottom: 0;
}

.num {
  text-align: right;
}

.asset-main {
  display: grid;
  gap: 3px;
}

.asset-main strong {
  font-size: 15px;
}

.asset-main span {
  color: var(--ji-muted);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.pill.ok {
  color: #13612e;
  background: rgba(61, 188, 140, 0.12);
}

.pill.warn {
  color: #865a00;
  background: rgba(251, 170, 0, 0.16);
}

.pill.bad {
  color: var(--ji-danger);
  background: rgba(184, 33, 5, 0.09);
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.group-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--ji-border);
  border-radius: var(--ji-radius);
  background: var(--ji-white);
}

.group-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.group-header h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.group-header span {
  color: var(--ji-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.technical-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.technical-meta span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--ji-border);
  border-radius: 6px;
  color: var(--ji-muted);
  background: #f7faf9;
  font-size: 12px;
  font-weight: 800;
}

.group-assets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.group-assets span {
  min-height: 24px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #f7faf9;
  color: var(--ji-muted);
  font-size: 12px;
  font-weight: 800;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(61, 188, 140, 0.12);
  color: #13612e;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.yield-curve-chart {
  min-height: 480px;
  padding: 18px;
  border: 1px solid var(--ji-border);
  border-radius: var(--ji-radius);
  background: var(--ji-white);
}

.yield-plot {
  overflow-x: auto;
}

.yield-plot svg {
  width: 100%;
  min-width: 620px;
  height: auto;
  display: block;
}

.yield-grid line {
  stroke: #e4ebe8;
  stroke-width: 1;
}

.yield-grid text {
  fill: #4f5955;
  font-size: 13px;
  font-weight: 400;
}

.yield-trajectory {
  fill: none;
  stroke: #aebbb6;
  stroke-width: 2;
  stroke-dasharray: 6 6;
}

.yield-point {
  cursor: crosshair;
  stroke: var(--ji-white);
  stroke-width: 3;
  transition: stroke-width 160ms ease, filter 160ms ease;
}

.yield-point:hover,
.yield-point:focus {
  stroke: var(--ji-black);
  stroke-width: 4;
  filter: drop-shadow(0 3px 4px rgba(10, 12, 12, 0.2));
  outline: none;
}

.axis-label {
  fill: var(--ji-ink);
  font-size: 13px;
  font-weight: 500;
}

.yield-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 12px 8px 2px;
  border-top: 1px solid var(--ji-border);
}

.yield-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ji-ink);
  font-size: 12px;
}

.yield-legend-item i {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
}

.cashflow-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.cashflow-toolbar > div:first-child {
  display: grid;
  gap: 5px;
}

.cashflow-toolbar span {
  color: var(--ji-muted);
  font-size: 12px;
  font-weight: 800;
}

.cashflow-actions {
  display: grid;
  justify-items: end;
  gap: 9px;
}

.flow-downloads {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.flow-download {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.cashflow-period-filter {
  display: grid;
  grid-template-columns: auto minmax(180px, 220px) minmax(180px, 220px) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--ji-border);
  border-radius: var(--ji-radius);
  background: #f7faf9;
}

.cashflow-period-title {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  padding-right: 6px;
  color: var(--ji-ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.cashflow-period-title svg,
.cashflow-period-reset svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cashflow-period-filter label {
  display: grid;
  gap: 5px;
  color: var(--ji-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.cashflow-period-filter input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--ji-border);
  border-radius: 6px;
  color: var(--ji-ink);
  background: var(--ji-white);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  text-transform: none;
  outline: none;
}

.cashflow-period-filter input:focus {
  border-color: var(--ji-green);
  box-shadow: 0 0 0 3px rgba(61, 188, 140, 0.13);
}

.cashflow-period-reset {
  min-height: 38px;
  padding: 8px 11px;
  font-size: 12px;
}

.projected-cashflow-chart {
  position: relative;
  min-height: 480px;
  padding: 18px;
  border: 1px solid var(--ji-border);
  border-radius: var(--ji-radius);
  background: var(--ji-white);
}

.cashflow-plot {
  overflow-x: auto;
  padding-bottom: 6px;
}

.cashflow-plot svg {
  display: block;
  max-width: none;
  flex: 0 0 auto;
}

.cashflow-grid line {
  stroke: #e4ebe8;
  stroke-width: 1;
}

.cashflow-grid text,
.cashflow-month-label {
  fill: var(--ji-muted);
  font-size: 11px;
  font-weight: 400;
}

.cashflow-total-label {
  fill: var(--ji-ink);
  font-size: 10px;
  font-weight: 600;
}

.cashflow-axis-line {
  stroke: #aebbb6;
  stroke-width: 1;
}

.cashflow-segment {
  cursor: crosshair;
  stroke: var(--ji-white);
  stroke-width: 1;
  transition: opacity 150ms ease, stroke-width 150ms ease;
}

.cashflow-segment:hover,
.cashflow-segment:focus {
  opacity: 0.82;
  stroke: var(--ji-black);
  stroke-width: 2;
  outline: none;
}

.cashflow-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 8px;
  padding: 2px 8px 12px;
  border-bottom: 1px solid var(--ji-border);
}

.cashflow-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ji-ink);
  font-size: 12px;
  font-weight: 700;
}

.cashflow-legend-item i {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 2px;
}

.cashflow-tooltip {
  position: absolute;
  z-index: 4;
  max-width: min(330px, calc(100% - 16px));
  padding: 9px 11px;
  border: 1px solid #aebbb6;
  border-radius: 6px;
  color: var(--ji-black);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 22px rgba(10, 12, 12, 0.12);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  pointer-events: none;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--ji-border);
  border-radius: var(--ji-radius);
  color: var(--ji-muted);
  text-align: center;
  background: #fbfdfc;
}

.ji-footnote {
  margin-top: auto;
  padding: 18px clamp(18px, 4vw, 48px) 30px;
  color: var(--ji-muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 1120px) {
  .ji-workspace {
    grid-template-columns: 1fr;
  }

  .ji-upload {
    position: static;
  }

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

@media (max-width: 780px) {
  .ji-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .ji-status {
    width: 100%;
    justify-content: flex-start;
  }

  .summary-grid,
  .insight-layout,
  .group-grid {
    grid-template-columns: 1fr;
  }

  .summary-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-segments {
    width: 100%;
  }

  .summary-filter-bar > span {
    white-space: normal;
  }

  .wide {
    grid-column: auto;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .bar-value {
    text-align: left;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .table-toolbar input {
    width: 100%;
  }

  .group-header,
  .metric-row {
    grid-template-columns: 1fr;
  }

  .group-header {
    display: grid;
  }

  .metric-row strong {
    text-align: left;
  }

  .cashflow-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .cashflow-actions {
    justify-items: stretch;
  }

  .flow-downloads {
    justify-content: flex-start;
  }

  .cashflow-period-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cashflow-period-title {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 32px;
  }

  .ji-workspace {
    padding: 18px 14px;
  }

  .ji-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .manual-form {
    grid-template-columns: 1fr;
  }

  .assumptions-form {
    grid-template-columns: 1fr;
  }

  .assumptions-submit,
  .manual-submit {
    grid-column: auto;
  }

  .ji-button {
    width: 100%;
  }

  .cashflow-period-filter {
    grid-template-columns: 1fr;
  }

  .cashflow-period-title {
    grid-column: auto;
  }

}
