/* ── Processing step icons ──────────────────────────────────────── */
.processing-step { display: flex; align-items: center; gap: 13px; padding: 8px 0; }
.processing-step + .processing-step { border-top: 1px solid rgba(37,42,56,.6); }
.step-icon { width: 27px; height: 27px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 11px; font-family: var(--mono); }
.step-icon.active  { border: 2px solid var(--accent); color: var(--accent); animation: spin .8s linear infinite; }
.step-icon.done    { background: rgba(52,199,89,.12); border: 2px solid var(--success); color: var(--success); }
.step-icon.pending { border: 2px solid var(--hairline); color: var(--text-dim); }
.step-text { font-family: var(--sans); }
.step-text strong { display: block; font-size: 13px; margin-bottom: 2px; color: var(--text); }
.step-text.active strong { color: var(--accent); }
.step-text.done strong   { color: var(--success); }
.step-text.pending strong{ color: var(--text-dim); }
.step-text span { font-size: 11px; color: var(--text-dim); font-family: var(--sans); }

/* ── Calendar navigation bar ────────────────────────────────────── */
.cal-nav-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; flex-shrink: 0;
  background: var(--surface); border-bottom: 0.5px solid var(--border);
}
.cal-nav-btn {
  background: rgba(0,122,255,.07); border: 1px solid rgba(0,122,255,.25);
  color: var(--accent); width: 34px; height: 34px; border-radius: 10px;
  font-size: 18px; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s; font-family: var(--mono);
}
.cal-nav-btn:hover:not(:disabled) { background: rgba(0,122,255,.12); border-color: var(--accent); }
.cal-nav-btn:disabled { opacity: .3; cursor: not-allowed; }
.cal-nav-label { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: 0; }

/* ── Calendar navigation bar (iOS) ──────────────────────────── */
.cal-nav-bar {
  background: var(--surface); border-bottom: 0.5px solid var(--border);
  padding: 10px 14px;
}
.cal-nav-btn {
  background: rgba(0,122,255,.07); border-color: rgba(0,122,255,.25);
  color: var(--accent); width: 34px; height: 34px; border-radius: 10px; font-size: 18px;
}
.cal-nav-btn:hover:not(:disabled) { background: rgba(0,122,255,.12); border-color: var(--accent); }
.cal-nav-label { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: 0; }

/* ── Bottom nav bar ──────────────────────────────────────────── */
  .m-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    height: calc(var(--nav-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    display: flex;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(32px);
    -webkit-backdrop-filter: saturate(180%) blur(32px);
    border-top: 0.5px solid rgba(0,0,0,.14);
  }

  .m-nav-btn {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2px; border: none; background: none;
    font-family: var(--sans); font-size: 10px; font-weight: 500;
    color: var(--text-dim); cursor: pointer;
    padding: 6px 2px 4px; position: relative;
    transition: color .2s;
  }

  .m-nav-btn svg { width: 26px; height: 26px; fill: currentColor; flex-shrink: 0; transition: transform .2s; }

  .m-nav-btn.active { color: var(--accent); }
  .m-nav-btn.active svg { transform: scale(1.06); }

  .m-nav-btn.m-disabled { opacity: 0.32; cursor: default; }
  .m-nav-btn:not(.m-disabled):active { background: rgba(0,122,255,.05); }

  .m-nav-badge {
    position: absolute; top: 5px; right: calc(50% - 20px);
    background: var(--danger); color: #fff; border-radius: 10px;
    min-width: 18px; height: 18px; padding: 0 5px;
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--nav-bg);
  }

  /* ── Views container ─────────────────────────────────────────── */
  .m-views {
    display: block;
    position: fixed;
    top: 0; bottom: calc(50px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0;
  }
  .m-view {
    display: none;
    position: absolute; inset: 0;
    overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .m-view.active { display: block; }

  /* ── Toast notification ──────────────────────────────────────── */
  .m-toast {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 62px);
    left: 50%; transform: translateX(-50%) translateY(12px);
    background: var(--toast-bg); color: #fff;
    padding: 10px 20px; border-radius: 22px;
    font-family: var(--sans); font-size: 14px; line-height: 1.5;
    z-index: 200; opacity: 0;
    transition: opacity .3s, transform .3s;
    pointer-events: none;
    max-width: calc(100vw - 48px); text-align: center;
  }
  .m-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  /* ── Placeholder views ───────────────────────────────────────── */
  .m-coming-soon {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 8px;
  }
  .m-coming-soon svg { width: 44px; height: 44px; fill: var(--text-faint); margin-bottom: 6px; }
  .m-coming-soon-text { font-family: var(--sans); font-size: 17px; font-weight: 600; color: var(--text); }
  .m-coming-soon-sub  { font-family: var(--sans); font-size: 13px; color: var(--text-dim); }

  /* ── Stats modal bottom-sheet on mobile ─────────────────────── */
  .stats-modal { align-items: flex-end; padding: 0; }
  .stats-backdrop { background: rgba(0,0,0,.35); backdrop-filter: none; }
  .stats-panel {
    width: 100%; max-width: 100vw;
    border-radius: 18px 18px 0 0;
    padding: 8px 22px calc(env(safe-area-inset-bottom,0px) + 24px);
    background: var(--surface);
    box-shadow: 0 -2px 20px rgba(0,0,0,.1);
    border: none; border-top: 0.5px solid var(--border);
  }
  .stats-panel::before {
    content: ''; display: block;
    width: 36px; height: 4px;
    background: rgba(0,0,0,.15); border-radius: 2px;
    margin: 0 auto 14px;
  }
  .stats-title  { color: var(--text); font-family: var(--sans); font-size: 15px; }
  .stats-label  { color: var(--text-dim); font-family: var(--sans); }
  .stats-sub    { color: rgba(142,142,147,.55); font-family: var(--sans); }
  .stats-value  { color: var(--accent2); font-family: var(--sans); }
  .stats-value.pending { color: var(--text-dim); }
  .stats-close {
    color: var(--text-dim); font-size: 18px;
    width: 30px; height: 30px;
    background: rgba(142,142,147,.15); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
  }
