/* Clinical Editorial — shared mock tokens from DESIGN.md */
@import url("fonts/fonts.css");

:root {
  --surface-base: #fbf9f4;
  --surface-raised: #ffffff;
  --surface-sunken: #f3f0e9;
  --ink: #1f1b16;
  --ink-muted: #6b6358;
  --line: #e3ddd1;
  --accent: #2f6f6a;
  --accent-soft: #e4efed;
  --sev-minor: #b07d2b;
  --sev-moderate: #c2622d;
  --sev-major: #a23b34;
  --silence: #5b6b6e;
  --warn-bg: #fbf1dc;
  --warn-ink: #7a5a1e;
  --shadow: 0 1px 2px rgba(31, 27, 22, 0.06);
  --serif: "Source Serif 4", Newsreader, Georgia, "Times New Roman", serif;
  --sans: Inter, "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --side: 240px;
  --gutter: 32px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Author display rules (e.g. .banner { display: flex }) must not override [hidden]. */
[hidden] {
  display: none !important;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  color-scheme: light;
  scrollbar-color: var(--line) var(--surface-base);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface-base);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--accent);
}

button,
a.btn,
input,
textarea { font-family: inherit; }

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

::placeholder { color: color-mix(in srgb, var(--ink-muted) 82%, var(--surface-sunken)); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a {
  text-underline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 8;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--surface-base);
  text-decoration: none;
  transform: translateY(-120%);
}

.skip:focus {
  transform: none;
  outline-color: var(--surface-base);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  background: var(--surface-base);
  border-right: 1px solid var(--line);
  padding: 28px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  margin: 0 2px 12px;
}

.brand-mark {
  flex: none;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}

.brand em {
  display: block;
  margin-top: 4px;
  font-family: var(--sans);
  font-style: normal;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.navsec {
  margin: 18px 8px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  transition: background 180ms var(--ease);
}

.nav a svg {
  flex: none;
  opacity: 0.65;
}

.nav a:hover { background: var(--surface-sunken); }

.nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav a.active svg { opacity: 1; }

.nav a[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.side-end {
  margin-top: auto;
  padding-top: 8px;
}

.side-foot {
  padding: 14px 8px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* Account row */
.account-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 8px;
  padding: 6px 6px 6px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-raised);
}

.account-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  min-height: 32px;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 180ms var(--ease);
}

.account-link:hover { background: var(--surface-sunken); }

.account-avatar {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  flex: none;
}

.account-name {
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.account-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  flex: none;
  transition: background 180ms var(--ease), color 180ms var(--ease);
}

.account-logout:hover {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.main {
  padding: 24px var(--gutter) 56px;
  max-width: calc(1120px + var(--gutter) * 2);
}

.crumb {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--ink-muted);
}

.crumb a {
  color: inherit;
  text-decoration: none;
}

.crumb a:hover { color: var(--accent); text-decoration: underline; }

.crumb span { color: var(--ink); }

.pagehead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.pagehead h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.875rem;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 8px;
}

.pagehead .sub {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-muted);
}

.pagehead .meta {
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: none;
}

button.btn {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
}

.inline-form {
  display: inline;
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  font: 600 14px/1 var(--sans);
  cursor: pointer;
  text-decoration: none;
  transition: background 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease);
}

.btn:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }

.btn:active { background: color-mix(in srgb, var(--accent) 72%, var(--ink)); }

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn.ghost:hover { background: var(--surface-sunken); }

.btn.ghost:active { background: color-mix(in srgb, var(--surface-sunken) 70%, var(--line)); }

.btn.quiet {
  background: transparent;
  color: var(--accent);
  padding: 0 10px;
}

.btn.quiet:hover { background: var(--accent-soft); }

.btn.compact {
  min-height: 36px;
  padding: 0 12px;
}

.btn:disabled,
.btn[aria-busy="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.panel {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 20px;
}

.panel h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.limit {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 28px;
  padding: 18px 20px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: var(--radius-lg);
}

.limit svg {
  flex: none;
  margin-top: 5px;
}

.limit h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--warn-ink);
}

