/* =========================================================================
   Ova Scope design tokens
   Palette: cool sage paper + slate ink + microscope teal + ochre accent
   Type: IBM Plex Mono (display/labels) + IBM Plex Sans (body)
   Signature: circular "reticle" viewport motif around specimen imagery
   ========================================================================= */

:root {
  --paper: #e9ede7;
  --panel: #f6f8f4;
  --ink: #1b2523;
  --ink-soft: #4a544f;
  --line: #c7d0c4;
  --teal: #2f6b63;
  --teal-dark: #1f4a44;
  --teal-pale: #dce9e5;
  --rust: #b5651d;
  --rust-pale: #f3e2cf;
  --danger: #a3341f;
  --danger-pale: #f5ded8;
  --radius: 3px;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--teal-dark); }

h1, h2, h3, h4 {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em 0;
  color: var(--ink);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--teal-dark);
  display: block;
  margin-bottom: 0.6em;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark { color: var(--teal); display: flex; }

.brand-name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.brand-name-thin { font-weight: 400; color: var(--ink-soft); }

.site-nav { display: flex; align-items: center; gap: 1.4rem; }

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-family: var(--mono);
}

.site-nav a:hover { color: var(--teal-dark); }

.nav-cta {
  background: var(--teal);
  color: #fff !important;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
}

.nav-cta:hover { background: var(--teal-dark); }

.nav-user { font-family: var(--mono); font-size: 0.9rem; color: var(--ink); }

.tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  background: var(--rust-pale);
  color: var(--rust);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius);
  text-transform: uppercase;
}

/* ---------- Main / layout ---------- */

.site-main { flex: 1; padding: 2.5rem 2rem 3rem; max-width: 1080px; margin: 0 auto; width: 100%; }

.site-footer {
  text-align: center;
  padding: 1.2rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

/* ---------- Flash messages ---------- */

.flash-stack { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.6rem; }

.flash {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  border-left: 3px solid transparent;
}

.flash-success { background: var(--teal-pale); border-color: var(--teal); color: var(--teal-dark); }
.flash-error { background: var(--danger-pale); border-color: var(--danger); color: var(--danger); }

/* ---------- Reticle signature motif ---------- */

.reticle {
  position: relative;
  border-radius: 50%;
  border: 1.5px dashed var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fff;
}

.reticle::before,
.reticle::after {
  content: "";
  position: absolute;
  background: var(--teal);
  opacity: 0.55;
  z-index: 2;
}

.reticle::before { width: 100%; height: 1px; left: 0; top: 50%; }
.reticle::after { height: 100%; width: 1px; top: 0; left: 50%; }

.reticle img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Landing page ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
  padding: 2rem 0 4rem;
}

.hero h1 {
  font-size: 2.5rem;
  line-height: 1.15;
  margin-bottom: 0.7rem;
}

.hero p.lede {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 42ch;
  margin-bottom: 1.8rem;
}

.hero-actions { display: flex; gap: 0.9rem; }

.btn {
  font-family: var(--mono);
  font-size: 0.92rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1.5px solid var(--teal);
  cursor: pointer;
  display: inline-block;
}

.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }

.btn-ghost { background: transparent; color: var(--teal-dark); }
.btn-ghost:hover { background: var(--teal-pale); }

.btn-danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-danger:hover { background: var(--danger-pale); }

.btn-small { padding: 0.35rem 0.7rem; font-size: 0.78rem; }

.hero-scope {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 340px;
  margin: 0 auto;
}

.hero-scope .reticle {
  width: 100%;
  height: 100%;
  border-width: 2px;
}

.hero-scope-count {
  font-family: var(--mono);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--teal-dark);
  z-index: 3;
  position: relative;
}

.hero-scope-label {
  position: absolute;
  bottom: 14%;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  z-index: 3;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-bottom: 3rem;
}

.feature-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.feature-card .slide-num {
  font-family: var(--mono);
  color: var(--teal);
  font-size: 0.8rem;
  display: block;
  margin-bottom: 0.6rem;
}

.feature-card h3 { font-size: 1.02rem; margin-bottom: 0.4rem; }
.feature-card p { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }

