:root {
  --color-bg: #f8f9fa;
  --color-surface: #ffffff;
  --color-surface-soft: #f1f3f4;
  --color-border: #dadce0;
  --color-border-strong: #bdc1c6;
  --color-text: #202124;
  --color-text-muted: #5f6368;
  --color-text-faint: #80868b;
  --color-primary: #1a73e8;
  --color-primary-hover: #1765cc;
  --color-primary-soft: #e8f0fe;
  --color-success: #188038;
  --color-warning: #b06000;
  --color-warning-bg: #fef7e0;
  --color-error: #b3261e;
  --color-error-bg: #fce8e6;
  --radius-small: 0.5rem;
  --radius-medium: 0.75rem;
  --radius-large: 1rem;
  --content-width: 90rem;
  --shadow-subtle: 0 1px 2px rgb(60 64 67 / 8%), 0 1px 3px 1px rgb(60 64 67 / 5%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  color-scheme: light;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--color-bg);
}

body {
  min-width: 20rem;
  min-height: 100vh;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--color-primary);
}

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

h1,
h2 {
  color: var(--color-text);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h1 {
  margin-bottom: 0.6rem;
  font-size: clamp(1.9rem, 4vw, 2.75rem);
}

h2 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-small);
  background: var(--color-text);
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid #a8c7fa;
  outline-offset: 2px;
}

.eyebrow {
  margin-bottom: 0.4rem;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.brand-mark {
  display: inline-grid;
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #d8e9e7;
  border-radius: 0.7rem;
  background: linear-gradient(145deg, #f0fdfa, #eff6ff);
  color: #0f766e;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.brand-mark img {
  width: 1.85rem;
  height: 1.85rem;
}

.brand-mark--large {
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.82rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-text);
  text-decoration: none;
}

.brand__text {
  display: grid;
  line-height: 1.05;
}

.brand__text strong {
  font-size: 0.92rem;
  font-weight: 600;
}

.brand__text span {
  margin-top: 0.22rem;
  color: var(--color-text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.brand--centered {
  justify-content: center;
}

.button {
  display: inline-flex;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  padding: 0.62rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
}

.button--primary {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #ffffff;
}

.button--primary:hover {
  border-color: var(--color-primary-hover);
  background: var(--color-primary-hover);
  box-shadow: 0 1px 2px rgb(26 115 232 / 25%);
}

.button--secondary {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-primary);
}

.button--secondary:hover {
  border-color: #a8c7fa;
  background: #f8fbff;
}

.button--quiet {
  min-height: 2.4rem;
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.84rem;
}

.button--quiet:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-soft);
  color: var(--color-text);
}

.button--small {
  min-height: 2.25rem;
  padding: 0.48rem 0.8rem;
  font-size: 0.8rem;
}

.button--full {
  width: 100%;
}

/* Login */

.auth-page {
  overflow-x: hidden;
  background: #ffffff;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  grid-template-areas: "form signature";
  grid-template-columns: minmax(23rem, 2fr) minmax(32rem, 3fr);
  background: #ffffff;
}

.auth-panel {
  position: relative;
  z-index: 2;
  display: grid;
  grid-area: form;
  place-items: center;
  padding: clamp(2rem, 6vw, 5rem);
  background: #ffffff;
}

.auth-panel__inner {
  width: min(100%, 27rem);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: clamp(2.5rem, 8vh, 5rem);
  color: var(--color-text);
}