.limit-copy {
  margin: 0;
  max-width: 68ch;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}

.defs {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px 24px;
  margin: 0;
}

.defs dt {
  font-size: 13px;
  color: var(--ink-muted);
}

.panel-action {
  margin-top: 20px;
}

.defs dd {
  margin: 0;
}

.hist-list {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hist {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.hist:last-child { border-bottom: 0; }

.hist:hover { background: var(--surface-sunken); }

.hist:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.hist .when {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}

.hist .drugs {
  margin: 0;
  font-weight: 600;
}

.hist .meta {
  margin: 0;
  font-size: 12px;
  color: var(--ink-muted);
}

.hist .state {
  grid-row: 1 / span 3;
  align-self: center;
}

.hist.is-inert {
  pointer-events: none;
  background: var(--surface-raised);
}

.hist.is-inert:hover { background: var(--surface-raised); }

.row-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.row-tools h2 { margin: 0; }

label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
}

textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  color: var(--ink);
  padding: 12px 14px;
  font-size: 14px;
  appearance: none;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
  appearance: none;
}

textarea:hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="search"]:hover { border-color: color-mix(in srgb, var(--line) 50%, var(--ink-muted)); }

textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
  background: var(--surface-raised);
}

input[type="email"][aria-invalid="true"],
input[type="password"][aria-invalid="true"] {
  border-color: color-mix(in srgb, var(--warn-ink) 45%, var(--line));
  background: var(--warn-bg);
}

textarea {
  min-height: 112px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
}

.hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--ink-muted);
}

.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 13px;
}

.banner svg { flex: none; margin-top: 2px; }

.banner.run {
  background: var(--accent-soft);
  color: var(--ink);
}

.banner.run strong { color: var(--accent); font-weight: 600; }

.match-list {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-raised);
}

.match {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) 16px minmax(120px, 1fr) minmax(88px, auto) auto auto;
  align-items: center;
  gap: 10px 12px;
  min-height: 52px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.match:last-child { border-bottom: 0; }

.match.flag {
  grid-template-columns: minmax(110px, 0.9fr) 16px 1fr auto auto;
  background: var(--warn-bg);
}

.match.named {
  background: var(--warn-bg);
}

.com { font-weight: 600; }

.arrow { color: var(--ink-muted); text-align: center; }

.ing,
.dbid {
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.dbid { color: var(--ink-muted); }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 9999px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  white-space: nowrap;
}

