/* ===== ChemScreen ===== */

:root {
  --navy: #0e2a3f;
  --navy-dark: #0a1f30;
  --teal: #0e8f8a;
  --teal-dark: #0b746f;
  --ink: #22313f;
  --muted: #5b6b78;
  --line: #e2e8ee;
  --bg: #ffffff;
  --bg-alt: #f4f7fa;
  --fail: #c0392b;
  --fail-bg: #fdecea;
  --pass: #1e7e4c;
  --pass-bg: #e8f5ee;
  --radius: 10px;
  --shadow: 0 8px 30px rgba(14, 42, 63, 0.12);
}

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

h1, h2, h3 { line-height: 1.2; color: var(--navy); }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-lg { padding: 0.75rem 1.6rem; font-size: 1.05rem; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-outline { border-color: currentColor; color: var(--navy); background: transparent; }
.btn-outline:hover { background: rgba(14, 42, 63, 0.06); }
.btn-ghost { color: #fff; background: rgba(255, 255, 255, 0.12); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.22); }

/* ===== Header ===== */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  text-decoration: none;
  font-size: 1.35rem;
  letter-spacing: 0.2px;
}
.brand strong { color: #5fd3cd; font-weight: 700; }
.brand-mark { width: 28px; height: 28px; color: #5fd3cd; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.nav-user { font-size: 0.9rem; color: #c8d6e0; }
.nav-user strong { color: #fff; }

/* ===== User dropdown (Amazon-style hover menu) ===== */
.user-menu { position: relative; }
.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
}
.user-menu-trigger:hover { background: rgba(255, 255, 255, 0.12); }
.user-menu-trigger .trigger-prefix { font-weight: 400; color: #c8d6e0; }
.user-menu .caret { width: 10px; height: 6px; opacity: 0.7; transition: transform 0.15s; }
.user-menu:hover .caret, .user-menu:focus-within .caret { transform: rotate(180deg); }

.user-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0.4rem 0;
  margin-top: 0.35rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 30;
}
/* Invisible bridge so the menu doesn't close crossing the gap to it */
.user-menu-dropdown::before {
  content: "";
  position: absolute;
  top: -0.4rem;
  left: 0;
  right: 0;
  height: 0.4rem;
}
.user-menu:hover .user-menu-dropdown,
.user-menu:focus-within .user-menu-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.user-menu-dropdown a {
  display: block;
  padding: 0.55rem 1.1rem;
  color: var(--ink);
  font-size: 0.92rem;
  text-decoration: none;
}
.user-menu-dropdown a:hover { background: var(--bg-alt); color: var(--teal-dark); }
.user-menu-divider { border-top: 1px solid var(--line); margin: 0.35rem 0; }

.login-form { display: flex; gap: 0.45rem; align-items: center; flex-wrap: wrap; }
.login-form input {
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.9rem;
  width: 150px;
}
.login-form input::placeholder { color: #a9bcc9; }
.login-form input:focus {
  outline: none;
  border-color: #5fd3cd;
  background: rgba(255, 255, 255, 0.16);
}
.btn-signup { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.btn-signup:hover { background: rgba(255, 255, 255, 0.12); }

.auth-note a { color: var(--teal-dark); font-weight: 600; }
.account-heading {
  font-size: 1.05rem;
  text-align: left;
  margin: 0.4rem 0 1rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.auth-card .cf-turnstile { margin-bottom: 1.1rem; }

/* ===== Flash messages ===== */
.flash-area { padding-top: 1rem; }
.flash {
  padding: 0.7rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.flash-error { background: var(--fail-bg); color: var(--fail); border: 1px solid #f2c1bb; }
.flash-info { background: #e8f1f8; color: var(--navy); border: 1px solid #c5d9e8; }
.flash-success { background: var(--pass-bg); color: var(--pass); border: 1px solid #bfe3cf; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 60%, #123a52 100%);
  color: #fff;
  padding: 4.5rem 0 5rem;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #5fd3cd;
  margin-bottom: 0.8rem;
}
.hero h1 { color: #fff; font-size: 2.6rem; margin-bottom: 1rem; }
.hero .lead { color: #c8d6e0; font-size: 1.15rem; margin-bottom: 1.8rem; }
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.hero-actions .btn-outline { color: #fff; }
.hero-actions .btn-outline:hover { background: rgba(255, 255, 255, 0.1); }

/* Hero mock panel */
.hero-panel {
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-title {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 1rem;
  font-weight: 700;
  color: var(--navy);
  font-size: 0.95rem;
}
.panel-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.panel-table th, .panel-table td { text-align: left; padding: 0.5rem 1rem; }
.panel-table thead th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--line);
}
.panel-table tbody tr { border-bottom: 1px solid var(--line); }
.row-exceed { background: var(--fail-bg); }
.pill {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.pill-pass { background: var(--pass-bg); color: var(--pass); }
.pill-fail { background: var(--fail); color: #fff; }
.panel-footer {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--bg-alt);
}

/* ===== Sections ===== */
section h2 {
  font-size: 1.9rem;
  text-align: center;
  margin-bottom: 2.2rem;
}

.features { padding: 4.5rem 0; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.4rem;
}
.feature-card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.3rem;
}
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--teal);
  color: #fff;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.feature-card h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.92rem; color: var(--muted); }

.how { background: var(--bg-alt); padding: 4.5rem 0; }
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.4rem;
  counter-reset: step;
}
.steps li {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.3rem;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  margin-bottom: 0.9rem;
}
.steps h3 { font-size: 1.02rem; margin-bottom: 0.45rem; }
.steps p { font-size: 0.9rem; color: var(--muted); }

.value { padding: 4.5rem 0; }
.value-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.value-item { border-top: 3px solid var(--teal); padding-top: 1.1rem; }
.value-item h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.value-item p { color: var(--muted); font-size: 0.95rem; }

.cta {
  background: var(--navy);
  color: #fff;
  padding: 4rem 0;
  text-align: center;
}
.cta h2 { color: #fff; margin-bottom: 0.6rem; }
.cta p { color: #c8d6e0; margin-bottom: 1.5rem; }

/* ===== Auth page ===== */
.auth { padding: 4.5rem 0; background: var(--bg-alt); min-height: 60vh; }
.auth-inner { display: flex; justify-content: center; }
.auth-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.2rem 2rem;
  width: 100%;
  max-width: 400px;
}
.auth-card h1 { font-size: 1.6rem; margin-bottom: 0.3rem; }
.auth-sub { color: var(--muted); margin-bottom: 1.5rem; font-size: 0.95rem; }
.auth-card label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: var(--navy);
}
.auth-card input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 1.1rem;
}
.auth-card input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 143, 138, 0.15);
}
.auth-note {
  margin-top: 1.2rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

/* ===== Dashboard ===== */
.dashboard { padding: 3.5rem 0; min-height: 55vh; }
.dashboard h1 { margin-bottom: 0.4rem; }
.dashboard .lead { color: var(--muted); margin-bottom: 2rem; }
.placeholder-panel {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg-alt);
  padding: 3rem 2rem;
  text-align: center;
}
.placeholder-panel h2 { margin-bottom: 0.6rem; font-size: 1.3rem; }
.placeholder-panel p { color: var(--muted); max-width: 560px; margin: 0 auto; }

/* ===== Dashboard ===== */
.section-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.4rem 0 1.1rem;
}
.dashboard .lead + .section-head { margin-top: 1.8rem; }
.section-label {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
.section-rule { flex: 1; height: 1px; background: var(--line); }
.section-action {
  color: var(--teal-dark);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}
.section-action:hover { text-decoration: underline; }

.app-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.app-card {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
a.app-card:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.app-card-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}
.app-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--teal);
  color: #fff;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.app-card h2 { font-size: 1.1rem; margin: 0; text-align: left; }
.app-card p { font-size: 0.92rem; color: var(--muted); margin-bottom: 0.9rem; }
.app-card-cta { color: var(--teal-dark); font-weight: 700; font-size: 0.95rem; }
.app-grid-note { color: var(--muted); font-size: 0.85rem; margin-top: 0.8rem; }

.app-card-locked { background: var(--bg-alt); }
.app-card-locked .app-card-icon { background: var(--muted); }
.app-card-locked h2 { color: var(--muted); }
.app-chip {
  margin-left: auto;
  flex: none;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.app-card-locked-note {
  color: var(--muted);
  font-size: 0.88rem;
  font-style: italic;
}

/* history table on the dashboard: panel without its own heading */
.history-panel-flush { padding: 0.4rem 1.5rem 0.6rem; }
.history-table-dash th:first-child { width: auto; }
.history-table .th-date { width: 160px; }
.history-table .th-actions { width: 84px; }
.icon-form { display: inline; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  cursor: pointer;
  vertical-align: middle;
}
.icon-btn:hover { color: var(--teal-dark); background: var(--bg-alt); border-color: var(--line); }
.icon-btn-danger:hover { color: #fff; background: var(--fail); border-color: var(--fail); }
.icon-btn svg { width: 15px; height: 15px; }

/* Admin: per-user app access */
.apps-form { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.apps-check {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.88rem;
  white-space: nowrap;
  cursor: pointer;
}
.apps-all { color: var(--muted); font-size: 0.88rem; font-style: italic; }
.apps-form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: var(--navy);
}

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

/* ===== Screening history ===== */
.history-panel {
  margin-top: 2.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.history-panel h2 { font-size: 1.15rem; margin-bottom: 0.4rem; text-align: left; }
.history-hint { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
/* Fixed layout so long filenames wrap inside their column instead of
   pushing the table beyond the panel border. */
.history-table { table-layout: fixed; width: 100%; }
.history-table th:nth-child(1) { width: 140px; }
.history-table th:last-child { width: 90px; }
.history-table td { overflow-wrap: anywhere; }
.history-table .cell-date { white-space: nowrap; color: var(--muted); font-size: 0.88rem; }
.history-link { color: var(--teal-dark); font-weight: 600; text-decoration: none; }
.history-link:hover { text-decoration: underline; }
.history-size { color: var(--muted); font-size: 0.8rem; margin-left: 0.4rem; }
.history-missing { color: var(--muted); }
.history-head { display: flex; justify-content: space-between; align-items: baseline; }
.history-viewall { color: var(--teal-dark); font-weight: 600; text-decoration: none; font-size: 0.9rem; }
.history-viewall:hover { text-decoration: underline; }
.history-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.history-search { display: flex; align-items: center; gap: 0.5rem; }
.history-search input {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.92rem;
  width: 240px;
}
.history-search input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 143, 138, 0.15);
}
.history-clear { color: var(--muted); font-size: 0.88rem; }

/* Log filter tabs + table */
.log-filter { display: flex; gap: 0.4rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.log-tab {
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.log-tab:hover { border-color: var(--teal); color: var(--teal-dark); }
.log-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.log-table .cell-date { white-space: nowrap; }
.log-uid { color: var(--muted); font-size: 0.8rem; }
.log-ip { font-family: monospace; font-size: 0.85rem; color: var(--muted); }
.pill-run { background: var(--teal); color: #fff; }
.stat-grid-wrap { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.stat-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  display: flex;
  flex-direction: column;
}
.stat-value { font-size: 1.7rem; font-weight: 700; color: var(--navy); line-height: 1.2; }
.stat-label { color: var(--muted); font-size: 0.88rem; }
@media (max-width: 700px) {
  .stat-grid { grid-template-columns: 1fr; }
}

.history-empty {
  color: var(--muted);
  background: var(--bg-alt);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
  text-align: center;
}

/* ===== Admin ===== */
.admin-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
.admin-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.admin-card h2 { font-size: 1.15rem; margin-bottom: 1rem; text-align: left; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin-table th, .admin-table td { text-align: left; padding: 0.55rem 0.6rem; }
.admin-table thead th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--line);
}
.admin-table tbody tr { border-bottom: 1px solid var(--line); }
.admin-table tbody tr:hover { background: var(--bg-alt); }
.cell-actions { text-align: right; }
.cell-actions form { display: inline; }
.tag-you {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--teal-dark);
  background: rgba(14, 143, 138, 0.12);
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  vertical-align: middle;
}
.pill-admin { background: var(--navy); color: #fff; }
.pill-user { background: var(--bg-alt); color: var(--muted); border: 1px solid var(--line); }

.btn-danger { background: var(--fail); color: #fff; }
.btn-danger:hover { background: #a53125; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.82rem; }

.admin-form label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: var(--navy);
}
.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.admin-form input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 143, 138, 0.15);
}
.label-optional { font-weight: 400; color: var(--muted); }
.check-label {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  font-weight: 500 !important;
  cursor: pointer;
}

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

/* app-access summary pills in the users table */
.pill-app {
  background: rgba(14, 143, 138, 0.12);
  color: var(--teal-dark);
  border: 1px solid rgba(14, 143, 138, 0.25);
  margin: 0 0.2rem 0.2rem 0;
}
.apps-none { color: var(--muted); font-size: 0.88rem; }
.admin-table .cell-date { white-space: nowrap; color: var(--muted); font-size: 0.88rem; }

/* ===== Modify drawer ===== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 31, 48, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 100;
}
.drawer-backdrop.open { opacity: 1; visibility: visible; }
body.drawer-open { overflow: hidden; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 440px;
  max-width: 92vw;
  background: #fff;
  box-shadow: -14px 0 44px rgba(14, 42, 63, 0.20);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 101;
}
.drawer.open { transform: translateX(0); }
.drawer form { display: flex; flex-direction: column; height: 100%; }

.drawer-head {
  background: var(--navy);
  color: #fff;
  padding: 1.3rem 1.4rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.drawer-head h2 { color: #fff; font-size: 1.2rem; margin: 0; }
.drawer-head .tag-you { vertical-align: middle; }
.drawer-sub { color: #c8d6e0; font-size: 0.9rem; margin-top: 0.2rem; }
.drawer-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0.85;
}
.drawer-close:hover { opacity: 1; }

.drawer-body { flex: 1; overflow-y: auto; padding: 1.3rem 1.4rem; }
.drawer-foot {
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.drawer-delete { margin-left: auto; }
.drawer-section-gap { margin-top: 1.6rem; }
.reset-form { margin-top: 0.6rem; }

.detail-list {
  display: grid;
  grid-template-columns: 110px 1fr;
  row-gap: 0.55rem;
  font-size: 0.92rem;
  margin: 0;
}
.detail-list dt { color: var(--muted); }
.detail-list dd { color: var(--ink); margin: 0; }
.detail-filename { overflow-wrap: anywhere; }
.detail-list-strip {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.4rem;
}
.drawer-download { margin-top: 1.4rem; }
.history-table-runs .th-date { width: 150px; }
.history-table-runs .th-app { width: 110px; }
.history-table-runs .th-details { width: 92px; }
.history-table-runs th:first-child { width: 150px; }

.drawer-field {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.5rem;
}
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.field-title { font-weight: 700; color: var(--navy); }
.field-help { color: var(--muted); font-size: 0.85rem; margin-top: 0.5rem; }

.drawer-section-label {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.7rem;
}
.apps-admin-note {
  background: #fff7e6;
  border: 1px solid #f5d9a0;
  color: #8a6d15;
  font-size: 0.83rem;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  margin-bottom: 0.8rem;
}

.app-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 0.7rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.app-toggle:hover { border-color: var(--teal); background: var(--bg-alt); }
.app-toggle-name { display: block; font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.app-toggle-desc { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 0.2rem; }

/* iOS-style toggle switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e0;
  border-radius: 999px;
  transition: background 0.2s;
}
.switch-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.switch input:checked + .switch-slider { background: var(--teal); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch input:disabled + .switch-slider { opacity: 0.5; }
.switch input:focus-visible + .switch-slider { box-shadow: 0 0 0 3px rgba(14, 143, 138, 0.35); }

@media (max-width: 560px) {
  .drawer { width: 100vw; }
}
@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer-backdrop, .switch-slider, .switch-slider::before { transition: none; }
}

/* ===== Footer ===== */
.site-footer {
  background: var(--navy-dark);
  color: #c8d6e0;
  padding: 2.2rem 0;
  margin-top: 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-brand { font-size: 1.15rem; color: #fff; }
.footer-brand strong { color: #5fd3cd; }
.footer-tag { font-size: 0.85rem; max-width: 380px; margin-top: 0.3rem; }
.footer-copy { font-size: 0.85rem; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .feature-grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .value-inner { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.1rem; }
}

@media (max-width: 560px) {
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .login-form input { width: 120px; }
  .header-inner { justify-content: center; }
}
