:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --ink: #101827;
  --muted: #76839a;
  --line: #e7ebf2;
  --accent: #388cf5;
  --accent-strong: #237bea;
  --surface: #ffffff;
  --nav-height: 68px;
  --silver-mirror:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(246, 247, 248, 0.94) 58%, rgba(238, 240, 242, 0.82)),
    #f7f8f9;
  background: #fafafa;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: #f7f7f8;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
input,
select,
a {
  outline: none;
}

:focus-visible {
  outline: 3px solid rgba(56, 140, 245, 0.34);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(238, 240, 243, 0.72), transparent 30%),
    var(--surface);
}

.view {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.login-view {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: max(28px, env(safe-area-inset-top)) 24px max(22px, env(safe-area-inset-bottom));
}

.login-panel {
  width: 100%;
  max-width: 410px;
  margin: auto;
}

.login-mark {
  display: block;
  width: clamp(130px, 38vw, 176px);
  height: auto;
  margin: 0 auto -4px;
  object-fit: contain;
}

.wordmark {
  text-align: center;
}

.wordmark h1 {
  margin: 0;
  padding-left: 0.22em;
  font-size: clamp(28px, 8vw, 35px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.wordmark p {
  margin: 9px 0 34px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.passkey-option {
  margin-bottom: 20px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 12px;
}

.login-divider::before,
.login-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.login-form {
  display: grid;
  gap: 20px;
}

.field label {
  display: block;
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 550;
}

.input-wrap {
  display: flex;
  min-height: 56px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 28px rgba(44, 68, 104, 0.04);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input-wrap:focus-within {
  border-color: rgba(56, 140, 245, 0.48);
  box-shadow:
    0 8px 28px rgba(44, 68, 104, 0.04),
    0 0 0 2px rgba(56, 140, 245, 0.055);
}

.input-wrap svg,
.passkey-option .button svg {
  flex: 0 0 auto;
  fill: none;
  stroke: #7284a1;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.passkey-option .button svg {
  stroke: currentColor;
}

.input-wrap input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
}

.input-wrap input:focus,
.input-wrap input:focus-visible {
  border: 0;
  outline: 0;
  box-shadow: none;
  -webkit-box-shadow: none;
}

.input-wrap input:autofill {
  border: 0;
  outline: 0;
  box-shadow: none;
}

.input-wrap input:-webkit-autofill {
  border: 0;
  outline: 0;
  box-shadow: none;
  -webkit-box-shadow: none;
  -webkit-background-clip: text;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
}

.input-wrap input::placeholder {
  color: #9ba6b8;
}

.field-error {
  min-height: 18px;
  margin: 5px 3px -15px;
  color: #b54141;
  font-size: 12px;
}

.button {
  position: relative;
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button-primary {
  width: 100%;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(56, 140, 245, 0.2);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.button-secondary {
  width: 100%;
  margin-top: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.button-primary[aria-busy="true"] .spinner {
  display: block;
}

.auth-status {
  min-height: 40px;
  margin: 14px 8px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.auth-status.is-error {
  color: #a43d3d;
}

.code-step {
  margin-top: 4px;
}

.code-heading {
  margin-bottom: 22px;
  text-align: center;
}

.code-heading h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 650;
}

.code-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.code-form {
  display: grid;
  gap: 22px;
}

.otp-inputs {
  display: grid;
  grid-template-columns: repeat(6, minmax(38px, 1fr));
  gap: clamp(6px, 2vw, 10px);
}

.otp-inputs input {
  width: 100%;
  min-width: 0;
  height: 56px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 28px rgba(44, 68, 104, 0.04);
  font-size: 23px;
  font-weight: 650;
  text-align: center;
  caret-color: var(--accent);
}

.otp-inputs input:focus {
  border-color: rgba(56, 140, 245, 0.7);
  box-shadow: 0 0 0 4px rgba(56, 140, 245, 0.1);
}

.code-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}

.text-button {
  min-height: 40px;
  padding: 4px;
  border: 0;
  color: var(--accent-strong);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.text-button:disabled {
  color: var(--muted);
  cursor: default;
}

.privacy-note {
  margin: 18px auto 0;
  color: #8996aa;
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.strategy-view {
  position: relative;
  display: grid;
  height: 100vh;
  height: 100dvh;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: max(18px, env(safe-area-inset-top)) 0 0;
}

.app-header {
  position: relative;
  min-height: 44px;
  margin: 0 clamp(16px, 5vw, 22px);
  text-align: center;
}

.app-header h1 {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.logout-button {
  position: absolute;
  top: -4px;
  right: 0;
  min-height: 44px;
  padding: 4px 0 4px 14px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.logout-button:disabled {
  cursor: default;
  opacity: 0.6;
}

.strategy-view :focus-visible {
  outline-color: rgba(42, 46, 51, 0.32);
}

.strategy-view button {
  touch-action: manipulation;
}

.strategy-content,
.portfolio-content {
  min-height: 0;
  margin-top: 12px;
  padding-bottom: 34px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.strategy-content::-webkit-scrollbar,
.portfolio-content::-webkit-scrollbar {
  display: none;
}

.portfolio-section {
  width: 100%;
}

.portfolio-pager-wrap {
  position: relative;
  max-width: 100%;
  overflow: hidden;
}

.portfolio-pager {
  display: flex;
  gap: 0;
  width: 100%;
  padding: 4px 16px 14px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 16px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

.portfolio-pager::-webkit-scrollbar {
  display: none;
}

.portfolio-page {
  display: flex;
  min-width: 0;
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.portfolio-card {
  display: flex;
  width: 100%;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(205, 209, 214, 0.82);
  border-radius: 24px;
  background: var(--silver-mirror);
  box-shadow:
    inset 0 1px 0 #fff,
    0 10px 30px rgba(42, 48, 56, 0.075),
    0 2px 5px rgba(42, 48, 56, 0.035);
}

.portfolio-summary {
  min-height: 230px;
  padding: 24px 22px 19px;
  color: #17191c;
}

.portfolio-name {
  margin: 0 0 27px;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portfolio-current-value {
  display: block;
  overflow: hidden;
  font-size: clamp(30px, 9vw, 38px);
  font-weight: 650;
  line-height: 1.03;
  letter-spacing: -0.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-return {
  display: block;
  margin: 9px 0 0;
  color: #5e6268;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.portfolio-return.is-negative {
  color: #55595f;
}

.portfolio-metric {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 7px 0 0;
  color: #5e6268;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.2;
  white-space: nowrap;
}

.portfolio-metric b {
  color: #30343a;
  font-weight: 680;
}

.portfolio-metric-spacer {
  visibility: hidden;
}

.portfolio-temporal-meta {
  margin: 14px 0 0;
  color: #767b82;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.portfolio-temporal-meta p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 0;
}

.portfolio-temporal-meta b {
  color: #555a61;
  font-weight: 550;
  text-align: right;
}

.personal-summary-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 18px;
}

.personal-summary-actions button {
  width: 100%;
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid #d3d6da;
  border-radius: 13px;
  color: #2e3237;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 #fff;
  font-size: 13px;
  font-weight: 680;
}

.personal-summary-actions .personal-liquidity-open {
  border-color: #202327;
  color: #fff;
  background: linear-gradient(180deg, #35393e, #202327);
  box-shadow: 0 5px 12px rgba(32, 35, 39, 0.13);
}

.chart-panel {
  position: relative;
  aspect-ratio: 320 / 238;
  margin: 0 12px;
  padding: 3px 1px 0;
  overflow: hidden;
  border-top: 1px solid rgba(209, 213, 218, 0.68);
  background: rgba(255, 255, 255, 0.38);
}

.personal-empty-state {
  display: grid;
  min-height: 176px;
  place-items: center;
}

.personal-empty-state p {
  margin: 0;
  color: #686d73;
  font-size: 14px;
  font-weight: 550;
  text-align: center;
}

.personal-new-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 22px;
  padding: 14px 0;
  border-top: 1px solid #d7dadd;
  border-bottom: 1px solid #d7dadd;
}

.personal-new-target h3 {
  margin: 0;
  color: #25282c;
  font-size: 13px;
  font-weight: 750;
}

.personal-new-target p {
  margin: 4px 0 0;
  color: #6e7379;
  font-size: 12px;
}

.personal-new-target button {
  min-height: 44px;
  flex: 0 0 auto;
  padding: 0 15px;
  border: 1px solid #202327;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(180deg, #35393e, #202327);
  font-size: 13px;
  font-weight: 750;
}

.personal-allocation-heading,
.personal-allocation-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 66px;
  align-items: center;
  gap: 7px;
}

.personal-allocation-heading {
  padding: 0 3px 6px;
  color: #74797f;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
}

.personal-allocation-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.personal-allocation-list li {
  min-height: 48px;
  padding: 7px 3px;
  border-bottom: 1px solid rgba(218, 221, 225, 0.75);
}

.personal-allocation-list span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.personal-allocation-list strong {
  overflow: hidden;
  color: #33373c;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-allocation-list small {
  color: #777c82;
  font-size: 12px;
}

.personal-allocation-list b {
  color: #383c41;
  font-size: 13px;
  font-weight: 650;
  text-align: right;
}

.personal-transaction-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.personal-transaction-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 0;
  border-bottom: 1px solid #e0e2e5;
}

.personal-transaction-list li > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.personal-transaction-list strong {
  overflow: hidden;
  color: #303338;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-transaction-list small {
  color: #74797f;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.personal-transaction-list button {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 4px 6px 10px;
  border: 0;
  color: #555a60;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
}

.personal-ledger-status,
.portfolio-ledger-status {
  min-height: 0;
  margin: 0;
  padding: 0 20px;
  color: #666b71;
  background: transparent;
  font-size: 12px;
  text-align: center;
}

.personal-ledger-status:not(:empty),
.portfolio-ledger-status:not(:empty) {
  padding-block: 10px;
  border-top: 1px solid #e1e3e6;
}

.portfolio-operations-card {
  padding-top: 8px;
}

.portfolio-operations-card h2,
.portfolio-local-data h2 {
  margin-bottom: 10px;
}

.portfolio-operations-card .portfolio-no-transactions {
  justify-content: center;
  color: #686d73;
  font-size: 13px;
}

.portfolio-local-data {
  padding-bottom: 28px;
}

.portfolio-transaction-dialog {
  width: min(calc(100% - 28px), 430px);
  max-height: calc(100dvh - 28px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(154, 162, 172, 0.65);
  border-radius: 22px;
  color: #27313e;
  background: #f4f5f6;
  box-shadow: 0 24px 80px rgba(30, 38, 49, 0.28);
}

.portfolio-realignment-dialog {
  width: min(calc(100% - 28px), 430px);
  max-height: calc(100dvh - 28px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(154, 162, 172, 0.65);
  border-radius: 22px;
  color: #27313e;
  background: #f4f5f6;
  box-shadow: 0 24px 80px rgba(30, 38, 49, 0.28);
}

.portfolio-realignment-dialog::backdrop {
  background: rgba(28, 35, 44, 0.38);
  backdrop-filter: blur(3px);
}

.portfolio-transaction-dialog :focus-visible,
.portfolio-realignment-dialog :focus-visible {
  outline-color: rgba(42, 46, 51, 0.32);
}

.portfolio-realignment-view {
  padding: 22px;
}

.portfolio-realignment-view header {
  margin-bottom: 17px;
}

.portfolio-realignment-view header h2 {
  margin: 0;
  font-size: 19px;
}

.portfolio-realignment-view header p,
.portfolio-realignment-view > p {
  margin: 5px 0 0;
  color: #717c89;
  font-size: 12px;
}

.portfolio-realignment-view > p {
  margin-top: 18px;
  text-align: center;
}

.portfolio-realignment-form {
  display: grid;
  gap: 9px;
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid rgba(153, 162, 173, 0.3);
}

.portfolio-realignment-form label {
  color: #4b5663;
  font-size: 12px;
  font-weight: 650;
}

.portfolio-realignment-cash-input {
  display: flex;
  min-height: 46px;
  align-items: center;
  overflow: hidden;
  border: 1px solid #cfd5dc;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.88);
}

.portfolio-realignment-cash-input span {
  padding-left: 12px;
  color: #67727e;
  font-weight: 700;
}

.portfolio-realignment-cash-input input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px 0 7px;
  border: 0;
  color: #27313e;
  background: transparent;
}

.portfolio-realignment-form > button {
  min-height: 44px;
  border: 1px solid #89929d;
  border-radius: 11px;
  color: #f8f9fa;
  background: linear-gradient(180deg, #858e99, #68717c);
  font-size: 12px;
  font-weight: 750;
}

.portfolio-realignment-status {
  min-height: 15px;
  color: #6d5d61 !important;
  font-size: 12px !important;
}

.portfolio-realignment-result {
  margin-top: 6px;
  padding: 15px 13px;
  border: 1px solid rgba(153, 162, 173, 0.36);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.52);
}

.portfolio-realignment-result h3 {
  margin: 0;
  color: #394450;
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.portfolio-realignment-result > p {
  margin: 6px 0 15px;
  color: #68737f;
  font-size: 12px;
}

.portfolio-realignment-result h4 {
  margin: 13px 0 3px;
  color: #5d6875;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.portfolio-realignment-result ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.portfolio-realignment-result li {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(153, 162, 173, 0.22);
}

.portfolio-realignment-result li span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.portfolio-realignment-result li strong,
.portfolio-realignment-result li b {
  color: #3f4a56;
  font-size: 12px;
}

.portfolio-realignment-result li small,
.portfolio-realignment-result > small {
  color: #7a8490;
  font-size: 12px;
}

.portfolio-liquidity-zero {
  margin: 14px 0 2px !important;
  color: #596571 !important;
  font-size: 13px !important;
  line-height: 1.45;
  text-align: left !important;
}

.realignment-operation-action {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.realignment-operation-action button {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #aab2bc;
  border-radius: 9px;
  color: #414c58;
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 750;
}

.portfolio-realignment-result .realignment-no-operation {
  justify-content: flex-start;
  color: #6d7783;
  font-size: 12px;
}

.portfolio-realignment-result > small {
  display: block;
  margin-top: 15px;
  text-align: center;
}

.portfolio-realignment-view > button {
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  border: 1px solid #c7cdd4;
  border-radius: 12px;
  color: #414c58;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.portfolio-realignment-view > .portfolio-realignment-complete {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(180deg, #858e99, #68717c);
}

.portfolio-transaction-dialog::backdrop {
  background: rgba(28, 35, 44, 0.38);
  backdrop-filter: blur(3px);
}

.portfolio-transaction-form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.portfolio-transaction-form header h2 {
  margin: 0;
  font-size: 19px;
}

.portfolio-transaction-form header p {
  margin: 5px 0 0;
  color: #717c89;
  font-size: 12px;
}

.portfolio-transaction-form label {
  display: grid;
  gap: 6px;
  color: #4b5663;
  font-size: 12px;
  font-weight: 650;
}

.portfolio-transaction-form input,
.portfolio-transaction-form select {
  width: 100%;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid #cfd5dc;
  border-radius: 11px;
  color: #27313e;
  background: rgba(255, 255, 255, 0.88);
}

.portfolio-transaction-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.portfolio-transaction-status {
  min-height: 16px;
  margin: 0;
  color: #87565e;
  font-size: 12px;
}

.portfolio-transaction-suggested {
  margin: -3px 0 0;
  padding: 9px 11px;
  border-radius: 9px;
  color: #596571;
  background: rgba(225, 229, 234, 0.58);
  font-size: 12px;
  font-weight: 650;
}

.portfolio-transaction-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
}

.portfolio-transaction-actions button {
  min-height: 46px;
  border: 1px solid #cfd5dc;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.portfolio-transaction-actions .button-primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(180deg, #838c97, #68717c);
}

.portfolio-chart {
  display: block;
  width: 100%;
  height: 100%;
}

.portfolio-chart-empty {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 24px;
}

.portfolio-chart-empty p {
  max-width: 240px;
  margin: 0;
  color: #686d73;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.45;
  text-align: center;
}

.chart-grid-line {
  stroke: #e1e4e8;
  stroke-dasharray: 2 5;
  stroke-width: 1;
}

.chart-axis-label {
  fill: #777c83;
  font-size: 12px;
  font-weight: 500;
}

.chart-area {
  opacity: 0.11;
}

.chart-line {
  fill: none;
  stroke: #176ee8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
  vector-effect: non-scaling-stroke;
}

.chart-endpoint {
  fill: #176ee8;
  stroke: #fff;
  stroke-width: 2;
}

.chart-line-invested {
  stroke: #68717c;
  stroke-dasharray: 5 4;
}

.chart-endpoint-invested {
  fill: #68717c;
}

.chart-legend-swatch {
  stroke-linecap: round;
  stroke-width: 2.25;
  vector-effect: non-scaling-stroke;
}

.chart-legend-swatch-value {
  stroke: #176ee8;
}

.chart-legend-swatch-invested {
  stroke: #68717c;
  stroke-dasharray: 5 4;
}

.chart-legend-label {
  fill: #686d73;
  font-size: 7.5px;
  font-weight: 550;
}

.model-capital-note {
  margin: auto 0 0;
  padding: 13px 18px 17px;
  border-top: 0;
  color: #686d73;
  background: transparent;
  font-size: 12px;
  font-weight: 520;
  text-align: center;
}

.portfolio-page-indicator {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 0;
}

.shared-price-meta {
  margin: -3px clamp(20px, 6vw, 28px) 0;
  color: #767b82;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
}

.shared-price-meta p {
  margin: 0;
}

.shared-price-meta b {
  color: #555a61;
  font-weight: 550;
}

.allocation-card {
  margin: 12px clamp(20px, 6vw, 28px) 0;
  padding: 25px 2px 23px;
  border-top: 1px solid #e1e3e6;
  border-bottom: 1px solid #e1e3e6;
}

.allocation-summary {
  display: block;
  min-height: 0;
  padding: 0;
}

.allocation-copy {
  min-width: 0;
}

.allocation-copy h2 {
  margin: 0 0 9px;
  color: #666b72;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.allocation-mode {
  display: block;
  color: #191b1f;
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

.allocation-copy p {
  margin: 9px 0 0;
  color: #5d6876;
  font-size: 12px;
  font-weight: 650;
}

.allocation-gauge {
  display: none;
  width: clamp(106px, 34vw, 132px);
  height: auto;
  flex: 0 0 auto;
  overflow: visible;
}

.gauge-segments path {
  fill: none;
  stroke: #b7bec7;
  stroke-linecap: butt;
  stroke-width: 7;
}

.gauge-segments path.is-active {
  stroke: url(#gauge-green);
}

.gauge-ticks path {
  fill: none;
  stroke: #98a1ac;
  stroke-linecap: round;
  stroke-width: 2.5;
}

.gauge-ticks path.is-active {
  stroke: #139841;
}

.gauge-needle path {
  fill: none;
  stroke: #1d2939;
  stroke-linecap: round;
  stroke-width: 4.5;
}

.gauge-needle circle {
  fill: #1d2939;
}

.gauge-needle-cap {
  fill: #dfe3e7 !important;
}

.allocation-scale {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
  margin: 20px 0 0;
  padding: 4px;
  border: 1px solid #d9dcdf;
  border-radius: 14px;
  background: linear-gradient(180deg, #eceef0, #f7f7f8);
  box-shadow:
    inset 0 1px 2px rgba(51, 56, 62, 0.08),
    0 1px 0 #fff;
  list-style: none;
}

.allocation-scale li {
  display: grid;
  min-width: 0;
  min-height: 40px;
  place-items: center;
  padding: 4px 2px 3px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #777c82;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.allocation-scale li.is-current {
  border-color: #202327;
  color: #fff;
  background: linear-gradient(180deg, #41454a, #222529);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 3px 8px rgba(32, 35, 39, 0.16);
}

.strategy-status {
  min-height: 18px;
  margin: 12px 20px 0;
  color: #656a70;
  font-size: 13px;
  text-align: center;
}

.strategy-status:empty {
  display: none;
}

.strategy-card {
  margin: 0 clamp(20px, 6vw, 28px);
  padding: 25px 2px;
  border-bottom: 1px solid #e1e3e6;
  color: #272a2f;
}

.strategy-card h2 {
  margin: 0;
  color: #62676d;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.personal-details-card {
  padding-top: 25px;
}

.personal-details-header {
  display: grid;
  gap: 0;
}

.personal-details-header .personal-summary-actions {
  margin-top: 16px;
}

.personal-details-body {
  margin-top: 22px;
}

.personal-details-card .personal-empty-state {
  min-height: 92px;
  border-bottom: 1px solid #e0e2e5;
}

.portfolio-privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(224, 226, 229, 0.8);
}

.portfolio-privacy-note svg {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  padding: 8px;
  border-radius: 12px;
  background: #edf7f0;
  fill: none;
  stroke: #76a989;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.portfolio-privacy-note p {
  margin: 0;
  color: #74797f;
  font-size: 12px;
  line-height: 1.5;
}

.settings-portfolio-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.settings-portfolio-actions button {
  min-height: 46px;
  padding: 8px 11px;
  border: 1px solid #d2d5d9;
  border-radius: 13px;
  color: #35393e;
  background: rgba(248, 248, 249, 0.9);
  box-shadow: inset 0 1px 0 #fff;
  font-size: 12px;
  font-weight: 700;
}

.settings-portfolio-actions button:disabled {
  opacity: 0.58;
}

.portfolio-backup-status {
  min-height: 15px;
  margin: 10px 1px 0;
  color: #696e74;
  font-size: 12px;
}

.decision-card header {
  margin-bottom: 14px;
}

.decision-card time {
  display: block;
  margin-top: 5px;
  color: #74797f;
  font-size: 12px;
  font-weight: 550;
}

.decision-allocation {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.decision-allocation li {
  display: block;
  min-height: 52px;
  padding: 13px 0 12px;
  border-bottom: 1px solid #e3e5e7;
  font-size: 13px;
}

.decision-asset-summary,
.decision-allocation-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.decision-asset-summary > span {
  min-width: 0;
}

.decision-asset-summary strong,
.decision-asset-summary small {
  display: block;
  min-width: 0;
}

.decision-asset-summary strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-asset-summary small {
  margin-top: 2px;
  color: #777c82;
  font-size: 12px;
  letter-spacing: 0.025em;
}

.decision-asset-summary > b {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 680;
  text-align: right;
}

.decision-allocation-values {
  margin-top: 10px;
}

.decision-allocation-values > span {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.decision-allocation-values small {
  color: #777c82;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.decision-allocation-values b {
  font-size: 13px;
  font-weight: 680;
}

.verification-card {
  padding-top: 21px;
  padding-bottom: 21px;
}

.verification-lead {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 17px;
}

.verification-lead strong {
  color: #30343a;
  font-size: 15px;
  font-weight: 650;
}

.verification-mark {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #697078;
  background: #f0f1f2;
  font-size: 15px;
  font-weight: 750;
}

.verification-mark.is-verified {
  color: #397b53;
  background: #e8f5ec;
}

.verification-status-list,
.verification-dialog-status-list {
  display: grid;
  gap: 0;
  margin: 15px 0 0;
}

.verification-status-list div,
.verification-dialog-status-list div {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.verification-status-list dt,
.verification-status-list dd,
.verification-dialog-status-list dt,
.verification-dialog-status-list dd {
  margin: 0;
  color: #555a60;
  font-size: 13px;
}

.verification-status-list dd,
.verification-dialog-status-list dd {
  color: #6d7379;
  font-weight: 650;
  text-align: right;
}

.verification-hash-open {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 8px 0;
  border: 0;
  border-top: 1px solid #e3e5e7;
  color: #686e75;
  background: transparent;
  text-align: left;
}

.verification-hash-open:disabled {
  opacity: 0.62;
}

.verification-hash-open > span:first-child {
  font-size: 12px;
  font-weight: 700;
}

.verification-hash-open > span:last-child {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.verification-hash-open code {
  color: #74797f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 500;
}

.verification-hash-open b {
  color: #6e747b;
  font-size: 22px;
  font-weight: 400;
}

.verification-dialog {
  width: min(100%, 480px);
  max-height: calc(100dvh - 24px);
  margin: auto auto 0;
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(154, 162, 172, 0.5);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  color: #272b30;
  background: #f8f8f9;
  box-shadow: 0 -18px 60px rgba(30, 38, 49, 0.2);
}

.verification-dialog::backdrop {
  background: rgba(28, 35, 44, 0.4);
  backdrop-filter: blur(3px);
}

.verification-sheet {
  padding: 20px 20px max(26px, env(safe-area-inset-bottom));
}

.verification-sheet > header {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.verification-sheet > header h2,
.verification-explanation h3 {
  margin: 0;
  color: #62676d;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.verification-sheet > header button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  margin: -7px -8px -7px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.verification-sheet > header svg {
  fill: none;
  stroke: #676d74;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.verification-dialog-lead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}

.verification-dialog-lead span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #397b53;
  background: #e8f5ec;
  font-size: 16px;
  font-weight: 750;
}

.verification-dialog-lead strong {
  font-size: 16px;
  font-weight: 680;
}

.verification-decision-meta {
  display: grid;
  gap: 5px;
  margin-top: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #dfe2e5;
}

.verification-decision-meta > span {
  margin-top: 8px;
  color: #747a81;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.verification-decision-meta time {
  color: #34383d;
  font-size: 14px;
  font-weight: 600;
}

.verification-decision-meta code {
  color: #555b62;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.verification-decision-meta button {
  width: max-content;
  min-width: 80px;
  min-height: 40px;
  margin-top: 7px;
  padding: 0 16px;
  border: 1px solid #cdd1d5;
  border-radius: 11px;
  color: #3f444a;
  background: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 700;
}

.verification-copy-status {
  min-height: 15px;
  margin: 2px 0 -6px;
  color: #687078;
  font-size: 11px;
}

.verification-dialog-status-list {
  margin-top: 13px;
  padding-bottom: 13px;
  border-bottom: 1px solid #dfe2e5;
}

.verification-pending-note {
  margin: 16px 0 0;
  padding-left: 12px;
  border-left: 2px solid #b8c7bd;
  color: #60676e;
  font-size: 12px;
  line-height: 1.5;
}

.verification-explanation {
  margin-top: 22px;
}

.verification-explanation p {
  margin: 11px 0 0;
  color: #5f656c;
  font-size: 13px;
  line-height: 1.55;
}

body.verification-dialog-open {
  overflow: hidden;
}

body.verification-dialog-open .strategy-content,
body.verification-dialog-open .portfolio-content {
  overflow: hidden;
}

.pagination-dot {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.pagination-dot::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #c9ccd0;
  content: "";
  transition: width 180ms ease, background-color 180ms ease;
}

.pagination-dot[aria-current="true"]::before {
  width: 20px;
  background: #50545a;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bottom-nav {
  position: relative;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  min-height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  align-items: flex-start;
  justify-content: center;
  padding: 5px 20px env(safe-area-inset-bottom);
  border-top: 1px solid rgba(224, 226, 229, 0.94);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.nav-item {
  display: inline-flex;
  min-width: 96px;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  border: 0;
  border-radius: 14px;
  color: #92979d;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}

.nav-item[aria-current="page"] {
  color: #25282c;
  background: rgba(238, 239, 241, 0.72);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  fill: transparent;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.passkey-invite {
  position: absolute;
  z-index: 3;
  right: 16px;
  bottom: calc(var(--nav-height) + 18px + env(safe-area-inset-bottom));
  left: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 14px;
  max-width: 420px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 50px rgba(42, 48, 56, 0.11);
}

.passkey-invite h2 {
  margin: 0 30px 3px 0;
  font-size: 15px;
}

.passkey-invite p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.icon-button svg {
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.7;
}

.button-compact {
  align-self: center;
  min-width: 78px;
  min-height: 44px;
  padding: 0 17px;
  color: #fff;
  background: linear-gradient(180deg, #35393e, #202327);
  font-size: 14px;
}

.invite-status {
  grid-column: 1 / -1;
}

noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #fff;
  text-align: center;
}

.privacy-cover {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  color: #7f8ca0;
  background: #f7f9fc;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

body.privacy-covered .app-shell {
  visibility: hidden;
}

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

@media (max-height: 670px) {
  .login-view {
    justify-content: flex-start;
    overflow-y: auto;
  }

  .login-mark {
    width: 118px;
  }

  .wordmark p {
    margin-bottom: 24px;
  }

  .privacy-note {
    margin-top: 12px;
  }
}

@media (max-width: 374px) {
  .portfolio-pager {
    padding-inline: 14px;
    scroll-padding-inline: 14px;
  }

  .portfolio-page {
    flex-basis: 100%;
  }

  .portfolio-summary {
    padding-inline: 20px;
  }

  .personal-allocation-heading,
  .personal-allocation-list li {
    grid-template-columns: minmax(0, 1fr) 50px 58px;
    gap: 6px;
  }

  .allocation-card,
  .strategy-card {
    margin-inline: 18px;
  }
}

@media (min-width: 400px) and (max-width: 559px) {
  .portfolio-pager {
    padding-inline: 18px;
    scroll-padding-inline: 18px;
  }

  .portfolio-page {
    flex-basis: 100%;
  }

  .allocation-card,
  .strategy-card {
    margin-inline: 28px;
  }
}

@media (min-width: 560px) {
  body {
    padding: 18px;
  }

  .app-shell {
    max-width: 480px;
    min-height: calc(100vh - 36px);
    min-height: calc(100dvh - 36px);
    border: 1px solid #e1e6ee;
    border-radius: 34px;
    box-shadow: 0 22px 70px rgba(39, 59, 88, 0.08);
  }

  .view {
    min-height: calc(100vh - 38px);
    min-height: calc(100dvh - 38px);
  }

  .strategy-view {
    height: calc(100vh - 38px);
    height: calc(100dvh - 38px);
  }

  .portfolio-pager {
    padding-inline: 20px;
    scroll-padding-inline: 20px;
  }

  .portfolio-page {
    flex-basis: 100%;
  }

  .allocation-card {
    margin-inline: 20px;
  }

  .strategy-card {
    margin-inline: 20px;
  }

}

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