:root {
  --green-1: #1f5146;
  --green-2: #16403a;
  --green-3: #10302c;
  --cream: #f4f1ea;
  --ink: #1d4038;
  --ink-soft: #3c5a52;
  --muted: #7d948c;
  --card: #f6f3ec;
  --card-border: #d9dcd2;
  --tint: #e3eadf;
  --tint-border: #c5d2c2;
  --mint: #cfe6c8;
  --blue: #2f6db5;
  --dot: #7fa86b;

  --serif: "DM Serif Display", Georgia, serif;
  --num: "Fraunces", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.mono { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }

/* ================= LAYOUT ================= */
.app {
  display: grid;
  grid-template-columns: 37.4% 1fr;
  min-height: 100vh;
}

/* ================= LADO ESQUERDO ================= */
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(170deg, var(--green-1) 0%, var(--green-2) 50%, var(--green-3) 100%);
  color: #e9efe9;
  padding: 34px 28px 24px 36px;
  display: flex;
  flex-direction: column;
}

.brand { display: flex; align-items: flex-start; gap: 14px; position: relative; z-index: 2; }
.brand { align-items: flex-start; gap: 16px; }
.brand-logo { width: 92px; height: 92px; flex: none; object-fit: contain; margin: -14px 0 -10px -10px; }
.login-logo { width: 96px; height: 96px; object-fit: contain; margin: -8px 0 -4px; }
.brand-icon { width: 38px; height: 38px; color: #d8e6dc; flex: none; margin-top: 2px; }
.brand-icon svg { width: 100%; height: 100%; }
.brand-title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 23px;
  letter-spacing: -.035em;
  line-height: 1.2;
  color: #f2f5ef;
}
.brand-sub { font-family: var(--mono); font-size: 10px; color: #d6e3c9; margin-top: 6px; }

/* Arcos decorativos */
.arcs { position: absolute; right: -240px; bottom: -330px; width: 520px; height: 520px; pointer-events: none; z-index: 0; }
.arcs span { position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; }
.arcs span:nth-child(2) { inset: 45px; }
.arcs span:nth-child(3) { inset: 90px; }

/* Câmara de contagem */
.chamber-wrap { display: none; flex: 1; align-items: center; justify-content: center; position: relative; z-index: 1; }
.chamber { position: relative; width: 300px; height: 300px; }
.chamber-glow {
  position: absolute; inset: -6px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.04) 55%, rgba(255,255,255,.035) 70%, transparent 71%);
  box-shadow: 0 0 0 18px rgba(255,255,255,.02);
}
.chamber-grid {
  position: absolute; inset: 44px 46px 46px 44px;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px;
}
.q {
  border: 1px solid rgba(214,232,210,.55);
  border-radius: 3px;
  background-image:
    linear-gradient(rgba(214,232,210,.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214,232,210,.16) 1px, transparent 1px);
  background-size: 10px 10px;
  background-position: -1px -1px;
  display: flex; align-items: center; justify-content: center;
}
.q span { font-size: 9px; color: #d7e9cf; font-family: var(--sans); }
.chamber-circle {
  position: absolute; inset: 34px; border-radius: 50%;
  border: 1.5px solid rgba(220,235,215,.7);
}
.chamber-label {
  position: absolute; right: 2px; bottom: 26px;
  font-family: var(--mono); font-size: 8px; letter-spacing: .08em; color: #d7e9cf;
}

/* Card informativo */
.info-card {
  display: none;
  position: relative; z-index: 2;
  margin: auto -10px 70px -10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  background: rgba(255,255,255,.035);
  padding: 22px 14px 12px;
  font-size: 10px;
  line-height: 1.55;
  color: #e3ece4;
}
.info-card h2 { font-family: var(--sans); font-weight: 500; font-size: 14px; color: #f2f5ef; margin-bottom: 14px; }
.info-card p { margin-bottom: 8px; }
.ref-table { border: 1px solid rgba(255,255,255,.14); border-radius: 3px; margin: 10px 0 8px; padding: 0 9px; }
.ref-head { font-size: 8px; font-weight: 600; letter-spacing: .06em; padding: 9px 0 7px; border-bottom: 1px solid rgba(255,255,255,.14); }
.ref-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0 5px; border-bottom: 1px solid rgba(255,255,255,.1); font-size: 9px; }
.ref-row:last-child { border-bottom: 0; }
.ref-row strong { font-weight: 600; }
.warn { background: rgba(255,255,255,.06); border-radius: 3px; padding: 10px 10px; font-size: 9.5px; }
.warn strong { font-weight: 600; }

/* Estados do painel esquerdo por tela */
.app[data-view="count"] .chamber-wrap { display: flex; }
.app[data-view="viab"] .chamber-wrap { display: flex; flex: none; margin-top: 4px; }
.app[data-view="viab"] .info-card { display: block; margin-top: 40px; margin-bottom: 40px; }
/* Na viabilidade o painel acompanha a altura da página, para o card nunca ser cortado */
.app[data-view="viab"] .side { position: relative; height: auto; min-height: 100vh; overflow: hidden; }
.app[data-view="viab"] .chamber { width: 260px; height: 260px; }
.app[data-view="viab"] .chamber-grid { inset: 36px 38px 38px 36px; gap: 5px; }
.app[data-view="viab"] .chamber-circle { inset: 28px; }
.app[data-view="viab"] .chamber-label { bottom: 18px; }

/* ================= LADO DIREITO ================= */
.main { position: relative; padding: 0 40px 0 72px; min-width: 0; }
.view { display: none; min-height: 100vh; flex-direction: column; }
.app[data-view="home"] .view-home,
.app[data-view="count"] .view-count,
.app[data-view="viab"] .view-viab { display: flex; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.topbar { display: flex; justify-content: space-between; align-items: center; padding-top: 44px; color: var(--ink-soft); }
.topbar-inline { padding-top: 30px; }
.status { display: inline-flex; align-items: center; gap: 9px; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: var(--dot); display: inline-block; }
.status.busy i { background: #d1a54b; }

.foot { margin-top: auto; border-top: 1px solid var(--card-border); padding: 13px 0 4px; text-align: right; color: var(--muted); font-size: 9px; }

/* HOME */
.home-center { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 460px; padding-top: 140px; padding-bottom: 110px; }
.hero {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 74px;
  line-height: .98;
  letter-spacing: -.055em;
  color: var(--ink);
  margin-bottom: 18px;
}
.option {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  text-align: left;
  width: 100%;
  min-height: 76px;
  padding: 18px 16px 18px 18px;
  margin-bottom: 12px;
  background: var(--tint);
  border: 1px solid var(--tint-border);
  border-radius: 3px;
  font-size: 11px;
  color: var(--ink);
  transition: box-shadow .2s, transform .2s, background .2s;
}
.option:first-of-type { box-shadow: 0 4px 14px rgba(29,64,56,.1); }
.option:hover { box-shadow: 0 6px 18px rgba(29,64,56,.14); transform: translateY(-1px); background: #dde6d8; }
.arrow { flex: none; width: 29px; height: 29px; border: 1px solid #9fb3a6; border-radius: 50%; display: grid; place-items: center; color: var(--ink-soft); }
.arrow svg { width: 15px; height: 15px; }

/* CABEÇALHO DAS TELAS */
.back { display: inline-flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: .04em; color: var(--ink-soft); padding-top: 38px; align-self: flex-start; }
.topbar-inline .back { padding-top: 0; }
.back svg { width: 13px; height: 13px; }
.back:hover { color: var(--ink); }
.page-title {
  font-family: var(--serif); font-weight: 400;
  font-size: 40px; letter-spacing: -.045em; line-height: 1.1;
  margin-top: 14px; color: var(--ink);
}
.page-sub { font-size: 10px; color: var(--ink-soft); margin-top: 4px; }
.blue { color: var(--blue); }

/* CAMPOS */
.count-col { width: 100%; max-width: 560px; margin-top: 18px; padding-bottom: 20px; }
.field {
  display: block;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 3px;
  padding: 14px 14px 12px;
  margin-bottom: 10px;
  cursor: text;
}
.field-q { display: block; font-size: 11px; color: var(--ink); line-height: 1.35; }
.field-line { display: flex; align-items: flex-end; gap: 10px; margin-top: 12px; }
.field-line em { font-style: normal; font-family: var(--mono); font-size: 7.5px; color: var(--muted); margin-bottom: -6px; flex: none; }
.field small { display: block; font-size: 8.5px; color: var(--ink-soft); margin-top: 6px; }
.num {
  flex: 1; min-width: 0; width: 100%;
  border: 0; border-bottom: 1px solid #b7c2bb;
  background: transparent;
  font-family: var(--num);
  font-variant-numeric: oldstyle-nums;
  font-size: 22px;
  color: var(--ink);
  padding: 0 0 4px;
  outline: none;
}
.num::placeholder { color: var(--ink-soft); opacity: .8; }
.num:focus { border-bottom-color: var(--ink); }
.field:focus-within { border-color: #a9bbb0; }

.field.sm { padding: 10px 10px 10px; margin-bottom: 8px; min-height: 66px; }
.field.sm .field-q { font-size: 9px; max-width: 190px; }
.field.sm .field-line { margin-top: 10px; }
.field.sm .num { font-size: 15px; }

/* RESULTADOS — contagem */
.results { background: var(--tint); border: 1px solid var(--tint-border); border-radius: 2px; margin: 14px 0 10px; }
.res-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--tint-border); font-size: 10px; color: var(--ink-soft); }
.res-row:last-child { border-bottom: 0; }
.res-row small { color: var(--muted); font-size: 9px; }
.res-row b { font-family: var(--num); font-variant-numeric: oldstyle-nums; font-weight: 700; font-size: 20px; color: var(--ink); white-space: nowrap; }

.actions { display: flex; align-items: center; gap: 22px; margin-top: 16px; flex-wrap: wrap; }
.btn-clear {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--tint-border); background: var(--tint);
  border-radius: 3px; font-size: 10px; font-weight: 500; color: var(--ink);
}
.btn-clear svg { width: 12px; height: 12px; }
.btn-clear:hover { background: #d9e3d4; }
.hint { font-size: 8.5px; color: var(--ink-soft); position: relative; padding-left: 8px; }
.hint::before { content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 3px; border-radius: 50%; background: var(--dot); transform: translateY(-50%); }

/* VIABILIDADE */
.viab-wrap { max-width: 560px; width: 100%; margin-top: 22px; padding-bottom: 50px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.col-title { font-family: var(--sans); font-weight: 500; font-size: 11px; color: var(--ink); }
.col-sub { font-size: 8px; color: var(--ink-soft); margin: 4px 0 13px; }

.sum-box { background: var(--tint); border: 1px solid var(--tint-border); border-radius: 2px; padding: 12px 10px 10px; min-height: 106px; }
.sb-label, .sb-row span { font-size: 8.5px; color: var(--ink-soft); line-height: 1.5; }
.sb-big { display: block; text-align: right; font-family: var(--num); font-variant-numeric: oldstyle-nums; font-weight: 700; font-size: 15px; color: var(--ink); margin-top: 6px; }
.sb-row { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 24px; }
.sb-row b { font-family: var(--num); font-variant-numeric: oldstyle-nums; font-weight: 700; font-size: 15px; }

.divider { border: 0; border-top: 1px solid var(--card-border); margin: 22px 0 14px; }

.big-box { background: var(--tint); border: 1px solid var(--tint-border); border-radius: 2px; min-height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 18px 10px 14px; gap: 10px; }
.big-box span { font-size: 9px; color: var(--ink-soft); }
.big-box b { font-family: var(--num); font-variant-numeric: oldstyle-nums; font-weight: 700; font-size: 22px; color: var(--ink); }
.big-box small { font-size: 8.5px; font-weight: 600; letter-spacing: .04em; color: var(--ink-soft); min-height: 1px; }
.big-box small:empty { display: none; }

.three-col { display: grid; grid-template-columns: 1.05fr 1fr 1fr; gap: 9px; margin-top: 27px; }
.mini-box { background: var(--card); border: 1px solid var(--card-border); border-radius: 2px; padding: 12px 10px; min-height: 162px; display: flex; flex-direction: column; }
.mini-box.center { align-items: stretch; }
.mb-title { font-size: 8.5px; line-height: 1.55; color: var(--ink); }
.mini-box small { font-size: 7.5px; line-height: 1.5; color: var(--ink-soft); }
.big-input { flex: none; font-size: 24px; border-bottom: 0; margin: 20px 0 6px; padding: 0; }
.big-input::placeholder { color: #8f9e98; }
.mb-val { font-family: var(--num); font-variant-numeric: oldstyle-nums; font-weight: 700; font-size: 17px; text-align: center; margin: 22px 0 10px; color: var(--ink); }
.sci-label { text-align: center; margin-top: 12px; }
.mb-sci { text-align: center; font-family: var(--num); font-weight: 600; font-size: 13px; color: var(--ink); margin-top: 4px; }
.mb-sci sup { font-size: .7em; }

.viab-wrap .actions { margin-top: 16px; }

/* ================= PLAQUEAMENTO ================= */
.app[data-view="plate"] .view-plate { display: flex; animation: fade .35s ease; }
.option-next { margin-top: 26px; max-width: 460px; }

/* Placa no painel esquerdo */
.plate-wrap { display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 14px; position: relative; z-index: 1; }
.app[data-view="plate"] .plate-wrap { display: flex; }
.plate {
  width: min(340px, 90%);
  border: 1.5px solid rgba(220,235,215,.7);
  border-radius: 14px 14px 14px 26px;
  padding: 18px 20px;
  background: rgba(255,255,255,.03);
  box-shadow: 0 0 0 14px rgba(255,255,255,.02);
}
.plate-wells { display: grid; gap: 7px; }
.well {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(214,232,210,.5);
  transition: background .25s, border-color .25s;
}
.well.on { background: rgba(207,230,200,.55); border-color: rgba(230,242,226,.9); }
.well.extra { background: rgba(207,230,200,.18); border-style: dashed; }
.plate-label { font-family: var(--mono); font-size: 8px; letter-spacing: .08em; color: #d7e9cf; text-align: center; }

.notice { font-size: 10px; color: #8a5a12; background: #f6ead2; border: 1px solid #e6d2a8; border-radius: 3px; padding: 10px 12px; margin-bottom: 10px; }
.notice[hidden] { display: none; }
.field small.italic { font-style: italic; font-size: 8.5px; margin-top: 8px; }
.field small.factor { font-family: var(--mono); font-size: 9px; color: var(--ink); margin-top: 5px; letter-spacing: .02em; }

.plan { background: var(--tint); border: 1px solid var(--tint-border); border-radius: 2px; margin: 14px 0 10px; }
.plan-row {
  display: grid; grid-template-columns: 1fr auto; column-gap: 18px; row-gap: 4px; align-items: center;
  padding: 14px; border-bottom: 1px solid var(--tint-border);
}
.plan-row:last-child { border-bottom: 0; }
.plan-row > span { font-size: 10.5px; color: var(--ink); line-height: 1.4; }
.plan-row b { font-family: var(--num); font-variant-numeric: oldstyle-nums; font-weight: 700; font-size: 20px; color: var(--ink); white-space: nowrap; text-align: right; }
.plan-row small { grid-column: 1 / -1; font-family: var(--mono); font-size: 8.5px; color: var(--muted); letter-spacing: .02em; }
.plan-row small sup, .plan-row b sup { font-size: .7em; }
.plan-row.highlight { background: var(--mint); }
/* resultado em destaque: volume da solução de trabalho */
.plan-row.emph { background: #d3e3cd; }
.plan-row.emph > span { font-weight: 600; font-size: 11.5px; }
.plan-row.emph b { font-size: 24px; }
/* grupo: preparo da solução de trabalho */
.plan-prep { background: var(--mint); border: 1.5px solid #9fc796; border-radius: 4px; margin-top: 12px; overflow: hidden; }
.prep-head { background: var(--ink); color: #eef5ec; font-size: 9px; letter-spacing: .12em; padding: 8px 14px; }
.plan-prep .plan-row { border-bottom-color: #b5d3ab; }
.plan-prep .plan-row > span { font-weight: 600; font-size: 11.5px; display: flex; gap: 9px; align-items: flex-start; }
.plan-prep .plan-row b { font-size: 24px; }
.plan-prep .plan-row small { padding-left: 27px; color: #6c8a7c; }
.step-ic { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: #eef5ec; font-style: normal; font-family: var(--mono); font-size: 9.5px; font-weight: 500; display: grid; place-items: center; margin-top: -1px; }

.leftover { border-radius: 3px; padding: 16px 14px 12px; margin: 4px 0 10px; animation: fade .35s ease; }
.leftover[hidden] { display: none; }
.leftover.good { background: #d6ecd0; border: 1px solid #9fc796; }
.leftover.bad { background: #f3e6d6; border: 1px solid #dfc4a2; }
.lo-title { font-family: var(--serif); font-size: 20px; line-height: 1.2; letter-spacing: -.02em; color: var(--ink); margin-bottom: 12px; }
.leftover.bad .lo-title { color: #7a4a1c; }
.lo-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.lo-row span { font-size: 10.5px; color: var(--ink); }
.lo-row b { font-family: var(--num); font-variant-numeric: oldstyle-nums; font-weight: 700; font-size: 22px; color: var(--ink); }
.leftover small { display: block; margin-top: 6px; font-family: var(--mono); font-size: 8.5px; color: var(--muted); }
.leftover small sup { font-size: .7em; }

.alert { font-size: 10px; color: #8b2c1f; background: #f7e1dc; border: 1px solid #e8bdb3; border-radius: 3px; padding: 10px 12px; line-height: 1.5; }
.alert[hidden] { display: none; }

/* ================= BANCO DE CÉLULAS ================= */
.app[data-view="bank"] .view-bank,
.app[data-view="lines"] .view-lines,
.app[data-view="people"] .view-people,
.app[data-view="store"] .view-store,
.app[data-view="take"] .view-take,
.app[data-view="dewar"] .view-dewar { display: flex; animation: fade .35s ease; }

.option:disabled { cursor: default; opacity: .62; background: #ebebe3; border-color: var(--card-border); box-shadow: none; transform: none; }
.option:disabled:hover { background: #ebebe3; box-shadow: none; transform: none; }
.soon { font-size: 8.5px; color: var(--muted); border: 1px solid var(--card-border); border-radius: 20px; padding: 4px 9px; flex: none; }
.opt-count { font-family: var(--mono); font-size: 9px; color: var(--muted); margin-left: 6px; }
.bank-center { padding-top: 90px; }
.view-bank .option:first-of-type { box-shadow: 0 4px 14px rgba(29,64,56,.1); }

/* Linhagens */
.lines-wrap { width: 100%; max-width: 760px; margin-top: 20px; padding-bottom: 30px; }
.lines-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: #f2f5ef; border-radius: 3px;
  padding: 10px 14px; font-size: 10.5px; font-weight: 500;
}
.btn-primary svg { width: 13px; height: 13px; }
.btn-primary:hover { background: #2a574c; }
.search {
  flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 3px; padding: 0 10px; color: var(--muted);
}
.search svg { width: 14px; height: 14px; flex: none; }
.search input { flex: 1; border: 0; background: transparent; outline: none; font: inherit; font-size: 11px; color: var(--ink); padding: 10px 0; min-width: 0; }
.filter { font: inherit; font-size: 10.5px; color: var(--ink); background: var(--card); border: 1px solid var(--card-border); border-radius: 3px; padding: 9px 8px; }

.line-form { background: var(--card); border: 1px solid #a9bbb0; border-radius: 4px; padding: 16px; margin-bottom: 14px; box-shadow: 0 6px 18px rgba(29,64,56,.08); animation: fade .25s ease; }
.line-form[hidden] { display: none; }
.lf-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.lf-head h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; letter-spacing: -.02em; }
.lf-close { font-size: 22px; line-height: 1; color: var(--muted); padding: 0 4px; }
.lf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; }
.lf-field { display: flex; flex-direction: column; gap: 4px; }
.lf-field.wide { grid-column: span 3; }
.lf-grid .lf-field:nth-child(5), .lf-grid .lf-field:nth-child(6) { grid-column: span 1; }
.lf-grid .lf-field:nth-child(6) { grid-column: span 2; }
.lf-field span { font-size: 9px; color: var(--ink-soft); letter-spacing: .02em; }
.lf-field input, .lf-field textarea {
  font: inherit; font-size: 11.5px; color: var(--ink);
  background: #fbfaf6; border: 1px solid var(--card-border); border-radius: 3px; padding: 8px 9px; outline: none; resize: vertical;
}
.lf-field input:focus, .lf-field textarea:focus { border-color: var(--ink-soft); }
.lf-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.lf-msg { font-size: 10px; color: #8b2c1f; }

.lines-list { display: flex; flex-direction: column; gap: 8px; }
.line-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 3px; padding: 13px 14px; display: grid; grid-template-columns: 150px 1fr auto; gap: 6px 16px; align-items: start; }
.line-card.flash { animation: flash 1.2s ease; }
@keyframes flash { 0% { background: var(--mint); } 100% { background: var(--card); } }
.lc-code { font-family: var(--serif); font-size: 21px; letter-spacing: -.02em; line-height: 1.1; color: var(--ink); word-break: break-word; }
.lc-id { font-size: 9.5px; color: var(--ink-soft); margin-top: 3px; }
.lc-body { font-size: 10px; color: var(--ink); line-height: 1.5; min-width: 0; }
.lc-body dl { display: grid; grid-template-columns: 112px 1fr; gap: 2px 10px; }
.lc-body dt { color: var(--muted); font-size: 9px; padding-top: 1px; }
.lc-body dd { word-break: break-word; }
.lc-body a { color: var(--blue); }
.lc-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.tag { font-family: var(--mono); font-size: 8px; letter-spacing: .08em; padding: 3px 7px; border-radius: 20px; border: 1px solid var(--tint-border); background: var(--tint); color: var(--ink); }
.tag.imo { background: #dbe7f3; border-color: #b6cbe2; color: #23497a; }
.tag.pri { background: #e3efd9; border-color: #bcd6aa; color: #355b22; }
.tag.inc { background: #f6e3c8; border-color: #e7c590; color: #8a5a12; }
.lc-actions { display: flex; gap: 4px; }
.icon-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--card-border); display: grid; place-items: center; color: var(--ink-soft); }
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn:hover { background: var(--tint); color: var(--ink); }
.icon-btn.del:hover { background: #f7e1dc; color: #8b2c1f; border-color: #e8bdb3; }
.empty { font-size: 11px; color: var(--muted); text-align: center; padding: 30px 0; }

.data-tools { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--card-border); }
.data-tools .mono { color: var(--muted); font-size: 9px; }
.link-btn { font-size: 10px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #a9bbb0; cursor: pointer; }
.link-btn:hover { text-decoration-color: var(--ink); }
.data-note { font-size: 9px; color: var(--muted); margin-top: 8px; }

/* ---------- Botijão (painel esquerdo) ---------- */
.dewar-wrap { display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 14px; position: relative; z-index: 1; }
.app[data-view="bank"] .dewar-wrap, .app[data-view="lines"] .dewar-wrap, .app[data-view="people"] .dewar-wrap,
.app[data-view="store"] .dewar-wrap, .app[data-view="take"] .dewar-wrap, .app[data-view="dewar"] .dewar-wrap { display: flex; }
.dewar { width: min(330px, 90%); }
.dewar svg { width: 100%; height: auto; display: block; overflow: visible; }
.dw-n { font-family: var(--serif); font-size: 22px; fill: #eef5ec; }
.dw-c { font-family: var(--mono); font-size: 8px; fill: #d7e9cf; letter-spacing: .04em; }
.dw-can circle { transition: fill .3s, stroke .3s; }
.dw-can.hl circle { filter: drop-shadow(0 0 6px rgba(207,230,200,.55)); }

/* ---------- Menu do banco ---------- */
.bank-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.bank-stats div { border: 1px solid var(--card-border); border-radius: 3px; padding: 10px 12px; background: var(--card); }
.bank-stats b { display: block; font-family: var(--num); font-variant-numeric: oldstyle-nums; font-size: 24px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.bank-stats span { font-size: 9px; color: var(--ink-soft); }
.view-bank .option { min-height: 62px; margin-bottom: 9px; }
.view-bank .data-tools { margin-top: 14px; }

/* ---------- Cards extras ---------- */
.lc-stock { margin-top: 10px; font-size: 10px; color: var(--ink); line-height: 1.35; }
.lc-stock b { font-family: var(--num); font-size: 17px; }
.lc-stock span { font-size: 8.5px; color: var(--muted); }
.lc-stock.zero { color: var(--muted); font-size: 9px; font-style: italic; }
.lc-code.sm { font-size: 16px; line-height: 1.25; }
.line-card.person { grid-template-columns: 220px 1fr auto; }
dd.na { color: var(--muted); }
.lf-field select {
  font: inherit; font-size: 11.5px; color: var(--ink); background: #fbfaf6; border: 1px solid var(--card-border);
  border-radius: 3px; padding: 8px 6px; outline: none; min-width: 0; width: 100%;
}
.lf-field select:focus { border-color: var(--ink-soft); }
.lf-hint { font-style: normal; font-family: var(--mono); font-size: 8.5px; color: var(--ink-soft); min-height: 11px; }
.filter.grow { flex: 1; min-width: 160px; }

/* ---------- Armazenar ---------- */
.store-form { display: flex; flex-direction: column; gap: 10px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; background: var(--card); border: 1px solid var(--card-border); border-radius: 3px; padding: 14px; }
.step-n { font-size: 11px; color: var(--muted); padding-top: 18px; }
.step-title { display: block; font-size: 9px; color: var(--ink-soft); margin-bottom: 8px; }
.step-link { font-size: 9px; color: var(--muted); margin-top: 10px; }
.step-link .link-btn { font-size: 9px; }
.lf-field.wide2 { grid-column: span 2; }
.can-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.can-btn { border: 1px solid var(--card-border); border-radius: 4px; background: #fbfaf6; padding: 9px 6px 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; transition: background .15s, border-color .15s; }
.can-btn b { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1; color: var(--ink); }
.can-btn span { font-family: var(--mono); font-size: 8.5px; color: var(--ink-soft); }
.can-btn small { font-size: 7.5px; color: var(--muted); line-height: 1.3; min-height: 20px; }
.can-btn:hover { border-color: var(--ink-soft); }
.can-btn.on { background: var(--ink); border-color: var(--ink); }
.can-btn.on b, .can-btn.on span, .can-btn.on small { color: #eef5ec; }

.done { background: var(--mint); border: 1px solid #9fc796; border-radius: 3px; padding: 14px; display: flex; flex-direction: column; gap: 4px; margin: 4px 0 12px; animation: fade .3s ease; }
.done[hidden] { display: none; }
.done b { font-family: var(--serif); font-weight: 400; font-size: 19px; color: var(--ink); }
.done span { font-size: 10px; color: var(--ink); }
.done-actions { display: flex; gap: 16px; margin-top: 6px; }

/* ---------- Retirar ---------- */
.lot-list { display: flex; flex-direction: column; gap: 7px; }
.lot { background: var(--card); border: 1px solid var(--card-border); border-radius: 3px; }
.lot.open { border-color: #a9bbb0; box-shadow: 0 6px 18px rgba(29,64,56,.08); }
.lot-head { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 11px 12px; }
.lot-can { font-size: 9px; background: var(--tint); border: 1px solid var(--tint-border); border-radius: 20px; padding: 4px 8px; color: var(--ink); white-space: nowrap; }
.lot-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lot-info b { font-size: 11px; font-weight: 600; }
.lot-info span { font-size: 9.5px; color: var(--ink-soft); }
.lot-n { font-size: 9px; color: var(--ink-soft); white-space: nowrap; }
.lot-n b { font-family: var(--num); font-size: 18px; color: var(--ink); }
.lot-btn { padding: 7px 11px; }
.lot-form { display: grid; grid-template-columns: 90px 1fr 1.3fr 1.6fr; gap: 10px; padding: 0 12px 12px; border-top: 1px dashed var(--card-border); padding-top: 12px; }
.lf-actions.full { grid-column: 1 / -1; margin-top: 2px; }

/* ---------- Botijão: estoque ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--card-border); margin-bottom: 14px; }
.tab { font-size: 11px; padding: 9px 12px; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tab-pane[hidden] { display: none; }
.can-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 3px; margin-bottom: 8px; }
.can-card summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; }
.can-card summary::-webkit-details-marker { display: none; }
.can-num { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--ink-soft); display: grid; place-items: center; font-family: var(--serif); font-size: 20px; color: var(--ink); }
.can-card[open] .can-num { background: var(--ink); color: #eef5ec; border-color: var(--ink); }
.can-sum b { font-size: 11.5px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.chip { font-size: 9px; background: var(--tint); border: 1px solid var(--tint-border); border-radius: 20px; padding: 2px 8px; color: var(--ink); }
.chip b { font-family: var(--mono); font-size: 8.5px; font-weight: 500; margin-left: 2px; }
.empty-chip { color: var(--muted); background: transparent; }
.can-total { font-size: 9px; color: var(--ink-soft); white-space: nowrap; }
.can-total b { font-family: var(--num); font-size: 22px; color: var(--ink); font-variant-numeric: oldstyle-nums; }
.tbl-wrap { overflow-x: auto; border-top: 1px solid var(--card-border); }
.tbl { width: 100%; border-collapse: collapse; font-size: 10px; }
.tbl th { text-align: left; font-family: var(--mono); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--card-border); white-space: nowrap; }
.tbl td { padding: 7px 10px; border-bottom: 1px solid #ebe8df; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.num { text-align: right; }
.tbl td.num { font-family: var(--num); font-weight: 700; font-size: 13px; text-align: right; }

/* ---------- Histórico ---------- */
.tab-count { font-family: var(--mono); font-size: 9px; font-weight: 500; background: var(--tint); border: 1px solid var(--tint-border); border-radius: 20px; padding: 2px 7px; margin-left: 4px; color: var(--ink); }
.tab.on .tab-count { background: var(--ink); border-color: var(--ink); color: #eef5ec; }
.hist-sum { font-size: 10px; color: var(--ink-soft); padding: 4px 2px 10px; border-bottom: 1px solid var(--card-border); }
.hist-sum b { font-family: var(--num); font-size: 16px; color: var(--ink); }
.hist { display: flex; flex-direction: column; }
.hist-row { display: grid; grid-template-columns: 82px 1fr auto; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--card-border); }
.hist-date { font-size: 9.5px; color: var(--ink-soft); }
.hist-info { display: flex; flex-direction: column; gap: 3px; }
.hist-info b { font-size: 11px; font-weight: 600; }
.hist-info span { font-size: 9.5px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.hist-row .link-btn { font-size: 9px; color: var(--muted); }

/* ---------- Edição de lotes e retiradas ---------- */
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn.sm svg { width: 12px; height: 12px; }
.tbl td.act { width: 34px; padding: 4px 8px; text-align: right; }
.tbl tr.editing td { background: var(--tint); }
.tbl tr.edit-row td { white-space: normal; padding: 0; background: #fbfaf6; }
.obs-dot { font-family: var(--mono); font-size: 7.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); border: 1px solid #b6cbe2; border-radius: 10px; padding: 1px 5px; margin-left: 4px; cursor: help; }
.edit-form { padding: 14px; border-top: 1px dashed var(--card-border); }
.ef-title { font-family: var(--serif); font-size: 17px; letter-spacing: -.01em; color: var(--ink); margin-bottom: 10px; }
.ef-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; }
.ef-wide { grid-column: span 2; }
.ef-grid > * { min-width: 0; }
.ef-grid input, .ef-grid select { width: 100%; }
.ef-hint { font-size: 8.5px; color: var(--muted); margin-top: 8px; }
.edit-form .lf-actions { margin-top: 10px; }
.hist-actions { display: flex; gap: 12px; }
.hist-row.editing { background: var(--tint); }
.hist-row .hist-edit { grid-column: 1 / -1; background: #fbfaf6; border: 1px solid var(--card-border); border-radius: 3px; margin-top: 4px; }
.hist-info[data-expand-hist] { cursor: pointer; border-radius: 3px; padding: 3px 6px; margin: -3px -6px; transition: background .15s; }
.hist-info[data-expand-hist]:hover { background: var(--tint); }
.hist-info[data-expand-hist]:focus-visible { outline: 2px solid var(--ink-soft); }
.chev { font-style: normal; display: inline-block; font-size: 10px; color: var(--muted); margin-left: 3px; transition: transform .2s; }
.chev.up { transform: rotate(180deg); }
.hist-detail { grid-column: 1 / -1; background: #fbfaf6; border: 1px solid var(--card-border); border-radius: 3px; margin-top: 4px; animation: fade .25s ease; }
.hd-title { font-size: 8px; letter-spacing: .1em; color: var(--muted); padding: 9px 10px 0; }
.hist-detail .tbl-wrap { border-top: 0; }
.tbl small.dim { color: var(--muted); font-size: 8.5px; }
.tbl tr.obs-row td { font-size: 9px; font-style: italic; color: var(--ink-soft); padding-top: 0; white-space: normal; }
.hl { border: 1px solid var(--card-border); border-radius: 3px; background: var(--card); margin-top: 8px; }
.hl.open { border-color: #a9bbb0; box-shadow: 0 6px 18px rgba(29,64,56,.07); }
.hl-head { display: grid; grid-template-columns: 1fr auto 18px; gap: 14px; align-items: center; padding: 12px 14px; cursor: pointer; border-radius: 3px; }
.hl-head:hover { background: var(--tint); }
.hl-head:focus-visible { outline: 2px solid var(--ink-soft); }
.hl-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hl-name b { font-family: var(--serif); font-weight: 400; font-size: 20px; letter-spacing: -.02em; color: var(--ink); line-height: 1.1; }
.hl-name span { font-size: 9px; color: var(--ink-soft); }
.hl-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 10px; color: var(--ink-soft); }
.hl-stats b { font-family: var(--num); font-size: 18px; color: var(--ink); font-variant-numeric: oldstyle-nums; }
.hl-sub { font-size: 9px; color: var(--muted); }
.hl-body { border-top: 1px solid var(--card-border); padding: 4px 12px 12px; animation: fade .25s ease; }
.rt { border-bottom: 1px dashed var(--card-border); padding: 10px 0; }
.rt:last-child { border-bottom: 0; padding-bottom: 0; }
.rt.editing { background: var(--tint); margin: 0 -12px; padding: 10px 12px; }
.rt-head { display: grid; grid-template-columns: 82px 1fr auto; gap: 12px; align-items: start; margin-bottom: 6px; }
.rt-date { font-size: 9.5px; color: var(--ink); padding-top: 2px; }
.rt-info { display: flex; flex-direction: column; gap: 3px; }
.rt-info b { font-size: 11px; font-weight: 600; }
.rt-info > span { font-size: 9.5px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.rt-info strong { font-weight: 600; color: var(--ink); }
.rt .tbl-wrap { border: 1px solid #ebe8df; border-radius: 3px; background: #fbfaf6; }
.rt .hist-edit { background: #fbfaf6; border: 1px solid var(--card-border); border-radius: 3px; margin-top: 8px; }
.rt .hist-actions .link-btn { font-size: 9px; color: var(--muted); }
.hist-obs { font-style: italic; color: var(--muted) !important; }

/* ---------- Fotos das linhagens ---------- */
.lc-photo {
  display: block; position: relative; width: 100%; aspect-ratio: 4 / 3; margin-bottom: 10px;
  border-radius: 3px; overflow: hidden; border: 1px solid var(--card-border); background: #e9e6dd; cursor: zoom-in;
}
.lc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.lc-photo:hover img { transform: scale(1.04); }
.zoom-ic { position: absolute; right: 5px; bottom: 5px; width: 20px; height: 20px; border-radius: 50%; background: rgba(16,48,44,.7); color: #fff; font-size: 11px; display: grid; place-items: center; }
.lc-photo.empty { cursor: pointer; border-style: dashed; background: transparent; display: grid; place-items: center; }
.lc-photo.empty span { font-family: var(--mono); font-size: 9px; color: var(--muted); letter-spacing: .06em; }
.lc-photo.empty:hover { background: var(--tint); }

.photo-field .pf-row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: start; }
.pf-preview { aspect-ratio: 4 / 3; border: 1px dashed var(--card-border); border-radius: 3px; display: grid; place-items: center; overflow: hidden; background: #fbfaf6; }
.pf-preview img { width: 100%; height: 100%; object-fit: cover; }
.pf-preview em { font-size: 9px; color: var(--muted); }
.pf-ctrl { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.pf-btns { display: flex; align-items: center; gap: 14px; }
.pf-pick { cursor: pointer; }
.pf-pick svg { width: 14px; height: 14px; }
.pf-msg { font-size: 8.5px; color: var(--muted); }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10,26,23,.88); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade .2s ease; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox figure { max-width: min(1400px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 3px; box-shadow: 0 10px 40px rgba(0,0,0,.4); cursor: default; background: #fff; }
.lightbox figcaption { color: #e9efe9; font-size: 12px; text-align: center; display: flex; flex-direction: column; gap: 3px; }
.lightbox figcaption b { font-family: var(--serif); font-weight: 400; font-size: 20px; }
.lightbox figcaption span { font-size: 10px; color: #b9cbbf; }
.lb-close { position: absolute; top: 14px; right: 18px; color: #fff; font-size: 30px; line-height: 1; width: 40px; height: 40px; }
body.no-scroll { overflow: hidden; }

/* ---------- Acesso (login) ---------- */
.login { position: fixed; inset: 0; z-index: 200; background: rgba(10,26,23,.62); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .25s ease; }
.login[hidden] { display: none; }
.login-card {
  width: min(340px, 100%); background: var(--cream); border-radius: 6px; padding: 26px 24px 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 10px; text-align: center; align-items: center;
}
.login-icon { color: var(--ink); width: 40px; height: 40px; }
.login-card h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; letter-spacing: -.03em; color: var(--ink); line-height: 1; }
.login-card p { font-size: 10.5px; color: var(--ink-soft); }
.login-card input {
  width: 100%; text-align: center; font-family: var(--mono); font-size: 20px; letter-spacing: .3em; color: var(--ink);
  background: #fbfaf6; border: 1px solid var(--card-border); border-radius: 4px; padding: 10px; outline: none; margin-top: 4px;
}
.login-card input::placeholder { letter-spacing: .05em; font-size: 14px; }
.login-card input:focus { border-color: var(--ink-soft); }
.login-card .btn-primary { width: 100%; justify-content: center; padding: 11px; }
.login-card small { font-size: 9.5px; color: var(--muted); }
.login-card small b { color: var(--ink-soft); font-weight: 600; }
.login-msg { font-size: 9.5px; color: #8b2c1f; min-height: 1px; }
.login-msg:empty { display: none; }
.shake { animation: shake .35s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.mode-pill {
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 9px; border-radius: 20px;
  font-size: 8.5px; letter-spacing: .1em; color: #e9efe9; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.05);
}
.mode-pill i { width: 6px; height: 6px; border-radius: 50%; background: #d1a54b; }
.app[data-mode="edit"] .mode-pill i { background: #8fd17a; }
.mode-pill span { color: #b9cbbf; text-transform: none; letter-spacing: .02em; }
.mode-pill:hover { background: rgba(255,255,255,.12); }

.sync-pill { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 8px; letter-spacing: .1em; color: #b9cbbf; }
.sync-pill { flex-wrap: wrap; max-width: 300px; }
.sync-err { flex-basis: 100%; font-family: var(--sans); font-size: 9.5px; letter-spacing: 0; text-transform: none; color: #f2c4b5; line-height: 1.4; margin-top: 2px; }
.sync-pill i { width: 6px; height: 6px; border-radius: 50%; background: #9fb3a6; }
.sync-pill.s-ok i { background: #8fd17a; }
.sync-pill.s-salvando i, .sync-pill.s-carregando i { background: #d1a54b; animation: pulse 1s infinite; }
.sync-pill.s-pendente i, .sync-pill.s-erro i { background: #e07a5f; }
.sync-pill.s-vazio i { background: #d1a54b; }
@keyframes pulse { 50% { opacity: .3; } }
.online-notice { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; background: #f6ead2; border: 1px solid #e6d2a8; border-radius: 4px; padding: 14px 16px; margin-bottom: 14px; color: #6b4a14; }
.online-notice[hidden] { display: none; }
.online-notice b { font-size: 12px; }
.online-notice span { font-size: 10px; }
.online-notice .btn-primary { margin-top: 4px; }

/* Modo visualização: esconde tudo que altera dados */
.locked-note { display: none; }
.app[data-mode="view"] .locked-note {
  display: flex; align-items: center; gap: 12px; margin-top: 20px; max-width: 760px;
  background: #f6ead2; border: 1px solid #e6d2a8; border-radius: 4px; padding: 14px 16px; color: #6b4a14;
}
.locked-note svg { width: 22px; height: 22px; flex: none; }
.locked-note div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.locked-note b { font-size: 12px; }
.locked-note span { font-size: 10px; }
.app[data-mode="view"] #storeForm,
.app[data-mode="view"] .view-take .lines-wrap,
.app[data-mode="view"] #btnNewLine,
.app[data-mode="view"] #btnNewPerson,
.app[data-mode="view"] .lc-actions,
.app[data-mode="view"] .lc-photo.empty,
.app[data-mode="view"] .tbl td.act,
.app[data-mode="view"] .tbl th:last-child:empty,
.app[data-mode="view"] .hist-actions,
.app[data-mode="view"] .line-form,
.app[data-mode="view"] .edit-form,
.app[data-mode="view"] #btnResetSeed,
.app[data-mode="view"] label.link-btn:has(#fileRestore) { display: none !important; }
.app[data-mode="view"] .view-bank .option[data-go="store"],
.app[data-mode="view"] .view-bank .option[data-go="take"] { opacity: .55; }

/* ================= RESPONSIVO ================= */
@media (max-width: 1100px) {
  .main { padding: 0 28px 0 40px; }
  .hero { font-size: 60px; }
}

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; min-height: 0; padding: 22px 16px 22px; }
  .brand-title { font-size: 18px; }
  .brand-icon { width: 32px; height: 32px; }
  .brand-logo { width: 64px; height: 64px; margin: -4px 0 -4px -4px; }
  .app[data-view="home"] .side { padding-bottom: 26px; }
  .chamber-wrap, .app[data-view="viab"] .chamber-wrap { flex: none; padding: 20px 0 6px; }
  .chamber { width: 220px; height: 220px; }
  .chamber-grid { inset: 32px 34px 34px 32px; gap: 4px; }
  .chamber-circle { inset: 24px; }
  .chamber-label { bottom: 14px; }
  .info-card, .app[data-view="viab"] .info-card { margin: 18px 0 0; }
  .app[data-view="plate"] .plate-wrap { flex: none; padding: 22px 0 6px; }
  .plate { width: min(280px, 100%); padding: 14px 16px; }
  .dewar-wrap { flex: none !important; padding: 18px 0 4px; }
  .dewar { width: 200px; }
  .app[data-view="lines"] .dewar-wrap, .app[data-view="people"] .dewar-wrap, .app[data-view="dewar"] .dewar-wrap, .app[data-view="take"] .dewar-wrap { display: none !important; }
  .bank-center { padding-top: 40px; }
  .line-card { grid-template-columns: 1fr auto; }
  .lc-photo { max-width: 240px; }
  .photo-field .pf-row { grid-template-columns: 1fr; }
  .pf-preview { max-width: 240px; }
  .line-card .lc-body { grid-column: 1 / -1; grid-row: 2; }
  .lf-grid { grid-template-columns: 1fr; }
  .lf-field.wide, .lf-grid .lf-field:nth-child(5), .lf-grid .lf-field:nth-child(6) { grid-column: auto; }
  .app[data-view="viab"] .side { min-height: 0; }
  .app[data-view="viab"] .chamber { width: 220px; height: 220px; }
  .app[data-view="viab"] .chamber-grid { inset: 32px 34px 34px 32px; gap: 4px; }
  .app[data-view="viab"] .chamber-circle { inset: 24px; }
  .app[data-view="viab"] .chamber-label { bottom: 14px; }
  .arcs { right: -320px; bottom: -400px; }

  .main { padding: 0 16px; }
  .view { min-height: auto; }
  .topbar { padding-top: 22px; }
  .topbar-inline { padding-top: 20px; }
  .home-center { padding-top: 48px; padding-bottom: 48px; max-width: none; }
  .hero { font-size: 48px; }
  .back { padding-top: 22px; }
  .page-title { font-size: 34px; }
  .foot { margin-top: 24px; }
}

@media (max-width: 820px) {
  .line-card.person { grid-template-columns: 1fr auto; }
  .lot-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .can-pick { grid-template-columns: repeat(3, 1fr); }
  .step { grid-template-columns: 1fr; gap: 6px; }
  .step-n { padding-top: 0; }
  .lf-field.wide2 { grid-column: auto; }
  .lot-head { grid-template-columns: auto 1fr auto; }
  .lot-head .lot-btn { grid-column: 1 / -1; justify-self: start; }
  .lot-form { grid-template-columns: 1fr; }
  .hist-row { grid-template-columns: 1fr auto; }
  .rt-head { grid-template-columns: 1fr auto; }
  .rt-date { grid-column: 1 / -1; }
  .hl-name b { font-size: 17px; }
  .hist-date { grid-column: 1 / -1; }
  .bank-stats b { font-size: 20px; }
  .ef-grid { grid-template-columns: 1fr; }
  .ef-wide { grid-column: auto; }
  .edit-form { width: calc(100vw - 34px); position: sticky; left: 0; }
  .tbl td.act { position: sticky; right: 0; background: var(--card); box-shadow: -6px 0 8px -6px rgba(29,64,56,.25); }
  .tbl tr.editing td.act { background: var(--tint); }
  .two-col { grid-template-columns: 1fr; }
  .two-col .col + .col { margin-top: 18px; }
  .field.sm .field-q { max-width: none; }
  .three-col { grid-template-columns: 1fr; }
  .mini-box { min-height: 0; }
  .plan-row { grid-template-columns: 1fr; }
  .plan-row b { text-align: left; white-space: normal; }
  .lc-body dl { grid-template-columns: 1fr; gap: 0; }
  .lc-body dt { margin-top: 6px; }
  .search { min-width: 100%; order: 3; }
  .hero { font-size: 42px; }
}

/* ---------- Unidades (mL, células, poços) ---------- */
/* a linha (sublinhado) fica no contêiner; o campo encolhe ao tamanho do número
   e a unidade aparece logo ao lado dele */
.field-line, .vol-line { display: flex; align-items: baseline; gap: 7px; border-bottom: 1px solid #b7c2bb; padding-bottom: 4px; }
.field-line:focus-within, .vol-line:focus-within { border-bottom-color: var(--ink); }
.field-line .num, .vol-line .num { flex: 0 1 auto; width: 3ch; max-width: 100%; border-bottom: 0; padding-bottom: 0; }
.field-line em:not(.u) { margin-left: auto; margin-bottom: 0; align-self: flex-end; }
.field-line em.u, .vol-line em.u {
  font-family: var(--sans); font-style: normal; font-size: 16px; font-weight: 500; letter-spacing: 0;
  color: var(--ink-soft); margin: 0; flex: none;
}
.vol-line { margin: 20px 0 6px; }
.vol-line .big-input { margin: 0; }
.unit { font-family: var(--sans); font-size: 16px; font-weight: 500; color: var(--ink-soft); letter-spacing: 0; margin-left: 3px; }

/* ---------- Logo do laboratório (NCTBio) — versão em creme, no rodapé do painel ---------- */
.lab-foot { margin-top: auto; padding-top: 24px; position: relative; z-index: 2; }
.lab-logo { display: block; width: 200px; max-width: 70%; height: auto; opacity: .92; }
.app[data-view="viab"] .lab-foot { margin-top: 0; padding-top: 0; }
.app[data-view="viab"] .info-card { margin-bottom: 26px; }
@media (max-width: 820px) {
  .lab-foot, .app[data-view="viab"] .lab-foot { padding-top: 14px; }
  .lab-logo { width: 150px; }
}

/* ---------- Excluir registro errado (edição de lote) ---------- */
.ef-danger { display: grid; grid-template-columns: 1fr 120px auto; gap: 12px; align-items: end; margin-top: 16px; padding: 12px; border: 1px dashed #e0b4aa; border-radius: 4px; background: #fbefec; }
.efd-text { display: flex; flex-direction: column; gap: 3px; }
.efd-text b { font-size: 11px; color: #8b2c1f; }
.efd-text span { font-size: 9.5px; color: #7a4a40; line-height: 1.45; }
.btn-danger { background: #a3392a; color: #fff; border-radius: 3px; padding: 10px 14px; font-size: 10.5px; font-weight: 500; white-space: nowrap; }
.btn-danger:hover { background: #8b2c1f; }
@media (max-width: 820px) { .ef-danger { grid-template-columns: 1fr; } .btn-danger { justify-self: start; } }
.app[data-mode="view"] .ef-danger { display: none !important; }

/* ================= SUBCULTURA / CRIOGENIZAÇÃO ================= */
.app[data-view="sub"] .view-sub { display: flex; animation: fade .35s ease; }
.app[data-view="sub"] .chamber-wrap { display: flex; }
.sub-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 28px; width: 100%; max-width: 1180px; margin-top: 18px; padding-bottom: 24px; align-items: start; }
.sub-col { min-width: 0; }
.sub-h { font-size: 9px; color: var(--muted); letter-spacing: .12em; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--card-border); }
.sub-block { background: var(--card); border: 1px solid var(--card-border); border-radius: 3px; padding: 14px; margin-bottom: 10px; }
.sb-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.sb-title { font-size: 12px; font-weight: 600; color: var(--ink); }
.sb-head small { font-size: 9px; color: var(--muted); }
.sb-add { margin-top: 4px; }
.sb-add svg { width: 12px; height: 12px; }

.flask { border: 1px solid var(--tint-border); background: #fbfaf6; border-radius: 3px; padding: 12px; margin-bottom: 8px; }
.fl-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.fl-name { font-family: var(--serif); font-size: 18px; color: var(--ink); letter-spacing: -.01em; }
.fl-del { margin-left: auto; font-size: 16px; line-height: 1; }
.fl-field { display: block; cursor: text; }
.fl-field .field-line { margin-top: 8px; }
.fl-res { margin-top: 10px; background: var(--tint); border: 1px solid var(--tint-border); border-radius: 2px; }
.fl-res > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--tint-border); }
.fl-res > div:last-child { border-bottom: 0; }
.fl-res span { font-size: 10.5px; color: var(--ink); line-height: 1.35; }
.fl-res > div:first-child { background: #d3e3cd; }
.fl-res > div:first-child > span { font-weight: 600; }
.fl-res b { font-family: var(--num); font-variant-numeric: oldstyle-nums; font-weight: 700; font-size: 20px; color: var(--ink); white-space: nowrap; }
.fl-res b.fl-size { font-family: var(--sans); font-size: inherit; font-weight: 700; }

.seg { display: inline-flex; border: 1px solid var(--tint-border); border-radius: 20px; overflow: hidden; background: var(--card); }
.seg button { font-size: 10px; padding: 7px 12px; color: var(--ink-soft); border-right: 1px solid var(--tint-border); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: #eef5ec; }
.seg.sm button { font-size: 9.5px; padding: 6px 10px; }

.sb-toggle { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.sb-toggle input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--ink); flex: none; }
.sb-toggle span { display: flex; flex-direction: column; gap: 2px; }
.sb-toggle b { font-size: 12px; font-weight: 600; color: var(--ink); }
.sb-toggle small { font-size: 9px; color: var(--muted); }
#cryoBox { margin-top: 12px; }
#cryoBox[hidden] { display: none; }
.cryo-cfg { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.cryo-cfg .field { margin: 0; flex: 1; min-width: 180px; min-height: 0; }
.cr-table { background: var(--tint); border: 1px solid var(--tint-border); border-radius: 2px; }
.cr-row { display: grid; grid-template-columns: 70px 1fr 1.2fr; gap: 12px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--tint-border); }
.cr-row:last-child { border-bottom: 0; }
.cr-head { font-size: 8px; letter-spacing: .08em; color: var(--muted); padding: 7px 12px; }
.cr-n { font-family: var(--serif); font-size: 17px; color: var(--ink); }
.cr-row b { font-family: var(--num); font-variant-numeric: oldstyle-nums; font-weight: 700; font-size: 17px; color: var(--ink); white-space: nowrap; }
.cr-row b small { font-family: var(--num); font-size: 10px; font-weight: 600; color: var(--ink-soft); }
.cr-in { margin: 0; }
.cr-in .num { font-size: 17px; }
.cr-note { display: block; font-size: 9px; color: var(--muted); margin-top: 6px; }
#subSummary { margin-top: 4px; }
.view-sub .field small b { color: var(--ink); }

@media (max-width: 1100px) {
  .sub-grid { grid-template-columns: 1fr; max-width: 620px; }
}
@media (max-width: 520px) {
  .cr-row { grid-template-columns: 44px 1fr 1fr; gap: 8px; }
  .fl-res > div { flex-direction: column; align-items: flex-start; gap: 4px; }
  .seg.sm button { padding: 6px 8px; }
}

/* ---------- Criotubos: meio de congelamento + armazenar ---------- */
.cryo-step { font-size: 10.5px; line-height: 1.5; color: #355b22; background: #e3efd9; border: 1px solid #bcd6aa; border-radius: 3px; padding: 10px 12px; margin-bottom: 10px; }
.cryo-step b { color: var(--ink); }
#cryoVolEq[hidden] { display: none; }
#cryoVolEq { margin-bottom: 10px; }
.store-cryo { margin-top: 14px; border-top: 1px dashed var(--card-border); padding-top: 14px; }
.sc-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.sc-head b { font-size: 12px; color: var(--ink); }
.sc-head small { font-size: 9px; color: var(--muted); }
.store-cryo .lf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.app[data-mode="view"] .store-cryo .lf-grid,
.app[data-mode="view"] .store-cryo .lf-actions { display: none; }
.app[data-mode="view"] .sc-lock { margin-top: 0; }
@media (max-width: 520px) { .store-cryo .lf-grid { grid-template-columns: 1fr; } }
.store-cryo .lf-grid .lf-field { grid-column: auto !important; }