.how-it-works {
  border-top: 1px solid var(--line);
  padding-top: 2.4rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.step {
  padding: 1rem 0;
  border-top: 2px solid var(--teal);
}

.step .slide-num { font-family: var(--mono); font-size: 0.78rem; color: var(--teal); }
.step h4 { font-size: 0.95rem; margin: 0.3rem 0 0.2rem; }
.step p { font-size: 0.85rem; color: var(--ink-soft); margin: 0; }

/* ---------- Auth forms ---------- */

.auth-wrap {
  max-width: 420px;
  margin: 0 auto;
  padding: 2.5rem 2.5rem 2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.auth-wrap h1 { font-size: 1.5rem; margin-bottom: 0.3rem; }
.auth-wrap .lede { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 1.6rem; }

.field { margin-bottom: 1.1rem; }

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.field input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.95rem;
  background: #fff;
  color: var(--ink);
}

.field input:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-color: var(--teal);
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.captcha-row img {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: block;
}

.captcha-refresh {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--teal-dark);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.auth-submit { width: 100%; text-align: center; }

.auth-switch {
  text-align: center;
  margin-top: 1.4rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* ---------- Dashboard ---------- */

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.upload-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
  margin-bottom: 2.4rem;
}

.upload-panel h2 { font-size: 1.05rem; }

.upload-dropzone {
  border: 1.5px dashed var(--teal);
  border-radius: var(--radius);
  padding: 1.6rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  background: #fff;
}

.upload-dropzone input[type="file"] { display: block; margin: 0.7rem auto 0; }

.upload-hint { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-soft); margin-bottom: 1rem; }

.preview-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.preview-row .reticle { width: 70px; height: 70px; }

.batch-block {
  margin-bottom: 2.2rem;
  padding-bottom: 2.2rem;
  border-bottom: 1px solid var(--line);
}

.batch-block:last-child { border-bottom: none; }

.batch-meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 0.8rem;
}

.specimen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.2rem;
}

.specimen-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.specimen-card .reticle {
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-bottom: 0.8rem;
}

.specimen-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--teal-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}

.specimen-name {
  font-size: 0.88rem;
  word-break: break-all;
  margin-bottom: 0.5rem;
  color: var(--ink-soft);
}

.count-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--teal-dark);
}

.count-badge span.label {
  font-weight: 400;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

details.object-list { margin-top: 0.7rem; font-size: 0.82rem; }
details.object-list summary { cursor: pointer; font-family: var(--mono); color: var(--teal-dark); font-size: 0.78rem; }
details.object-list table { width: 100%; margin-top: 0.5rem; border-collapse: collapse; }
details.object-list td, details.object-list th {
  text-align: left;
  padding: 0.25rem 0.4rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.9rem;
}

/* ---------- Admin ---------- */

.stat-row { display: flex; gap: 1.2rem; margin-bottom: 2rem; flex-wrap: wrap; }

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.4rem;
  flex: 1;
  min-width: 140px;
}

.stat-card .value { font-family: var(--mono); font-size: 1.7rem; font-weight: 700; color: var(--teal-dark); }
.stat-card .label { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; color: var(--ink-soft); letter-spacing: 0.06em; }

.filter-form {
  display: flex;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}

.filter-form .field { margin-bottom: 0; }

.admin-section { margin-bottom: 3rem; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.88rem;
}

.admin-table th {
  text-align: left;
  background: var(--teal-pale);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal-dark);
  padding: 0.7rem 0.8rem;
}

.admin-table td { padding: 0.6rem 0.8rem; border-top: 1px solid var(--line); vertical-align: middle; }

.admin-table tr:hover { background: rgba(47,107,99,0.04); }

.row-actions { display: flex; gap: 0.5rem; }

.thumb-link .reticle { width: 44px; height: 44px; }

.edit-form-row td { background: #fff; }

.edit-fields { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.edit-fields input[type="text"],
.edit-fields input[type="email"],
.edit-fields input[type="password"] {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.85rem;
  width: 140px;
}

.checkbox-inline { display: flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; font-family: var(--mono); }

/* ---------- Error page ---------- */

.error-wrap { text-align: center; padding: 4rem 1rem; }
.error-wrap .code { font-family: var(--mono); font-size: 4rem; color: var(--teal); font-weight: 700; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .site-header { padding: 1rem; flex-wrap: wrap; gap: 0.7rem; }
  .site-main { padding: 1.6rem 1rem 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}


/* ---------- Landing page: sample instructions ---------- */

.instructions-section,
.calculation-section,
.interpretation-section,
.drug-section {
  border-top: 1px solid var(--line);
  padding-top: 2.4rem;
  margin-top: 2.8rem;
}

.instructions-header {
  margin-bottom: 1.4rem;
}

.section-lede {
  color: var(--ink-soft);
  max-width: 70ch;
  margin: 0;
}

.instruction-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.instruction-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.instruction-card .slide-num {
  font-family: var(--mono);
  color: var(--teal);
  font-size: 0.8rem;
  display: block;
  margin-bottom: 0.5rem;
}

.instruction-card h3 {
  font-size: 0.98rem;
  margin-bottom: 0.4rem;
}

.instruction-card p {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 0;
}

.formula-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius);
  padding: 1.4rem;
}

.formula-main {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--mono);
}

