.tool-page { padding: 28px 0 64px; }
.tool-head h1 { font-size: 26px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.tool-head p { font-size: 14px; color: var(--gray-500); line-height: 1.8; max-width: 860px; }
.tool-note { margin-top: 10px; font-size: 12px; color: var(--gray-400); }

.panel { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; margin-bottom: 20px; }
.panel-title { font-size: 16px; font-weight: 700; color: var(--gray-900); margin-bottom: 14px; }
.panel-sub { font-size: 12px; color: var(--gray-400); margin-top: -8px; margin-bottom: 14px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: 8px;
  font-size: 14px; font-family: var(--font); outline: none; color: var(--gray-800); background: var(--white);
}
.field input:focus, .field select:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-100); }
.field input[readonly] { background: var(--gray-50); color: var(--gray-500); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 26px; border-radius: 8px; border: none; font-size: 14px; font-weight: 600; font-family: var(--font); cursor: pointer; transition: background 0.2s; }
.btn-primary { background: var(--blue-600); color: var(--white); }
.btn-primary:hover { background: var(--blue-700); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }
.btn-secondary { background: var(--white); color: var(--blue-700); border: 1px solid var(--blue-200); }
.btn-secondary:hover { background: var(--blue-50); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-danger:hover { background: #fecaca; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 4px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.tag-blue { background: var(--blue-100); color: #1d4ed8; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-amber { background: #fef3c7; color: #92400e; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-gray { background: var(--gray-100); color: var(--gray-600); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 5px 12px; border-radius: 20px; font-size: 12px; color: var(--gray-700); background: var(--gray-100); border: 1px solid var(--gray-200); }
.chip.blue { background: var(--blue-50); color: #1d4ed8; border-color: var(--blue-200); }
.chip.green { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }

.tool-table-wrap { overflow-x: auto; margin-top: 4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--gray-100); white-space: nowrap; }
.data-table th { font-size: 12px; color: var(--gray-500); font-weight: 600; background: var(--gray-50); }
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table td.school-cell { font-weight: 600; color: var(--gray-800); }
.data-table td.major-cell { color: var(--blue-700); }

.empty-state { text-align: center; padding: 46px 20px; color: var(--gray-400); font-size: 14px; }
.error-state { text-align: center; padding: 26px; color: #dc2626; font-size: 14px; background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius); margin-bottom: 18px; }

.alert { border-radius: 8px; padding: 12px 16px; font-size: 13px; line-height: 1.7; margin-bottom: 14px; }
.alert-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-info { background: var(--blue-50); border: 1px solid var(--blue-200); color: #1e40af; }

.summary-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.summary-chip { background: var(--white); border: 1px solid var(--gray-200); border-radius: 8px; padding: 8px 14px; font-size: 12px; color: var(--gray-500); }
.summary-chip b { color: var(--gray-900); font-size: 15px; margin-right: 4px; }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; font-size: 13px; }
.kv-row { display: contents; }
.kv-row dt { color: var(--gray-500); }
.kv-row dd { color: var(--gray-800); }

.step-list { counter-reset: step; list-style: none; }
.step-list li { counter-increment: step; position: relative; padding: 0 0 18px 34px; font-size: 13px; color: var(--gray-600); line-height: 1.8; }
.step-list li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: var(--blue-100); color: #1d4ed8; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.step-list li:last-child { padding-bottom: 0; }

.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--gray-200); }
.timeline-item { position: relative; padding: 0 0 22px 18px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -20px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--blue-600); border: 3px solid var(--blue-100); }
.timeline-item.done::before { background: #16a34a; border-color: #bbf7d0; }
.timeline-item.now::before { background: #f59e0b; border-color: #fde68a; }
.timeline-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--gray-900); }
.timeline-month { font-size: 12px; color: var(--blue-600); font-weight: 600; }
.timeline-desc { font-size: 13px; color: var(--gray-600); line-height: 1.8; margin-top: 4px; }

.quiz-progress { height: 6px; background: var(--gray-100); border-radius: 4px; overflow: hidden; margin-bottom: 22px; }
.quiz-progress i { display: block; height: 100%; background: var(--blue-600); transition: width 0.25s; }
.quiz-q { font-size: 18px; font-weight: 700; color: var(--gray-900); margin-bottom: 18px; line-height: 1.6; }
.quiz-option { display: block; width: 100%; text-align: left; padding: 13px 16px; margin-bottom: 10px; background: var(--white); border: 1px solid var(--gray-200); border-radius: 8px; font-size: 14px; color: var(--gray-700); cursor: pointer; font-family: var(--font); transition: all 0.15s; }
.quiz-option:hover { border-color: var(--blue-500); background: var(--blue-50); color: var(--blue-800); }
.quiz-option:disabled { opacity: 0.55; cursor: default; }

.result-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.result-card { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px; }
.result-card .rc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.result-card h3 { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.result-card .rc-tag { font-size: 11px; font-weight: 600; color: var(--gray-500); }
.result-card p { font-size: 12px; color: var(--gray-500); margin-bottom: 10px; line-height: 1.7; }
.result-card ul { list-style: none; }
.result-card li { font-size: 13px; color: var(--gray-700); padding: 6px 0; border-top: 1px dashed var(--gray-100); }
.result-card li:first-child { border-top: none; }

.vol-row { display: grid; grid-template-columns: 46px 1.2fr 1fr 110px 110px 130px 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.vol-row .idx { font-size: 12px; font-weight: 700; color: var(--gray-500); text-align: center; }
.vol-row input[type="text"], .vol-row input[type="number"] { width: 100%; padding: 8px 10px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 13px; font-family: var(--font); outline: none; }
.vol-row input:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-100); }
.vol-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-600); cursor: pointer; }
.vol-toggle input { width: 15px; height: 15px; accent-color: var(--blue-600); }
.vol-del { width: 30px; height: 30px; border: 1px solid var(--gray-200); border-radius: 8px; background: var(--white); color: var(--gray-400); cursor: pointer; font-size: 15px; }
.vol-del:hover { color: #dc2626; border-color: #fecaca; background: #fef2f2; }

.check-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.check-item { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; background: var(--white); border: 1px solid var(--gray-200); border-radius: 20px; font-size: 12px; color: var(--gray-700); cursor: pointer; }
.check-item input { width: 15px; height: 15px; accent-color: var(--blue-600); }
.check-item.on { background: var(--blue-50); border-color: var(--blue-200); color: var(--blue-800); }

.issue-list { list-style: none; }
.issue-list li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--gray-100); font-size: 13px; color: var(--gray-700); line-height: 1.7; }
.issue-list li:last-child { border-bottom: none; }
.issue-list .issue-text { flex: 1; }

.tool-links { display: flex; flex-wrap: wrap; gap: 10px; }
.tool-links a { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; background: var(--blue-50); color: var(--blue-700); font-size: 13px; font-weight: 600; }
.tool-links a:hover { background: var(--blue-100); text-decoration: none; }

.province-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 14px; }
.province-cell { padding: 9px 12px; background: var(--white); border: 1px solid var(--gray-200); border-radius: 8px; font-size: 12px; color: var(--gray-600); text-align: center; }
.province-cell b { display: block; font-size: 13px; color: var(--gray-800); margin-bottom: 2px; }

@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .vol-row { grid-template-columns: 34px 1fr 1fr; }
  .vol-row .hide-m { display: none; }
  .kv { grid-template-columns: 96px 1fr; }
}
@media (max-width: 560px) {
  .tool-page { padding-top: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .tool-head h1 { font-size: 22px; }
}
