/* styles.css — 깔끔한 모던 테마 + 반응형 */
:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #1c2330;
  --ink-soft: #5b6472;
  --line: #e6e8ec;
  --brand: #3b6ff5;
  --brand-soft: #eaf0ff;
  --accent: #10b981;
  --shadow: 0 1px 3px rgba(20, 30, 50, 0.06), 0 8px 24px rgba(20, 30, 50, 0.06);
  --radius: 14px;
  --topbar-h: 68px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
    "Malgun Gothic", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* --- 상단바 --- */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 clamp(16px, 4vw, 48px);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
}
.top-search {
  flex: 1 1 auto;
  max-width: 560px;
  margin-left: auto;
}
.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 15px;
  outline: none;
  background: var(--bg);
}
.search-input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.empty { padding: 20px 10px; color: var(--ink-soft); font-size: 14px; }

/* --- 레이아웃 --- */
.layout {
  min-height: 0;
}

/* --- 메인 --- */
.main {
  padding: 28px clamp(16px, 4vw, 48px);
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

/* --- 홈 --- */
.home-title { font-size: 29px; margin: 8px 0 6px; text-align: center; }
.home-sub { color: var(--ink-soft); margin: 0 0 24px; text-align: center; font-size: 15px; }
.home-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: -12px 0 28px;
}
.home-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}
.home-pill.active {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
}

/* 카테고리 섹션 */
.home-cat { margin-bottom: 28px; }
.home-cat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.home-cat-emoji { font-size: 18px; line-height: 1; }
.home-cat-name { font-size: 17px; font-weight: 700; color: var(--ink); }
.home-cat-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--bg);
  border-radius: 999px;
  padding: 2px 9px;
}