.formula-label {
  color: var(--teal-dark);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.formula-main strong {
  font-size: 1rem;
}

.formula-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.formula-meta strong {
  color: var(--teal-dark);
  font-size: 1.2rem;
}

.formula-result {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.84rem;
}

.interpretation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.interpretation-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.interpretation-card strong {
  font-family: var(--mono);
  color: var(--teal-dark);
  font-size: 1.1rem;
}

.interpretation-card span {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.epg-note {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.76rem;
  margin-top: 1rem;
}

.drug-table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.drug-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.drug-table th {
  text-align: left;
  background: var(--teal-pale);
  color: var(--teal-dark);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.75rem 0.8rem;
}

.drug-table td {
  padding: 0.75rem 0.8rem;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.drug-table tbody tr:hover {
  background: rgba(47,107,99,0.04);
}

@media (max-width: 860px) {
  .instruction-grid,
  .interpretation-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   RECOMMENDED DRUG BUTTON
   ========================================================= */

.recommended-drug-wrap {
    margin-top: 0.75rem;
}

.recommended-drug-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;

    padding: 0.55rem 0.9rem;

    border: 1px solid var(--teal);
    border-radius: var(--radius);

    background: var(--teal);
    color: #fff;

    font-family: var(--mono);
    font-size: 0.76rem;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;

    animation: drugPulse 2s infinite;
}

.recommended-drug-btn:hover {
    background: var(--teal-dark);
    transform: translateY(-2px);
}

.recommended-drug-btn:active {
    transform: translateY(0);
}

.drug-icon {
    font-size: 0.95rem;
    font-weight: 700;
}


@keyframes drugPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(47, 107, 99, 0.25);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(47, 107, 99, 0.08);
    }
}


/* =========================================================
   DRUG MODAL
   ========================================================= */

.drug-modal {
    display: none;

    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    z-index: 99999;

    overflow: hidden;
}


.drug-modal.is-open {
    display: flex;

    align-items: center;
    justify-content: center;

    padding: 1rem;
}


/* =========================================================
   MODAL BACKGROUND
   ========================================================= */

.drug-modal-overlay {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    background: rgba(27, 37, 35, 0.65);

    backdrop-filter: blur(3px);

    cursor: pointer;

    animation: modalFadeIn 0.2s ease;
}


/* =========================================================
   MODAL CONTENT
   ========================================================= */

.drug-modal-content {
    position: relative;

    z-index: 2;

    width: 100%;
    max-width: 900px;

    max-height: 90vh;

    overflow-y: auto;
    overflow-x: hidden;

    background: var(--panel);

    border: 1px solid var(--line);

    border-radius: var(--radius);

    box-shadow:
        0 20px 60px rgba(27, 37, 35, 0.30);

    animation: modalSlideIn 0.25s ease;

    -webkit-overflow-scrolling: touch;
}


/* =========================================================
   MODAL HEADER
   ========================================================= */

.drug-modal-header {
    position: sticky;
    top: 0;

    z-index: 5;

    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 1rem;

    padding: 1.4rem 1.5rem;

    background: var(--panel);

    border-bottom: 1px solid var(--line);
}


.drug-modal-header h2 {
    margin: 0;

    font-size: 1.25rem;
}


/* =========================================================
   CLOSE BUTTON
   ========================================================= */

.drug-modal-close {
    width: 36px;
    height: 36px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--line);

    border-radius: 50%;

    background: transparent;

    color: var(--ink-soft);

    font-size: 1.5rem;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}


.drug-modal-close:hover {
    background: var(--danger-pale);

    color: var(--danger);

    border-color: var(--danger);
}


/* =========================================================
   MODAL BODY
   ========================================================= */

.drug-modal-body {
    padding: 1.5rem;
}


/* =========================================================
   STRONGYLE NOTICE
   ========================================================= */

.drug-modal-note {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    margin-bottom: 1rem;

    padding: 0.85rem 1rem;

    background: var(--teal-pale);

    border-left: 3px solid var(--teal);
}


.drug-modal-note strong {
    font-family: var(--mono);

    color: var(--teal-dark);
}


.drug-modal-note span {
    color: var(--ink-soft);

    font-size: 0.82rem;
}


/* =========================================================
   TABLE
   ========================================================= */

.drug-table-modal-wrap {
    width: 100%;

    overflow-x: auto;

    border: 1px solid var(--line);

    border-radius: var(--radius);

    -webkit-overflow-scrolling: touch;
}


.drug-table-modal {
    width: 100%;

    min-width: 650px;

    border-collapse: collapse;

    background: #fff;

    font-size: 0.86rem;
}


.drug-table-modal th {
    text-align: left;

    background: var(--teal-pale);

    color: var(--teal-dark);

    font-family: var(--mono);

    font-size: 0.7rem;

    text-transform: uppercase;

    letter-spacing: 0.06em;

    padding: 0.75rem;
}