.pill.confirmed {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.pill.review {
  background: var(--surface-sunken);
  color: var(--ink);
}

/* Origin pills: color is never the sole signal (icon/label text carries it).
   pill-etl = catalog source; pill-user = this user's Relação override (5.4). */
.pill.origin-etl {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.pill.origin-user {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-color: transparent;
}

.pill.etl {
  background: var(--surface-sunken);
  color: var(--ink-muted);
}

.pill.user {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.bind {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.5rem minmax(0, 1fr);
  gap: 4px 16px;
  align-items: start;
}

.bind-arrow {
  padding-top: 2.6rem;
  color: var(--ink-muted);
  text-align: center;
  font-size: 1.125rem;
}

.bind input[readonly] {
  color: var(--ink);
  background: var(--surface-raised);
}

.bind-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.bind-preview.is-ready {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.bind-preview .pair {
  margin: 0;
  font-size: 15px;
}

.bind-preview .pair .com { font-weight: 600; }

.bind-preview .pair .ing,
.bind-preview .pair .dbid {
  font-family: var(--mono);
  font-size: 13px;
}

.bind-preview .pair .dbid { color: var(--ink-muted); }

.bind-preview .wait {
  margin: 0;
  font-size: 14px;
  color: var(--ink-muted);
}

.match-actions { display: flex; gap: 6px; justify-self: end; }

.match-delete {
  display: flex;
  justify-self: end;
}

.delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--sev-major);
  cursor: pointer;
  transition: background 180ms var(--ease);
}

.delete-btn:hover {
  background: color-mix(in srgb, var(--sev-major) 10%, transparent);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
  min-height: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 8px 4px 12px;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: var(--surface-raised);
  font-size: 13px;
}

.chip.review {
  background: var(--surface-sunken);
}

.chip.origin-user {
  background: var(--warn-bg);
  border-color: color-mix(in srgb, var(--warn-ink) 25%, var(--line));
}

.chip.origin-etl {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
}

.chip-origin-note {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.chip-name { font-weight: 600; }

.chip-id {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
}

.chip-rxcui,
.combo-option .rxcui {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.combo-option .rxcui {
  margin-left: auto;
}

.chip-fix {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 6px;
}
.chip-fix:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

.chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.chip-remove:hover { background: color-mix(in srgb, var(--line) 40%, transparent); }

.limit-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin-left: auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--warn-ink);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.limit-close:hover { background: color-mix(in srgb, var(--warn-ink) 12%, transparent); }

.combo {
  position: relative;
}

.combo-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 12%, transparent);
}

.combo-option {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 44px;
}

.combo-option .com { font-weight: 600; }
.combo-option .ing { color: var(--ink-muted); font-size: 13px; }
.combo-option .dbid { font-family: var(--mono); font-size: 12px; color: var(--ink-muted); margin-left: auto; }
.combo-option.active,
.combo-option:hover { background: var(--accent-soft); }

.combo-option.origin-user {
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}

.combo-origin-note {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  margin-left: 4px;
}

.combo-empty {
  padding: 12px;
  color: var(--ink-muted);
  font-size: 13px;
}

.combo-foot {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.combo-foot a { color: var(--accent); text-decoration: none; }
.combo-foot a:hover { text-decoration: underline; }

.search-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.search-row input { flex: 1; min-width: 200px; }

.entrada-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 8px;
}

.kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-raised);
}

.matrix { margin-bottom: 8px; }

.sevhead {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 32px 0 10px;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
}

.matrix:first-of-type .sevhead { margin-top: 4px; }

.sevhead .count {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge.major { color: var(--sev-major); background: color-mix(in srgb, var(--sev-major) 12%, white); }
.badge.moderate { color: var(--sev-moderate); background: color-mix(in srgb, var(--sev-moderate) 12%, white); }
.badge.minor { color: var(--sev-minor); background: color-mix(in srgb, var(--sev-minor) 14%, white); }
.badge.silence { color: var(--silence); background: color-mix(in srgb, var(--silence) 12%, white); }
/* Internal catalog sentinel: NULL clinical severity (AD-19). The chip text
   "não classificada" is always present, so color is never the only signal
   (NFR12 / UX-DR-INC1). */
.badge.unclassified { color: var(--ink-muted); background: color-mix(in srgb, var(--ink-muted) 12%, white); }
.badge.check {
  color: var(--accent);
  background: var(--accent-soft);
}

/* CAP-5: severity chips are in-page anchors — no underline, pointer cursor,
   an explicit hover affordance, and the design system's global
   :focus-visible ring carries keyboard focus. */
a.badge { text-decoration: none; cursor: pointer; }
a.badge:hover { text-decoration: underline; text-underline-offset: 2px; }

.table-wrap {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: auto;
  box-shadow: var(--shadow);
}

table.data {
  width: 100%;
  border-collapse: collapse;
}

table.data th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-raised);
}

table.data td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.data tbody tr:last-child td { border-bottom: 0; }

table.data tbody tr:hover td { background: var(--surface-sunken); }

.pair { font-weight: 600; }

.mech { font-family: var(--mono); font-size: 13px; }

.src {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}

.src:visited { color: var(--accent); }
.src:hover { text-decoration: underline; }

/* Third-party provenance (Drogas detail matrix): the citing label belongs to
   another product, so its title is shown as plain text and the row carries a
   discreet neutral badge. No alarm color (FR-14). */
.src-title { color: var(--ink-muted); }
.src-thirdparty {
  font-size: 11px;
  color: var(--ink-muted);
  background: var(--surface-sunken);
  border-radius: 9999px;
  padding: 1px 7px;
  white-space: nowrap;
  cursor: help;
}

