:root {
  --bg: #ecf2f7;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --ink: #17232e;
  --muted: #5d6976;
  --line: rgba(146, 167, 188, 0.26);
  --line-strong: rgba(123, 148, 173, 0.42);
  --a1: #1f9a71;
  --a3: #dd8b2d;
  --b: #3179cf;
  --loss: #d15639;
  --gain: #1f9a71;
  --soft-loss: #fff0ea;
  --soft-gain: #edf9f2;
  --soft-blue: #eef5ff;
  --soft-neutral: #f4f7f9;
  --hero: linear-gradient(135deg, #ffffff 0%, #f4f9fd 56%, #edf5fb 100%);
  --panel-glow: radial-gradient(circle at top right, rgba(49, 121, 207, 0.1), transparent 40%);
  --shadow: 0 22px 48px rgba(23, 35, 46, 0.08);
  --shadow-soft: 0 10px 26px rgba(23, 35, 46, 0.05);
  font-size: 16px;
}

@media (max-height: 900px) {
  :root {
    font-size: 14px;
  }
}

@media (max-height: 750px) {
  :root {
    font-size: 13px;
  }
}

@media (max-height: 650px) {
  :root {
    font-size: 12px;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at top left, rgba(76, 151, 221, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(31, 154, 113, 0.08), transparent 24%),
    linear-gradient(180deg, #f7fafc 0%, #edf3f7 100%);
  color: var(--ink);
  font-family: "Segoe UI", "Aptos", sans-serif;
}

.screen {
  width: 100%;
  max-width: 1920px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 280px;
  grid-template-rows: auto auto minmax(320px, 1fr) auto auto;
  gap: 0.75rem;
}

.money-layout-top,
.compare-layout {
  display: contents;
}

.headline {
  grid-column: 1 / -1;
  grid-row: 1;
}

.money-panel-app10 {
  grid-column: 1;
  grid-row: 2;
}

.money-panel-result {
  grid-column: 2;
  grid-row: 2;
}

.money-spacer {
  display: none !important;
}

.base-panel {
  grid-column: 1;
  grid-row: 3;
}

.after-panel {
  grid-column: 2;
  grid-row: 3;
}

.action-ribbon {
  grid-column: 1 / -1;
  grid-row: 4;
}

.footer {
  grid-column: 1 / -1;
  grid-row: 5;
}

.panel,
.headline,
.side-panel,
.action-ribbon,
.money-panel,
.footer {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 10px 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(244, 249, 253, 0.92)),
    var(--panel-glow);
  box-shadow: var(--shadow);
}

.headline-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.headline-main p {
  margin: 0;
}

.headline-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.headline h1 {
  margin: 0;
  font-family: "Bahnschrift", "Aptos", sans-serif;
  font-size: clamp(1.7rem, 2.15vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(230, 238, 244, 0.92);
  border: 1px solid rgba(146, 167, 188, 0.24);
  margin-right: 2px;
}

.lang-button {
  min-width: 52px;
  min-height: 34px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Bahnschrift", "Aptos", sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.lang-button.is-active {
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fa 100%);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(23, 35, 46, 0.08);
}

.logout-link {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(146, 167, 188, 0.26);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(23, 35, 46, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.logout-link:hover,
.logout-link:focus-visible {
  color: var(--ink);
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(23, 35, 46, 0.08);
}

.money-layout-top {
  display: contents;
}

.money-spacer {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.compare-layout {
  display: contents;
}

.panel,
.side-panel {
  min-height: 0;
  padding: 14px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.panel-label,
.side-label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

.panel-head strong {
  font-family: "Bahnschrift", "Aptos", sans-serif;
  font-size: 1.55rem;
  line-height: 1;
  white-space: nowrap;
}

.bars-grid {
  height: calc(100% - 44px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.stage-card {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
}

.bar-shell {
  height: 100%;
  min-height: 190px;
  display: flex;
  align-items: end;
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(248, 250, 251, 0.98) 0%, rgba(238, 244, 247, 0.98) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(240, 245, 249, 0.7));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.bar-fill {
  width: 100%;
  min-height: 28px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10px 8px 8px;
  color: white;
  transition: height 0.75s ease, opacity 0.3s ease;
  border-radius: 16px 16px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.bar-fill.a1 {
  background: linear-gradient(180deg, #49b28e 0%, var(--a1) 100%);
}

.bar-fill.a3 {
  background: linear-gradient(180deg, #f0aa57 0%, var(--a3) 100%);
}

.bar-fill.b {
  background: linear-gradient(180deg, #5b96dd 0%, var(--b) 100%);
}

.is-base .bar-fill {
  opacity: 0.64;
  filter: saturate(0.82);
}

.bar-value {
  font-family: "Bahnschrift", "Aptos", sans-serif;
  font-size: clamp(1.6rem, 2.2vw, 2.2rem);
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.bar-meta {
  min-height: 28px;
  font-weight: 800;
}

.stage-card.is-base .bar-meta {
  display: flex;
  justify-content: center;
  align-items: center;
}

.stage-card.is-live .bar-meta {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 0 4px;
}

.bar-stage {
  font-size: 1.34rem;
  text-align: center;
  font-family: "Bahnschrift", "Aptos", sans-serif;
  white-space: nowrap;
}

.stage-card.is-live .bar-stage {
  justify-self: start;
}

.bar-delta {
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.9rem;
  background: var(--soft-neutral);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.stage-card.is-live .bar-delta {
  justify-self: end;
}

.bar-delta.up {
  background: var(--soft-gain);
  color: var(--gain);
}

.bar-delta.down {
  background: var(--soft-loss);
  color: var(--loss);
}

.after-panel {
  position: relative;
}

.change-callouts {
  display: none;
}

.change-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 800;
}

.change-badge.up {
  background: var(--soft-gain);
  color: var(--gain);
}

.change-badge.down {
  background: var(--soft-loss);
  color: var(--loss);
}

.side-panel {
  grid-column: 3;
  grid-row: 2 / 4;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(249, 252, 254, 0.92)),
    var(--panel-glow);
}

.side-group {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(247, 250, 252, 0.95), rgba(241, 246, 250, 0.95));
  border: 1px solid rgba(146, 167, 188, 0.18);
}

.solo-card,
.mini-tile,
.strip-tile {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafcfd;
}

.solo-card {
  min-height: 74px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #fff8f5 0%, #fff2eb 100%);
}

.solo-title {
  color: var(--muted);
  font-weight: 700;
}

.solo-card strong,
.mini-tile strong,
.strip-tile strong {
  font-family: "Bahnschrift", "Aptos", sans-serif;
  font-size: 1.45rem;
  line-height: 1;
}

.solo-card strong {
  color: var(--loss);
}

.stage-transfer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-content: start;
}

.mini-tile,
.strip-tile {
  min-height: 52px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.mini-tile span,
.strip-tile span {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.95rem;
}

.strip-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-content: start;
}

.strip-tile {
  min-height: 48px;
  background: linear-gradient(180deg, #f2f7fb 0%, #edf4f8 100%);
}

.action-ribbon {
  padding: 10px 14px;
  display: grid;
  grid-template-columns: minmax(320px, max-content) 1fr;
  gap: 12px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(245, 249, 252, 0.94)),
    var(--panel-glow);
}

.action-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.action-banner {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(90deg, #204d85 0%, #3179cf 100%);
  color: white;
  font-family: "Bahnschrift", "Aptos", sans-serif;
  font-size: 1.12rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.action-banner.inside {
  background: linear-gradient(90deg, #455361 0%, #5e6c7a 100%);
}

.action-banner.outside {
  background: linear-gradient(90deg, #b14d2f 0%, #d96a41 100%);
}

.action-banner.neutral {
  background: linear-gradient(90deg, #204d85 0%, #3179cf 100%);
}

.action-banner:hover {
  filter: brightness(1.04);
  box-shadow: 0 10px 22px rgba(49, 121, 207, 0.26);
}

.action-banner:active {
  transform: translateY(1px);
}

.action-banner:focus-visible {
  outline: 3px solid rgba(49, 121, 207, 0.28);
  outline-offset: 2px;
}

.action-banner:disabled {
  cursor: default;
  filter: grayscale(0.08);
  opacity: 0.72;
  box-shadow: none;
}

.action-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  align-content: center;
}

.help-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #eef4fb 0%, #e1edf9 100%);
  color: #225f9c;
  font-family: "Bahnschrift", "Aptos", sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.help-button.hidden {
  display: none;
}

.action-chip {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.92rem;
  color: white;
  display: inline-flex;
  align-items: center;
}

.action-chip.transfer_inside_group {
  background: #4c5c6a;
}

.action-chip.transfer_outside_group,
.action-chip.split_transfer_assumption,
.action-chip.cancelled {
  background: var(--loss);
}

.action-chip.new_work_added,
.action-chip.split_added_to_group,
.action-chip.transfer_added_to_group {
  background: var(--gain);
}

.action-chip.neutral {
  background: var(--soft-blue);
  color: #225f9c;
}

.action-chip.split-summary {
  background: #d15639;
}

.action-chip.split-detail-inside {
  background: #eef3f7;
  color: #506170;
}

.action-chip.split-detail-outside {
  background: var(--soft-loss);
  color: var(--loss);
}

.money-panel {
  padding: 12px 14px;
  display: grid;
  grid-template-rows: auto 26px auto;
  gap: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(245, 249, 252, 0.94)),
    var(--panel-glow);
}

.money-panel .panel-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.money-track {
  overflow: hidden;
  border-radius: 999px;
  background: #e2eaf0;
  box-shadow: inset 0 1px 2px rgba(23, 35, 46, 0.06);
}

.money-fill {
  height: 100%;
}

.money-fill-base {
  width: 100%;
  background: #8f9ba7;
}

.money-fill-live {
  width: 100%;
  transition: width 0.75s ease;
  background: linear-gradient(90deg, var(--a1) 0%, #4ec08f 100%);
}

.money-fill-live.is-below {
  background: linear-gradient(90deg, #d15639 0%, #ef8d6f 100%);
}

.money-fill-live.is-equal {
  background: linear-gradient(90deg, #1f9a71 0%, #56c89a 100%);
}

.money-fill-live.is-above {
  background: linear-gradient(90deg, #1f9a71 0%, #3179cf 100%);
}

.money-panel strong {
  font-family: "Bahnschrift", "Aptos", sans-serif;
  font-size: 1.95rem;
  line-height: 1;
}

.money-track-segmented {
  display: flex;
  overflow: hidden;
}

.money-segment {
  position: relative;
  min-width: 0;
  padding: 4px 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-family: "Bahnschrift", "Aptos", sans-serif;
  white-space: nowrap;
}

.money-segment.a1 {
  background: linear-gradient(180deg, #49b28e 0%, var(--a1) 100%);
}

.money-segment.a3 {
  background: linear-gradient(180deg, #f0aa57 0%, var(--a3) 100%);
}

.money-segment.b {
  background: linear-gradient(180deg, #5b96dd 0%, var(--b) 100%);
}

.money-segment-label {
  position: absolute;
  left: 10px;
  font-size: 1.02rem;
  font-weight: 800;
  opacity: 0.9;
  white-space: nowrap;
}

.money-segment-value {
  font-size: 1.02rem;
  font-weight: 800;
  white-space: nowrap;
  text-align: center;
}

.money-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
}

.money-badge {
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--muted);
  background: var(--soft-neutral);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.money-badge.up {
  background: var(--soft-gain);
  color: var(--gain);
}

.money-badge.down {
  background: var(--soft-loss);
  color: var(--loss);
}

.money-badge.neutral {
  display: none;
}

.footer {
  padding: 8px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 252, 0.94)),
    var(--panel-glow);
}

.progress {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
}

.progress-dot {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e8edf1;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.progress-dot.done {
  background: #dff4ea;
  color: var(--gain);
}

.progress-dot.active {
  background: #dceafe;
  color: #225f9c;
}

.formula-note {
  min-height: 16px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
}

.button {
  min-width: 120px;
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.button:disabled {
  opacity: 0.44;
  cursor: not-allowed;
}

.button-primary {
  background: linear-gradient(180deg, #29ac7f 0%, #1f9a71 100%);
  border-color: #197454;
  color: white;
}

.button-light {
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fa 100%);
  color: var(--ink);
}

.flash {
  animation: flash 0.6s ease;
}

.table-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(23, 35, 46, 0.38);
}

.table-modal.hidden {
  display: none;
}

.table-card {
  width: min(1680px, 100%);
  max-height: min(88vh, 980px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 24px 60px rgba(23, 35, 46, 0.24);
}

.table-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.table-head strong {
  display: block;
  margin-bottom: 4px;
  font-family: "Bahnschrift", "Aptos", sans-serif;
  font-size: 1.55rem;
}

.table-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.help-card {
  width: min(760px, 100%);
  max-height: initial;
}

.help-body {
  display: grid;
  gap: 18px;
}

.help-total {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eef5ff;
  color: #225f9c;
  font-family: "Bahnschrift", "Aptos", sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
}

.help-section {
  display: grid;
  gap: 8px;
}

.help-lines {
  display: grid;
  gap: 10px;
  max-height: 58vh;
  padding-right: 4px;
  overflow: auto;
}

.help-scenario-card {
  display: grid;
  grid-template-columns: 150px 36px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfd;
}

.help-source-box {
  min-height: 60px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  border-radius: 10px;
  background: white;
  border: 1px solid var(--line);
}

.help-source-box strong {
  font-family: "Bahnschrift", "Aptos", sans-serif;
  font-size: 1.45rem;
  line-height: 1;
}

.help-arrow {
  display: grid;
  place-items: center;
  color: #225f9c;
  font-family: "Bahnschrift", "Aptos", sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
}

.help-destination-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.help-destination-column {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.help-destination-stage {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.help-destination-box {
  width: 100%;
  min-height: 42px;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: "Bahnschrift", "Aptos", sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  background: white;
}

.help-destination-box.inside {
  background: linear-gradient(90deg, #495764 0%, #62717f 100%);
  color: white;
  border-color: transparent;
}

.help-destination-box.outside {
  background: linear-gradient(90deg, #c75a38 0%, #e07b57 100%);
  color: white;
  border-color: transparent;
}

.help-destination-box.empty {
  background: transparent;
  border-style: dashed;
  color: transparent;
}

.calc-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.calc-table th,
.calc-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.calc-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f8fb;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.calc-table td {
  font-size: 0.95rem;
}

.table-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.table-up {
  color: var(--gain);
  font-weight: 800;
}

.table-down {
  color: var(--loss);
  font-weight: 800;
}

.table-flat {
  color: var(--muted);
  font-weight: 800;
}

@keyframes flash {
  0% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}

@media (max-width: 1180px) {
  :root {
    font-size: 14px;
  }

  html,
  body {
    overflow-y: auto;
  }

  .screen {
    height: auto;
    min-height: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .headline,
  .money-panel-app10,
  .money-panel-result,
  .base-panel,
  .after-panel,
  .side-panel,
  .action-ribbon,
  .footer {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }

  .money-spacer {
    display: none !important;
  }

  .bar-shell {
    min-height: 230px;
  }

  .side-panel {
    margin-top: 0;
    min-height: 0;
  }

  .action-ribbon {
    grid-template-columns: 1fr;
  }

  .action-banner {
    white-space: normal;
  }
}

@media (max-width: 820px) {
  .screen {
    padding: 12px;
    gap: 12px;
  }

  .panel,
  .side-panel,
  .headline,
  .money-panel,
  .action-ribbon,
  .footer {
    border-radius: 16px;
  }

  .panel-head {
    align-items: start;
    flex-direction: column;
  }

  .headline,
  .headline-main {
    align-items: stretch;
    flex-direction: column;
  }

  .lang-switch {
    align-self: flex-end;
  }

  .bars-grid {
    grid-template-columns: 1fr;
  }

  .bar-shell {
    min-height: 180px;
  }

  .action-main {
    grid-template-columns: 1fr;
  }

  .controls {
    flex-direction: column;
    justify-content: stretch;
  }

  .button,
  .action-banner {
    width: 100%;
  }
}