.auth-brand__mark {
  display: inline-grid;
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #d8e9e7;
  border-radius: 0.9rem;
  background: linear-gradient(145deg, #f0fdfa, #eff6ff);
  box-shadow: 0 1px 2px rgb(15 118 110 / 8%);
}

.auth-brand__mark img {
  width: 2.15rem;
  height: 2.15rem;
}

.auth-brand__wordmark {
  display: grid;
  line-height: 1.05;
}

.auth-brand__wordmark strong {
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.auth-brand__wordmark span {
  margin-top: 0.28rem;
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-card {
  width: 100%;
}

.auth-card h1 {
  margin-bottom: 0.65rem;
  font-size: clamp(2rem, 4vw, 2.65rem);
  font-weight: 650;
}

.auth-intro {
  max-width: 23rem;
  margin-bottom: 1.8rem;
  color: var(--color-text-muted);
}

.auth-form {
  display: grid;
  gap: 1.05rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  color: var(--color-text);
  font-size: 0.84rem;
  font-weight: 600;
}

.field input {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-small);
  background: #ffffff;
  color: var(--color-text);
  caret-color: var(--color-primary);
}

.field input:hover {
  border-color: var(--color-text-muted);
}

.field input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgb(26 115 232 / 15%);
  outline: none;
}

.auth-footnote {
  margin: 1.5rem 0 0;
  color: var(--color-text-faint);
  font-size: 0.74rem;
  text-align: left;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #f4c7c3;
  border-radius: var(--radius-small);
  background: var(--color-error-bg);
  color: var(--color-error);
  font-size: 0.84rem;
}

.alert__icon,
.balance-card__notice-icon {
  display: inline-grid;
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid currentcolor;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 700;
}

.lorenz-stage {
  position: relative;
  isolation: isolate;
  grid-area: signature;
  min-width: 0;
  min-height: 36rem;
  overflow: hidden;
  border-left: 1px solid #e2e8f0;
  background:
    radial-gradient(circle at 78% 25%, rgb(37 99 235 / 10%), transparent 32%),
    radial-gradient(circle at 30% 72%, rgb(20 184 166 / 12%), transparent 36%),
    linear-gradient(145deg, #fbfefd 0%, #f3f9f8 48%, #f5f8fd 100%);
}

.lorenz-stage::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background-image: radial-gradient(circle, rgb(15 118 110 / 11%) 0.75px, transparent 0.85px);
  background-size: 24px 24px;
  content: "";
  mask-image: linear-gradient(to bottom, rgb(0 0 0 / 38%), transparent 70%);
  pointer-events: none;
}

.lorenz-stage__copy {
  position: relative;
  z-index: 2;
  width: min(34rem, calc(100% - 4rem));
  padding: clamp(2.5rem, 6vw, 5rem);
  pointer-events: none;
}

.lorenz-stage__eyebrow {
  margin-bottom: 0.65rem;
  color: #0f766e;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.lorenz-stage__title {
  max-width: 28rem;
  margin-bottom: 0.7rem;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.lorenz-stage__summary {
  max-width: 29rem;
  margin-bottom: 0;
  color: #53636a;
  font-size: clamp(0.85rem, 1.4vw, 0.98rem);
}

.lorenz-canvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
}

.lorenz-static-fallback {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: min(72%, 38rem);
  height: auto;
  opacity: 0.74;
  transform: translate(-50%, -43%);
}

.lorenz-static-fallback--noscript {
  display: block;
}

.lorenz-parameters {
  position: absolute;
  bottom: 1.4rem;
  left: 1.5rem;
  z-index: 2;
  display: flex;
  gap: 0.45rem;
  margin: 0;
  color: #55716f;
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
}

.lorenz-parameters span {
  padding: 0.35rem 0.5rem;
  border: 1px solid rgb(15 118 110 / 15%);
  border-radius: 999px;
  background: rgb(255 255 255 / 58%);
  backdrop-filter: blur(8px);
}

.lorenz-parameters i {
  color: #0f766e;
  font-family: Georgia, serif;
  font-style: italic;
}

.motion-toggle {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 3;
  display: inline-flex;
  min-height: 2.4rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgb(15 118 110 / 20%);
  border-radius: 999px;
  background: rgb(255 255 255 / 76%);
  color: #486461;
  cursor: pointer;
  font-size: 0.72rem;
  backdrop-filter: blur(8px);
}

.motion-toggle:hover {
  border-color: rgb(15 118 110 / 42%);
  background: rgb(255 255 255 / 92%);
  color: var(--color-text);
}

.motion-toggle:disabled {
  cursor: default;
  opacity: 0.78;
}

.motion-toggle__icon {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #0f766e;
  box-shadow: 0 0 0 3px rgb(15 118 110 / 10%);
}

.motion-toggle[aria-pressed="true"] .motion-toggle__icon {
  background: var(--color-text-faint);
}

/* Dashboard */

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--color-border);
  background: #ffffff;
}

