/* 쇼비 관리툴 스타일. 색·글꼴·간격 값은 tokens.css(design/tokens.css 복사본)를 쓴다. */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface-2);
  color: var(--ink-900);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--tracking-tight);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-deep); }

code, pre, .mono {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  letter-spacing: 0;
}

/* 머리 줄 */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--s-3) var(--gutter);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.brand { display: flex; align-items: center; gap: var(--s-2); text-decoration: none; color: var(--ink-900); }
.brand img { height: 26px; width: auto; }
.brand span { font-weight: 700; font-size: 17px; }
.topbar__spacer { flex: 1; }
.topbar__who { color: var(--ink-500); font-size: var(--fs-sub); }

/* 본문 */
.page { max-width: 1080px; margin: 0 auto; padding: var(--s-8) var(--gutter) var(--s-14); }
.page__title { font-size: var(--fs-display); line-height: var(--lh-display); font-weight: 800; margin: 0 0 var(--s-2); }
.page__lead { color: var(--ink-500); margin: 0 0 var(--s-8); }

.platform { margin-bottom: var(--s-10); }
.platform__head { display: flex; align-items: baseline; gap: var(--s-3); margin-bottom: var(--s-4); }
.platform__name { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 700; margin: 0; }

.grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-4); }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: var(--s-6);
  min-width: 0;
}
.card__title { font-size: var(--fs-sub); font-weight: 700; color: var(--ink-700); margin: 0 0 var(--s-3); display: flex; gap: var(--s-2); align-items: center; }
.card pre {
  margin: 0;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: var(--s-4);
  overflow-x: auto;
  color: var(--ink-700);
}

.chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: var(--fs-caption);
  font-weight: 700;
  letter-spacing: 0;
}
.chip--muted { background: var(--surface-2); color: var(--ink-500); }

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sub); }
.table th { text-align: left; color: var(--ink-500); font-weight: 600; padding: 0 var(--s-2) var(--s-2); border-bottom: 1px solid var(--line); }
.table td { padding: var(--s-3) var(--s-2); border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .name { font-weight: 700; }
.muted { color: var(--ink-500); }

/* 버튼·입력칸 */
.btn, input[type="submit"], button {
  appearance: none;
  border: 0;
  border-radius: var(--r-md);
  background: var(--brand-button);
  color: var(--on-brand);
  font: inherit;
  font-weight: 700;
  height: var(--btn-h);
  padding: 0 var(--s-6);
  cursor: pointer;
}
.btn--ghost, .topbar button {
  background: transparent;
  color: var(--ink-700);
  height: 36px;
  padding: 0 var(--s-3);
  font-size: var(--fs-sub);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

input[type="email"], input[type="password"], input[type="text"] {
  width: 100%;
  height: 52px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 0 var(--s-4);
  font: inherit;
  color: var(--ink-900);
}
input:focus-visible, .btn:focus-visible, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 로그인 */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--s-6) var(--s-4); }
.auth__card { width: 100%; max-width: 400px; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-card); padding: var(--s-10) var(--s-8); }
.auth__logo { height: 40px; width: auto; display: block; margin-bottom: var(--s-6); }
.auth__title { font-size: var(--fs-title); font-weight: 800; margin: 0 0 var(--s-1); }
.auth__lead { color: var(--ink-500); margin: 0 0 var(--s-6); font-size: var(--fs-sub); }
.auth form { display: grid; gap: var(--s-3); }
.auth input[type="submit"] { width: 100%; margin-top: var(--s-2); }
.auth__links { margin-top: var(--s-5); font-size: var(--fs-sub); text-align: center; }

.flash { border-radius: var(--r-sm); padding: var(--s-3) var(--s-4); font-size: var(--fs-sub); margin-bottom: var(--s-4); }
.flash--alert { background: var(--brand-soft); color: var(--brand-deep); }
.flash--notice { background: var(--shobi-green-soft); color: var(--shobi-green); }

/* 머리 줄 메뉴 */
.nav { display: flex; gap: var(--s-1); margin-left: var(--s-4); }
.nav__link { padding: 6px 12px; border-radius: var(--r-sm); color: var(--ink-500); text-decoration: none; font-size: var(--fs-sub); font-weight: 600; }
.nav__link:hover { background: var(--surface-2); color: var(--ink-900); }
.nav__link.is-active { background: var(--surface-2); color: var(--ink-900); }

/* 표 공통 */
.table-wrap { overflow-x: auto; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th.num { text-align: right; }
.table .nowrap { white-space: nowrap; }
.table tr.is-empty td { color: var(--ink-400); }
.table--compact td { padding: var(--s-2) 0; }
.empty { color: var(--ink-500); margin: 0; }
.pager { display: flex; align-items: center; gap: var(--s-3); justify-content: center; margin-top: var(--s-4); }
.btn--ghost { display: inline-flex; align-items: center; text-decoration: none; }

/* 사용량 */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); margin-bottom: var(--s-4); }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat p { margin: 0; }
.stat__label { color: var(--ink-500); font-size: var(--fs-sub); font-weight: 600; }
.stat__value { font-size: 28px; font-weight: 800; margin: var(--s-1) 0 var(--s-2) !important; font-variant-numeric: tabular-nums; }
.stat__sub { font-size: var(--fs-caption); }

/* 대화 보기 */
.page--narrow { max-width: 760px; }
.back { margin: 0 0 var(--s-3); font-size: var(--fs-sub); }
.back a { color: var(--ink-500); text-decoration: none; }
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-5); }
.turn__meta { display: flex; gap: var(--s-2); align-items: center; margin-bottom: var(--s-2); font-size: var(--fs-caption); }
.bubble { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); box-shadow: var(--shadow-card); }
.bubble p { margin: 0 0 var(--s-2); }
.bubble p:last-child { margin-bottom: 0; }
.turn--user { justify-self: end; max-width: 80%; }
.turn--user .turn__meta { justify-content: flex-end; }
.turn--user .bubble { background: var(--brand-button); color: var(--on-brand); box-shadow: none; }
.turn--assistant { max-width: 92%; }
.turn__usage { font-size: var(--fs-caption); margin: var(--s-2) 0 0; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); margin-top: var(--s-3); }
.pcard__head { display: flex; gap: var(--s-2); align-items: center; justify-content: space-between; }
.pcard__title { font-weight: 600; }
.pcard__price { font-size: 26px; font-weight: 800; margin: var(--s-2) 0 0; font-variant-numeric: tabular-nums; }
.pcard__price small { font-size: 15px; font-weight: 700; margin-left: 2px; }
.pcard__sub { margin: 0 0 var(--s-2); font-size: var(--fs-sub); }
