/* AI 계정센터 — 수업 중 폰으로도 보기 쉬운, 군더더기 없는 화면 */
:root {
  --ink: #1b2430; --muted: #66707f; --line: #e2e6ec; --bg: #f4f6f9; --card: #ffffff;
  --accent: #2456c9; --accent-ink: #ffffff; --good: #17794a; --warn: #9a6200; --bad: #b3261e;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.mono { font-family: Consolas, "D2Coding", ui-monospace, monospace; }
.muted { color: var(--muted); } .small { font-size: 13px; } .nowrap { white-space: nowrap; } .center { text-align: center; }

.top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 10px 20px;
  background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--ink); }
.top nav { display: flex; gap: 14px; flex-wrap: wrap; flex: 1; }
.who { display: flex; gap: 10px; align-items: center; margin: 0; color: var(--muted); }

main { max-width: 1080px; margin: 0 auto; padding: 22px 16px 60px; }
.headline { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin: 0 0 16px; }
.card.narrow { max-width: 420px; margin: 48px auto; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.two > .card { margin: 0 0 16px; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
input, textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #c9d0da; border-radius: 7px; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { font-family: Consolas, ui-monospace, monospace; font-size: 13px; resize: vertical; margin-bottom: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; align-items: end; }
.grid .btn { margin-bottom: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row form, form.inline { margin: 0; }
form.inline { display: flex; gap: 6px; align-items: center; }
form.inline input { margin: 0; padding: 5px 8px; min-width: 90px; }

.btn { display: inline-block; padding: 8px 14px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer;
  background: #fff; border: 1px solid #c9d0da; border-radius: 7px; text-decoration: none; }
.btn:hover { background: #f0f3f7; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #1c469f; }
.btn.small { padding: 4px 10px; font-size: 13px; } .btn.wide { width: 100%; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.btn, button.link { white-space: nowrap; }      /* 좁은 칸에서도 글자가 세로로 쪼개지지 않게 */

.notice, .error { padding: 10px 12px; border-radius: 7px; margin: 0 0 14px; }
.notice { background: #eef3ff; border: 1px solid #c9d8fb; }
.error { background: #fdecea; border: 1px solid #f3c1bc; color: var(--bad); }

table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.card table.list { border: 0; border-radius: 0; margin-bottom: 12px; }
.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; background: #f8f9fb; }
.list th, .list td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list tr:last-child td { border-bottom: 0; }
.list tr.unread td { font-weight: 700; }
.list form { margin: 0; }
.empty { color: var(--muted); text-align: center; padding: 18px; }

.badge { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: #eceff3; color: var(--muted); white-space: nowrap; }
.badge.active, .badge.claude-invited { background: #e3f4ea; color: var(--good); }
.badge.expired { background: #fdecea; color: var(--bad); }
.badge.locked { background: #fff3d9; color: var(--warn); }
.count { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 99px; background: #eceff3;
  color: var(--muted); font-size: 12px; text-align: center; vertical-align: middle; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stats div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.stats b { display: block; font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: 13px; }

/* 로그인 코드 — 이 화면에서 가장 눈에 띄어야 하는 것 */
.code-card { background: #0f1b33; color: #fff; border-radius: 12px; padding: 20px; margin: 0 0 16px; }
.code-card .label { color: #b9c6e4; font-size: 13px; margin-bottom: 6px; }
.code-card .code { font: 700 44px/1.1 Consolas, ui-monospace, monospace; letter-spacing: 6px; margin: 4px 0 14px; }
.code-card .btn { margin-right: 8px; }
.code-card .hint { color: #b9c6e4; font-size: 13px; margin-top: 12px; }
.code-card.empty-card { background: var(--card); color: var(--ink); border: 1px dashed #c9d0da; }
.code-card.empty-card .label { color: var(--ink); font-weight: 700; font-size: 15px; }
.code-card.empty-card p { margin: 0; color: var(--muted); }

.subject { font-size: 19px; }
.mail-text { white-space: pre-wrap; word-break: break-word; font: 14px/1.6 inherit; background: #f8f9fb;
  border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin: 14px 0; }
.mail-html { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-top: 10px; }

@media (max-width: 640px) {
  /* 좁은 화면: 표는 칸을 숨기지 않고 옆으로 밀어 본다(리셋 버튼이 사라지면 안 된다) */
  table.list { display: block; overflow-x: auto; white-space: nowrap; }
  /* 메일 목록만은 '보낸 곳'을 접고 제목을 줄바꿈해 한 화면에 담는다 */
  .messages th:nth-child(2), .messages td:nth-child(2) { display: none; }
  .messages td:nth-child(3) { white-space: normal; }
  .list th, .list td { padding: 9px 10px; }
  .code-card .code { font-size: 36px; letter-spacing: 4px; }
}
@media print { .top, .btn, button { display: none !important; } body { background: #fff; } }