.site-header__inner {
  display: flex;
  width: min(calc(100% - 2rem), var(--content-width));
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 0 auto;
}

.account-menu,
.account-menu form {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.account-menu__identity {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.account-menu__identity strong {
  color: var(--color-text);
  font-weight: 600;
}

.app-tabs {
  border-top: 1px solid #eef0f2;
}

.app-tabs__inner {
  display: flex;
  width: min(calc(100% - 2rem), var(--content-width));
  gap: 0.25rem;
  overflow-x: auto;
  margin: 0 auto;
  scrollbar-width: none;
}

.app-tabs__inner::-webkit-scrollbar {
  display: none;
}

.app-tabs__link {
  position: relative;
  display: inline-flex;
  min-height: 2.9rem;
  flex: 0 0 auto;
  align-items: center;
  padding: 0.25rem 0.85rem;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.app-tabs__link:hover {
  color: #0f766e;
}

.app-tabs__link.is-active {
  color: #0f766e;
}

.app-tabs__link.is-active::after {
  position: absolute;
  right: 0.65rem;
  bottom: -1px;
  left: 0.65rem;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: #0f766e;
  content: "";
}

.dashboard {
  width: min(calc(100% - 2rem), var(--content-width));
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) 0 2rem;
}

.overview-hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(19rem, 27vw, 22rem);
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid #d7e5e3;
  border-radius: var(--radius-large);
  background:
    radial-gradient(circle at 75% 35%, rgb(37 99 235 / 10%), transparent 30%),
    radial-gradient(circle at 54% 74%, rgb(20 184 166 / 14%), transparent 38%),
    linear-gradient(145deg, #fbfefd 0%, #f2f9f8 54%, #f4f7fc 100%);
  box-shadow: var(--shadow-subtle);
}

.overview-hero::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background-image: radial-gradient(circle, rgb(15 118 110 / 10%) 0.7px, transparent 0.8px);
  background-size: 24px 24px;
  content: "";
  mask-image: linear-gradient(90deg, rgb(0 0 0 / 20%), transparent 78%);
}

.overview-hero::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(90deg, rgb(255 255 255 / 94%) 0%, rgb(255 255 255 / 78%) 34%, transparent 64%);
  content: "";
  pointer-events: none;
}

.overview-hero__copy {
  position: relative;
  z-index: 3;
  width: min(37rem, 58%);
  padding: clamp(2rem, 5vw, 4rem);
}

.overview-hero__copy h1 {
  max-width: 32rem;
  margin-bottom: 0.8rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
}

.overview-hero__copy > p:last-child {
  max-width: 30rem;
  margin-bottom: 0;
  color: #53636a;
}

.dashboard-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-section-heading h2 {
  margin-bottom: 0;
}

.dashboard-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.dashboard-intro h1 {
  margin-bottom: 0.35rem;
}

.dashboard-intro__copy {
  max-width: 40rem;
  margin-bottom: 0;
  color: var(--color-text-muted);
}

.status-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-pill__dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--color-success);
}

.balance-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr);
  margin-bottom: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-large);
  background: #ffffff;
  box-shadow: var(--shadow-subtle);
}

.balance-card__context {
  display: grid;
  align-content: center;
  gap: 1.2rem;
  margin: 0;
  padding: clamp(1.4rem, 4vw, 2.2rem);
  border-left: 1px solid var(--color-border);
}

