/* 멤버십·로그인 상태·한도 안내 (명세서 §3.1·§3.2, §12.13) */

/* ---------- 플랜 배지 ---------- */
.plan-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--pill);
  background: var(--chip);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.plan-badge.plan-basic { background: var(--bg-dim); color: var(--ink-3); }
.plan-badge.plan-standard { background: var(--cyan-soft); color: #017e9b; }
.plan-badge.plan-startup { background: var(--green-soft); color: #2f6e0c; }
.plan-badge.plan-professional { background: #efe8ff; color: #5b3bb5; }
.plan-badge.plan-enterprise { background: var(--ink); color: var(--white); }

/* ---------- 헤더 로그인 상태 ---------- */
.header-auth { display: flex; align-items: center; min-width: 0; }
.header-auth .auth-login { font-weight: 700; color: var(--ink); }
.auth-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.auth-email {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--ink-2);
}
.auth-usage-btn,
.auth-logout {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  background: var(--white);
  color: var(--ink-2);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.auth-usage-btn:hover,
.auth-logout:hover { background: var(--bg-soft); color: var(--ink); }
.auth-usage-btn[aria-expanded="true"] { border-color: var(--cyan); color: var(--cyan); }
.auth-logout:disabled { opacity: 0.55; cursor: not-allowed; }

.usage-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  width: 320px;
  padding: 14px 16px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: var(--shadow);
}
.usage-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-size: 13px; }
.usage-popover-link { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--cyan); }
.usage-popover-link:hover { text-decoration: underline; }

/* ---------- 사용량 막대 ---------- */
.usage-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.usage-row { display: flex; flex-direction: column; gap: 5px; }
.usage-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.usage-name { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.usage-count { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.usage-count.full { color: var(--red); font-weight: 700; }
.usage-track { height: 6px; border-radius: var(--pill); background: var(--bg-dim); overflow: hidden; }
.usage-fill { display: block; height: 100%; border-radius: var(--pill); background: var(--cyan); }
.usage-fill.full { background: var(--red); }
.usage-reset { font-size: 11px; color: var(--ink-dis); }
.usage-empty { font-size: 12px; }
.usage-foot { margin-top: 12px; font-size: 11px; color: var(--ink-dis); }

/* ---------- API 오류 안내(토스트형 배너) ---------- */
.api-notices {
  position: fixed;
  top: calc(var(--header-h) + 12px);
  right: 24px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
}
.api-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: var(--r-md);
  background: var(--white);
  box-shadow: var(--shadow);
}
.api-notice.quota { border-left-color: var(--red); }
.api-notice.plan { border-left-color: var(--cyan); }
.api-notice-body { flex: 1 1 auto; min-width: 0; }
.api-notice-title { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.api-notice-desc { margin-top: 3px; font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.api-notice-link { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--cyan); }
.api-notice-link:hover { text-decoration: underline; }
.api-notice-close {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: var(--r-xs);
  background: none;
  color: var(--ink-3);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.api-notice-close:hover { background: var(--bg-dim); color: var(--ink); }

/* ---------- 목록 상한 안내 ---------- */
.cap-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-soft);
  font-size: 12.5px;
  color: var(--ink-2);
}
.cap-notice .link { font-weight: 700; color: var(--cyan); }
.cap-notice .link:hover { text-decoration: underline; }

/* ---------- 잠금 카드 ---------- */
.lock-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.lock-pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 9px;
  border-radius: var(--pill);
  background: var(--bg-dim);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
}
.lock-title { font-size: 17px; color: var(--ink); }
.lock-desc { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; max-width: 640px; }
.lock-card .btn { margin-top: 4px; }

/* ---------- 요금 안내 화면 ---------- */
.pricing-page { max-width: var(--content-max); }
.honest-note {
  margin: 18px 0 22px;
  padding: 14px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--bg-soft);
}
.honest-note strong { display: block; font-size: 14px; color: var(--ink); }
.honest-note p { margin-top: 5px; font-size: 12px; line-height: 1.65; color: var(--ink-3); }

.usage-card { margin-bottom: 24px; display: flex; flex-direction: column; gap: 12px; }
.usage-card .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.usage-card .usage-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 24px; }

.pricing-section { margin-bottom: 26px; }
.pricing-section > .card-head { margin-bottom: 12px; }
.plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.plan-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--white);
}
.plan-card.recommended { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset; }
.plan-card.current { background: var(--bg-soft); }
.plan-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.plan-card-head h3 { font-size: 15px; color: var(--ink); }
.plan-flag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: var(--pill);
  background: var(--cyan-soft);
  color: #017e9b;
  font-size: 10.5px;
  font-weight: 700;
}
.plan-flag.current { background: var(--chip); color: var(--ink-2); }
.plan-price { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.plan-price-sub { min-height: 16px; font-size: 11.5px; color: var(--ink-3); }
.plan-meta { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 2px; }
.plan-meta > div { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; }
.plan-meta dt { color: var(--ink-3); }
.plan-meta dd { color: var(--ink-2); font-weight: 600; text-align: right; }
.plan-points { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line); list-style: none; }
.plan-points li { font-size: 11.5px; color: var(--ink-2); }

.pricing-table table { min-width: 720px; }
.pricing-table th[scope="row"] { text-align: left; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.pricing-table td { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.pricing-table tr.group-row th {
  padding-top: 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  background: var(--bg-soft);
}
.pricing-policy ul { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 0; padding-left: 18px; }
.pricing-policy li { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.pricing-foot { margin: 0 0 12px; font-size: 11px; }

@media (max-width: 1280px) {
  .auth-email { max-width: 110px; }
}
@media (max-width: 1100px) {
  .header-auth .auth-email { display: none; }
  .api-notices { right: 12px; left: 12px; width: auto; }
}
@media (max-width: 720px) {
  .auth-usage-btn { display: none; }
  .usage-popover { position: fixed; top: calc(var(--header-h) + 8px); right: 12px; left: 12px; width: auto; }
  .pricing-table table { min-width: 640px; }
}
