:root {
  --tomoro-lime: #d8ff00;
  --tomoro-blue: #1456fb;
  --tomoro-teal: #20c8bd;
  --tomoro-ice-blue: #beeae5;
  --tomoro-sand: #eee8df;
  --tomoro-slate: #1c1f20;
  --tomoro-white: #ffffff;
}

* {
  box-sizing: border-box;
}

.font-heading {
  font-family: "Space Grotesk", sans-serif;
}

.font-main {
  font-family: "Rethink Sans", sans-serif;
}

body {
  margin: 0;
  font-family: "Rethink Sans", sans-serif;
  background: var(--tomoro-sand);
  color: var(--tomoro-slate);
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  z-index: 5;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.top-nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(28, 31, 32, 0.16);
  background: rgba(238, 232, 223, 0.94);
  backdrop-filter: blur(8px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  padding: 0.625rem 1.25rem;
  border: 1.5px solid var(--tomoro-slate);
  border-radius: 50px;
  background: transparent;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}

.nav-logo img {
  height: 16px;
  width: auto;
}

.nav-logo .nav-logo-light {
  display: none;
}

.nav-logo .nav-logo-dark {
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-pill {
  padding: 0.625rem 1.25rem;
  background: var(--tomoro-slate);
  color: var(--tomoro-sand);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: "Rethink Sans", sans-serif;
  text-decoration: none;
  transition: all 0.3s ease;
}

.nav-pill:hover {
  background: var(--tomoro-blue);
  color: var(--tomoro-white);
}

.app-shell {
  position: relative;
  z-index: 10;
  padding: 5rem 0 3.5rem;
}

.app-header {
  padding-top: 1.75rem;
  padding-bottom: 1rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--tomoro-blue);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  font-family: "Space Grotesk", sans-serif;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--tomoro-slate);
}

