/* Helm UI kit — layout & screen styles (kit-local; composes DS tokens + components) */

.kit-stage {
  min-height: 100vh; margin: 0;
  display: flex; align-items: center; justify-content: center; gap: 40px;
  padding: 32px;
  background:
    radial-gradient(120% 90% at 50% 0%, #1c3a31 0%, #142a23 55%, #0f211b 100%);
}

/* ----- phone frame ----- */
.phone {
  position: relative; width: 390px; height: 800px; flex: 0 0 auto;
  background: var(--surface-canvas);
  border-radius: 46px; box-shadow: 0 40px 90px rgba(0,0,0,0.45), 0 0 0 11px #0c1611, 0 0 0 12px #2a3a33;
  overflow: hidden; display: flex; flex-direction: column;
  background-image: var(--texture-paper); background-size: var(--texture-paper-size);
}
.phone__notch {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 116px; height: 30px; background: #0c1611; border-radius: 16px; z-index: 40;
}

/* ----- app header ----- */
.app-header {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 46px 18px 10px; background: var(--surface-card); border-bottom: 1px solid var(--line);
  z-index: 20;
}
.app-header__brand { display: flex; align-items: center; gap: 8px; color: var(--brand); }
.app-header__word { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--text-primary); letter-spacing: .01em; }

/* ----- scroll area ----- */
.app-scroll { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; position: relative; }
.app-scroll::-webkit-scrollbar { width: 0; }
.screen { display: flex; flex-direction: column; gap: 16px; padding: 18px 16px 120px; }
.ov-sec { padding: 4px 2px 0; }

/* ----- overview ----- */
.ov-hero { display: flex; flex-direction: column; gap: 4px; container-type: inline-size; }
.ov-hero .helm-amt--hero { margin-top: 4px; }
.ov-hero__sub { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.ov-colloq { font-size: var(--fs-body); color: var(--accent-brass); font-weight: 600; }
.ov-hero__guide { font-size: var(--fs-label); color: var(--text-tertiary); }
.ov-trend {
  margin-top: 16px; height: 88px; border-radius: var(--radius-md);
  border: 1px dashed var(--line-strong); background: var(--surface-sunken);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--text-tertiary); font-size: var(--fs-caption);
}
.ov-trend i { font-size: 1.5rem; color: var(--c-ink-400); }