.date {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* Bilingual expansion renders always open (no details toggle). */
.en {
  margin-top: 8px;
  max-width: 62ch;
  font-size: 13px;
  color: var(--ink-muted);
}

.silence-row td { color: var(--silence); }

.ctx {
  margin: 32px 0 8px;
  padding: 18px 20px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-left-color: var(--accent);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  box-shadow: var(--shadow);
}

.ctx h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.125rem;
}

.ctx p { margin: 0 0 10px; max-width: 68ch; }

.ctx .disc {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-muted);
}

/* Story 11.3 (UX-DR30): AI inference section — a card family of its own,
   visually distinct from .matrix (no severity strip) and from .ctx (badged
   items). Mirrors the approved 9.4 mockup revision. */
.inference {
  margin: 32px 0 8px;
  padding: 18px 20px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-left-color: var(--accent);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  box-shadow: var(--shadow);
}

.inference h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 1.125rem;
}

.inf-list { margin: 0; padding: 0; list-style: none; }

.inf-item { margin: 0 0 12px; max-width: 68ch; }

.inf-kind {
  display: inline-block;
  margin-bottom: 4px;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--ink-muted);
  background: var(--surface);
}

.inf-kind.documented { border-color: var(--ink-muted); }

.inf-kind.inferred {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface-raised);
}

.inf-text { margin: 0; }

.inference .disc {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-muted);
}

.strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

/* Story 25.5: o trace ganha um quinto card (evidência não classificada); o
   strip do Relatório segue com 4 colunas (2 cards). */
.strip-trace {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stat {
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: start;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.stat-ico {
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}

.stat .n {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat .l {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-muted);
}

.stat.is-full {
  background: var(--warn-bg);
}

.stat.is-full .stat-ico {
  color: var(--warn-ink);
}

/* Rolling-24h consult budget: discreet thin progress bar below Observações. */
.quota {
  max-width: 520px;
  margin: 0 2px 18px;
}
.quota-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--ink-muted);
}
.quota-line svg { flex: none; color: var(--ink-muted); }
.quota-n {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.quota-l { color: var(--ink-muted); }
.quota-track {
  display: block;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 9999px;
  background: var(--surface-sunken);
  overflow: hidden;
  appearance: none;
}
.quota-track::-webkit-progress-bar {
  background: var(--surface-sunken);
  border-radius: 9999px;
}
.quota-track::-webkit-progress-value {
  background: var(--accent);
  border-radius: 9999px;
  transition: width 0.2s ease;
}
.quota-track::-moz-progress-bar {
  background: var(--accent);
  border-radius: 9999px;
}
.quota.is-full .quota-track::-webkit-progress-value { background: var(--warn-ink); }
.quota.is-full .quota-track::-moz-progress-bar { background: var(--warn-ink); }
.quota.is-full .quota-n { color: var(--warn-ink); }
.quota .banner { margin: 10px 0 0; }

.chain {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 4px 6px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  scroll-margin-top: 24px;
}

.chain.chain-target,
.chain:target {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow);
}

a.pair-trace {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

a.pair-trace:hover {
  color: var(--accent);
}

.chain summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 600;
}

.chain summary::-webkit-details-marker { display: none; }

.chain pre {
  margin: 0 14px 16px;
  padding: 12px 14px;
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-x: auto;
}

.step-ok { color: var(--accent); }

.empty {
  padding: 28px 8px 12px;
  text-align: left;
  color: var(--ink-muted);
  font-size: 14px;
}

/* Empty-state icon: replaces the former inline style attribute so the strict
   CSP (style-src 'self') holds without 'unsafe-inline'. */
.empty-ico { display: block; margin-bottom: 12px; opacity: 0.55; }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .strip { grid-template-columns: 1fr 1fr; }
  .match,
  .match.flag { grid-template-columns: 1fr; }
  .pagehead { flex-direction: column; }
  .hist { grid-template-columns: 1fr; }
  .hist .state { grid-row: auto; justify-self: start; margin-top: 8px; }
}