.balance-card__context div {
  display: grid;
  gap: 0.15rem;
}

.balance-card__context dt {
  color: var(--color-text-faint);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.balance-card__context dd {
  margin: 0;
  color: var(--color-text);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.balance-card__content {
  padding: clamp(1.4rem, 4vw, 2.2rem);
}

.balance-card__label {
  margin-bottom: 0.35rem;
  color: var(--color-text-muted);
  font-size: 0.83rem;
  font-weight: 600;
}

.balance-card__value {
  margin-bottom: 0.4rem;
  color: var(--color-text);
  font-size: clamp(2.25rem, 6vw, 3.6rem);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
}

.balance-card__date {
  margin-bottom: 0;
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 600;
}

.balance-card__freshness {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.7rem 0 0;
  color: var(--color-text-faint);
  font-size: 0.74rem;
}

.balance-card__freshness-dot {
  width: 0.4rem;
  height: 0.4rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #0f766e;
}

.balance-card__freshness--stale {
  color: #7a4d00;
}

.balance-card__freshness--stale .balance-card__freshness-dot {
  background: var(--color-warning);
}

.balance-card__notice {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 1rem;
  padding: 0.9rem;
  border: 1px solid #f4d9a5;
  border-radius: var(--radius-medium);
  background: var(--color-warning-bg);
  color: #7a4d00;
  font-size: 0.78rem;
}

.balance-card__notice p {
  margin: 0;
}

.balance-card__notice-icon {
  color: var(--color-warning);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
  gap: 1rem;
}

.panel {
  min-width: 0;
  padding: clamp(1.1rem, 3vw, 1.5rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-large);
  background: #ffffff;
  box-shadow: var(--shadow-subtle);
}

.panel__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Portfolio and About */

.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
}

.property-card {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-large);
  background: #ffffff;
  box-shadow: var(--shadow-subtle);
}

.property-card__image-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--color-surface-soft);
}

.property-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.property-card:hover .property-card__image {
  transform: scale(1.015);
}

.property-card__body {
  padding: 1.15rem;
}

.property-card__body h2 {
  margin-bottom: 0.35rem;
  font-size: 1.08rem;
}

.property-card__body h2 a {
  color: var(--color-text);
  text-decoration: none;
}

.property-card__body h2 a:hover {
  color: #0f766e;
}

.property-card__body > p:last-child {
  margin-bottom: 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.back-link:hover {
  color: #0f766e;
}

.property-detail {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-large);
  background: #ffffff;
  box-shadow: var(--shadow-subtle);
  grid-template-columns: minmax(0, 1.35fr) minmax(20rem, 0.65fr);
}

.property-detail__image-wrap {
  min-height: 30rem;
  background: var(--color-surface-soft);
}

.property-detail__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.property-detail__copy {
  align-self: center;
  padding: clamp(1.75rem, 5vw, 3.5rem);
}

.property-detail__copy > p:last-child {
  margin: 1.5rem 0 0;
  color: var(--color-text-muted);
}

.property-facts {
  display: grid;
  gap: 1rem;
  margin: 1.75rem 0 0;
}

.property-facts div {
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-border);
}

