
:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface2: #1a1a24;
  --border: #2a2a3a;
  --accent: #c8f04a;
  --accent2: #4af0c8;
  --text: #e8e8f0;
  --text-muted: #6e6e88;
  --danger: #f04a6a;
  --font-display: 'Syne', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 40px rgba(0,0,0,0.6);
}

*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  min-height: 100vh;
  overflow-x: hidden;
}


.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-mark {
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
}

.logo-text em {
  color: var(--accent);
  font-style: normal;
}

.header-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}


.hero {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
  overflow: hidden;
}

.hero-bg-text {
  position: absolute;
  top: 50%;
  right: -2rem;
  transform: translateY(-50%);
  font-size: clamp(140px, 20vw, 260px);
  font-weight: 800;
  color: transparent;
  -webkit-text-stroke: 1px rgba(200, 240, 74, 0.07);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.2rem;
}

.hero-title .accent {
  color: var(--accent);
  position: relative;
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.7;
  font-weight: 400;
}

.hero-formula {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1.4rem;
}

.formula-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.formula-eq {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
}


.main-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}


.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  animation: fadeUp 0.5s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.8rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  background: rgba(200, 240, 74, 0.1);
  border: 1px solid rgba(200, 240, 74, 0.25);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


.table-wrapper {
  overflow-x: auto;
}

.course-table,
.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.course-table th,
.summary-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.course-table td,
.summary-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(42,42,58,0.5);
  vertical-align: middle;
}

.course-table tr:last-child td,
.summary-table tr:last-child td {
  border-bottom: none;
}

.course-table td input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.9rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.course-table td input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 240, 74, 0.1);
}

.course-table td input.error {
  border-color: var(--danger);
}

.row-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}


.table-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.5rem;
}


.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
}

.btn-primary:hover {
  background: #d8ff5a;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(200, 240, 74, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--text-muted);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid transparent;
  padding: 0.4rem 0.7rem;
  font-size: 1rem;
}

.btn-danger:hover {
  background: rgba(240, 74, 106, 0.1);
  border-color: var(--danger);
}


.calc-row {
  display: flex;
  justify-content: center;
}

.calc-row .btn-primary {
  padding: 1rem 3rem;
  font-size: 1rem;
  letter-spacing: 0.02em;
}


.result-card {
  border-color: rgba(200, 240, 74, 0.2);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.result-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.result-box.wide {
  grid-column: span 2;
}

.result-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.result-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.result-value.accent {
  color: var(--accent);
  font-size: 1.4rem;
}

.summary-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 1.5rem 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.summary-table td {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.result-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}


.advisor-card {
  border-color: rgba(74, 240, 200, 0.2);
}

.advisor-card .card-tag {
  color: var(--accent2);
  background: rgba(74, 240, 200, 0.1);
  border-color: rgba(74, 240, 200, 0.25);
}

.advisor-input-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.advisor-input-row label {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.advisor-input-row input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.95rem;
  width: 140px;
  outline: none;
  transition: border-color 0.2s;
}

.advisor-input-row input:focus {
  border-color: var(--accent2);
}

.advisor-output {
  margin-top: 1.5rem;
  padding: 1.2rem 1.4rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 1.8;
  display: none;
}

.advisor-output.show { display: block; animation: fadeUp 0.3s ease; }
.advisor-output ul { padding-left: 1.2rem; }
.advisor-output li { margin-bottom: 0.4rem; }
.advisor-output strong { color: var(--accent2); }


.footer {
  text-align: center;
  padding: 2rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}


@media print {
  body { background: white; color: black; }
  .header, .hero, .input-card, .calc-row, .advisor-card, .footer,
  .result-actions, .table-actions { display: none !important; }
  .result-card { border: 1px solid #ccc; box-shadow: none; }
  .result-value { color: black; }
}


@media (max-width: 640px) {
  .hero { padding: 3rem 1.2rem 2rem; }
  .main-container { padding: 0 1.2rem 3rem; }
  .card { padding: 1.4rem; }
  .result-box.wide { grid-column: span 1; }
  .advisor-input-row { flex-direction: column; align-items: flex-start; }
  .advisor-input-row input { width: 100%; }
  .hero-bg-text { display: none; }
}
