/* Presnap — Apple dark × SpaceX: black, white, one accent, nothing else */

:root {
  --black: #000000;
  --surface: #0b0b0d;
  --surface-2: #141417;
  --surface-3: #1c1c20;
  --hairline: rgba(255, 255, 255, 0.07);
  --hairline-strong: rgba(255, 255, 255, 0.16);

  --text: #f5f5f7;
  --text-2: #8b8b93;
  --text-3: #55555d;

  --accent: #30d158;
  --accent-dim: rgba(48, 209, 88, 0.1);
  --warn: #ff9f0a;
  --danger: #ff453a;
  --info: #0a84ff;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  background: var(--black);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
    system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  padding: 0 0 72px;
  max-width: 520px;
  margin: 0 auto;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.mono {
  font-family: "SF Mono", ui-monospace, "JetBrains Mono", monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ---------- loader ---------- */

#loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--black);
  z-index: 100;
  transition: opacity 0.4s var(--ease);
}

#loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--hairline-strong);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ---------- header ---------- */

header {
  padding: 26px 20px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.head-main p {
  margin-bottom: 5px;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.1;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 100px;
  border: 1px solid var(--hairline-strong);
  color: var(--text-2);
  white-space: nowrap;
}

.badge.pro {
  background: var(--text);
  border-color: var(--text);
  color: var(--black);
}

/* ---------- tabs ---------- */

.tabs {
  position: relative;
  display: flex;
  gap: 2px;
  padding: 0 20px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 20px;
}

.tab {
  padding: 11px 14px 13px;
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -0.01em;
  color: var(--text-3);
  transition: color 0.2s var(--ease);
}

.tab[aria-selected="true"] {
  color: var(--text);
}

.tab-ink {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.32s var(--ease), width 0.32s var(--ease);
}

main {
  padding: 0 20px;
}

/* ---------- today ---------- */

.act {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 15px 16px 0;
  margin-bottom: 10px;
  overflow: hidden;
}

.act.urgent {
  border-color: rgba(255, 159, 10, 0.3);
}

.act-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.act-drop {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.act-wallet {
  font-size: 11.5px;
  color: var(--text-3);
  flex: none;
}

.act-task {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 11px;
}

.act-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.act-meta {
  font-size: 11.5px;
  color: var(--text-3);
}

.act.urgent .act-meta {
  color: var(--warn);
}

.auto {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 100px;
  padding: 4px 9px;
  white-space: nowrap;
}

.auto .i {
  width: 8px;
  height: 11px;
}

/* ---------- bar ---------- */

.bar {
  height: 2px;
  background: var(--surface-3);
  margin: 0 -16px;
}

.bar i {
  display: block;
  height: 100%;
  background: var(--text);
  transition: width 0.5s var(--ease);
}

.act.urgent .bar i {
  background: var(--warn);
}

/* ---------- wallets ---------- */

.wcard {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  margin-bottom: 10px;
  overflow: hidden;
}

.wcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 15px 16px 13px;
}

.wcard-id {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.wcard-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.012em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wcard-sub {
  font-size: 11.5px;
  color: var(--text-3);
}

.wcard-score {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  flex: none;
}

.wcard .bar {
  margin: 0;
}

.wcard-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.34s var(--ease);
}

.wcard[data-open="true"] .wcard-body {
  grid-template-rows: 1fr;
}

.wcard-inner {
  overflow: hidden;
}

.chains {
  list-style: none;
  padding: 6px 16px 0;
}

.chains li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--text-2);
}

.chains li:last-child {
  border-bottom: none;
}

.chains b {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
}

.rm {
  display: block;
  width: calc(100% - 32px);
  margin: 10px 16px 14px;
  padding: 9px;
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline);
  font-size: 12.5px;
  color: var(--danger);
}

.w-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

/* ---------- risk ---------- */

.risk-head {
  margin-bottom: 12px;
}

.rcard {
  background: var(--surface);
  border: 1px solid rgba(255, 159, 10, 0.26);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 10px;
}

.rtop {
  width: 22px;
  height: 22px;
  color: var(--warn);
  margin-bottom: 11px;
}

.rtop svg {
  width: 100%;
  height: 100%;
}

.rlist {
  list-style: none;
  margin-bottom: 11px;
}

.rlist li {
  font-size: 13px;
  color: var(--text);
  padding: 5px 0;
  border-bottom: 1px solid var(--hairline);
}

.rlist li:last-child {
  border-bottom: none;
}

