:root {
  --bg: #eef0f3;
  --surface: #ffffff;
  --surface-soft: #f8f9fa;
  --ink: #111318;
  --ink-soft: #353a44;
  --muted: #777d88;
  --faint: #a5aab3;
  --line: #e7e9ed;
  --line-strong: #dadddf;
  --up: #e04447;
  --up-deep: #bd2c32;
  --up-soft: #fff1f1;
  --down: #07966c;
  --down-deep: #047654;
  --down-soft: #eaf9f3;
  --amber: #b8771d;
  --amber-soft: #fff7e8;
  --blue: #3776c7;
  --shadow: 0 16px 44px rgba(22, 27, 36, 0.07);
  --radius-lg: 24px;
  --radius-md: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0, rgba(255, 255, 255, 0) 290px),
    var(--bg);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
.signal-card {
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(55, 118, 199, 0.24);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.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;
}

.page-glow {
  position: fixed;
  z-index: -1;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
  pointer-events: none;
}

.page-glow--red {
  top: -130px;
  right: -80px;
  background: #f57f84;
}

.page-glow--green {
  top: 310px;
  left: -185px;
  background: #59d6ad;
}

.app-shell {
  width: 100%;
  max-width: 640px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 18px) 16px calc(var(--safe-bottom) + 28px);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 55px;
  margin-bottom: 15px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  position: relative;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 13px;
  background: #15171c;
  box-shadow: 0 7px 18px rgba(21, 23, 28, 0.2);
}

.brand-mark::after {
  position: absolute;
  inset: auto -9px -11px auto;
  width: 29px;
  height: 29px;
  content: "";
  border-radius: 50%;
  background: rgba(224, 68, 71, 0.65);
  filter: blur(8px);
}

.brand-mark span {
  position: absolute;
  bottom: 10px;
  z-index: 1;
  width: 4px;
  border-radius: 4px;
}

.brand-mark span:nth-child(1) {
  left: 10px;
  height: 10px;
  background: #79818d;
}

.brand-mark span:nth-child(2) {
  left: 18px;
  height: 19px;
  background: #f0f2f5;
}

.brand-mark span:nth-child(3) {
  left: 26px;
  height: 25px;
  background: #f26367;
}

.eyebrow,
.card-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.35;
  text-transform: uppercase;
}

