@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@700;800&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

:root {
  --page-bg: #ffffff;
  --panel-bg: #ffffff;
  --line: #777;
  --dark: #3e3e3e;
  --muted: #6d6d6d;
  --green: #49bb58;
  --deep-green: #017f0f;
  --blue: #1eb5df;
  --red: #fd0000;
  --white: #fafafa;
  --shadow: rgba(20, 20, 20, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 10px 8px;
  background: radial-gradient(
    circle at top,
    #efefef 0%,
    #dddddd 58%,
    #d4d4d4 100%
  );
  color: #111;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 13px;
}

.browser-shell {
  border: 2px solid #7f7f7f;
  border-radius: 6px;
  background: #ddd;
  max-width: 1200px;
  margin: 0 auto;
  box-shadow: 0 12px 20px var(--shadow);
  overflow: hidden;
  animation: fade-in 500ms ease;
}

.browser-bar {
  border-bottom: 2px solid #868686;
  background: #c8c8c8;
  height: 36px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 4px 12px;
}

.browser-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #3b3b3b;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0.75px;
  user-select: none;
}

.address {
  border: 2px solid #727272;
  border-radius: 7px;
  background: #f2f2f2;
  height: 22px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: #333;
  font-size: 11px;
}

.dashboard {
  padding: 6px 8px;
  background: var(--page-bg);
}

.page-back-wrap {
  margin: 2px 0 10px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: #545454;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: color 120ms ease;
}

.back-link:hover {
  color: #1f1f1f;
}

.back-link:focus-visible {
  outline: 2px solid #6c6c6c;
  outline-offset: 2px;
  border-radius: 3px;
}

.back-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 120ms ease;
}

.back-link:hover .back-icon {
  transform: translateX(-1px);
}

