:root {
  --bg: #e8f4fa;
  --paper: #ffffff;
  --paper-soft: #f3fbff;
  --ink: #14364b;
  --ink-soft: #4f6a7d;
  --accent: #0c84a3;
  --accent-deep: #085f7c;
  --line: rgba(12, 76, 104, 0.2);
  --danger: #a52e28;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 9% 8%, rgba(12, 132, 163, 0.18), transparent 42%),
    radial-gradient(ellipse at 92% 2%, rgba(83, 200, 178, 0.22), transparent 38%),
    linear-gradient(170deg, #eef8fc, var(--bg) 58%);
}

h1,
h2,
h3 {
  font-family: "Fraunces", "Georgia", serif;
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 34px;
}

header {
  margin-bottom: 12px;
}

.brand {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  align-items: center;
  border-radius: 24px;
  padding: 18px;
  background: linear-gradient(116deg, rgba(8, 60, 84, 0.95), rgba(11, 93, 123, 0.94));
  color: #eaf9fd;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 16px 30px rgba(11, 71, 96, 0.16);
}

.brand-logo {
  width: 268px;
  max-width: 48vw;
  height: auto;
  object-fit: contain;
}

header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.08;
}

header p {
  margin: 7px 0 0;
  color: #d6eef5;
}

.tagline {
  font-size: 0.9rem;
  color: #c1e7f1;
}

.hint {
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.4;
}

header .hint {
  margin-top: 9px;
}

header .hint a {
  color: #baf5e8;
  text-decoration: none;
  font-weight: 600;
}

header .hint a:hover {
  text-decoration: underline;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 12px 22px rgba(8, 70, 96, 0.09);
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 1.3rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.between {
  justify-content: space-between;
  align-items: center;
}

input,
select,
button {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 0.92rem;
  font-family: inherit;
}

input,
select {
  background: #fff;
  color: var(--ink);
}

button {
  border: 0;
  background: linear-gradient(95deg, var(--accent-deep), var(--accent));
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: transform 130ms ease, filter 130ms ease;
}

button:hover {
  filter: brightness(1.05);
}

button:active {
  transform: translateY(1px);
}

.secondary-btn {
  background: #4d6679;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.hidden {
  display: none;
}

.card-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.tool-card {
  text-align: left;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(12, 84, 112, 0.24);
  background: linear-gradient(165deg, #fafdff, #ebf8ff);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 124px;
}

.tool-card:hover {
  transform: translateY(-2px);
}

.tool-card strong {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 1.08rem;
}

.tool-card span {
  color: var(--ink-soft);
  font-size: 0.89rem;
  line-height: 1.38;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: #fff;
}

th,
td {
  padding: 9px;
  border: 1px solid var(--line);
  text-align: left;
  font-size: 0.87rem;
  vertical-align: top;
}

th {
  background: var(--paper-soft);
  color: #33556d;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.73rem;
}

.panel,
.brand {
  animation: liftIn 540ms ease both;
}

#tabularView .panel,
#graftView .panel {
  animation-delay: 100ms;
}

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

@media (max-width: 800px) {
  .brand {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .brand-logo {
    width: 230px;
    max-width: 75vw;
  }

  header h1 {
    font-size: 1.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel,
  .brand {
    animation: none;
  }
}