/* Session gate (Entrar) — paper column, not the app shell. */
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 24px 48px;
}

.gate-inner {
  width: min(100%, 26rem);
}

.gate .brand {
  margin: 0 0 36px;
}

.gate .brand-mark {
  width: 40px;
  height: 40px;
  margin-top: 0;
  border-radius: var(--radius-md);
}

.gate h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.875rem;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.gate .sub {
  margin: 0;
  max-width: 42ch;
  color: var(--ink-muted);
}

.gate form {
  margin: 28px 0 0;
}

.gate .banner {
  margin-bottom: 16px;
}

.gate .field + .field {
  margin-top: 16px;
}

.gate .btn {
  width: 100%;
  margin-top: 20px;
}

.gate-foot {
  margin: 32px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .nav a { transition: none; }
}

/* Drogas detail (Story 9.1): read-only drug identity + observed interactions.
   Identity IDs in mono, muted and smaller than the canonical name; pair cells
   show the EN name with the RXCUI alongside in small mono. */
.mono-id {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-muted);
}
.data td.pair .pair-id {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-muted);
}

/* Relatório como superfície de leitura (Story 9.4, UX-DR30): blocos de
   leitura por par não-orientado em vez de grade tabular. IDs em mono menor
   que o nome; mecanismo em texto corrido ~70ch; rodapé com Fonte + data. */
.reading-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 22px;
  margin: 0 0 14px;
  background: var(--paper, #fff);
}
.pair-head { margin: 0 0 6px; }
.pair-name {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}
.pair-ids {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-muted);
}
/* Title: compressed mechanism. Enzyme tokens use <abbr> (hover gloss). */
.mech-short {
  max-width: 70ch;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  margin: 6px 0 0;
}
.mech-short abbr.enzyme {
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: help;
}
/* Body: explicit enzyme text (no abbr). Sits below Fonte + date. */
.reading-mech {
  max-width: 70ch;
  line-height: 1.6;
  margin: 12px 0 8px;
}
.reading-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: baseline;
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 8px;
  font-size: 13px;
  color: var(--ink-muted);
}
.reading-footer .date { font-family: var(--mono); font-size: 13px; }
.reading-footer .attr { font-size: 12px; }
.reverse-note {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}
.reading-silence .silence-lead {
  max-width: 70ch;
  margin: 10px 0;
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--silence);
}
.reading-silence .silence-pairs {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 70ch;
}
.reading-silence .silence-pairs li {
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

/* Subsection template (Relatório): "Interações observadas", "Menções em bulas
   cruzadas" e "Silêncio Justificado" são três subseções pares de "Matriz de
   interações", separadas por um card de filete fino com respiro próprio —
   antes a primeira flutuava sem moldura e as outras duas eram listas soltas.
   O card agrupa, o filete delimita; nada de sombra ou cor de alarme (FR-14). */
.reading-observed,
.reading-cross-mentions,
.reading-silence {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin: 0 0 18px;
}
/* O sevhead de grupo é o título visível da subseção; o primeiro grupo de
   severidade logo abaixo não repete o respiro grande. */
.reading-observed > .sevhead,
.reading-cross-mentions > .sevhead,
.reading-silence > .sevhead { margin-top: 0; }
.reading-observed .matrix { margin-bottom: 0; }
.reading-observed .matrix:first-of-type .sevhead { margin-top: 20px; }

/* CAP-1: "Menções em bulas cruzadas" — menções narrativas que as bulas de
   dois medicamentos confirmados cruzam. Mesma tipografia de seção do silêncio
   e da evidência não classificada (UX-DR17), lista compacta com a sentença da
   bula + Fonte + data + Ver Trace. Sem badge/chip/valor de severidade
   (AD-19), sem estilo de alarme. */
/* O sevhead é o título da subseção: o `.unc-title` dentro dele apenas normaliza
   o h2 para herdar a face e o corpo do sevhead (sem o h2 default do browser). */
.reading-observed .unc-title,
.reading-cross-mentions .unc-title {
  margin: 0;
  font: inherit;
}
.reading-cross-mentions .unclassified-lead {
  max-width: 70ch;
  margin: 10px 0;
}
/* Legenda dos canais: decodifica os dois chips sem exigir hover. */
.reading-cross-mentions .cm-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--ink-muted);
}
.reading-cross-mentions .cm-legend .chip { cursor: default; }
.reading-cross-mentions .cm-legend .legend-sep { color: var(--line); }
.reading-cross-mentions .unclassified-pairs {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 78ch;
}
/* Cada menção é um bloco de três linhas: par, metadados, citação — o olho não
   precisa desembaraçar uma linha flex única que quebra em vários pontos. */
