:root {
  color-scheme: dark;
  --bg: #090a0b;
  --surface: #101215;
  --surface-2: #17191d;
  --surface-3: #1d2025;
  --line: #2b2f35;
  --line-gold: #5c4a15;
  --text: #f5f3ed;
  --muted: #9b9da3;
  --gold: #f7c928;
  --gold-strong: #ffda49;
  --green: #36d59a;
  --red: #ff6474;
  --blue: #6aa8ff;
  --nav-height: 74px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }

[hidden] { display: none !important; }
select, .health-search input { min-width: 0; min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); }
.stage-filter { display: flex; align-items: center; gap: 12px; margin: 12px 18px; font-size: 12px; color: var(--muted); }
.stage-filter select { flex: 1; }
.stage-filter-note { margin: 0 18px 16px; color: #aeb4bb; font-size: 13px; line-height: 1.75; }
.signal-search { margin: 18px 18px 0; }
.signal-search > label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.signal-search-control { display: flex; align-items: center; min-height: 48px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.signal-search-control:focus-within { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.signal-search-control > svg { width: 20px; height: 20px; margin-left: 12px; flex-shrink: 0; color: var(--muted); }
.signal-search-control input { min-width: 0; width: 100%; flex: 1; min-height: 48px; padding: 12px; border: 0; background: transparent; color: var(--text); font-size: 16px; line-height: 24px; }
.signal-search-control input::placeholder { color: var(--muted); font-size: 14px; }
.signal-search-control input:focus { outline: none; }
.signal-search-control input::-webkit-search-cancel-button { display: none; }
.signal-search-control button { flex-shrink: 0; min-width: 56px; min-height: 44px; padding: 8px 12px; border: 0; background: transparent; color: var(--gold); font-size: 13px; cursor: pointer; }
.signal-search > p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.current-price-line { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 7px; row-gap: 5px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.current-price-line .current-price-value { color: var(--text); font-size: 16px; overflow-wrap: anywhere; }
.current-price-line .current-price-unit { font-size: 10px; }
.current-price-line .current-price-note { flex-basis: 100%; font-size: 11px; line-height: 1.6; }
.current-price-change { font-size: 12px; font-weight: 700; white-space: nowrap; }
.current-price-change[data-tone="gain"] { color: var(--green); }
.current-price-change[data-tone="loss"] { color: var(--red); }
.current-price-line .current-return-note { flex-basis: 100%; font-size: 10px; line-height: 1.6; }
.setting-row .setting-name { display: flex; align-items: center; gap: 12px; }
.setting-name svg { width: 20px; height: 20px; color: var(--gold); }
.tp-options { margin: 24px 0 0; padding: 14px 18px; border: 0; border-block: 1px solid var(--line); }
.tp-options legend { padding-right: 10px; font-size: 15px; font-weight: 700; }
.tp-all { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; }
.tp-checkboxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tp-checkboxes label { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; cursor: pointer; }
.tp-checkboxes label:has(:checked) { border-color: var(--gold); background: #1c1c13; color: var(--gold); }
.tp-options input { width: 18px; height: 18px; margin: 0; accent-color: var(--gold); }
.tp-options p { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.notification-preview-section { padding: 22px 18px; border-bottom: 1px solid var(--line); }
.notification-preview-section > label { display: block; margin-bottom: 10px; font-size: 15px; font-weight: 700; }
.notification-preview-section select { width: 100%; }
.notification-preview { margin-top: 16px; padding: 14px; border: 1px solid #45494f; border-radius: 8px; background: #222529; }
.notification-app { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: #c2c5cb; font-size: 11px; }
.notification-app small { margin-left: auto; }
.notification-preview > strong { font-size: 16px; overflow-wrap: anywhere; }
.notification-preview > p { white-space: pre-line; line-height: 1.75; margin: 5px 0 0; font-size: 14px; }
.health-form { padding: 0 18px 18px; }
.health-form > label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.health-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.health-search input { width: 100%; text-transform: uppercase; font-size: 18px; }
.health-search button { display: flex; align-items: center; gap: 8px; }
.health-search svg { width: 18px; height: 18px; }
.inline-status { margin: 14px 18px; color: var(--muted); line-height: 1.7; font-size: 13px; overflow-wrap: anywhere; }
.health-result-head { padding: 18px; border-block: 1px solid var(--line); }
.health-result-head h2 { font-size: 23px; margin-bottom: 8px; }
.health-result-head p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.health-list { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.account-row strong { min-width: 0; text-align: right; overflow-wrap: anywhere; }
.member-ident { min-width: 0; }
.member-ident div { min-width: 0; overflow-wrap: anywhere; }
.member-tier { flex-shrink: 0; }
.signal-title-line, .signal-meta-line { flex-wrap: wrap; }
.signal-symbol { overflow-wrap: anywhere; }
button:disabled { opacity: .6; cursor: default; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.app-shell {
  width: min(100%, 680px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  border-inline: 1px solid transparent;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 18px 10px;
  background: rgba(9, 10, 11, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

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

.brand img, .member-ident img {
  display: block;
  border: 1px solid var(--line-gold);
  border-radius: 50%;
  object-fit: cover;
}

.brand span, .member-ident div { display: grid; gap: 2px; }
.brand strong { font-size: 17px; }
.brand small, .member-ident small { color: var(--muted); font-size: 11px; }

.connection {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.connection span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(54, 213, 154, 0.1);
}

.connection.is-offline span { background: var(--red); box-shadow: none; }

main { padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 26px); }
.view { min-height: calc(100vh - 150px); }

.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 24px 18px 16px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; line-height: 1.15; }
h2 { margin-bottom: 0; font-size: 23px; }

.heading-actions { display: flex; gap: 8px; }

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

.icon-button:hover, .icon-button:focus-visible { border-color: var(--gold); color: var(--gold); }
.icon-button svg { width: 19px; height: 19px; }

.market-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 65px;
  padding: 12px 18px;
  background: #15150f;
  border-block: 1px solid var(--line-gold);
}

.market-mark { width: 3px; height: 30px; background: var(--gold); }
.market-strip div { display: grid; gap: 3px; min-width: 0; }
.market-strip strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.market-strip small { color: var(--muted); font-size: 11px; }
.version { color: var(--gold); font-size: 11px; font-weight: 800; }

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr 1fr;
  gap: 0;
  margin: 16px 18px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.filters button {
  min-height: 40px;
  padding: 7px 6px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.filters button:last-child { border-right: 0; }
.filters button.is-active { background: var(--gold); color: #111; }

.signal-list { border-top: 1px solid var(--line); }

.signal-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  padding: 17px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  text-align: left;
  cursor: pointer;
}

.signal-row.has-exit-result { grid-template-columns: minmax(0, 1fr) auto; }

.signal-row:hover, .signal-row:focus-visible { background: var(--surface); outline: none; }
.signal-row.is-unread::before { position: absolute; top: 22px; left: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); content: ""; }

.signal-main { display: grid; gap: 10px; min-width: 0; }
.signal-exit-reason { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.signal-title-line, .signal-meta-line { display: flex; align-items: center; gap: 9px; min-width: 0; }
.signal-symbol { font-size: 21px; line-height: 1; }
.direction { color: var(--green); font-size: 10px; font-weight: 900; }

.stage-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold-strong);
  font-size: 12px;
  font-weight: 800;
}

.stage-label::before { width: 7px; height: 7px; background: var(--gold); content: ""; }
.stage-label[data-tone="add"] { color: var(--blue); }
.stage-label[data-tone="add"]::before { background: var(--blue); }
.stage-label[data-tone="risk"] { color: var(--red); }
.stage-label[data-tone="risk"]::before { background: var(--red); }
.signal-time { color: var(--muted); font-size: 11px; }

.entry-line { display: flex; flex-wrap: wrap; gap: 7px 16px; color: var(--muted); font-size: 12px; }
.entry-line strong { margin-left: 5px; color: var(--text); font-size: 14px; }
.signal-result { display: grid; align-content: center; justify-items: end; min-width: 56px; }
.signal-result strong { color: var(--gold); font-size: 27px; line-height: 1; }
.signal-result small { margin-top: 6px; color: var(--muted); font-size: 10px; }

.empty-state {
  display: grid;
  min-height: 250px;
  padding: 42px 24px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-state svg { width: 28px; height: 28px; margin-bottom: 14px; color: var(--muted); }
.empty-state strong { font-size: 16px; }
.empty-state p { max-width: 310px; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }

.signal-skeleton {
  height: 108px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  animation: loading 1.1s ease-in-out infinite alternate;
}

@keyframes loading { to { opacity: 0.48; } }

.count-box {
  display: grid;
  min-width: 42px;
  height: 42px;
  padding: 0 8px;
  place-items: center;
  border: 1px solid var(--line-gold);
  border-radius: 6px;
  color: var(--gold);
  font-size: 18px;
  font-weight: 800;
}

.permission-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 18px;
  background: #15150f;
  border-block: 1px solid var(--line-gold);
}

.permission-icon { display: grid; width: 42px; height: 42px; place-items: center; background: var(--gold); color: #111; border-radius: 6px; }
.permission-icon svg { width: 21px; height: 21px; }
.permission-band strong { font-size: 15px; }
.permission-band p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.primary-button, .secondary-button {
  min-height: 42px;
  padding: 9px 15px;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button { border: 1px solid var(--gold); background: var(--gold); color: #111; }
.secondary-button { display: flex; width: calc(100% - 36px); margin: 16px 18px; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--line); background: var(--surface-2); }
.secondary-button:hover, .secondary-button:focus-visible { border-color: var(--gold); }
.secondary-button svg { width: 17px; height: 17px; }

.settings-section { margin-top: 24px; border-block: 1px solid var(--line); }
.section-label { display: flex; align-items: baseline; justify-content: space-between; padding: 0 18px 10px; border-bottom: 1px solid var(--line); }
.section-label h2 { font-size: 15px; }
.section-label small { color: var(--muted); font-size: 10px; }

.setting-row {
  display: flex;
  min-height: 70px;
  padding: 13px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.setting-row:last-of-type { border-bottom: 0; }
.setting-row span { display: grid; gap: 4px; }
.setting-row strong { font-size: 14px; }
.setting-row small { color: var(--muted); font-size: 11px; }
.setting-critical strong { color: #ffc0c7; }

.setting-row input {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
  margin: 0;
  appearance: none;
  border: 1px solid #494d54;
  border-radius: 14px;
  background: #30333a;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.setting-row input::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e9e9e7;
  content: "";
  transition: transform 160ms ease;
}

.setting-row input:checked { border-color: var(--gold); background: var(--gold); }
.setting-row input:checked::after { background: #111; transform: translateX(20px); }
.setting-row input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.member-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 18px;
  background: #15150f;
  border-block: 1px solid var(--line-gold);
}

.member-ident { display: flex; align-items: center; gap: 13px; }
.member-ident strong { font-size: 17px; }
.member-tier { padding: 6px 8px; border: 1px solid var(--line-gold); border-radius: 4px; color: var(--gold); font-size: 11px; font-weight: 800; }
.account-list { margin-top: 24px; border-block: 1px solid var(--line); }
.account-row { display: flex; min-height: 56px; padding: 12px 18px; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.account-row:last-child { border-bottom: 0; }
.account-row span { color: var(--muted); }
.positive { color: var(--green); }

.risk-note { display: flex; gap: 12px; margin: 24px 18px; padding: 14px; border-left: 3px solid var(--red); background: var(--surface); color: var(--muted); }
.risk-note svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--red); }
.risk-note p { margin: 0; font-size: 12px; line-height: 1.7; }

.bottom-nav {
  position: fixed;
  z-index: 30;
  bottom: 0;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(100%, 680px);
  min-height: calc(var(--nav-height) + var(--safe-bottom));
  padding: 6px 8px var(--safe-bottom);
  transform: translateX(-50%);
  background: rgba(16, 18, 21, 0.98);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.bottom-nav button {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 58px;
  padding: 7px 4px 6px;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.bottom-nav svg { width: 21px; height: 21px; }
.bottom-nav span { font-size: 10px; font-weight: 700; }
.bottom-nav button.is-active { color: var(--gold); }
.bottom-nav b { position: absolute; top: 4px; left: calc(50% + 8px); display: grid; min-width: 17px; height: 17px; padding: 0 4px; place-items: center; border-radius: 9px; background: var(--red); color: white; font-size: 9px; }
.bottom-nav b[data-empty="true"] { display: none; }

.signal-dialog {
  width: min(100%, 680px);
  max-height: 88vh;
  margin: auto auto 0;
  padding: 0 0 calc(18px + var(--safe-bottom));
  overflow-y: auto;
  color: var(--text);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--surface);
}

.signal-dialog::backdrop { background: rgba(0, 0, 0, 0.74); backdrop-filter: blur(3px); }
.dialog-grip { width: 38px; height: 4px; margin: 9px auto 1px; border-radius: 2px; background: #4b4e54; }
.dialog-head { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; background: rgba(16, 18, 21, 0.97); border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 27px; }

.decision-band { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: center; padding: 16px 18px; background: #15150f; border-bottom: 1px solid var(--line-gold); }
.decision-band strong { display: block; margin-bottom: 5px; font-size: 15px; }
.decision-band small { color: var(--muted); font-size: 11px; }

.price-grid { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.price-cell { min-width: 0; padding: 15px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.price-cell:nth-child(2n) { border-right: 0; }
.price-cell:nth-last-child(-n+2) { border-bottom: 0; }
.price-cell small { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.price-cell strong { display: block; overflow-wrap: anywhere; font-size: 17px; }
.price-cell.is-positive strong { color: var(--green); }
.price-cell.is-danger strong { color: var(--red); }

.detail-block { padding: 18px; border-bottom: 1px solid var(--line); }
.detail-block h3 { margin: 0 0 8px; font-size: 13px; }
.detail-block p { margin: 0; color: #c9c9c6; font-size: 13px; line-height: 1.75; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 18px 0; }
.detail-actions button { width: 100%; margin: 0; }

.toast {
  position: fixed;
  z-index: 80;
  right: 16px;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 14px);
  left: 16px;
  width: min(calc(100% - 32px), 500px);
  margin-inline: auto;
  padding: 12px 14px;
  border: 1px solid var(--line-gold);
  border-radius: 6px;
  background: #202014;
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.42);
}

@media (min-width: 681px) {
  body { background: #050506; }
  .app-shell { border-color: var(--line); box-shadow: 0 0 60px rgba(0, 0, 0, 0.55); }
  .signal-dialog { margin-bottom: 24px; border-bottom: 1px solid var(--line); border-radius: 8px; }
}

@media (max-width: 380px) {
  .topbar, .view-heading, .signal-row, .setting-row, .member-panel { padding-inline: 14px; }
  .filters { margin-inline: 14px; }
  .connection b { display: none; }
  .permission-band { grid-template-columns: auto 1fr; }
  .permission-band .primary-button { grid-column: 1 / -1; width: 100%; }
  h1 { font-size: 27px; }
}

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

body { min-width: 0; }
.access-state .primary-button { margin-top: 22px; min-height: 44px; padding: 12px 24px; }
.iphone-guide-entry { display: flex; align-items: center; gap: 12px; width: calc(100% - 36px); margin: 0 18px 22px; padding: 16px; border: 1px solid var(--gold); border-radius: 8px; background: #211d0d; color: var(--gold); text-align: left; cursor: pointer; }
.iphone-guide-entry > svg { width: 24px; height: 24px; flex: 0 0 24px; }
.iphone-guide-entry > svg:last-child { margin-left: auto; width: 18px; flex-basis: 18px; }
.iphone-guide-entry strong, .iphone-guide-entry small { display: block; }
.iphone-guide-entry strong { font-size: 16px; line-height: 1.5; }
.iphone-guide-entry small { margin-top: 3px; color: #d2c697; font-size: 13px; line-height: 1.5; }
.iphone-guide { margin: 24px 18px; border: 1px solid var(--line-gold); border-top: 4px solid var(--gold); border-radius: 10px; background: #111311; overflow-wrap: anywhere; scroll-margin-top: 96px; }
.iphone-guide:focus-visible, .iphone-guide summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.iphone-guide-heading { display: flex; gap: 14px; align-items: center; padding: 22px 20px 0; }
.iphone-guide-heading > svg { color: var(--gold); width: 32px; height: 32px; flex: 0 0 32px; }
.iphone-guide-heading p { color: var(--gold); font-size: 13px; font-weight: 700; margin: 0 0 6px; }
.iphone-guide-heading h2 { margin: 0; font-size: 23px; line-height: 1.4; letter-spacing: 0; }
.iphone-guide-intro { margin: 14px 20px 0; font-size: 14px; line-height: 1.7; color: #bdc2c7; }
.iphone-steps { padding: 0 20px; margin: 8px 0 0; list-style: none; }
.iphone-steps > li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 22px 0; }
.iphone-steps > li + li { border-top: 1px solid var(--line); }
.iphone-step-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #171300; font-weight: 800; font-size: 16px; }
.iphone-steps h3 { margin: 3px 0 9px; font-size: 17px; line-height: 1.4; }
.iphone-steps p, .iphone-guide-help p { margin: 0; font-size: 15px; line-height: 1.85; color: #c5c9ce; }
.iphone-steps strong { color: var(--text); }
.iphone-steps .iphone-guide-url { margin: 10px 0; padding: 10px 12px; background: #090b0a; border: 1px solid var(--line); border-radius: 5px; color: var(--gold); font-size: 15px; user-select: all; }
.iphone-steps .iphone-step-hint { font-size: 13px; color: #aab1b7; }
.iphone-action-example { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 14px 0; color: var(--gold); }
.iphone-action-example > span { display: inline-flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid #625522; border-radius: 6px; font-size: 14px; font-weight: 700; background: #201d11; }
.iphone-action-example svg { width: 22px; height: 22px; flex: 0 0 22px; }
.iphone-action-example > svg { width: 16px; flex-basis: 16px; }
.iphone-home-icon { display: flex; align-items: center; gap: 12px; margin: 12px 0; color: #c5c9ce; font-size: 14px; line-height: 1.7; }
.iphone-home-icon img { flex: 0 0 44px; border-radius: 10px; }
.iphone-steps .iphone-guide-success { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; color: #90dbb7; font-size: 14px; }
.iphone-guide-success svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 4px; }
.iphone-guide-help { margin: 0 20px; border-top: 1px solid var(--line); }
.iphone-guide-help details { border-bottom: 1px solid var(--line); }
.iphone-guide-help summary { min-height: 48px; padding: 15px 0; font-size: 14px; font-weight: 700; line-height: 1.6; cursor: pointer; }
.iphone-guide-help p { padding: 0 0 16px; font-size: 14px; }
.iphone-guide-next { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 20px 20px 0; padding: 13px 10px; min-height: 48px; border-radius: 6px; background: var(--gold); color: #171300; text-decoration: none; font-size: 14px; font-weight: 800; line-height: 1.5; }
.iphone-guide-next svg { width: 18px; height: 18px; flex: 0 0 18px; }
.iphone-guide-source { display: block; width: fit-content; margin: 8px auto; padding: 12px; color: #aab1b7; font-size: 13px; text-underline-offset: 3px; }
@media (max-width: 380px) {
  .iphone-guide { margin-inline: 14px; }
  .iphone-guide-entry { width: calc(100% - 28px); margin-inline: 14px; padding: 13px; gap: 10px; }
  .iphone-guide-heading { padding-inline: 14px; gap: 10px; }
  .iphone-guide-heading h2 { font-size: 21px; }
  .iphone-guide-intro, .iphone-guide-help { margin-inline: 14px; }
  .iphone-steps { padding-inline: 14px; }
  .iphone-steps > li { grid-template-columns: 26px minmax(0, 1fr); gap: 10px; }
  .iphone-step-number { width: 26px; height: 26px; font-size: 14px; }
  .iphone-action-example { gap: 6px; }
  .iphone-action-example > span { padding: 8px; gap: 6px; }
  .iphone-guide-next { margin-inline: 14px; }
}
.auth-flow { margin: 0 18px 24px; padding: 20px; border: 1px solid var(--line-gold); border-radius: 10px; background: #15160f; }
.auth-flow h2 { margin: 8px 0 12px; font-size: 21px; line-height: 1.5; }
.auth-context { color: #ded8ba; font-size: 14px; line-height: 1.8; margin: 0; }
.auth-steps { padding: 0; margin: 20px 0; list-style: none; display: grid; gap: 17px; }
.auth-steps li { display: flex; align-items: flex-start; gap: 12px; line-height: 1.7; font-size: 15px; }
.auth-steps b { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border-radius: 50%; background: var(--gold); color: #171300; font-size: 14px; }
.auth-steps small { display: block; color: #abb1ba; font-size: 13px; }
.auth-flow > .primary-button, .auth-flow > .secondary-button { display: flex; justify-content: center; width: 100%; min-height: 48px; margin: 12px 0 0; padding: 12px; text-align: center; text-decoration: none; line-height: 1.5; }
.auth-flow [hidden], .auth-flow[hidden] { display: none !important; }
.auth-flow .inline-status { margin: 14px 0 0; padding: 0; color: #d0caa9; font-size: 14px; line-height: 1.8; }
.auth-boundary { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: #aab1b7; font-size: 12px; line-height: 1.7; }

.current-price-amount { display: inline-flex; align-items: baseline; min-width: 0; gap: 1px; }

.signal-meta-line{flex-wrap:wrap;align-items:baseline}.signal-time{font-variant-numeric:tabular-nums;white-space:nowrap}

/* Explicit read action, sized for mobile alongside the refresh control. */
.read-all-button { min-height: 44px; padding: 0 10px; border: 1px solid var(--gold); border-radius: 6px; background: transparent; color: var(--gold); font: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.read-all-button:disabled { opacity: .45; cursor: default; }
.read-all-button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* One compact tool panel at a time; the main navigation stays unchanged. */
.health-hub { margin:28px 0 0; border-top:1px solid var(--line,#2a2f35); padding:20px 18px 0; }
.health-hub-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.health-hub-heading h2 { margin:0; font-size:18px; }
.health-text-button { min-height:44px; padding:8px 12px; color:var(--yellow,#f4cf47); background:none; border:1px solid var(--line,#2a2f35); border-radius:8px; }
.health-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border:1px solid var(--line,#2a2f35); border-radius:9px; overflow:hidden; }
.health-tabs button { min-height:46px; border:0; border-right:1px solid var(--line,#2a2f35); background:#101216; color:#adb4c0; font-size:14px; font-weight:700; padding:8px 3px; }
.health-tabs button:last-child { border-right:0; }
.health-tabs button[aria-selected="true"] { background:var(--yellow,#f4cf47); color:#111; }
.health-tabs button:focus-visible,.health-text-button:focus-visible,.health-history-header button:focus-visible { outline:2px solid #fff; outline-offset:-4px; }
.health-tool-note { font-size:13px; line-height:1.6; color:#9da4ad; margin:12px 0; }
.health-tool-row { display:flex; gap:12px; align-items:center; padding:16px 0; border-bottom:1px solid var(--line,#2a2f35); }
.health-tool-main { flex:1; min-width:0; }
.health-tool-main strong { display:block; overflow-wrap:anywhere; font-size:17px; }
.health-tool-main p { margin:5px 0 0; color:#a5acb5; font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
.health-rank { color:var(--yellow,#f4cf47); font-size:20px; font-weight:800; width:27px; flex-shrink:0; }
.health-picks-action { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
.health-picks-action .primary-button { min-height:44px; padding:10px 18px; }
#health-picks-quota { font-size:12px; color:#a5acb5; }
.health-pick { padding:18px 0; border-bottom:1px solid var(--line,#2a2f35); }
.health-pick-head { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.health-pick-head strong { font-size:19px; overflow-wrap:anywhere; }
.health-pick-head span { font-size:12px; color:#f4cf47; }
.health-pick p,.health-pick li { font-size:13px; line-height:1.7; }
.health-pick ul { padding-left:20px; }
.health-pick .health-risk { color:#e9b38b; }
.health-history-dialog { color:inherit; background:#0c0f12; border:1px solid #343941; border-radius:14px; width:min(620px,calc(100% - 24px)); max-height:85dvh; overflow:auto; padding:20px; }
.health-history-dialog::backdrop { background:rgb(0 0 0 / 72%); }
.health-history-header { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.health-history-header h2 { font-size:20px; margin:0; }
.health-history-header p { margin:8px 0; color:#adb4c0; font-size:12px; line-height:1.6; }
.health-history-header button { flex-shrink:0; width:44px; height:44px; background:#181c21; border:1px solid #343941; border-radius:8px; color:#fff; }
#health-history-rerun { margin-top:20px; padding:12px 18px; min-height:44px; }
#health-history-detail .price-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.health-hub [hidden],.health-history-dialog [hidden] { display:none!important; }

/* Interaction recipes: Transitions.dev, copyright 2026 Jakub Antalik. */
:root {
  --tabs-dur: 250ms;
  --tabs-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tabs-text-muted: rgba(15, 15, 15, 0.8);
  --tabs-text-active: #0f0f0f;
  --tabs-bar-bg: #f1f1f1;
  --tabs-pill-bg: #ffffff;
}
/* The bar is just a flex container with padding for the pill
   to sit inside. Tabs sit on z-index: 1, the pill on z-index: 0,
   so labels read above the pill background. */
.t-tabs {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 48px;
  background: var(--tabs-bar-bg);
}
.t-tab {
  position: relative;
  appearance: none;
  border: 0;
  background: transparent;
  height: 30px;
  padding: 4px 12px;
  color: var(--tabs-text-muted);
  cursor: pointer;
  border-radius: 48px;
  z-index: 1;
  transition: color var(--tabs-dur) var(--tabs-ease);
}
.t-tab:not([aria-selected="true"]):hover,
.t-tab[aria-selected="true"] {
  color: var(--tabs-text-active);
}

/* The pill: width + transform are written inline by JS so
   the transition tweens between the previous and next
   measured positions. */
.t-tabs-pill {
  position: absolute;
  top: 3px;
  left: 0;
  height: 30px;
  width: 0;
  background: var(--tabs-pill-bg);
  border-radius: 48px;
  transform: translateX(0);
  transition:
    transform var(--tabs-dur) var(--tabs-ease),
    width     var(--tabs-dur) var(--tabs-ease);
  will-change: transform, width;
  z-index: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .t-tabs-pill, .t-tab { transition: none !important; }
}
:root {
  --modal-open-dur: 250ms;
  --modal-close-dur: 150ms;
  --modal-scale: 0.96;
  --modal-scale-close: 0.96;
  --modal-ease: cubic-bezier(0.22, 1, 0.36, 1);
}
.t-modal {
  transform-origin: center;
  transform: scale(var(--modal-scale));
  opacity: 0;
  pointer-events: none;
  transition:
    transform var(--modal-open-dur) var(--modal-ease),
    opacity   var(--modal-open-dur) var(--modal-ease);
  will-change: transform, opacity;
}
.t-modal.is-open {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}
.t-modal.is-closing {
  transform: scale(var(--modal-scale-close));
  opacity: 0;
  pointer-events: none;
  transition:
    transform var(--modal-close-dur) var(--modal-ease),
    opacity   var(--modal-close-dur) var(--modal-ease);
}

@media (prefers-reduced-motion: reduce) {
  .t-modal { transition: none !important; }
}
/* Product integration: preserve button semantics, grid widths and brand colours. */
.t-tabs {
  --tabs-text-muted: var(--muted, #aab2bd);
  --tabs-text-active: var(--text, #f5f3ed);
  --tabs-pill-bg: var(--gold, #f7c928);
  --tabs-bar-bg: var(--surface, #101215);
}
:is(.filters, .health-tabs, .ms-filters).t-tabs {
  display: grid;
  align-items: stretch;
  gap: 3px;
  padding: 4px;
  border-radius: 12px;
  isolation: isolate;
}
:is(.filters, .health-tabs, .ms-filters).t-tabs .t-tab {
  min-width: 0;
  min-height: 44px;
  height: auto;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 8px 3px;
  color: var(--tabs-text-muted);
  line-height: 1.4;
}
:is(.filters, .health-tabs, .ms-filters).t-tabs .t-tab:is([aria-pressed="true"], [aria-selected="true"]) { color: #111; background: transparent; }
:is(.filters, .health-tabs, .ms-filters).t-tabs .t-tab:focus-visible { outline: 2px solid var(--text); outline-offset: -3px; }
.t-tabs .t-tabs-pill { border-radius: 8px; }
body[data-theme="light"] .t-tabs, body.light .t-tabs { --tabs-pill-bg: #eac347; }
:is(button, a.primary-action, a.secondary-action, .app-install-link) { touch-action: manipulation; }
:is(.primary-button, .secondary-button, .icon-button, .read-all-button, .health-text-button, .primary-action, .secondary-action, .ms-refresh, .ms-more, .app-install-link, .film-close, .app-install-close) {
  transition: transform 150ms cubic-bezier(0.22, 1, 0.36, 1), background-color 150ms ease, border-color 150ms ease;
}
:is(.primary-button, .secondary-button, .icon-button, .read-all-button, .health-text-button, .primary-action, .secondary-action, .ms-refresh, .ms-more, .app-install-link, .film-close, .app-install-close):not(:disabled):active {
  transform: scale(.97);
  transition-duration: 70ms;
}
:is(.current-price-value, .current-price-change, .ms-price, .ms-return, .price-cell strong) { font-variant-numeric: tabular-nums; }
.t-modal { overscroll-behavior: contain; }
.t-modal.is-closing { pointer-events: auto; }
.t-modal::backdrop { transition: background-color 150ms ease; }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .topbar, .bottom-nav, .dialog-head { backdrop-filter: none; background: var(--surface, #101215); }
  .t-modal::backdrop { backdrop-filter: none; background: rgb(0 0 0 / 85%); }
}
@media (prefers-reduced-motion: reduce) {
  :is(.primary-button, .secondary-button, .icon-button, .read-all-button, .health-text-button, .primary-action, .secondary-action, .ms-refresh, .ms-more, .app-install-link, .film-close, .app-install-close) { transition: none; transform: none !important; }
  .t-modal { transform: none !important; }
}

/* Comfortable touch targets and stable, readable operational data. */
.bottom-nav span { font-size: 12px; line-height: 1.4; }
.bottom-nav button { border-radius: 10px; transition: color 150ms ease, background-color 150ms ease; }
.bottom-nav button.is-active { background: rgb(247 201 40 / 7%); }
.bottom-nav button:active { background: rgb(247 201 40 / 12%); }
.signal-meta-line { row-gap: 6px; }
.signal-time { font-size: 12px; }
.signal-dialog { border-radius: 18px 18px 0 0; max-height: 88dvh; }
.signal-dialog.t-modal { transform-origin: center bottom; }
.signal-row:focus-visible { outline: 2px solid var(--gold); outline-offset: -4px; }
.dialog-head .icon-button { min-width: 44px; min-height: 44px; }
.price-cell small { font-size: 12px; line-height: 1.5; }
.detail-block h3 { font-size: 14px; }
.detail-block p { font-size: 14px; }
.view-heading { gap: 10px; }
.heading-actions { flex-wrap: wrap; justify-content: flex-end; }
#refresh-button:disabled svg { animation: yaobi-refresh 800ms linear infinite; }
@keyframes yaobi-refresh { to { transform: rotate(360deg); } }
@media (min-width: 681px) { .signal-dialog { border-radius: 18px; } }
@media (prefers-reduced-motion: reduce) { .bottom-nav button { transition: none; } #refresh-button:disabled svg { animation: none; } }
