:root {
  --bg: #f6f2e8;
  --panel: #fffaf2;
  --ink: #1f261f;
  --muted: #5f655f;
  --line: #d8cfbf;
  --primary: #00594c;
  --primary-strong: #003e35;
  --accent: #c86414;
  --warn: #af2f2f;
  --ok: #1b7e4c;
  --caution: #9e6900;
  --radius: 18px;
  --shadow: 0 14px 40px rgba(30, 39, 30, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  background: radial-gradient(circle at 15% 10%, #f0e2c4 0%, transparent 40%),
    radial-gradient(circle at 95% 90%, #d5e8dc 0%, transparent 42%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  padding-top: 60px;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.45;
  z-index: -1;
  animation: drift 11s ease-in-out infinite alternate;
}

.orb-1 {
  width: 230px;
  height: 230px;
  background: #e7ad62;
  top: -30px;
  left: -45px;
}

.orb-2 {
  width: 270px;
  height: 270px;
  background: #8bc0a4;
  bottom: -80px;
  right: -70px;
}

.shell {
  width: min(1180px, 92vw);
  margin: 2.2rem auto 2.8rem;
}

.hero {
  margin-bottom: 1.3rem;
  animation: reveal 0.65s ease-out;
}

.eyebrow {
  font-size: 0.83rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0;
}

h1 {
  font-size: clamp(1.9rem, 4.7vw, 3.35rem);
  line-height: 1.05;
  margin-top: 0.35rem;
}

.subtitle {
  max-width: 760px;
  font-size: clamp(1rem, 2.3vw, 1.2rem);
  color: #384338;
  margin-top: 0.5rem;
}

.workspace {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  align-items: stretch;
}

.result-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.muted {
  color: var(--muted);
  margin-top: 0.45rem;
  margin-bottom: 0.9rem;
}

.session-panel {
  margin-bottom: 1rem;
}

.session-panel h2 {
  margin-bottom: 0.9rem;
}

.form-group {
  margin-bottom: 0.8rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--ink);
}

.form-group input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

.session-status {
  margin-top: 0.7rem;
  padding: 0.5rem;
  border-radius: 8px;
  display: none;
}

.session-status.active {
  display: block;
  background: #e8f5e9;
  color: var(--ok);
  border: 1px solid #4caf50;
}

.session-status.error {
  display: block;
  background: #ffebee;
  color: var(--warn);
  border: 1px solid #f44336;
}

.video-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px dashed #b9ae99;
  background: linear-gradient(145deg, #f5ead3, #ede4d5);
}

#cameraFeed {
  width: 100%;
  min-height: 220px;
  max-height: 360px;
  object-fit: cover;
  background: #152018;
}

#hiddenCanvas {
  display: none;
}

.feed-status {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(28, 44, 35, 0.72);
  color: #fff;
  font-size: 0.8rem;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.95rem 0;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 0.64rem 0.95rem;
  font-weight: 600;
  font-family: "IBM Plex Sans", sans-serif;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.

.review-history {
  max-height: 400px;
  overflow-y: auto;
}

.review-history h2 {
  margin-bottom: 0.8rem;
}

.review-item {
  border: 1px solid #d5c9b7;
  border-radius: 10px;
  padding: 0.7rem;
  margin-bottom: 0.6rem;
  background: #f8f1e4;
}

.review-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.review-item-time {
  font-size: 0.8rem;
  color: var(--muted);
}

.review-item-level {
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  display: inline-block;
}

.review-item-summary {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.review-item-confidence {
  font-size: 0.8rem;
  color: var(--muted);
}btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.btn-ghost {
  background: #ece4d6;
  color: #2f352f;
}

.upload-label {
  display: block;
  font-weight: 600;
 

.btn-success {
  background: var(--ok);
  color: #fff;
} margin-bottom: 0.4rem;
}

.file-input {
  width: 100%;
  border: 1px solid #ccbfa8;
  border-radius: 10px;
  padding: 0.5rem;
  background: #fff;
}

.preview-wrap {
  margin-top: 0.9rem;
  min-height: 105px;
}

#imagePreview {
  width: 100%;
  border-radius: 12px;
  display: none;
  border: 1px solid #c9bdac;
}

.result-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.score-block {
  border: 1px solid #cabcaa;
  border-radius: 12px;
  padding: 0.85rem;
  background: #f7efde;
}

.score-chip {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  background: #e5dfd4;
}

.score-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 0.75rem;
  gap: 0.5rem;
}

.score-metrics p {
  margin: 0;
  display: flex;
  justify-content: space-between;
}

.score-metrics span {
  color: var(--muted);
}

.summary p,
.recommendation p {
  margin: 0.45rem 0 0;
}

.signals ul {
  margin: 0.45rem 0 0;
  padding-left: 1rem;
}

.signals li {
  margin-bottom: 0.35rem;
}

.impact {
  margin-top: 1rem;
}

.impact h2 {
  margin-bottom: 0.8rem;
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.impact-grid article {
  border: 1px solid #d5c9b7;
  border-radius: 12px;
  padding: 0.9rem;
  background: #f8f1e4;
}

.impact-grid p {
  margin-top: 0.4rem;
}

.level-low {
  color: #fff;
  background: var(--ok);
}

.level-medium {
  color: #fff;
  background: var(--caution);
}

.level-high {
  color: #fff;
  background: var(--warn);
}

@keyframes reveal {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes drift {
  from {
    transform: translateY(-12px) scale(1);
  }
  to {
    transform: translateY(12px) scale(1.1);
  }
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(30, 39, 30, 0.08);
  z-index: 999;
}

.nav-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.8rem 2%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
}

.nav-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.patients-page {
  padding: 1rem;
}

.patients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.patient-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.patient-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.patient-card-header {
  font-weight: 700;
  color: var(--ink);
}

.patient-card-info {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.patient-details-page {
  padding: 1rem;
}

.patient-info {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
}

.patient-info p {
  margin: 0.5rem 0;
}

.session-review-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 0.8rem 0;
}

.review-with-image {
  display: flex;
  gap: 1rem;
}

.review-image {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  object-fit: cover;
}

.review-details {
  flex: 1;
}

@media (max-width: 640px) {
  body {
    padding-top: 50px;
  }

  .nav-container {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
  }

  .review-with-image {
    flex-direction: column;
  }

  .patients-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .result-column {
    flex-direction: row;
    gap: 1rem;
  }

  .result-column > .card {
    flex: 1;
  }

  .impact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .result-column {
    flex-direction: column;
  }

  .impact-grid {
    grid-template-columns: 1fr;
  }
}