.reading-cross-mentions .unclassified-pairs li {
  display: block;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.reading-cross-mentions .unclassified-pairs li:first-child { border-top: 0; padding-top: 0; }
.reading-cross-mentions .cm-pair {
  margin: 0;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.reading-cross-mentions .cm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}
.reading-cross-mentions .cm-quote {
  max-width: 74ch;
  margin: 8px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--line);
  color: var(--ink);
}
/* Channel chip (CAP-1): the compact label stands in for the full sentence,
   shown on hover. It is a provenance/label chip, never a severity chip
   (AD-19): neutral line + surface, no severity color, no alarm styling. */
.reading-cross-mentions .cm-chip {
  min-height: 22px;
  padding: 1px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-muted);
  background: var(--surface-sunken);
  border-color: var(--line);
  cursor: help;
}
/* Channel distinction: co-mention (same passage) uses the brand accent-soft,
   distinct from the neutral ddi chip. This is a channel label, never a
   severity color (AD-19) and never alarm styling. */
.reading-cross-mentions .cm-chip.cm-comention {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
}
.reading-cross-mentions span.cm-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.reading-cross-mentions .pair-trace { margin-left: auto; white-space: nowrap; }
.reading-cross-mentions a:not(.pair-trace) {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
  text-underline-offset: 3px;
}
.reading-cross-mentions a:not(.pair-trace):hover { text-decoration-color: currentColor; }
.reading-cross-mentions a:not(.pair-trace):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Story 9.5 (UX-DR29/DR30): nomes no par linkam ao detalhe /drogas/{rxcui}
   (mesma aba). O link herda a serif do h3; foco visível (NFR12). */
.pair-name a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
}
.pair-name a:hover { text-decoration-color: currentColor; }
.pair-name a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
/* Story 9.5/9.6 (refinamento): nomes do silêncio com sublinhado discreto
   (mesmo padrão do .pair-name) e "Ver Trace" alinhado à direita da linha. */
.silence-pairs a:not(.pair-trace) {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
  text-underline-offset: 3px;
}
.silence-pairs a:not(.pair-trace):hover { text-decoration-color: currentColor; }
.silence-pairs a:not(.pair-trace):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.silence-pairs li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}
.silence-pairs .pair-trace { margin-left: auto; white-space: nowrap; }

/* Story 9.6 (UX-DR29/NFR12): convenção única de RXCUI clicável. O link herda
   o mono e o tamanho do contexto; hit-area com padding e foco em accent. */
a.drug-id-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
  text-underline-offset: 3px;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: 3px;
}
a.drug-id-link:hover { text-decoration-color: currentColor; }
a.drug-id-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Detalhe do fármaco: lista de bulas de referência (DailyMed). */
.doc-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  max-width: 70ch;
}
.doc-list li {
  padding: 8px 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}
.doc-list .doc-title { font-size: 14px; }
.doc-list .date { font-family: var(--mono); font-size: 13px; color: var(--ink-muted); }

/* Detalhe do fármaco — "Menções nas bulas": a aba mais densa de texto vira
   uma lista de artigos. Cada menção tem cabeçalho com o medicamento citado
   (nome serifado + RXCUI mono) e corpo com a frase da bula em citação
   recuada; Fonte e data formam um rodapé mono discreto. Sem badge, chip ou
   valor de severidade (AD-19) e sem estilo de alarme. */