.rwhy {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ---------- empty ---------- */

.empty {
  text-align: center;
  padding: 52px 20px;
}

.empty .glyph {
  width: 34px;
  height: 34px;
  margin: 0 auto 16px;
  color: var(--text-3);
}

.empty .glyph svg {
  width: 100%;
  height: 100%;
}

.empty h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin-bottom: 7px;
}

.empty p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 22px;
}

.empty .spinner {
  margin: 0 auto;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 100px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.15s var(--ease), opacity 0.15s var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
}

.btn-primary {
  background: var(--text);
  color: var(--black);
}

.btn-ghost {
  border: 1px solid var(--hairline-strong);
  color: var(--text);
}

.btn-block {
  width: 100%;
}

/* ---------- sheet ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
  z-index: 50;
}

.backdrop[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 520px;
  margin: 0 auto;
  background: var(--surface-2);
  border-radius: 26px 26px 0 0;
  border-top: 1px solid var(--hairline-strong);
  padding: 10px 20px calc(26px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.4s var(--ease);
  z-index: 51;
}

.sheet[data-open="true"] {
  transform: translateY(0);
}

.grabber {
  width: 36px;
  height: 4px;
  border-radius: 100px;
  background: var(--hairline-strong);
  margin: 0 auto 20px;
}

.sheet h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}

.sheet > p {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 18px;
}

input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  background: var(--black);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 14px;
  margin-bottom: 10px;
  transition: border-color 0.2s var(--ease);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--hairline-strong);
}

input::placeholder {
  color: var(--text-3);
}

.field-note {
  font-size: 12px;
  min-height: 18px;
  margin-bottom: 14px;
}

.field-note.error {
  color: var(--danger);
}

.sheet-actions {
  display: flex;
  gap: 10px;
}

.sheet-actions .btn {
  flex: 1;
}

/* ---------- toast ---------- */

#toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  background: var(--surface-3);
  border: 1px solid var(--hairline-strong);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--ease);
  z-index: 60;
  white-space: nowrap;
}

#toast[data-show="true"] {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- footer ---------- */

footer {
  padding: 30px 20px 16px;
  text-align: center;
}

footer p {
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.05em;
}

/* ---------- projects ---------- */

.scope {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--surface-2);
  border-radius: 100px;
  margin-bottom: 14px;
}

.scope button {
  padding: 7px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-3);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.scope button[aria-selected="true"] {
  background: var(--text);
  color: var(--black);
}

.pcard {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  margin-bottom: 10px;
  overflow: hidden;
}

.pcard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 15px 16px 10px;
}

.pcard-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.pcard-name {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.018em;
}

.pcard-tag {
  font-size: 12.5px;
  color: var(--text-2);
}

.pscore {
  flex: none;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  padding-top: 2px;
}

.pscore.strong { color: var(--accent); }
.pscore.fair   { color: var(--warn); }
.pscore.weak   { color: var(--text-3); }

.pfacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 13px;
  font-size: 11px;
  color: var(--text-3);
}

.pfacts span {
  border: 1px solid var(--hairline);
  border-radius: 100px;
  padding: 3px 9px;
}

.prio {
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 10px !important;
}

.prio.high   { color: var(--warn); border-color: rgba(255, 159, 10, 0.32) !important; }
.prio.medium { color: var(--text-2); }
.prio.low    { color: var(--text-3); }

.pcard-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.34s var(--ease);
}

.pcard[data-open="true"] .pcard-body {
  grid-template-rows: 1fr;
}

.pcard-inner {
  overflow: hidden;
  padding: 0 16px;
}

.pinv,
.pdate {
  font-size: 12.5px;
  color: var(--text-2);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 8px;
}

.slabel {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 7px;
}

.srows {
  list-style: none;
  margin-bottom: 10px;
}

.srows li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 12.5px;
}

.srows li:last-child { border-bottom: none; }

.srows span { color: var(--text-2); flex: none; }

.srows em {
  flex: 1;
  min-width: 0;
  font-style: normal;
  color: var(--text-3);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.srows b {
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  font-weight: 600;
}

.srows b.on { color: var(--accent); }

.plink {
  display: inline-block;
  font-size: 12.5px;
  color: var(--info);
  text-decoration: none;
  margin-bottom: 12px;
}

.pfollow {
  width: 100%;
  padding: 12px;
  border-top: 1px solid var(--hairline);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  transition: background 0.2s var(--ease);
}

.pfollow.on {
  background: var(--accent-dim);
  color: var(--accent);
}