.home-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.home-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.08s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.home-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d3d8e0; }
.home-card.is-planned {
  background: #fbfcff;
  border-style: dashed;
}
.home-card-name {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  font-size: 15.5px;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.35;
}
.home-card-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.home-card-badge.active {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}
.home-card-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-cat-more {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.home-more-btn {
  min-width: 148px;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.home-more-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* --- 계산기 --- */
.calc-header { margin-bottom: 20px; }
.calc-title { font-size: 24px; margin: 0 0 6px; }
.calc-desc { color: var(--ink-soft); margin: 0; font-size: 14px; }

.calc-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full, .field:only-child { grid-column: 1 / -1; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.input-row { display: flex; align-items: center; position: relative; }
.input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  background: #fff;
  color: var(--ink);
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input-unit {
  position: absolute;
  right: 12px;
  color: var(--ink-soft);
  font-size: 13px;
  pointer-events: none;
}
.input-row:has(.input-unit) .input { padding-right: 42px; }
.field-hint { font-size: 12px; color: var(--brand); min-height: 14px; }
.field-help { font-size: 12px; color: var(--ink-soft); }

.radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  background: #fff;
  user-select: none;
}
.radio-chip input { accent-color: var(--brand); margin: 0; }
.radio-chip:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235b6472' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* --- 결과 --- */
.calc-results { margin-top: 22px; }
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.result-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.result-card.highlight { border-color: var(--brand); background: var(--brand-soft); }
.result-card.muted { opacity: 0.9; }
.result-label { font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.result-value { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.result-card.highlight .result-value { color: var(--brand); }
.result-sub { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

.result-bar { margin-top: 14px; }
.btn-copy {
  padding: 9px 16px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}
.btn-copy:hover { background: var(--bg); border-color: #d3d8e0; }
.btn-copy:disabled { color: var(--accent); border-color: var(--accent); }

.result-note { margin-top: 14px; font-size: 13px; color: var(--ink-soft); background: #fbfbfc; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
.result-disclaimer { margin-top: 12px; font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.result-error, .calc-error { margin-top: 14px; color: #d14343; font-size: 14px; }
.not-found, .home { padding-top: 8px; }

/* --- 계산기별 사용 가이드 --- */
.usage-guide {
  margin-top: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 2px rgba(20, 30, 50, 0.03);
}
.usage-kicker {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}
.usage-title {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.35;
}
.usage-lead {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}
.usage-keypoints {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: #f7f9ff;
  border: 1px solid #dfe7ff;
}
.usage-point-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}
.usage-point-list li + li { margin-top: 6px; }
.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.usage-block {
  min-width: 0;
  background: #fbfbfc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.usage-block h3 {
  margin: 0 0 9px;
  font-size: 14px;
}
.usage-list {
  margin: 0;
  padding-left: 17px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}
.usage-list li + li { margin-top: 6px; }
.usage-example {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}
.usage-example strong {
  flex: 0 0 auto;
  color: var(--brand);
}
.usage-section-title {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.35;
}
.usage-scenarios {
  margin-top: 18px;
}
.usage-scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.usage-scenario {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 13px;
}
.usage-scenario strong {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}
.usage-scenario p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}
.usage-detail {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 12px;
  margin-top: 18px;
}
.usage-detail-block {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.usage-steps {
  margin: 0;
  padding-left: 19px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}
.usage-steps li + li { margin-top: 7px; }
.usage-faq-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.usage-faq-item:first-of-type { padding-top: 0; }
.usage-faq-item:last-child { border-bottom: 0; padding-bottom: 0; }
.usage-faq-item strong {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
}
.usage-faq-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}
.usage-caution {
  margin: 16px 0 0;
  padding: 11px 12px;
  border-radius: 10px;
  background: #fff8e6;
  border: 1px solid #f2dfad;
  color: #6f5a1d;
  font-size: 12px;
  line-height: 1.55;
}

/* --- 저작권 안전형 구현 예정 항목 --- */
.planned-panel {
  background: var(--panel);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 18px;
}
.planned-eyebrow {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
}
.planned-copy {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}
.planned-list {
  display: grid;
  grid-template-columns: minmax(72px, auto) 1fr;
  gap: 8px 12px;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.planned-list dt {
  color: var(--ink-soft);
  font-weight: 700;
}
.planned-list dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* --- 결과 추가 UI (표/게이지) --- */
.result-extra { margin-top: 18px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.data-table th, .data-table td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); }
.data-table th { background: var(--bg); color: var(--ink-soft); font-weight: 600; }
.data-table td:first-child, .data-table th:first-child { text-align: left; }
.data-table tr:last-child td { border-bottom: none; }
.table-scroll { max-height: 340px; overflow-y: auto; border-radius: var(--radius); }

.gauge { margin-top: 6px; }
.gauge-bar { height: 14px; border-radius: 999px; position: relative; background: linear-gradient(90deg, #60a5fa, #34d399, #fbbf24, #f87171); }
.gauge-pin { position: absolute; top: -5px; width: 4px; height: 24px; background: var(--ink); border-radius: 2px; transform: translateX(-50%); box-shadow: 0 0 0 2px #fff; }
.gauge-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-soft); margin-top: 6px; }

/* --- 날짜 입력 --- */
input[type="date"].input { min-height: 44px; }

/* --- GPA 동적 행 --- */
.gpa-list { display: flex; flex-direction: column; gap: 8px; }
.gpa-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; align-items: center; }
.gpa-del {
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  border-radius: 9px; cursor: pointer; padding: 0 12px; height: 42px; font-size: 14px;
}
.gpa-del:hover { background: #fdecec; color: #d14343; border-color: #f3c6c6; }
.btn-add {
  margin-top: 10px; padding: 10px 16px; border: 1px dashed var(--line);
  background: var(--bg); color: var(--ink-soft); border-radius: 10px; cursor: pointer; font-size: 13px; width: 100%;
}
.btn-add:hover { border-color: var(--brand); color: var(--brand); }

/* --- 반응형 --- */
@media (max-width: 760px) {
  .topbar {
    height: auto;
    min-height: var(--topbar-h);
    flex-wrap: wrap;
    padding-bottom: 12px;
    padding-top: 12px;
  }
  .brand { width: 100%; }
  .top-search {
    width: 100%;
    max-width: none;
    margin-left: 0;
  }
  .calc-form { grid-template-columns: 1fr; }
  .usage-guide { padding: 16px; }
  .usage-grid { grid-template-columns: 1fr; }
  .usage-scenario-grid { grid-template-columns: 1fr; }
  .usage-detail { grid-template-columns: 1fr; }
  .usage-example { flex-direction: column; gap: 4px; }
  .main { padding: 20px 16px 60px; }
}