.property-facts dt {
  color: var(--color-text-faint);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.property-facts dd {
  margin: 0.15rem 0 0;
  color: var(--color-text);
  font-size: 1.05rem;
  font-weight: 600;
}

.about-hero {
  display: grid;
  gap: clamp(1.5rem, 5vw, 4rem);
  padding: clamp(2rem, 6vw, 4.5rem);
  border: 1px solid #d7e5e3;
  border-radius: var(--radius-large);
  background: linear-gradient(145deg, #ffffff, #f0f9f7 62%, #f3f7fd);
  grid-template-columns: minmax(0, 0.9fr) minmax(20rem, 1.1fr);
}

.about-hero h1 {
  margin-bottom: 0;
}

.about-hero > p {
  align-self: center;
  margin-bottom: 0;
  color: #46565c;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.7;
}

.about-principles {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.about-principles article {
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-large);
  background: #ffffff;
}

.about-principles article > p:last-child {
  margin-bottom: 0;
  color: var(--color-text-muted);
  font-size: 0.84rem;
}

.panel__subtitle {
  margin-bottom: 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.range-control {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid var(--color-border);
  border-radius: 0.6rem;
  background: var(--color-surface-soft);
}

.range-control__button {
  min-width: 3.2rem;
  min-height: 2.05rem;
  padding: 0.38rem 0.65rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 600;
}

.range-control__button:hover {
  color: var(--color-text);
}

.range-control__button.is-active {
  background: #ffffff;
  box-shadow: 0 1px 2px rgb(60 64 67 / 16%);
  color: var(--color-primary);
}

.chart-wrap {
  position: relative;
  height: clamp(17rem, 24vw, 20rem);
  margin-top: 0.5rem;
}

.chart-wrap--year {
  height: clamp(18rem, 26vw, 21rem);
}

.balance-chart,
.balance-chart .plot-container,
.balance-chart .svg-container {
  width: 100% !important;
  height: 100% !important;
}

.chart-status {
  display: flex;
  height: 1.2rem;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.45rem;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  opacity: 0;
  visibility: hidden;
}

.chart-status.htmx-request {
  opacity: 1;
  visibility: visible;
}

.spinner {
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.chart-error {
  position: absolute;
  inset: 1rem;
  display: grid;
  place-items: center;
  padding: 1rem;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-medium);
  background: var(--color-bg);
  color: var(--color-text-muted);
  text-align: center;
}

.year-picker {
  display: flex;
  width: 100%;
  flex: 0 1 auto;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.65rem;
}

.panel__header--stackable {
  flex-direction: column;
  gap: 0.9rem;
}

.year-picker__message {
  flex-basis: 100%;
  margin: 0;
  color: var(--color-error);
  font-size: 0.72rem;
}

.year-picker fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.year-picker legend {
  margin-bottom: 0.35rem;
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.year-picker__options {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
}

.check-pill {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.check-pill input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.check-pill span {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--color-text-muted);
  font-size: 0.73rem;
  font-weight: 600;
}

.check-pill:hover span {
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.check-pill input:checked + span {
  border-color: #a8c7fa;
  background: var(--color-primary-soft);
  color: #185abc;
}

.check-pill input:focus-visible + span {
  outline: 3px solid #a8c7fa;
  outline-offset: 2px;
}

.data-disclosure {
  margin-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.data-disclosure summary {
  width: max-content;
  max-width: 100%;
  padding: 0.85rem 0 0;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
}

.data-disclosure summary:hover {
  color: var(--color-primary);
}

.table-scroll {
  max-height: 26rem;
  overflow: auto;
  margin-top: 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
}

table {
  width: 100%;
  border-collapse: collapse;
  color: var(--color-text);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

caption {
  padding: 0.75rem;
  color: var(--color-text-muted);
  text-align: left;
}

th,
td {
  padding: 0.62rem 0.75rem;
  border-top: 1px solid #eef0f2;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-top: 0;
  background: var(--color-surface-soft);
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody th {
  color: var(--color-text);
}

tbody tr:hover {
  background: #f8fbff;
}

.number-cell {
  text-align: right;
}

.dashboard-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.75rem 0 0.5rem;
  color: var(--color-text-faint);
  font-size: 0.68rem;
}

.dashboard-footer p {
  margin: 0;
}

/* Generic error */

.error-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
  background: #ffffff;
}

.error-card {
  width: min(100%, 30rem);
  padding: clamp(1.75rem, 7vw, 2.75rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-large);
  background: #ffffff;
  box-shadow: var(--shadow-subtle);
  text-align: center;
}

.error-card .brand {
  margin-bottom: 1.4rem;
}

.error-card p:not(.eyebrow) {
  margin-bottom: 1.4rem;
  color: var(--color-text-muted);
}

@media (max-width: 58rem) {
  .auth-shell {
    grid-template-areas:
      "signature"
      "form";
    grid-template-columns: minmax(0, 1fr);
  }

  .lorenz-stage {
    min-height: clamp(20rem, 43svh, 26rem);
    border-bottom: 1px solid #e2e8f0;
    border-left: 0;
  }

  .lorenz-stage__copy {
    width: min(30rem, calc(100% - 2rem));
    padding: clamp(1.75rem, 6vw, 3rem);
  }

  .auth-panel {
    padding: clamp(2.5rem, 8vw, 4.5rem) clamp(1.25rem, 8vw, 4rem);
  }

  .auth-brand {
    margin-bottom: 2.75rem;
  }
}

@media (max-width: 50rem) {
  .overview-hero__copy {
    width: min(34rem, 75%);
  }

  .balance-card {
    grid-template-columns: 1fr;
  }

  .balance-card__context {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--color-border);
    border-left: 0;
  }

  .balance-card__notice {
    margin-top: 0;
  }

  .panel__header--stackable,
  .year-picker {
    align-items: stretch;
    flex-direction: column;
  }

  .year-picker__options {
    justify-content: flex-start;
  }

  .year-picker .button {
    align-self: flex-start;
  }

  .property-detail,
  .about-hero {
    grid-template-columns: 1fr;
  }

  .property-detail__image-wrap {
    min-height: 22rem;
  }

  .about-principles {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 38rem) {
  .lorenz-stage {
    min-height: 18rem;
  }

  .lorenz-stage__copy {
    width: calc(100% - 1rem);
    padding: 1.4rem;
  }

  .lorenz-stage__title {
    max-width: 17rem;
    font-size: 1.45rem;
  }

  .lorenz-stage__summary {
    max-width: 18rem;
    font-size: 0.8rem;
  }

  .lorenz-parameters {
    bottom: 0.85rem;
    left: 0.85rem;
  }

  .lorenz-parameters span {
    padding: 0.28rem 0.4rem;
  }

  .auth-panel {
    padding: 2.25rem 1.25rem 2.75rem;
  }

  .auth-brand {
    margin-bottom: 2.25rem;
  }

  .motion-toggle {
    right: 0.75rem;
    bottom: 0.75rem;
    min-height: 2.1rem;
    padding: 0.4rem 0.55rem;
  }

  .motion-toggle [data-lorenz-toggle-label] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .site-header__inner {
    width: min(calc(100% - 1.25rem), var(--content-width));
    min-height: 4.2rem;
  }

  .app-tabs__inner {
    width: calc(100% - 1.25rem);
  }

  .brand__text {
    display: none;
  }

  .account-menu__identity {
    max-width: 8.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dashboard {
    width: min(calc(100% - 1.25rem), var(--content-width));
    padding-top: 1.75rem;
  }

  .overview-hero {
    min-height: 21rem;
  }

  .overview-hero::after {
    background: linear-gradient(90deg, rgb(255 255 255 / 94%), rgb(255 255 255 / 70%) 68%, transparent);
  }

  .overview-hero__copy {
    width: 88%;
    padding: 1.6rem;
  }

  .overview-hero__copy h1 {
    max-width: 18rem;
    font-size: 2rem;
  }

  .dashboard-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-intro,
  .panel__header,
  .dashboard-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .range-control {
    width: 100%;
  }

  .range-control__button {
    flex: 1;
  }

  .balance-card__content {
    padding: 1.3rem;
  }

  .balance-card__value {
    font-size: clamp(2.1rem, 12vw, 2.9rem);
  }

  .panel {
    border-radius: var(--radius-medium);
  }

  .chart-wrap,
  .chart-wrap--year {
    height: 20rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (forced-colors: active) {
  .brand-mark,
  .status-pill__dot,
  .motion-toggle__icon {
    forced-color-adjust: none;
  }
}