.brand h1 {
  margin: 2px 0 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(7, 150, 108, 0.16);
  border-radius: 999px;
  color: var(--down-deep);
  background: rgba(234, 249, 243, 0.86);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.source-badge.is-loading {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.source-badge.is-demo {
  color: var(--amber);
  border-color: rgba(184, 119, 29, 0.18);
  background: var(--amber-soft);
}

.source-badge.is-stale {
  color: #9f4346;
  border-color: rgba(224, 68, 71, 0.15);
  background: var(--up-soft);
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(221, 224, 228, 0.85);
  border-radius: 13px;
  place-items: center;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.quote-card,
.chart-card,
.history-card {
  border: 1px solid rgba(225, 227, 231, 0.82);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.quote-card {
  position: relative;
  z-index: 1;
  padding: 16px 18px 15px;
  overflow: hidden;
}

.quote-card::after {
  position: absolute;
  top: -90px;
  right: -90px;
  z-index: -1;
  width: 220px;
  height: 220px;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 241, 244, 0.85), transparent 68%);
}

.stock-form {
  position: relative;
  display: flex;
  gap: 8px;
}

.search-box {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  height: 42px;
  padding: 0 5px 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.search-box:focus-within {
  border-color: #bbc2cc;
  background: #fff;
}

.search-box svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-right: 8px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-box input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.search-box input::placeholder {
  color: var(--faint);
  font-weight: 500;
}

.switch-button {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: #1d2026;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.refresh-button {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  place-items: center;
  background: var(--surface-soft);
  cursor: pointer;
}

.refresh-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.refresh-button.is-spinning svg {
  animation: spin 800ms linear infinite;
}

.stock-hint {
  position: absolute;
  top: 45px;
  left: 3px;
  margin: 0;
  color: var(--faint);
  font-size: 10px;
}

.stock-hint.is-error {
  color: var(--up);
  font-weight: 600;
}

.security-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
}

.security-name-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.security-name-wrap h2 {
  max-width: 230px;
  margin: 0;
  overflow: hidden;
  font-size: 19px;
  font-weight: 760;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.security-code {
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--muted);
  background: #f0f2f4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.session-label {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.session-label.is-live {
  color: var(--down-deep);
  border-color: rgba(7, 150, 108, 0.14);
  background: var(--down-soft);
}

.session-label.is-demo {
  color: var(--amber);
  border-color: rgba(184, 119, 29, 0.16);
  background: var(--amber-soft);
}

.price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.price-main {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  color: var(--up);
}

.price-main.is-down {
  color: var(--down);
}

.price-main.is-flat {
  color: var(--ink);
}

.currency {
  margin-top: 8px;
  margin-right: 4px;
  font-size: 15px;
  font-weight: 650;
  opacity: 0.62;
}

.price-main strong {
  overflow: hidden;
  font-size: clamp(44px, 12.8vw, 58px);
  font-weight: 760;
  letter-spacing: -0.06em;
  line-height: 0.98;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.change-block {
  display: grid;
  min-width: 78px;
  margin-bottom: 4px;
  padding: 7px 9px;
  border-radius: 11px;
  color: var(--up-deep);
  background: var(--up-soft);
  text-align: right;
}

.change-block.is-down {
  color: var(--down-deep);
  background: var(--down-soft);
}

.change-block.is-flat {
  color: var(--muted);
  background: #f2f3f5;
}

.change-block strong {
  font-size: 15px;
  font-weight: 760;
  line-height: 1.2;
}

.change-block span {
  margin-top: 1px;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 18px 0 0;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metric {
  min-width: 0;
  padding: 0 10px;
  border-left: 1px solid var(--line);
}

.metric:first-child {
  padding-left: 0;
  border-left: 0;
}

.metric dt {
  margin-bottom: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric dd {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 720;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric dd.is-strong {
  color: var(--up-deep);
}

.quote-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 11px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 550;
}

.market-state {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

.market-state #marketStatus {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.state-dot.is-live {
  background: var(--down);
  box-shadow: 0 0 0 4px rgba(7, 150, 108, 0.1);
}

.state-dot.is-warn {
  background: var(--amber);
}

.quote-foot time {
  flex: 0 0 auto;
}

.signal-card {
  position: relative;
  margin-top: 12px;
  padding: 15px 17px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(22, 27, 36, 0.055);
  transition:
    border-color 200ms ease,
    background-color 200ms ease,
    transform 200ms ease;
}

.signal-card::after {
  position: absolute;
  top: -35px;
  right: -32px;
  width: 120px;
  height: 120px;
  content: "";
  border-radius: 50%;
  opacity: 0;
  transition: opacity 250ms ease;
}

.signal-card.is-neutral::after {
  background: radial-gradient(circle, rgba(63, 100, 153, 0.08), transparent 70%);
  opacity: 1;
}

.signal-card.is-high {
  border-color: rgba(224, 68, 71, 0.35);
  background:
    linear-gradient(135deg, rgba(255, 249, 249, 0.99), rgba(255, 241, 241, 0.97));
  box-shadow:
    0 12px 30px rgba(224, 68, 71, 0.09),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.signal-card.is-high::after {
  background: radial-gradient(circle, rgba(224, 68, 71, 0.23), transparent 69%);
  opacity: 1;
}

.signal-card.is-low {
  border-color: rgba(7, 150, 108, 0.32);
  background:
    linear-gradient(135deg, rgba(249, 255, 252, 0.99), rgba(235, 250, 244, 0.97));
  box-shadow:
    0 12px 30px rgba(7, 150, 108, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.signal-card.is-low::after {
  background: radial-gradient(circle, rgba(7, 150, 108, 0.2), transparent 69%);
  opacity: 1;
}

.signal-card.is-pending {
  border-color: rgba(184, 119, 29, 0.28);
  background: var(--amber-soft);
}

.signal-card.just-triggered {
  animation: signal-rise 650ms cubic-bezier(0.2, 0.8, 0.25, 1);
}

.signal-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.signal-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.04em;
}

.signal-card.is-high .signal-label {
  color: var(--up-deep);
}

.signal-card.is-low .signal-label {
  color: var(--down-deep);
}

.signal-card.is-pending .signal-label {
  color: var(--amber);
}

.signal-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ca2ac;
}

.signal-pulse::after {
  display: block;
  width: 100%;
  height: 100%;
  content: "";
  border-radius: inherit;
  background: inherit;
  animation: radar 1.9s ease-out infinite;
}

.signal-card.is-high .signal-pulse {
  background: var(--up);
}

.signal-card.is-low .signal-pulse {
  background: var(--down);
}

.signal-card.is-pending .signal-pulse {
  background: var(--amber);
}

.signal-time {
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
}

.signal-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 12px;
}

.signal-icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  place-items: center;
  color: var(--ink-soft);
  background: #f0f2f5;
}

.signal-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.signal-card.is-high .signal-icon {
  color: var(--up-deep);
  background: rgba(224, 68, 71, 0.11);
}

.signal-card.is-low .signal-icon {
  color: var(--down-deep);
  background: rgba(7, 150, 108, 0.1);
}

.signal-card.is-pending .signal-icon {
  color: var(--amber);
  background: rgba(184, 119, 29, 0.11);
}

.signal-body > div:last-child {
  min-width: 0;
}

.signal-body h2 {
  margin: 1px 0 0;
  font-size: 19px;
  font-weight: 780;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.signal-body p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.signal-card.is-high .signal-body p {
  color: #8e5b5d;
}

.signal-card.is-low .signal-body p {
  color: #547b6e;
}

.signal-reasons {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-left: 50px;
}

.signal-reasons span {
  padding: 4px 8px;
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  font-weight: 620;
}

.signal-card.is-high .signal-reasons span {
  color: var(--up-deep);
  background: rgba(224, 68, 71, 0.08);
}

.signal-card.is-low .signal-reasons span {
  color: var(--down-deep);
  background: rgba(7, 150, 108, 0.08);
}

.chart-card {
  margin-top: 12px;
  padding: 17px 14px 11px;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 3px;
}

.card-heading h2 {
  margin: 3px 0 0;
  font-size: 16px;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 11px;
  max-width: 200px;
  padding-top: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 580;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.legend-line {
  display: inline-block;
  width: 12px;
  height: 2px;
  border-radius: 2px;
}

.legend-line--price {
  background: var(--up);
}

.legend-line--average {
  background: #d19535;
}

.legend-bar {
  display: inline-block;
  width: 4px;
  height: 8px;
  border-radius: 1px;
  background: rgba(224, 68, 71, 0.35);
}

.chart-wrap {
  position: relative;
  height: 306px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(249, 250, 251, 0.75), rgba(255, 255, 255, 0.15));
}

#intradayChart {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 113px;
  padding: 8px 9px;
  border: 1px solid rgba(224, 226, 230, 0.9);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 9px 26px rgba(20, 24, 31, 0.12);
  font-size: 10px;
  line-height: 1.55;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-soft);
  font-size: 11px;
}

.chart-tooltip span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.chart-tooltip b {
  color: var(--ink-soft);
  font-weight: 700;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  background: rgba(249, 250, 251, 0.82);
  font-size: 11px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.loading-ring {
  width: 16px;
  height: 16px;
  border: 2px solid #d7dbe0;
  border-top-color: var(--ink-soft);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.chart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 9px 0;
  color: var(--faint);
  font-size: 9px;
  font-weight: 540;
}

.history-card {
  margin-top: 12px;
  padding: 17px 17px 10px;
}

.history-heading {
  align-items: center;
}

.text-button {
  padding: 5px 2px 5px 9px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 620;
  cursor: pointer;
}

.signal-history {
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.signal-history li {
  display: flex;
  align-items: center;
  min-height: 46px;
  border-top: 1px solid var(--line);
}

.signal-history li:first-child {
  border-top: 0;
}

.history-empty {
  gap: 9px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.5;
}

.empty-mark {
  display: grid;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  place-items: center;
  color: #9ca1aa;
  background: #f0f2f4;
  font-size: 10px;
  font-weight: 800;
}

.history-item__mark {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  margin-right: 9px;
  border-radius: 9px;
  place-items: center;
  font-size: 10px;
  font-weight: 780;
}

.history-item--high .history-item__mark {
  color: var(--up-deep);
  background: var(--up-soft);
}

.history-item--low .history-item__mark {
  color: var(--down-deep);
  background: var(--down-soft);
}

.history-item__copy {
  min-width: 0;
  flex: 1;
}

.history-item__copy strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 680;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item__copy small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item time {
  flex: 0 0 auto;
  margin-left: 10px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 620;
}

.method-strip {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(225, 227, 231, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  text-align: left;
  cursor: pointer;
}

.method-strip__icon {
  display: grid;
  flex: 0 0 35px;
  width: 35px;
  height: 35px;
  border-radius: 11px;
  place-items: center;
  color: var(--ink-soft);
  background: #fff;
  box-shadow: 0 4px 12px rgba(22, 27, 36, 0.06);
}

.method-strip__icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.method-strip > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.method-strip strong,
.method-strip small {
  display: block;
}

.method-strip strong {
  font-size: 12px;
  font-weight: 680;
}

.method-strip small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.method-strip .chevron {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--faint);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.legal-note {
  margin: 17px 6px 0;
  padding: 0 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.7;
}

.legal-note strong {
  color: #7d5759;
  font-size: 10px;
}

.legal-note p {
  margin: 3px 0 0;
}

.offline-banner {
  position: fixed;
  top: calc(var(--safe-top) + 8px);
  left: 50%;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 32px);
  padding: 8px 12px;
  transform: translateX(-50%);
  border: 1px solid rgba(184, 119, 29, 0.22);
  border-radius: 999px;
  color: #855915;
  background: rgba(255, 249, 236, 0.96);
  box-shadow: 0 8px 25px rgba(70, 56, 29, 0.12);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.offline-banner__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
}

.rules-dialog {
  width: min(calc(100% - 20px), 610px);
  max-height: min(86vh, 780px);
  max-height: min(86dvh, 780px);
  margin: auto auto 8px;
  padding: 7px 0 0;
  overflow: hidden auto;
  border: 0;
  border-radius: 26px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 -20px 70px rgba(20, 24, 32, 0.23);
  overscroll-behavior: contain;
}

.rules-dialog::backdrop {
  background: rgba(22, 25, 31, 0.38);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.rules-dialog[open] {
  animation: sheet-in 220ms cubic-bezier(0.25, 0.85, 0.3, 1);
}

.dialog-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 5px;
  border-radius: 999px;
  background: #d8dbe0;
}

.dialog-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 19px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.dialog-header h2 {
  margin: 3px 0 0;
  font-size: 20px;
  font-weight: 780;
  letter-spacing: -0.035em;
}

.dialog-header .icon-button {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.dialog-content {
  padding: 4px 20px calc(var(--safe-bottom) + 25px);
}

.dialog-content section {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.dialog-content section:last-child {
  border-bottom: 0;
}

.dialog-content h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 13px;
  font-weight: 740;
}

.dialog-content p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.68;
}

.rule-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

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

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

.rule-dot--amber {
  background: var(--amber);
}

.rule-dot--blue {
  background: var(--blue);
}

.dialog-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.dialog-setting > div {
  min-width: 0;
}

.dialog-setting p {
  margin-bottom: 0;
}

.switch-control {
  position: relative;
  flex: 0 0 46px;
  width: 46px;
  height: 28px;
  cursor: pointer;
}

.switch-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d8dce1;
  transition: background-color 180ms ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  content: "";
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15, 20, 25, 0.2);
  transition: transform 180ms ease;
}

.switch-control input:checked + .switch-track {
  background: var(--amber);
}

.switch-control input:checked + .switch-track::after {
  transform: translateX(18px);
}

.switch-control input:focus-visible + .switch-track {
  outline: 3px solid rgba(55, 118, 199, 0.24);
  outline-offset: 2px;
}

.risk-box {
  margin-top: 8px;
  padding: 14px !important;
  border: 1px solid rgba(224, 68, 71, 0.14) !important;
  border-radius: 14px;
  background: #fff8f8;
}

.risk-box h3 {
  color: #9f3c40;
}

.toast {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 20px);
  left: 50%;
  z-index: 50;
  max-width: calc(100% - 40px);
  padding: 10px 14px;
  transform: translateX(-50%);
  border-radius: 12px;
  color: #fff;
  background: rgba(28, 31, 37, 0.94);
  box-shadow: 0 10px 30px rgba(16, 20, 26, 0.22);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  animation: toast-in 180ms ease-out;
}

.noscript {
  position: fixed;
  inset: 20px;
  z-index: 100;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
}

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

@keyframes radar {
  0% {
    transform: scale(1);
    opacity: 0.45;
  }
  70%,
  100% {
    transform: scale(2.7);
    opacity: 0;
  }
}

@keyframes signal-rise {
  0% {
    transform: translateY(3px) scale(0.993);
  }
  55% {
    transform: translateY(0) scale(1.004);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes sheet-in {
  from {
    transform: translateY(25px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes toast-in {
  from {
    transform: translate(-50%, 8px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@media (max-width: 380px) {
  .app-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .quote-card {
    padding-right: 15px;
    padding-left: 15px;
  }

  .security-name-wrap h2 {
    max-width: 170px;
  }

  .metric {
    padding: 0 7px;
  }

  .metric dd {
    font-size: 13px;
  }

  .chart-card {
    padding-right: 10px;
    padding-left: 10px;
  }

  .chart-wrap {
    height: 286px;
  }
}

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

  .app-shell {
    padding-right: 22px;
    padding-left: 22px;
    border: 1px solid rgba(214, 217, 221, 0.72);
    border-radius: 32px;
    background: rgba(240, 242, 245, 0.64);
    box-shadow: 0 30px 90px rgba(29, 35, 44, 0.11);
  }

  .rules-dialog {
    margin: auto;
    border-radius: 24px;
  }
}

@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;
  }
}
