/* Platform chrome: auth pages, account bar, saved-search panel.
   Inherits the explorer's tokens (tool.css) but is self-sufficient for login/account. */
:root {
  --pf-bg: #0a0b0d; --pf-panel: #14161a; --pf-ink: #f4f1ea; --pf-dim: #9a988f;
  --pf-line: rgba(244,241,234,.12); --pf-accent: #f7a01d;
}

/* hide the app until auth is confirmed (prevents a flash of gated content) */
.app { opacity: 0; transition: opacity .25s ease; }
body.authed .app { opacity: 1; }

/* ---- account bar (injected into the topbar) ---- */
.acctbar { display: flex; align-items: center; gap: .6rem; font-family: Inter, system-ui, sans-serif; }
.acctbar__chip {
  display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .7rem;
  border: 1px solid var(--pf-line); border-radius: 100px; color: var(--pf-ink);
  font-size: .82rem; cursor: pointer; background: transparent;
}
.acctbar__plan { color: var(--pf-accent); font-weight: 600; text-transform: uppercase; font-size: .7rem; letter-spacing: .08em; }
.acctbar__btn {
  background: transparent; border: 1px solid var(--pf-line); color: var(--pf-ink);
  border-radius: 100px; padding: .35rem .8rem; font-size: .82rem; cursor: pointer;
}
.acctbar__btn:hover { border-color: var(--pf-accent); }
.viewnav__btn.locked { opacity: .5; }
.viewnav__btn .lock { font-size: .8em; margin-left: .25rem; }

/* ---- saved-search panel ---- */
.ss-pop {
  position: absolute; top: 52px; right: 16px; width: 320px; z-index: 60;
  background: var(--pf-panel); border: 1px solid var(--pf-line); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,.5); padding: .9rem; font-family: Inter, sans-serif;
}
.ss-pop h4 { color: var(--pf-ink); font-size: .95rem; margin: 0 0 .6rem; }
.ss-pop__row { display: flex; gap: .5rem; margin-bottom: .7rem; }
.ss-pop__row input {
  flex: 1; background: #0c0d10; border: 1px solid var(--pf-line); color: var(--pf-ink);
  border-radius: 8px; padding: .5rem .6rem; font-size: .85rem;
}
.ss-pop__row button {
  background: var(--pf-accent); color: #1a1206; border: none; border-radius: 8px;
  padding: .5rem .8rem; font-weight: 600; cursor: pointer; font-size: .85rem;
}
.ss-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; }
.ss-list li { display: flex; align-items: center; gap: .5rem; padding: .5rem 0; border-top: 1px solid var(--pf-line); }
.ss-list__open { flex: 1; text-align: left; background: none; border: none; color: var(--pf-ink); cursor: pointer; font-size: .85rem; }
.ss-list__open small { display: block; color: var(--pf-dim); font-size: .72rem; margin-top: .1rem; }
.ss-list__del { background: none; border: none; color: var(--pf-dim); cursor: pointer; font-size: 1rem; }
.ss-list__del:hover { color: #e0573f; }
.ss-empty { color: var(--pf-dim); font-size: .82rem; padding: .4rem 0; }

/* ---- auth + account pages ---- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; background: var(--pf-bg);
  font-family: Inter, system-ui, sans-serif; color: var(--pf-ink); padding: 2rem;
}
.auth-card {
  width: min(420px, 100%); background: var(--pf-panel); border: 1px solid var(--pf-line);
  border-radius: 16px; padding: 2rem; box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.auth-card h1 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 2rem; margin: 0 0 .25rem; }
.auth-card h1 b { color: var(--pf-accent); font-style: italic; }
.auth-card p.sub { color: var(--pf-dim); font-size: .92rem; margin: 0 0 1.4rem; }
.auth-tabs { display: flex; gap: .4rem; margin-bottom: 1.2rem; }
.auth-tabs button { flex: 1; background: transparent; border: 1px solid var(--pf-line); color: var(--pf-dim); border-radius: 100px; padding: .45rem; font-size: .82rem; cursor: pointer; }
.auth-tabs button.on { background: var(--pf-ink); color: #111; border-color: var(--pf-ink); font-weight: 600; }
.auth-field { margin-bottom: .9rem; }
.auth-field label { display: block; font-size: .75rem; color: var(--pf-dim); margin-bottom: .3rem; }
.auth-field input {
  width: 100%; background: #0c0d10; border: 1px solid var(--pf-line); color: var(--pf-ink);
  border-radius: 8px; padding: .7rem .8rem; font-size: .95rem; box-sizing: border-box;
}
.auth-field input:focus { outline: none; border-color: var(--pf-accent); }
.auth-btn {
  width: 100%; background: var(--pf-accent); color: #1a1206; border: none; border-radius: 100px;
  padding: .8rem; font-weight: 600; font-size: .95rem; cursor: pointer; margin-top: .4rem;
}
.auth-btn:disabled { opacity: .6; cursor: default; }
.auth-alt { text-align: center; margin-top: 1rem; font-size: .82rem; }
.auth-alt a { color: var(--pf-accent); cursor: pointer; text-decoration: none; }
.auth-msg { font-size: .85rem; margin-top: .9rem; min-height: 1.1em; }
.auth-msg.err { color: #e0573f; } .auth-msg.ok { color: #5bbf7b; }

.acct { max-width: 820px; margin: 0 auto; padding: 3rem 1.5rem; font-family: Inter, sans-serif; color: var(--pf-ink); }
.acct h1 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 2.4rem; margin: 0 0 1.5rem; }
.acct__card { background: var(--pf-panel); border: 1px solid var(--pf-line); border-radius: 14px; padding: 1.5rem; margin-bottom: 1.2rem; }
.acct__card h3 { margin: 0 0 .8rem; font-size: 1.1rem; }
.acct__row { display: flex; justify-content: space-between; padding: .4rem 0; border-top: 1px solid var(--pf-line); font-size: .92rem; }
.acct__row span:first-child { color: var(--pf-dim); }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.plan { background: var(--pf-panel); border: 1px solid var(--pf-line); border-radius: 14px; padding: 1.4rem; }
.plan.current { border-color: var(--pf-accent); }
.plan h4 { margin: 0 0 .2rem; font-size: 1rem; }
.plan .price { font-family: "Instrument Serif", Georgia, serif; font-size: 2.2rem; margin: .3rem 0; }
.plan .price small { font-size: .9rem; color: var(--pf-dim); font-family: Inter; }
.plan p { color: var(--pf-dim); font-size: .85rem; min-height: 2.4em; }
.plan button, .plan a.btn {
  display: block; text-align: center; width: 100%; box-sizing: border-box; margin-top: .8rem;
  background: var(--pf-accent); color: #1a1206; border: none; border-radius: 100px;
  padding: .65rem; font-weight: 600; cursor: pointer; text-decoration: none; font-size: .9rem;
}
.plan button.ghost, .plan a.ghost { background: transparent; color: var(--pf-ink); border: 1px solid var(--pf-line); }
.acct__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.acct__top a { color: var(--pf-dim); text-decoration: none; font-size: .9rem; }
@media (max-width: 640px) { .plans { grid-template-columns: 1fr; } }