.ov-donut { margin: 18px 0 6px; }
.ov-legend { display: flex; flex-direction: column; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-faint); }
.ov-legend__row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 6px; background: none; border: none; cursor: pointer; text-align: left;
  border-radius: var(--radius-sm); transition: background var(--dur-fast) var(--ease-standard);
}
.ov-legend__row:hover, .ov-legend__row.is-active { background: var(--surface-hover); }
.ov-legend__dot { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
.ov-legend__cat { font-size: var(--fs-label); color: var(--text-primary); flex: 1 1 auto; }
.ov-legend__amt { font-size: var(--fs-label); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ov-legend__pct { font-size: var(--fs-label); color: var(--text-tertiary); font-variant-numeric: tabular-nums; width: 52px; text-align: right; }
.ov-liq-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }

/* ----- detail ----- */
.dt-list { display: flex; flex-direction: column; gap: 14px; }

/* ----- FAB ----- */
.app-fab {
  position: absolute; right: 18px; bottom: calc(var(--tabbar-h) + 18px); z-index: 30;
}

/* ----- tab bar pinned ----- */
.app-tabbar { flex: 0 0 auto; z-index: 20; }

/* ----- Lock ----- */
.lock {
  position: absolute; inset: 0; z-index: 50;
  background: radial-gradient(130% 80% at 50% -10%, #245242 0%, #163a30 50%, #0e211b 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 30px; text-align: center;
}
.lock__texture { position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(203,172,116,0.05) 1px, transparent 1px);
  background-size: 16px 16px; pointer-events: none; }
.lock__center { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 300px; }
.lock__icon { border-radius: 18px; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.lock__word { font-family: var(--font-display); font-weight: 700; font-size: 2.6rem; color: #f3efe2; margin-top: 18px; letter-spacing: .02em; }
.lock__tag { font-size: var(--fs-label); color: #9fb3a8; margin-top: 2px; }
.lock__form { width: 100%; display: flex; flex-direction: column; gap: 14px; margin-top: 34px; }
.lock__form .helm-input { background: rgba(255,255,255,0.06); border-color: rgba(203,172,116,0.35); color: #f3efe2; }
.lock__form .helm-input::placeholder { color: #7d9085; }
.lock__form .helm-input:focus { border-color: var(--accent-brass); box-shadow: 0 0 0 3px rgba(203,172,116,0.25); }
.lock__err { color: #e6a48c; font-size: var(--fs-caption); margin-top: -4px; }
.lock__remember { display: flex; justify-content: center; margin-top: 2px; }
.lock__remember .helm-check__label { color: #d8e0d9; }
.lock__remember .helm-check__hint { color: #8a9c91; }
.lock__remember .helm-check__box { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.25); }
.lock__foot { position: absolute; bottom: 30px; left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: 6px; color: #8a9c91; font-size: var(--fs-caption); }
.shake { animation: lock-shake 0.4s var(--ease-standard); }
@keyframes lock-shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-7px)} 40%,80%{transform:translateX(7px)} }

/* ----- Add/Edit sheet ----- */
.sheet-scrim {
  position: absolute; inset: 0; z-index: 60; background: var(--surface-scrim);
  display: flex; align-items: flex-end; animation: scrim-in var(--dur-base) var(--ease-standard);
}
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-height: 94%; background: var(--surface-card);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0; box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column; overflow: hidden;
  animation: sheet-up var(--dur-sheet) var(--ease-out);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.sheet__grip { width: 38px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 10px auto 0; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 8px 18px 12px; border-bottom: 1px solid var(--line); }
.sheet__title { font-family: var(--font-serif); font-weight: 600; font-size: var(--fs-title-3); color: var(--text-primary); }
.sheet__cancel { background: none; border: none; color: var(--text-secondary); font-size: var(--fs-body); cursor: pointer; padding: 6px; }
.sheet__save { background: none; border: none; color: var(--brand); font-weight: 700; font-size: var(--fs-body); cursor: pointer; padding: 6px; }
.sheet__save:disabled { color: var(--text-disabled); }
.sheet__body { padding: 18px 18px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.sheet__fx { margin-top: 8px; font-size: var(--fs-caption); color: var(--value-positive); font-variant-numeric: tabular-nums; }
.sheet__danger { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.sheet__confirm { display: flex; flex-direction: column; gap: 12px; }
.sheet__confirm-q { margin: 0; font-size: var(--fs-label); color: var(--text-primary); text-align: center; }
.sheet__confirm-row { display: flex; gap: 10px; }

/* keep toast inside the phone frame (override DS fixed positioning) */
.phone .helm-toast-viewport { position: absolute; bottom: calc(var(--tabbar-h) + 16px); }

/* ----- demo controls (outside the phone) ----- */
.kit-controls { display: flex; flex-direction: column; gap: 12px; align-self: flex-start; margin-top: 8px; }
.kit-controls__title { font-family: var(--font-display); font-size: 1.6rem; color: #f3efe2; font-weight: 700; }
.kit-controls__hint { color: #9fb3a8; font-size: 13px; max-width: 220px; line-height: 1.5; }
.kit-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; cursor: pointer;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(203,172,116,0.3); border-radius: 12px;
  color: #f3efe2; font-family: var(--font-sans); font-size: 14px; font-weight: 500;
}
.kit-btn:hover { background: rgba(255,255,255,0.12); }
.kit-btn i { color: var(--accent-brass); font-size: 1.1rem; }

@media (max-width: 760px) {
  .kit-stage { flex-direction: column; gap: 20px; padding: 16px; }
  .kit-controls { align-self: center; align-items: center; text-align: center; }
}