.unclassified-list li {
  display: block;
  padding: 14px 0;
}
.unclassified-list li:first-child { border-top: 0; padding-top: 4px; }
.unclassified-list .unc-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  margin: 0 0 6px;
}
.unclassified-list .unc-head .doc-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.unclassified-list .pair-id {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-muted);
}
.unclassified-list .unc-evidence {
  display: block;
  max-width: 74ch;
  margin: 0 0 6px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
  color: var(--ink);
}
.unclassified-list .unc-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  font-size: 13px;
  color: var(--ink-muted);
}

/* Detalhe do fármaco: histórico de bulas (CAP-4) — um grupo por doc-title. */
.doc-group { margin-top: 18px; }
.doc-group:first-child { margin-top: 0; }
.doc-group h2.doc-title {
  margin: 0;
  font-size: 1rem;
}

/* Detalhe do fármaco: painel "Interações observadas" com chips de
   severidade no head (badge palette, contagem à direita). */
.matrix-panel .int-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 10px;
}
.matrix-panel .int-head h2 { margin: 0; }
.sev-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sev-chips .badge .n {
  font-family: var(--mono);
  font-weight: 700;
  margin-left: 2px;
}
.matrix-panel .sevblock .sevhead { margin-top: 20px; scroll-margin-top: 24px; }
/* CAP-5: the landed severity group is visibly confirmed after a chip click
   (same :target affordance family as .chain:target). */
.matrix-panel .sevhead:target {
  background: var(--accent-soft);
  border-radius: 6px;
  box-shadow: 0 0 0 6px var(--accent-soft);
}
.matrix-panel .sevblock:first-of-type .sevhead { margin-top: 14px; }

/* Detalhe do fármaco: abas (CAP-1). CSS-only — radios nativos, sem script.
   Os painéis ficam escondidos por padrão; o radio marcado revela o seu painel
   e o anel de foco acompanha o label do radio focado. As chaves
   mencoes|interacoes|bulas espelham drogasTabKeys (drogas.go); o teste de
   contrato em drogas_tabs_css_test.go prende os dois lados. */
.tabs .tab-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.tab-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 18px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab-panel { display: none; }

/* Estado vazio dentro de um painel de aba: o painel já é a moldura branca,
   então o vazio respira sem o padding de topo herdado do .panel. O ícone vira
   bloco (não inline) e os parágrafos perdem a margem default do browser, para
   o bloco ficar coeso em vez de esparramado. */
.tab-panel .empty { padding: 12px 0 4px; }
.tab-panel .empty svg { display: block; }
.tab-panel .empty p { margin: 0; }
.tab-panel .empty p + p { margin-top: 4px; }
#drogas-tab-mencoes:checked ~ .tab-menu label[for="drogas-tab-mencoes"],
#drogas-tab-interacoes:checked ~ .tab-menu label[for="drogas-tab-interacoes"],
#drogas-tab-bulas:checked ~ .tab-menu label[for="drogas-tab-bulas"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
#drogas-tab-mencoes:focus-visible ~ .tab-menu label[for="drogas-tab-mencoes"],
#drogas-tab-interacoes:focus-visible ~ .tab-menu label[for="drogas-tab-interacoes"],
#drogas-tab-bulas:focus-visible ~ .tab-menu label[for="drogas-tab-bulas"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#drogas-tab-mencoes:checked ~ #drogas-panel-mencoes,
#drogas-tab-interacoes:checked ~ #drogas-panel-interacoes,
#drogas-tab-bulas:checked ~ #drogas-panel-bulas { display: block; }

/* Settings — password panel (Story 10.4/10.5 review fixes). */
.pw { position: relative; }
.pw input[type="password"],
.pw input[type="text"] { padding-right: 46px; }
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}
.pw-toggle:hover { background: var(--surface-raised); color: var(--ink); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pw-toggle .pw-eye-off { display: none; }
.pw-toggle.is-on .pw-eye { display: none; }
.pw-toggle.is-on .pw-eye-off { display: inline; }
#senha-form .btn { margin-top: 12px; }
#senha-form .field { margin-bottom: 18px; }
#senha-form .banner { margin-top: 0; }