h1 {
  font-size: clamp(1.9rem, 4vw, 3.3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subhead {
  margin: 0.75rem 0 0;
  color: var(--tomoro-slate);
  opacity: 0.82;
  max-width: 760px;
  font-size: 1.05rem;
}

.accent-bar {
  margin-top: 1rem;
  width: 48px;
  height: 4px;
  background: var(--tomoro-blue);
}

.status-panel,
.view-panel {
  border: 1.5px solid var(--tomoro-slate);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--tomoro-slate);
}

.status-panel {
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.tech-settings {
  min-width: 300px;
  color: var(--tomoro-slate);
}

.tech-settings summary {
  cursor: pointer;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.tech-settings label {
  display: block;
  margin-top: 10px;
}

.view-panel {
  padding: 20px 20px 56px;
}

.step-shell {
  display: grid;
  gap: 16px;
}

.step-head {
  border-bottom: 1px solid rgba(28, 31, 32, 0.2);
  padding-bottom: 12px;
}

.step-title {
  font-size: 1.45rem;
  font-weight: 700;
}

.step-copy {
  margin: 8px 0 0;
  color: var(--tomoro-slate);
  opacity: 0.85;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--tomoro-slate);
  font-weight: 500;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(28, 31, 32, 0.22);
  background: rgba(255, 255, 255, 0.7);
  color: var(--tomoro-slate);
}

input::placeholder,
textarea::placeholder {
  color: rgba(28, 31, 32, 0.5);
}

button {
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: var(--tomoro-slate);
  color: var(--tomoro-sand);
  font-weight: 700;
  font-family: "Space Grotesk", sans-serif;
  cursor: pointer;
  padding: 10px 14px;
  transition: all 0.25s ease;
}

button:hover {
  background: var(--tomoro-blue);
  color: var(--tomoro-white);
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}

.step-shell > .actions:last-child {
  margin-bottom: 12px;
}

.actions a {
  color: var(--tomoro-slate);
  text-decoration: none;
  border-bottom: 1px solid var(--tomoro-slate);
  font-family: "Rethink Sans", sans-serif;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.actions a:hover {
  color: var(--tomoro-blue);
  border-color: var(--tomoro-blue);
}

.muted {
  margin: 0;
  color: var(--tomoro-slate);
  opacity: 0.78;
}

.error {
  color: #af1f11;
}

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  border-radius: 50px;
  padding: 0.5rem 1.25rem;
  background: var(--tomoro-slate);
  color: var(--tomoro-sand);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
}

.matrix-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.matrix-behaviours {
  display: grid;
  gap: 16px;
}

.matrix-behaviour {
  border: 1.5px solid var(--tomoro-slate);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.52);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.matrix-behaviour-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.matrix-skill-row {
  border-top: 1px solid rgba(28, 31, 32, 0.18);
  padding-top: 12px;
  display: grid;
  gap: 10px;
}

.matrix-skill-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.matrix-skill-title {
  font-size: 0.99rem;
  font-weight: 700;
}

.matrix-skill-helper {
  margin: 4px 0 0;
  color: var(--tomoro-slate);
  opacity: 0.82;
  font-size: 0.9rem;
}

.matrix-score-group {
  display: grid;
  grid-template-columns: repeat(10, minmax(34px, 1fr));
  gap: 6px;
}

.score-chip {
  padding: 8px 0;
  border: 1.5px solid rgba(28, 31, 32, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--tomoro-slate);
  font-weight: 700;
  font-family: "Space Grotesk", sans-serif;
}

.score-chip:hover {
  border-color: var(--tomoro-blue);
}

.score-chip.selected {
  border-color: var(--tomoro-blue);
  background: var(--tomoro-blue);
  color: var(--tomoro-white);
}

.results-panel {
  margin-top: 12px;
  border-top: 1px solid rgba(28, 31, 32, 0.2);
  padding-top: 14px;
}

.results-subtitle {
  margin: 10px 0 8px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  border: 1.5px solid var(--tomoro-slate);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  padding: 10px;
}

.stat-label {
  color: var(--tomoro-slate);
  opacity: 0.7;
  font-size: 0.84rem;
}

.stat-value {
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--tomoro-blue);
  font-family: "Space Grotesk", sans-serif;
}

.behaviour-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.behaviour-row {
  display: grid;
  grid-template-columns: 240px 1fr 40px;
  gap: 8px;
  align-items: center;
}

.track {
  background: rgba(28, 31, 32, 0.18);
  border-radius: 999px;
  height: 10px;
}

.fill {
  background: linear-gradient(90deg, var(--tomoro-lime), var(--tomoro-blue));
  height: 100%;
  border-radius: 999px;
}

.app-footer {
  margin-top: 16px;
  text-align: right;
}

.app-footer a {
  color: var(--tomoro-slate);
  text-decoration: none;
  border-bottom: 1px solid var(--tomoro-slate);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.app-footer a:hover {
  color: var(--tomoro-blue);
  border-color: var(--tomoro-blue);
}

.admin-shell {
  display: grid;
  gap: 12px;
}

.admin-section {
  border: 1.5px solid var(--tomoro-slate);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.52);
  padding: 12px;
}

.admin-section h2 {
  margin: 0 0 10px;
  font-size: 1.08rem;
}

textarea.mono {
  min-height: 260px;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
}

@media (min-width: 1024px) {
  .container {
    padding: 0 32px;
  }

  .nav-inner {
    padding: 0 32px;
  }
}

@media (max-width: 1100px) {
  .nav-links {
    gap: 0.5rem;
  }

  .nav-pill {
    padding: 0.55rem 0.9rem;
  }
}

@media (max-width: 960px) {
  .details-grid {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .matrix-score-group {
    grid-template-columns: repeat(5, minmax(34px, 1fr));
  }

  .behaviour-row {
    grid-template-columns: 1fr;
  }

  .nav-inner {
    flex-wrap: wrap;
    padding: 0 24px;
  }

  .app-shell {
    padding-top: 1.75rem;
  }

  .view-panel {
    padding: 18px 16px 52px;
  }
}

@media (max-width: 860px) {
  .status-panel {
    flex-direction: column;
  }

  .tech-settings {
    width: 100%;
    min-width: 0;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}