.drug-table-modal td {
    padding: 0.8rem;

    border-top: 1px solid var(--line);

    vertical-align: top;

    color: var(--ink-soft);
}


.drug-table-modal td:nth-child(2) {
    color: var(--ink);

    font-family: var(--mono);

    font-weight: 600;
}


.drug-table-modal tbody tr:hover {
    background: rgba(47, 107, 99, 0.04);
}


/* =========================================================
   DISCLAIMER
   ========================================================= */

.drug-disclaimer {
    margin-top: 1rem;

    padding: 0.8rem 1rem;

    background: var(--rust-pale);

    border-left: 3px solid var(--rust);

    color: var(--ink-soft);

    font-size: 0.78rem;

    line-height: 1.5;
}


/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes modalFadeIn {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


@keyframes modalSlideIn {

    from {
        opacity: 0;

        transform:
            translateY(15px)
            scale(0.98);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .drug-modal.is-open {
        padding: 0.5rem;
    }


    .drug-modal-content {
        width: 100%;

        max-width: 100%;

        max-height: 95vh;

        border-radius: 4px;
    }


    .drug-modal-header {
        padding: 1rem;

        position: sticky;
        top: 0;
    }


    .drug-modal-header h2 {
        font-size: 1rem;
    }


    .drug-modal-body {
        padding: 1rem;
    }


    .drug-modal-note {
        flex-direction: column;

        align-items: flex-start;
    }


    .drug-table-modal {
        min-width: 600px;

        font-size: 0.78rem;
    }


    .drug-table-modal th,
    .drug-table-modal td {
        padding: 0.6rem;
    }


    .recommended-drug-btn {
        font-size: 0.72rem;

        padding: 0.5rem 0.75rem;
    }
}

/* =========================================================
   PROCESSING OVERLAY
   ========================================================= */

.processing-overlay {
    display: none;

    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    z-index: 100000;

    align-items: center;
    justify-content: center;

    padding: 1rem;

    background: rgba(27, 37, 35, 0.72);

    backdrop-filter: blur(4px);
}


.processing-overlay.is-processing {
    display: flex;

    animation: processingFadeIn 0.2s ease;
}


/* =========================================================
   PROCESSING CARD
   ========================================================= */

.processing-card {
    width: min(420px, 100%);

    padding: 2rem 1.8rem;

    background: var(--panel);

    border: 1px solid var(--line);

    border-radius: var(--radius);

    text-align: center;

    box-shadow:
        0 20px 60px rgba(27, 37, 35, 0.30);

    animation: processingCardIn 0.3s ease;
}


/* =========================================================
   SPINNER
   ========================================================= */

.processing-spinner {
    position: relative;

    width: 72px;
    height: 72px;

    margin: 0 auto 1.3rem;
}


.spinner-ring {
    position: absolute;

    inset: 0;

    border: 4px solid var(--teal-pale);

    border-top-color: var(--teal);

    border-right-color: var(--teal);

    border-radius: 50%;

    animation: processingSpin 1s linear infinite;
}


.spinner-dot {
    position: absolute;

    width: 10px;
    height: 10px;

    top: 50%;
    left: 50%;

    margin-top: -5px;
    margin-left: -5px;

    background: var(--teal);

    border-radius: 50%;

    animation: processingPulse 1s ease-in-out infinite;
}


/* =========================================================
   PROCESSING TEXT
   ========================================================= */

.processing-title {
    font-family: var(--mono);

    font-size: 1.25rem;

    font-weight: 700;

    color: var(--teal-dark);

    margin-bottom: 0.6rem;
}


.processing-message {
    color: var(--ink);

    font-size: 0.92rem;

    margin-bottom: 0.45rem;
}


.processing-status {
    color: var(--ink-soft);

    font-family: var(--mono);

    font-size: 0.72rem;
}


/* =========================================================
   ANIMATED DOTS
   ========================================================= */

.processing-dots::after {
    content: "";

    display: inline-block;

    width: 1.5em;

    text-align: left;

    animation: processingDots 1.4s steps(4, end) infinite;
}


@keyframes processingDots {

    0% {
        content: "";
    }

    25% {
        content: ".";
    }

    50% {
        content: "..";
    }

    75% {
        content: "...";
    }

    100% {
        content: "";
    }
}


/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes processingSpin {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}


@keyframes processingPulse {

    0%,
    100% {
        transform: scale(0.8);

        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);

        opacity: 1;
    }
}


@keyframes processingFadeIn {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


@keyframes processingCardIn {

    from {
        opacity: 0;

        transform:
            translateY(12px)
            scale(0.97);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .processing-card {
        padding: 1.6rem 1.2rem;
    }

    .processing-spinner {
        width: 60px;
        height: 60px;
    }

    .processing-title {
        font-size: 1.1rem;
    }

    .processing-message {
        font-size: 0.85rem;
    }
}