:root {
  --ink: #102a2c;
  --ink-soft: #3a5557;
  --sea: #0d6e6e;
  --sea-deep: #085555;
  --mint: #d9f2ef;
  --foam: #f3fbfa;
  --sand: #fff7ef;
  --coral: #e4572e;
  --coral-soft: #ffe6de;
  --line: rgba(16, 42, 44, 0.12);
  --ok: #1f7a4c;
  --shadow: 0 18px 40px rgba(8, 60, 60, 0.12);
  --radius: 18px;
  --font: "Lexend", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #b8ebe4 0%, transparent 55%),
    radial-gradient(900px 500px at 110% 10%, #ffe0d2 0%, transparent 50%),
    linear-gradient(180deg, var(--foam) 0%, #eef7f5 45%, var(--sand) 100%);
  background-attachment: fixed;
  line-height: 1.45;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

.app {
  width: min(720px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  padding: 1.25rem 1.1rem calc(1.5rem + var(--safe-bottom));
}

.screen {
  animation: rise 0.45s ease both;
}

.screen.hidden,
.hidden {
  display: none !important;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.brand,
.brand-sm {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--sea-deep);
  margin: 0;
}

.brand {
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  line-height: 1.05;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.pref-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
}

.pref-logo.hidden {
  display: none;
}

.brand-sm {
  font-size: 1.25rem;
}

.hero {
  padding-top: 1.5rem;
  max-width: 28rem;
}

.hero-title {
  font-family: var(--display);
  font-size: clamp(1.8rem, 5.5vw, 2.4rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 1rem 0 0.75rem;
  color: var(--ink);
}

.hero-lead,
.lead {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin: 0 0 1.25rem;
}

.hero-actions,
.actions,
.media-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.actions-stack {
  flex-direction: column;
}

.actions-stack .btn {
  width: 100%;
}

.action-row {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
  width: 100%;
}

.actions-stack .action-row .btn {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.btn-stacked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  text-align: center;
  line-height: 1.25;
}

.btn-title {
  font-weight: 700;
}

.btn-sub {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.85;
}

.round-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 3rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--sea-deep);
  font: inherit;
  font-weight: 700;
  font-size: 1.15rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.round-btn:hover {
  background: var(--mint);
}

.round-btn:active {
  transform: scale(0.96);
}

.libras-dot img {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
}

.help-dot[aria-expanded='true'] {
  background: var(--sea);
  border-color: var(--sea);
  color: #fff;
}

.help-note {
  margin: 0;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: var(--mint);
  color: var(--sea-deep);
  border-left: 5px solid var(--sea);
  font-size: 0.98rem;
}

.hero-visual {
  margin-top: 2rem;
  display: grid;
  place-items: center;
}

.hero-mark {
  width: min(240px, 70vw);
  filter: drop-shadow(var(--shadow));
  animation: float 5s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.step {
  margin: 0;
  font-size: 0.85rem;
  color: var(--sea);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h2 {
  font-family: var(--display);
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  margin: 0.15rem 0 0;
  line-height: 1.2;
}

.subhead {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.05rem;
}

.btn,
.chip,
.check-card,
.option-card {
  font: inherit;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.35rem;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--sea);
  color: #fff;
  box-shadow: 0 10px 24px rgba(13, 110, 110, 0.28);
}

.btn-primary:hover:not(:disabled) {
  background: var(--sea-deep);
}

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost {
  background: transparent;
  color: var(--sea-deep);
  border: 1px dashed rgba(13, 110, 110, 0.35);
}

.btn-danger-soft {
  background: var(--coral-soft);
  color: #9b2d12;
  border-radius: 14px;
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
}

.linkish {
  background: none;
  border: 0;
  color: var(--sea);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.check-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.check-card input {
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.15rem;
  accent-color: var(--sea);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 1rem 0;
}

.field label {
  font-weight: 600;
  font-size: 0.95rem;
}

.field input,
.field textarea {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: #fff;
  color: var(--ink);
}

.field select {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 2.2rem 0.9rem 1rem;
  background: #fff;
  color: var(--ink);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--sea) 50%),
    linear-gradient(135deg, var(--sea) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.option-list {
  display: grid;
  gap: 0.7rem;
  margin: 1rem 0;
}

.option-list .option-card {
  width: 100%;
  min-height: auto;
}

.option-list .meta {
  font-weight: 400;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.field textarea {
  resize: vertical;
  min-height: 6rem;
}

.body-wrap {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}

.body-map {
  width: min(220px, 55vw);
  height: auto;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 28px;
  padding: 0.75rem;
  border: 1px solid var(--line);
}

.body-part {
  fill: #9fd6d1;
  stroke: #0d6e6e;
  stroke-width: 2;
  cursor: pointer;
  transition: fill 0.15s ease, transform 0.15s ease;
}

.body-part:hover,
.body-part:focus {
  fill: #6fbfb8;
}

.body-part.is-selected {
  fill: var(--coral);
  stroke: #9b2d12;
}

.body-label {
  fill: var(--ink-soft);
  font-size: 11px;
  font-family: var(--font);
}

.choice-pill {
  background: var(--sea);
  color: #fff;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
}

.chip-grid,
.option-grid,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.option-grid-sm {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.option-card,
.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 1rem 0.85rem;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.option-card {
  min-height: 4.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.option-card .icon {
  font-size: 1.4rem;
  line-height: 1;
}

.option-card.is-selected,
.chip.is-selected {
  background: var(--mint);
  border-color: var(--sea);
  box-shadow: inset 0 0 0 1px var(--sea);
}

.chip {
  border-radius: 999px;
  padding: 0.65rem 1rem;
}

.scale {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 0.35rem;
  margin: 1rem 0 0.5rem;
}

.scale button {
  appearance: none;
  border: 0;
  border-radius: 12px;
  aspect-ratio: 1;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.scale button.is-selected {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
}

.scale-label {
  font-weight: 600;
  color: var(--ink-soft);
  min-height: 1.5rem;
}

.resumo-card {
  background: #fff;
  border-radius: 22px;
  padding: 1.35rem 1.25rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 1.2rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.understand {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
}

.understand p {
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.preview-video {
  width: 100%;
  max-height: 240px;
  border-radius: 16px;
  background: #000;
  margin-top: 0.75rem;
}

.footnote {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + var(--safe-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 0.9rem 1.2rem;
  border-radius: 14px;
  max-width: min(92vw, 420px);
  z-index: 50;
  box-shadow: var(--shadow);
  animation: rise 0.25s ease;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
}

.btn-sm {
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
}

.panel-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 820px) {
  .panel-grid {
    grid-template-columns: 0.95fr 1.05fr;
    align-items: start;
  }
}

.plantao-box {
  margin: 0.75rem 0 0.25rem;
}

.plantao-box .subhead {
  margin-top: 0.5rem;
}

.plantao-box .actions {
  margin-top: 0.65rem;
}

.online-banner {
  background: var(--mint);
  color: var(--sea-deep);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  margin: 0.75rem 0 0;
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.list-card {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}

.list-card.is-selected {
  border-color: var(--sea);
  box-shadow: inset 0 0 0 1px var(--sea);
  background: var(--mint);
}

.list-card strong {
  display: block;
  margin-bottom: 0.25rem;
}

.list-card .meta {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.badge {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--coral-soft);
  color: #9b2d12;
}

.badge-ok {
  background: #d9f3e5;
  color: var(--ok);
}

.badge-busy {
  background: #dff3f1;
  color: var(--sea-deep);
}

.confirm-box {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.confirm-title {
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.confirm-row {
  margin-bottom: 0.85rem;
}

.confirm-row > span {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 30, 32, 0.55);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 60;
}

.modal.hidden {
  display: none !important;
}

.modal-card {
  width: min(560px, 100%);
  background: var(--foam);
  border-radius: 22px;
  padding: 1.1rem 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  max-height: min(90dvh, 720px);
  overflow: auto;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.libras-stage {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b3d3d;
  min-height: 220px;
}

.libras-video {
  width: 100%;
  display: block;
  max-height: 360px;
  background: #000;
}

.libras-placeholder {
  padding: 1.5rem 1.2rem;
  color: #fff;
  text-align: center;
}

.libras-sign {
  font-family: var(--display);
  font-size: 2rem;
  letter-spacing: 0.08em;
  margin: 0 0 0.5rem;
  color: #9fe7e1;
}

.libras-placeholder #libras-texto {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.libras-placeholder .footnote {
  color: rgba(255, 255, 255, 0.75);
}

.howto {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

.howto li {
  margin-bottom: 0.45rem;
}

.ia-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 22px;
  overflow: hidden;
  background: #041c1c;
  border: 1px solid var(--line);
  margin: 0.5rem 0 0.75rem;
}

.ia-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.ia-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ia-predicao {
  font-size: clamp(1.4rem, 5vw, 2rem);
  text-align: center;
  font-family: var(--display);
  min-height: 4.5rem;
  display: grid;
  place-items: center;
}

.ia-quality {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem 0.75rem;
  align-items: center;
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: var(--muted, #5a6b6b);
}

.ia-quality-bar {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1aa6a0 var(--fill, 0%), #d6e4e3 var(--fill, 0%));
  border: 1px solid var(--line);
}

.ia-quality.is-ok .ia-quality-bar {
  background: linear-gradient(90deg, #1aa6a0 var(--fill, 0%), #9ad8d4 var(--fill, 0%));
}

.ia-quality.is-warn .ia-quality-bar {
  background: linear-gradient(90deg, #c9852a var(--fill, 0%), #d6e4e3 var(--fill, 0%));
}

.ia-correcao {
  margin: 0.75rem 0 1rem;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(26, 166, 160, 0.06);
}

#contrib-sinal {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: #fff;
  width: 100%;
}

.record-stage {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #041c1c;
  border: 1px solid var(--line);
  margin-bottom: 1rem;
}

.record-preview {
  display: block;
  width: 100%;
  max-height: 360px;
  background: #000;
  object-fit: cover;
}

.record-timer {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  margin: 0;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fila-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.call-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 22px;
  overflow: hidden;
  background: #072e2e;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin: 0.5rem 0 1rem;
}

.call-remote {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #041c1c;
}

.call-local {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  width: min(34%, 160px);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: #000;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.call-banner {
  position: fixed;
  left: 50%;
  bottom: calc(5.5rem + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(92vw, 420px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  z-index: 40;
  box-shadow: var(--shadow);
}

.call-banner p {
  margin: 0;
  font-weight: 600;
}

.call-banner.hidden {
  display: none !important;
}

@media (max-width: 480px) {
  .scale {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .action-row {
    gap: 0.45rem;
  }

  .round-btn {
    width: 2.7rem;
  }

  .option-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen,
  .hero-mark,
  .toast {
    animation: none;
  }
}