.app-fixed {
  height: min(660px, calc(100vh - 20px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-shell {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  flex: 1;
  min-height: 0;
}

.sidebar-nav {
  border: 2px solid #d2d2d2;
  background: #ffffff;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 100%;
}

.sidebar-nav-title {
  margin: 0 0 6px;
  padding: 3px 6px;
  border-bottom: 1px solid #cfcfcf;
  color: #6a6a6a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.25px;
  text-transform: uppercase;
}

.sidebar-link {
  text-decoration: none;
  color: #4e4e4e;
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 40px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 600;
  transition:
    background 120ms ease,
    color 120ms ease,
    border-color 120ms ease;
}

.sidebar-link:hover {
  background: #dddddd;
  border-color: #cbcbcb;
  color: #222;
}

.sidebar-link.active {
  background: #3e3e3e;
  border-color: #3e3e3e;
  color: #f4f4f4;
}

.sidebar-icon {
  width: 16px;
  height: 16px;
  color: #5c5c5c;
  flex-shrink: 0;
}

.sidebar-link.active .sidebar-icon {
  color: #f4f4f4;
}

.sidebar-content {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.top-row {
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  align-items: start;
  gap: 8px;
  margin-bottom: 20px;
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: slide-up 450ms ease forwards;
  animation-delay: 80ms;
}

.logo-mark {
  width: 90px;
  height: 90px;

  position: relative;
  display: block;
  object-fit: contain;
}

.logo-mark:not(img)::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #31c1e9;
  bottom: 24px;
  left: 52px;
  box-shadow: 28px -22px 0 #31c1e9;
}

.logo-wording {
  line-height: 1.03;
  font-family: "Archivo", sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.15px;
}

.logo-wording span {
  color: var(--blue);
}

.title {
  margin: 6px 0 0;
  text-align: center;
  font-family: "Archivo", sans-serif;
  font-size: clamp(15px, 3vw, 48px);
  font-weight: 300;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0;
  animation: slide-up 450ms ease forwards;
  animation-delay: 120ms;
}

.profile-wrap {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 318px;
  opacity: 0;
  animation: slide-up 450ms ease forwards;
  animation-delay: 160ms;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.identity {
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  padding-right: 76px;
  word-wrap: break-word;
}

.hamburger {
  position: absolute;
  right: 0;
  top: 0;
  width: 72px;
  height: 55px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
}

.hamburger span {
  display: block;
  width: 52px;
  height: 7px;
  border-radius: 5px;
  margin: 5px 0;
  background: #506078;
  transition:
    transform 240ms ease,
    opacity 240ms ease;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(12px) rotate(35deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-12px) rotate(-35deg);
}

.menu {
  position: fixed;
  right: 24px;
  top: 56px;
  width: 300px;
  border: 2px solid #808080;
  background: #dfdfdf;
  list-style: none;
  margin: 0;
  padding: 20px 18px 22px;
  transform: translateY(-6px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
  z-index: 9999;
  font-size: 16px;
  font-weight: 600;
  color: #5f5f5f;
}

.menu.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.menu li {
  margin: 5px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu .icon {
  font-size: 16px;
  min-width: 20px;
}

.menu li::before {
  content: "- ";
  color: #404040;
}

.menu li {
  transition:
    background 120ms ease,
    color 120ms ease;
  padding: 6px 8px;
  margin: 2px -8px;
  border-radius: 3px;
  cursor: pointer;
}

.menu li:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #3e3e3e;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3px;
  align-items: start;
}

/* place the transactions card in the right column above charts */
.layout > .tx-card {
  grid-column: 2 / 3;
  align-self: start;
  margin: 0 0 3px 0;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 8px;
  align-items: start;
  grid-auto-rows: minmax(120px, auto);
}

.chart-card {
  opacity: 0;
  animation: slide-up 420ms ease forwards;
  transform-origin: center bottom;
  min-height: 160px;
  padding: 8px;
}

.chart-canvas-wrap {
  position: relative;
  height: 200px;
}

.chart-card:nth-child(1) {
  animation-delay: 200ms;
}

.chart-card:nth-child(2) {
  animation-delay: 240ms;
}

.chart-card:nth-child(3) {
  animation-delay: 280ms;
}

.chart-card:nth-child(4) {
  animation-delay: 320ms;
}

.chart-card:nth-child(5) {
  animation-delay: 360ms;
}

.chart-title {
  margin: 0 0 8px;
  text-align: center;
  font-size: 14px;
  color: #686868;
  font-weight: 500;
  line-height: 1.2;
}

.chart-legend {
  display: flex;
  gap: 8px;
  justify-content: center;
  font-size: 12px;
  color: #6a6a6a;
  margin: 4px 0;
  flex-wrap: wrap;
}

.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

.chart-value {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12px;
  color: #7a7a7a;
  font-weight: 500;
}

.bar-chart,
.hbar-chart {
  border-left: 2px solid #666;
  border-bottom: 2px solid #666;
  padding: 6px 8px 0;
  position: relative;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 18px,
    #e8e8e8 18px,
    #e8e8e8 19px
  );
}

.bar-chart {
  height: 220px;
  display: flex;
  align-items: end;
  gap: 12px;
  width: 96%;
  margin: 0 auto;
}

.bar-pair {
  display: flex;
  align-items: end;
  gap: 0;
  height: 100%;
  flex: 1;
}

.bar {
  width: 26px;
  border: 1.5px solid #7b7b7b;
  border-bottom-width: 0;
  background: #dcdcdc;
  height: var(--h);
  transform-origin: bottom;
  transform: scaleY(0);
  animation: grow-up 600ms ease forwards;
}

.bar.dark {
  background: #8f8f8f;
}

.bar-pair:first-child .bar:first-child {
  --h: 47%;
}

.bar-pair:first-child .bar:last-child {
  --h: 34%;
}

.bar-pair:last-child .bar:first-child {
  --h: 72%;
}

.bar-pair:last-child .bar:last-child {
  --h: 60%;
}

.pie {
  width: 220px;
  height: 220px;
  margin: 8px auto 0;
  border-radius: 50%;
  border: 2px solid #666;
  background: conic-gradient(#e8e8e8 0 52%, #4a4a4a 52% 76%, #b0b0b0 76% 100%);
  animation: spin-in 600ms ease;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.08);
}

.calendar {
  border: 2px solid #7a7a7a;
  background: #dfdfdf;
  width: 100%;
  min-width: 240px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.calendar-head {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
  border-bottom: 2px solid #7a7a7a;
  font-size: 14px;
  color: #666;
  text-align: center;
  height: 36px;
}

.calendar-nav-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: #3f3f3f;
  cursor: pointer;
  padding: 0;
  width: 34px;
  height: 44px;
  display: grid;
  place-items: center;
  transition:
    background 120ms ease,
    color 120ms ease;
}

.calendar-nav-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #1a1a1a;
}

#monthYear {
  font-weight: 600;
  color: #3f3f3f;
}

.calendar-grid {
  width: 100%;
  border-collapse: collapse;
  color: #6f6f6f;
  text-align: center;
  font-size: 13px;
}

.calendar-grid td,
.calendar-grid th {
  border-right: 1px solid #cdcdcd;
  padding: 2px 0;
  font-weight: 500;
}

.calendar-grid td:last-child,
.calendar-grid th:last-child {
  border-right: 0;
}

.calendar-grid td.today {
  font-weight: 700;
  color: var(--deep-green);
  background: rgba(1, 127, 15, 0.08);
}

.gauge {
  width: min(260px, 100%);
  aspect-ratio: 2 / 1;
  margin: 8px auto 0;
  border-radius: 160px 160px 0 0;
  background: conic-gradient(
    from 180deg,
    var(--green) 0 56%,
    var(--red) 56% 100%
  );
  position: relative;
  overflow: hidden;
}

.gauge::before {
  content: "";
  position: absolute;
  inset: 24px 24px -50%;
  border-radius: 200px 200px 0 0;
  background: var(--page-bg);
}

.needle {
  position: absolute;
  width: 92px;
  height: 10px;
  border-radius: 6px;
  background: #3a3a3a;
  left: calc(50% - 10px);
  top: calc(58% - 5px);
  transform-origin: 10px 5px;
  transform: rotate(-54deg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.needle::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4a4a4a;
  left: -3px;
  top: -3px;
}

.gauge-label {
  text-align: center;
  margin-top: 10px;
  /* push label below the meter */
  font-size: 18px;
  color: #676767;
}

.gauge-canvas-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 6px auto 0;
}

.gauge-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Styled HTML meter for compliance */
.meter-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 4px;
}

.compliance-meter {
  width: 180px;
  height: 18px;
  -webkit-appearance: none;
  appearance: none;
  border: 2px solid #7a7a7a;
  border-radius: 10px;
  background: linear-gradient(90deg, #e8e8e8, #e8e8e8);
  display: block;
  transition: background 600ms ease;
}

.compliance-meter::-webkit-meter-bar {
  background: transparent;
  border-radius: 8px;
}

.compliance-meter::-webkit-meter-optimum-value {
  background: linear-gradient(90deg, var(--green), #7fcf86);
  border-radius: 8px;
}

.compliance-meter::-webkit-meter-suboptimum-value {
  background: linear-gradient(90deg, #ffd28a, #ffb86b);
  border-radius: 8px;
}

.compliance-meter::-webkit-meter-even-less-good-value {
  background: linear-gradient(90deg, #ff9b9b, #ff6b6b);
  border-radius: 8px;
}

/* Firefox fallback */
.compliance-meter::-moz-meter-bar {
  background: linear-gradient(90deg, var(--green) 0%, var(--green) 100%);
  border-radius: 8px;
}

/* SVG semicircle gauge styles */
.gauge-svg-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 6px;
}

.gauge-svg {
  width: 180px;
  height: 92px;
  overflow: visible;
  display: block;
}

.gauge-track {
  stroke: #e8e8e8;
  opacity: 1;
}

.gauge-arc {
  stroke: var(--green);
  transition:
    stroke 600ms ease,
    stroke-dashoffset 800ms ease;
  transform: translateZ(0);
}

.gauge-text {
  font-weight: 700;
  fill: var(--dark);
}

.hbar-chart {
  width: 96%;
  height: 150px;
  margin: 0 auto;
  padding-top: 8px;
  display: grid;
  align-content: center;
  gap: 12px;
}

.stack {
  position: relative;
  height: 40px;
}

.stack > div {
  position: absolute;
  left: 0;
  height: 20px;
  border: 1.5px solid #7b7b7b;
  border-left-width: 0;
  transform-origin: left center;
  transform: scaleX(0);
  animation: stretch 600ms ease forwards;
}

.stack > div:first-child {
  top: 0;
  width: var(--w1);
  background: linear-gradient(to right, #e6e6e6, #d0d0d0);
  animation-delay: 90ms;
  border-color: #666;
}

.stack > div:last-child {
  top: 30px;
  width: var(--w2);
  background: linear-gradient(to right, #7a7a7a, #a0a0a0);
  animation-delay: 180ms;
  border-color: #888;
}

.side {
  opacity: 0;
  animation: slide-up 450ms ease forwards;
  animation-delay: 240ms;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tx-card {
  border: 2px solid #dedede;
  padding: 3px;
  min-height: 90px;
  position: relative;
  background: transparent;
}

.tx-card h3 {
  margin: 3px 0 3px;
  font-size: 14px;
  font-weight: 700;
}

.status-explain {
  margin: 4px 0 0;
  font-size: 11px;
  color: #666;
}

.tx-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tx-link {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid #8a8a8a;
  color: #3e3e3e;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  background: #ececec;
}

.tx-link:hover {
  background: #dfdfdf;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 8px;
  font-size: 13px;
}

.dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot.green {
  background: var(--green);
}

.dot.red {
  background: var(--red);
}

.returns {
  margin-top: 8px;
  padding: 0 12px;
}

.returns h2 {
  margin: 0 0 12px;
  text-align: center;
  font-family: "Archivo", sans-serif;
  font-size: clamp(16px, 2.2vw, 16px);
  font-weight: 300;
}

.return-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  border: 1px solid #bfbfbf;
  margin-bottom: 0;
  padding: 6px 6px;
  font-size: 13px;
  color: #5a5a5a;
  transition:
    background 120ms ease,
    box-shadow 120ms ease;
  background: #f5f5f5;
}

.return-row:nth-child(odd):not(.header-row) {
  background: #eeeeee;
}

.return-row:not(.header-row):hover {
  background: #e8e8e8;
  box-shadow:
    inset 0 0 0 1px #999,
    0 2px 4px rgba(0, 0, 0, 0.06);
}

.return-row div {
  display: grid;
  place-items: center;
  border-right: 1px solid #bfbfbf;
  text-align: center;
  line-height: 1.2;
  min-height: 36px;
}

.return-row div:first-child {
  text-align: left;
  justify-content: flex-start;
  padding: 2px 4px;
}

.return-row div:last-child {
  border-right: 0;
}

.return-row.header-row {
  font-weight: 700;
  background: #d4d4d4;
  color: #2a2a2a;
  padding: 10px 12px;
  border-bottom: 2px solid #999;
}

.tax-subtype {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #757575;
  margin-top: 2px;
}

.days-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.days-badge.ok {
  background: #c8f0d8;
  color: #0a5a1f;
}

.days-badge.warn {
  background: #ffe8c8;
  color: #8b4f00;
}

.days-badge.urgent {
  background: #ffd4d4;
  color: #a80000;
}

.bottom {
  margin: 12px auto 0;
  width: 86%;
  opacity: 0;
  animation: slide-up 450ms ease forwards;
  animation-delay: 400ms;
}

.app-fixed .top-row {
  margin-bottom: 6px;
  gap: 8px;
  grid-template-columns: 180px 1fr 238px;
}

.app-fixed .logo-mark {
  width: 58px;
  height: 58px;
}

.app-fixed .logo-wording {
  font-size: 10px;
}

.app-fixed .title {
  font-size: clamp(13px, 2vw, 28px);
  margin-top: 4px;
  letter-spacing: 0.6px;
}

.app-fixed .profile-wrap {
  max-width: 260px;
}

.app-fixed .identity {
  font-size: 11px;
  padding-right: 66px;
  line-height: 1.15;
}

.app-fixed .hamburger {
  width: 62px;
  height: 48px;
}

.app-fixed .hamburger span {
  width: 44px;
  height: 6px;
  margin: 4px 0;
}

.app-fixed .layout {
  gap: 6px;
  min-height: 0;
}

.app-fixed .layout > .tx-card {
  margin: 0;
}

.app-fixed .chart-grid {
  gap: 6px;
  grid-auto-rows: minmax(108px, auto);
}

.app-fixed .chart-card {
  min-height: 122px;
  padding: 6px;
}

.app-fixed .chart-title {
  font-size: 12px;
  margin-bottom: 6px;
}

.app-fixed .chart-value {
  margin-top: 6px;
  font-size: 11px;
}

.app-fixed .chart-legend {
  margin: 2px 0;
  font-size: 11px;
  gap: 6px;
}

.app-fixed .bar-chart {
  height: 124px;
  padding-top: 4px;
  gap: 8px;
}

.app-fixed .bar {
  width: 18px;
}

.app-fixed .pie {
  width: 138px;
  height: 138px;
  margin-top: 4px;
}

.app-fixed .calendar {
  min-height: 150px;
}

.app-fixed .calendar-head {
  height: 30px;
}

.app-fixed .calendar-grid td,
.app-fixed .calendar-grid th {
  padding: 1px 0;
  font-size: 11px;
}

.app-fixed .gauge-svg {
  width: 150px;
  height: 76px;
}

.app-fixed .gauge-canvas-wrap {
  width: 82px;
  height: 82px;
  margin-top: 4px;
}

.app-fixed .gauge-label {
  margin-top: 4px;
  font-size: 14px;
}

.app-fixed .hbar-chart {
  height: 105px;
  gap: 8px;
  padding-top: 4px;
}

.app-fixed .stack {
  height: 30px;
}

.app-fixed .stack > div {
  height: 14px;
}

.app-fixed .stack > div:last-child {
  top: 18px;
}

.app-fixed .tx-card {
  min-height: 72px;
  padding: 4px 6px;
}

.app-fixed .tx-card h3 {
  font-size: 13px;
  margin: 2px 0 4px;
}

.app-fixed .status-row {
  margin-top: 4px;
  font-size: 11px;
}

.app-fixed .dot {
  width: 14px;
  height: 14px;
}

.app-fixed .returns {
  margin-top: 2px;
  padding: 0 4px;
}

.app-fixed .return-row {
  padding: 4px;
  font-size: 11px;
}

.app-fixed .return-row div {
  min-height: 26px;
}

.app-fixed .days-badge {
  padding: 2px 6px;
  font-size: 10px;
}

.app-fixed .tax-subtype {
  font-size: 10px;
}

.app-fixed .bottom {
  margin-top: 4px;
  width: 100%;
}

.app-fixed .bottom h4 {
  margin-bottom: 6px;
  font-size: 14px;
}

.app-fixed .source-btn {
  padding: 5px 4px;
  font-size: 11px;
}

.app-fixed .tax-layout {
  gap: 6px;
}

.app-fixed .tax-charts {
  gap: 6px;
}

.app-fixed .chart-canvas-wrap {
  height: 150px;
}

.app-fixed .tax-sidebar {
  gap: 6px;
}

.app-fixed .tax-panel {
  padding: 8px 10px;
}

.app-fixed .tax-panel h3 {
  margin: 0 0 6px;
  font-size: 13px;
}

.app-fixed .funds-table {
  font-size: 12px;
}

.app-fixed .funds-table td {
  padding: 3px 0;
}

.app-fixed .report-btn {
  padding: 6px 8px;
  font-size: 11px;
  margin-bottom: 4px;
}

.app-fixed .cal-wrap {
  margin-top: 6px;
}

.app-fixed .tax-cal-head {
  height: 28px;
  font-size: 11px;
}

.app-fixed .tax-month-label {
  font-size: 11px;
}

.app-fixed .tax-cal-grid td,
.app-fixed .tax-cal-grid th {
  padding: 1px 0;
  font-size: 11px;
}

.bottom h4 {
  margin: 0 0 10px;
  text-align: center;
  font-size: 22px;
}

.sources {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid #717171;
  overflow: visible;
  border-radius: 4px;
  position: relative;
  z-index: 1;
}

.source-btn {
  appearance: none;
  margin: 0;
  font: inherit;
  cursor: pointer;
  background: linear-gradient(to bottom, #2d6f3a, #1f5930);
  border: 0;
  border-right: 1px solid #3a8047;
  color: #e6f7eb;
  text-align: center;
  padding: 8px 6px;
  font-size: 13px;
  white-space: nowrap;
  font-weight: 500;
  transition:
    background 240ms ease,
    color 240ms ease,
    opacity 240ms ease;
  position: relative;
}

.source-btn:last-child {
  border-right: 0;
}

.source-btn__label {
  display: block;
}

/* Chart.js-style tooltip (matches default dark tooltip on bar chart) */
.source-btn__tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  min-width: 148px;
  max-width: min(220px, 42vw);
  padding: 10px 12px 11px;
  background: rgba(31, 31, 31, 0.94);
  color: #fff;
  border-radius: 6px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.28),
    0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 400;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.12s ease,
    visibility 0.12s ease;
  z-index: 30;
}

.source-btn__tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(31, 31, 31, 0.94);
}

.source-btn__tooltip-title {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
  color: #fff;
}

.source-btn__tooltip-body {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-btn__swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.source-btn__swatch--online {
  background: #49bb58;
}

.source-btn__swatch--offline {
  background: #9a9a9a;
}

.source-btn:hover .source-btn__tooltip,
.source-btn:focus-visible .source-btn__tooltip {
  opacity: 1;
  visibility: visible;
}

.source-btn--online {
  background: linear-gradient(to bottom, #2d6f3a, #1f5930);
  border-right: 1px solid #3a8047;
  color: #e6f7eb;
  opacity: 1;
}

.source-btn--offline {
  background: linear-gradient(to bottom, #a0a0a0, #8a8a8a);
  border-right: 1px solid #aaaaaa;
  color: #e0e0e0;
  opacity: 0.6;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes grow-up {
  from {
    transform: scaleY(0);
  }

  to {
    transform: scaleY(1);
  }
}

@keyframes stretch {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes spin-in {
  from {
    transform: rotate(-140deg) scale(0.75);
    opacity: 0;
  }

  to {
    transform: rotate(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 1280px) {
  .top-row {
    grid-template-columns: 240px 1fr 264px;
  }

  .identity,
  .status-row,
  .returns h2,
  .tx-card h3 {
    font-size: 18px;
  }

  .chart-title,
  .gauge-label,
  .return-row,
  .bottom h4,
  .source-btn {
    font-size: 15px;
  }

  .pie {
    width: 200px;
    height: 200px;
  }

  .menu {
    width: 250px;
  }

  .app-fixed .top-row {
    grid-template-columns: 180px 1fr 238px;
  }

  .app-fixed .identity,
  .app-fixed .status-row,
  .app-fixed .returns h2,
  .app-fixed .tx-card h3 {
    font-size: 11px;
  }

  .app-fixed .chart-title,
  .app-fixed .gauge-label,
  .app-fixed .return-row,
  .app-fixed .bottom h4,
  .app-fixed .source-btn {
    font-size: 11px;
  }

  .app-fixed .pie {
    width: 138px;
    height: 138px;
  }
}

@media (max-width: 1100px) {
  .dashboard {
    padding: 18px;
  }

  .app-fixed {
    height: auto;
    overflow: visible;
  }

  .sidebar-shell {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .sidebar-nav {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 6px;
  }

  .sidebar-nav-title {
    grid-column: 1 / -1;
    margin-bottom: 2px;
  }

  .sidebar-link {
    min-height: 42px;
  }

  .sidebar-content {
    overflow: visible;
  }

  .top-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .title {
    text-align: left;
    margin-top: 0;
  }

  .profile-wrap {
    justify-self: start;
    align-items: flex-start;
  }

  .identity {
    text-align: left;
    padding-right: 62px;
  }

  .menu {
    position: fixed;
    left: 0;
    right: auto;
    top: 84px;
    width: 100%;
    max-width: 360px;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  /* make transactions card full-width above charts on narrower screens */
  .layout > .tx-card {
    grid-column: 1 / -1;
    margin: 0 0 3px 0;
    align-self: start;
  }

  .chart-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 30px 16px;
  }

  .chart-card:nth-child(5) {
    grid-column: span 2;
  }

  .returns {
    margin-top: 30px;
    padding: 0;
  }

  .bottom {
    width: 100%;
  }

  .sources {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  body {
    padding: 0;
  }

  .browser-shell {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .browser-icons {
    font-size: 16px;
    gap: 5px;
  }

  .address {
    font-size: 11px;
  }

  .logo-block {
    gap: 6px;
  }

  .logo-mark {
    width: 30px;
    height: 30px;
  }

  .logo-wording {
    font-size: 11px;
  }

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

  .sidebar-link {
    min-height: 40px;
    padding: 8px;
    font-size: 11px;
  }

  .sidebar-nav-title {
    font-size: 10px;
  }

  .title {
    font-size: 28px;
  }

  .identity {
    font-size: 18px;
    padding-right: 52px;
  }

  .chart-grid {
    grid-template-columns: 1fr;
    gap: 24px 0;
  }

  .chart-card:nth-child(5) {
    grid-column: auto;
  }

  /* ensure tx-card stacks and returns tighten on small screens */
  .layout > .tx-card {
    grid-column: 1 / -1;
    margin: 0 0 3px 0;
  }

  .returns {
    margin-top: 12px;
    padding: 0 6px;
  }

  .calendar {
    min-width: 0;
    font-size: 13px;
  }

  .calendar-grid td,
  .calendar-grid th {
    padding: 3px 0;
    font-size: 13px;
  }

  .hbar-chart,
  .bar-chart {
    width: 100%;
    height: 140px;
  }

  .status-row {
    font-size: 16px;
  }

  .dot {
    width: 24px;
    height: 24px;
  }

  .tx-card h3 {
    font-size: 20px;
  }

  .returns h2 {
    font-size: 32px;
  }

  .return-row {
    grid-template-columns: 1.2fr 1fr 1fr;
    font-size: 12px;
    padding: 10px 6px;
  }

  .return-row div {
    min-height: 40px;
    border-right: 1px solid #bfbfbf;
  }

  .return-row div:first-child {
    text-align: left;
    padding: 0 4px;
  }

  .tax-subtype {
    font-size: 11px;
    margin-top: 1px;
  }

  .days-badge {
    padding: 2px 6px;
    font-size: 11px;
  }

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

  .source-btn {
    padding: 6px 4px;
    font-size: 12px;
  }

  .bottom h4 {
    font-size: 16px;
  }

  .chart-legend {
    font-size: 11px;
    gap: 12px;
  }

  .chart-value {
    font-size: 11px;
  }

  .pie {
    width: 180px;
    height: 180px;
  }

  .gauge {
    width: 240px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 500px) {
  .return-row {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 8px;
    border: 1px solid #999;
    border-radius: 3px;
    overflow: hidden;
    padding: 0;
  }

  .return-row div {
    border-bottom: 1px solid #ddd;
    border-right: 0;
    text-align: left;
    justify-content: flex-start;
    padding: 8px 10px;
    min-height: 36px;
    font-size: 13px;
  }

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

  .return-row.header-row {
    display: none;
  }

  .tax-subtype {
    font-size: 11px;
    margin-top: 2px;
  }
}
