:root {
  --bg: #03080d;
  --panel: rgba(7, 21, 29, 0.78);
  --panel-strong: rgba(8, 28, 39, 0.94);
  --line: rgba(73, 211, 236, 0.3);
  --line-hot: rgba(99, 236, 255, 0.72);
  --text: #edfaff;
  --muted: #8bb4c0;
  --cyan: #49d3ec;
  --cyan-strong: #87f1ff;
  --neon-green: #72ff9d;
  --deep-cyan: #061923;
  --amber: #49d3ec;
  --green: #26df92;
  --blue: #4aa7ff;
  --danger: #ff6b6b;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(135, 241, 255, 0.06) 1px, transparent 1px) 0 0 / 86px 86px,
    linear-gradient(rgba(135, 241, 255, 0.05) 1px, transparent 1px) 0 0 / 86px 86px,
    radial-gradient(circle at 18% 0%, rgba(73, 211, 236, 0.28), transparent 34rem),
    radial-gradient(circle at 92% 30%, rgba(114, 255, 157, 0.1), transparent 28rem),
    #03080d;
  font-family: Inter, system-ui, sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background: url("assets/brand-rn.png") center / cover no-repeat;
  opacity: 0.28;
  filter: saturate(1.1) contrast(1.16);
}

body.auth-mode::before,
body.public-mode::before {
  opacity: 0.08;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 50%, transparent 50%) 0 0 / 100% 4px,
    radial-gradient(circle at center, transparent 0, rgba(0, 0, 0, 0.72) 78%);
}

.media-backdrop {
  position: fixed;
  inset: 0;
  z-index: -3;
  display: none;
  overflow: hidden;
  background: #02070b;
}

body.auth-mode .media-backdrop,
body.public-mode .media-backdrop {
  display: block;
}

.media-backdrop video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.38;
  filter: saturate(1.15) contrast(1.18) brightness(0.78) hue-rotate(150deg);
}

.media-backdrop::before,
.media-backdrop::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
}

.media-backdrop::before {
  background:
    linear-gradient(90deg, rgba(73, 211, 236, 0.08) 1px, transparent 1px) 0 0 / 74px 74px,
    linear-gradient(rgba(73, 211, 236, 0.06) 1px, transparent 1px) 0 0 / 74px 74px,
    radial-gradient(circle at 70% 24%, rgba(135, 241, 255, 0.2), transparent 32rem),
    rgba(0, 8, 12, 0.56);
}

.media-backdrop::after {
  mix-blend-mode: screen;
  opacity: 0.42;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08) 50%, transparent 50%) 0 0 / 100% 5px,
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(73, 211, 236, 0.08) 23px, transparent 25px);
  animation: scanShift 1.9s linear infinite;
}

.hacker-rain {
  position: absolute;
  inset: 0;
  opacity: 0.34;
  background:
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(135, 241, 255, 0.18) 39px, transparent 41px),
    repeating-linear-gradient(180deg, transparent 0 28px, rgba(114, 255, 157, 0.06) 29px, transparent 31px);
  animation: rainFall 4.2s linear infinite;
}

.sound-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: none;
  min-height: 42px;
  padding: 0 16px;
  color: var(--cyan-strong);
  border: 1px solid rgba(135, 241, 255, 0.34);
  border-radius: 4px;
  background: rgba(1, 10, 15, 0.78);
  text-transform: uppercase;
  font: 700 16px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.14em;
  box-shadow: 0 0 22px rgba(73, 211, 236, 0.16);
}

body.auth-mode .sound-toggle,
body.public-mode .sound-toggle {
  display: block;
}

@keyframes scanShift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(10px);
  }
}

@keyframes rainFall {
  from {
    transform: translateY(-60px);
  }
  to {
    transform: translateY(60px);
  }
}

button,
input,
textarea,
select {
  max-width: 100%;
  min-width: 0;
  font: inherit;
}

audio {
  width: 100%;
  min-height: 36px;
}

button {
  max-width: 100%;
  cursor: pointer;
}

.app-shell {
  display: block;
  min-height: 100vh;
}

.side-rail {
  display: none;
}

.side-brand span,
.side-brand small,
.side-operator span {
  display: block;
  color: rgba(237, 250, 255, 0.44);
  text-transform: uppercase;
  font: 600 13px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.28em;
}

.side-brand strong {
  display: block;
  margin-top: 12px;
  color: var(--amber);
  text-transform: uppercase;
  font: 700 48px/0.92 "Barlow Condensed", sans-serif;
  letter-spacing: 0.1em;
}

.side-brand small {
  margin-top: 8px;
  color: var(--cyan-strong);
}

.side-operator {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid rgba(73, 211, 236, 0.16);
  border-bottom: 1px solid rgba(73, 211, 236, 0.16);
}

.side-operator b {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #05070a;
  background: var(--amber);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  font: 700 20px/1 "Barlow Condensed", sans-serif;
}

.rail-mark {
  align-self: end;
  color: rgba(135, 241, 255, 0.72);
  font: 700 22px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(73, 211, 236, 0.24);
}

.screen {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 28px clamp(18px, 4vw, 54px) 42px;
}

.is-hidden {
  display: none !important;
}

.login-view {
  display: grid;
  align-content: center;
  min-height: 100vh;
  gap: 34px;
}

body.auth-mode .brand-lockup h1,
body.public-mode .brand-lockup h1 {
  position: relative;
  animation: glitchPulse 2.8s steps(2, end) infinite;
}

body.auth-mode .brand-lockup h1::before,
body.public-mode .brand-lockup h1::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "RN";
  color: rgba(114, 255, 157, 0.34);
  transform: translate(4px, 0);
  clip-path: inset(0 0 58% 0);
}

@keyframes glitchPulse {
  0%,
  88%,
  100% {
    transform: translate(0);
    text-shadow:
      0 0 12px rgba(135, 241, 255, 0.9),
      0 0 34px rgba(73, 211, 236, 0.8);
  }
  90% {
    transform: translate(2px, -1px);
    text-shadow:
      -4px 0 rgba(114, 255, 157, 0.38),
      4px 0 rgba(73, 211, 236, 0.42);
  }
  92% {
    transform: translate(-2px, 1px);
  }
}

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  text-transform: uppercase;
  font: 600 18px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.22em;
}

.system-status span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 22px var(--green);
}

.brand-lockup {
  text-align: center;
}

.brand-kicker,
.breadcrumb,
.panel-title,
.records-head,
.metric-card span,
.metric-card small,
.search-field span,
label span,
.dialog-head span,
.filter-button {
  text-transform: uppercase;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.22em;
}

.brand-lockup h1 {
  margin: 0;
  color: #eafcff;
  text-shadow:
    0 0 12px rgba(135, 241, 255, 0.9),
    0 0 34px rgba(73, 211, 236, 0.8),
    0 0 72px rgba(114, 255, 157, 0.18);
  font: 700 clamp(92px, 18vw, 180px) / 0.85 "Barlow Condensed", sans-serif;
}

.brand-lockup p,
.hero-strip p {
  margin: 12px 0 0;
  color: var(--muted);
}

.compact-lockup h1 {
  font-size: clamp(72px, 16vw, 132px);
}

.auth-panel,
.records-panel,
.link-panel,
.controls,
.record-dialog form {
  border: 1px solid rgba(135, 241, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(6, 25, 35, 0.92), rgba(1, 8, 13, 0.88)),
    linear-gradient(90deg, rgba(114, 255, 157, 0.08), transparent);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.42),
    inset 0 0 34px rgba(73, 211, 236, 0.08),
    0 0 0 1px rgba(114, 255, 157, 0.06);
  backdrop-filter: blur(10px);
}

.auth-panel {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 5vw, 42px);
  clip-path: none;
  border-radius: 6px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 26px;
  color: var(--cyan-strong);
  border-bottom: 1px solid rgba(73, 211, 236, 0.2);
}

label {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

label span {
  color: var(--cyan);
  font-size: 18px;
}

input,
textarea,
select {
  width: 100%;
  color: var(--text);
  border: 1px solid rgba(73, 211, 236, 0.34);
  outline: 0;
  background: rgba(0, 0, 0, 0.34);
  padding: 17px 18px;
  border-radius: 0;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--cyan-strong);
  box-shadow: 0 0 0 3px rgba(73, 211, 236, 0.16);
}

.primary-button,
.ghost-button,
.filter-button {
  min-height: 52px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(135, 241, 255, 0.42);
  text-transform: uppercase;
  font: 700 22px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.18em;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease, color 160ms ease;
}

.primary-button::before,
.ghost-button::before,
.filter-button::before,
.mini-button::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, transparent, rgba(135, 241, 255, 0.18), transparent),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%);
  opacity: 0;
  transition: opacity 160ms ease;
}

.primary-button {
  width: 100%;
  color: #eaffff;
  background:
    linear-gradient(180deg, rgba(8, 52, 63, 0.94), rgba(2, 16, 22, 0.96)),
    radial-gradient(circle at 50% 0%, rgba(135, 241, 255, 0.35), transparent 60%);
  clip-path: none;
  border-radius: 5px;
  box-shadow:
    inset 0 0 0 1px rgba(114, 255, 157, 0.16),
    inset 0 -3px 0 rgba(114, 255, 157, 0.18),
    0 0 22px rgba(73, 211, 236, 0.18);
}

.primary-button:hover,
.ghost-button:hover,
.filter-button:hover,
.mini-button:hover {
  transform: translateY(-1px);
  border-color: rgba(114, 255, 157, 0.82);
  box-shadow:
    inset 0 0 0 1px rgba(135, 241, 255, 0.18),
    0 0 28px rgba(73, 211, 236, 0.22),
    0 0 18px rgba(114, 255, 157, 0.12);
}

.primary-button:hover::before,
.ghost-button:hover::before,
.filter-button:hover::before,
.mini-button:hover::before {
  opacity: 1;
}

.primary-button.compact {
  width: auto;
  min-width: 210px;
  padding: 0 34px;
}

.ghost-button {
  color: #c9f9ff;
  border-color: rgba(135, 241, 255, 0.26);
  background: rgba(2, 14, 20, 0.74);
  padding: 0 18px;
  border-radius: 5px;
}

.ghost-button.is-active {
  color: #031016;
  border-color: rgba(114, 255, 157, 0.92);
  background: linear-gradient(180deg, var(--neon-green), #33d6a1);
  box-shadow: 0 0 22px rgba(114, 255, 157, 0.2);
}

.icon-button {
  display: grid;
  place-content: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(73, 211, 236, 0.32);
  background: rgba(0, 0, 0, 0.34);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.icon-button span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--cyan);
  transition: transform 160ms ease, opacity 160ms ease;
}

.icon-button:hover,
.icon-button.is-open {
  border-color: rgba(114, 255, 157, 0.78);
  background: rgba(2, 14, 20, 0.76);
  box-shadow: 0 0 22px rgba(73, 211, 236, 0.18);
}

.icon-button.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.icon-button.is-open span:nth-child(2) {
  opacity: 0;
}

.icon-button.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  min-height: 74px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(73, 211, 236, 0.24);
}

.menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 20;
  display: grid;
  width: min(260px, calc(100vw - 32px));
  transform: translateX(calc(-100% - 14px));
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(135, 241, 255, 0.28);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(4, 21, 29, 0.98), rgba(1, 8, 13, 0.96));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45), 0 0 28px rgba(73, 211, 236, 0.16);
}

.menu-panel .ghost-button {
  width: 100%;
}

.breadcrumb {
  flex: 1;
  min-width: 0;
  color: rgba(237, 250, 255, 0.64);
  font-size: 19px;
  overflow-wrap: anywhere;
}

.hero-strip {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: end;
  padding: 36px 0 28px;
}

.hero-strip h2 {
  margin: 24px 0 0;
  color: #f8fbff;
  text-shadow: 0 0 18px rgba(73, 211, 236, 0.24);
  font: 700 clamp(46px, 6vw, 76px) / 0.9 "Barlow Condensed", sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.primary-button.compact {
  color: #031016;
  border-color: rgba(135, 241, 255, 0.82);
  background: linear-gradient(180deg, #87f1ff, #1c8fb2);
  box-shadow: 0 0 24px rgba(73, 211, 236, 0.24), inset 0 -3px 0 rgba(0, 0, 0, 0.22);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.metric-card {
  position: relative;
  min-height: 150px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(73, 211, 236, 0.26);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(73, 211, 236, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(7, 21, 26, 0.82), rgba(2, 8, 12, 0.78));
}

.metric-card::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  content: "";
  background: var(--cyan);
}

.metric-card.waiting::after {
  background: var(--amber);
}

.metric-card.review::after {
  background: var(--blue);
}

.metric-card.confirmed::after {
  background: var(--green);
}

.metric-card.links::after {
  background: linear-gradient(90deg, var(--cyan), var(--neon-green));
}

.metric-card strong {
  display: block;
  margin-top: 20px;
  color: var(--amber);
  font: 700 64px/0.8 "Barlow Condensed", sans-serif;
}

.metric-card small {
  position: absolute;
  top: 24px;
  right: 24px;
  color: rgba(237, 250, 255, 0.52);
}

.controls {
  margin-top: 18px;
  padding: 18px;
}

.search-field {
  margin-bottom: 16px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-button {
  flex: 1 1 150px;
  color: #bdeef7;
  border-color: rgba(135, 241, 255, 0.22);
  background: rgba(2, 14, 20, 0.62);
  border-radius: 5px;
}

.filter-button.is-active {
  color: #031016;
  border-color: rgba(114, 255, 157, 0.88);
  background: linear-gradient(180deg, var(--neon-green), #38deae);
}

.records-panel {
  margin-top: 18px;
}

.link-panel {
  margin-top: 18px;
}

.records-head,
.record-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 170px 250px;
  gap: 18px;
  align-items: center;
}

.link-head,
.link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 170px;
  gap: 18px;
  align-items: center;
}

.records-head {
  padding: 18px 22px;
  color: rgba(135, 241, 255, 0.86);
  border-bottom: 1px solid rgba(73, 211, 236, 0.24);
}

.registry-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 18px;
  padding: 22px 26px;
  border-top: 2px solid var(--cyan);
  border-bottom: 1px solid rgba(73, 211, 236, 0.2);
  background: linear-gradient(90deg, rgba(73, 211, 236, 0.08), transparent 46%);
  text-transform: uppercase;
}

.registry-title strong {
  color: var(--cyan-strong);
  font: 700 28px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.12em;
}

.registry-title span {
  color: rgba(237, 250, 255, 0.42);
  font: 600 13px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.28em;
}

.record-row {
  position: relative;
  min-height: 84px;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(73, 211, 236, 0.12);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.record-row:hover {
  background: rgba(73, 211, 236, 0.04);
}

.record-row.is-expanded {
  background: rgba(3, 18, 26, 0.72);
  border-color: rgba(135, 241, 255, 0.24);
  box-shadow: inset 0 0 26px rgba(73, 211, 236, 0.06);
}

.record-row.is-approved::before {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 4px;
  content: "";
  background: var(--green);
  box-shadow: 0 0 18px rgba(38, 223, 146, 0.92), 0 0 34px rgba(38, 223, 146, 0.42);
}

.link-row {
  padding: 16px 22px;
  border-bottom: 1px solid rgba(73, 211, 236, 0.12);
}

.link-row:last-child {
  border-bottom: 0;
}

.link-row strong {
  display: block;
  margin-bottom: 10px;
  font: 700 21px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.08em;
}

.copy-input {
  min-width: 0;
  padding: 11px 12px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-instruction {
  margin: -10px 0 22px;
  color: var(--muted);
  text-transform: uppercase;
  font: 600 16px/1.4 "Barlow Condensed", sans-serif;
  letter-spacing: 0.14em;
}

.audio-recorder {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
  padding: 14px;
  border: 1px solid rgba(73, 211, 236, 0.22);
  background: rgba(0, 0, 0, 0.2);
}

.audio-recorder > span {
  color: var(--cyan);
  text-transform: uppercase;
  font: 700 18px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.18em;
}

.audio-recorder p,
.audio-recorder small {
  margin: 0;
  color: var(--muted);
}

.audio-recorder audio:not(.has-audio) {
  display: none;
}

.record-row:last-child {
  border-bottom: 0;
}

.record-id,
.record-alias {
  font: 700 25px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.08em;
}

.record-alias strong {
  display: block;
  overflow-wrap: anywhere;
}

.record-hint {
  display: block;
  margin-top: 8px;
  color: rgba(237, 250, 255, 0.44);
  text-transform: uppercase;
  font: 600 12px/1 Inter, sans-serif;
  letter-spacing: 0.12em;
}

.record-id {
  color: rgba(135, 241, 255, 0.82);
}

.record-alias small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font: 500 13px/1.3 Inter, sans-serif;
  letter-spacing: 0;
}

.record-details {
  display: none;
  grid-column: 2 / -1;
  padding: 8px 0 6px;
}

.record-row.is-expanded .record-details {
  display: block;
}

.record-details dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.record-details div {
  padding: 12px;
  border: 1px solid rgba(73, 211, 236, 0.16);
  background: rgba(0, 0, 0, 0.18);
}

.record-details .detail-wide {
  grid-column: 1 / -1;
}

.record-details .detail-wide dd {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.record-details .detail-wide dd:has(audio) {
  grid-template-columns: 1fr;
}

.record-details dt {
  margin-bottom: 7px;
  color: var(--cyan);
  text-transform: uppercase;
  font: 700 14px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.16em;
}

.record-details dd {
  margin: 0;
  color: rgba(237, 250, 255, 0.78);
  font: 500 14px/1.45 Inter, sans-serif;
  overflow-wrap: anywhere;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  color: #031016;
  background: var(--cyan);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  text-transform: uppercase;
  font: 700 18px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.14em;
}

.status-cell {
  display: grid;
  gap: 10px;
  align-content: center;
  min-width: 0;
}

.ref-progress {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ref-progress span {
  color: rgba(237, 250, 255, 0.76);
  text-transform: uppercase;
  font: 700 13px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.12em;
}

.ref-progress b {
  display: block;
  height: 7px;
  overflow: hidden;
  border: 1px solid rgba(237, 250, 255, 0.14);
  background: rgba(0, 0, 0, 0.36);
}

.ref-progress i {
  display: block;
  height: 100%;
  min-width: 6px;
  box-shadow: 0 0 16px currentColor;
}

.ref-progress.empty i {
  color: var(--danger);
  background: var(--danger);
}

.ref-progress.partial i {
  color: #ffb02e;
  background: #ffb02e;
}

.ref-progress.complete i {
  color: var(--green);
  background: var(--green);
}

.ref-progress.empty span {
  color: #ff9a9a;
}

.ref-progress.partial span {
  color: #ffd18a;
}

.ref-progress.complete span {
  color: #9dffca;
}

.status-badge.aguardando {
  background: var(--amber);
}

.status-badge.referencias {
  color: var(--cyan-strong);
  border: 1px solid rgba(135, 241, 255, 0.5);
  background: rgba(2, 14, 20, 0.92);
}

.status-badge.analise {
  background: var(--blue);
}

.status-badge.confirmada {
  background: var(--green);
}

.status-badge.negada {
  background: var(--danger);
}

.empty-state {
  padding: 34px 22px;
  color: var(--muted);
}

.auth-message {
  margin: 0 0 18px;
  padding: 12px 14px;
  color: var(--green);
  border: 1px solid rgba(38, 223, 146, 0.32);
  background: rgba(38, 223, 146, 0.08);
}

.auth-message.is-error {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.34);
  background: rgba(255, 107, 107, 0.08);
}

.admin-hero {
  padding-bottom: 18px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 18px;
}

.access-panel,
.access-list-panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(6, 20, 29, 0.92), rgba(2, 8, 12, 0.82));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34), inset 0 0 34px rgba(73, 211, 236, 0.05);
  backdrop-filter: blur(10px);
}

.access-panel {
  padding: 24px;
  align-self: start;
}

.access-head,
.access-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 120px 120px 180px;
  gap: 14px;
  align-items: center;
}

.access-head {
  padding: 18px;
  color: var(--muted);
  border-bottom: 1px solid rgba(73, 211, 236, 0.18);
  text-transform: uppercase;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.18em;
}

.access-row {
  min-height: 76px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(73, 211, 236, 0.14);
}

.access-row:last-child {
  border-bottom: 0;
}

.access-row strong {
  display: block;
  font: 700 24px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.08em;
}

.access-row small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
}

.access-status {
  display: inline-flex;
  justify-content: center;
  min-width: 86px;
  padding: 8px 10px;
  color: #031016;
  border-radius: 4px;
  background: var(--neon-green);
  text-transform: uppercase;
  font: 700 16px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.12em;
}

.access-status.blocked {
  background: var(--danger);
}

.access-actions {
  display: flex;
  min-width: 0;
  gap: 8px;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  gap: 8px;
}

.mini-button {
  position: relative;
  overflow: hidden;
  min-height: 36px;
  min-width: 0;
  color: #dffcff;
  border: 1px solid rgba(135, 241, 255, 0.32);
  background: rgba(2, 14, 20, 0.72);
  padding: 0 10px;
  text-transform: uppercase;
  font: 700 15px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.1em;
  border-radius: 4px;
  overflow-wrap: anywhere;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, color 160ms ease;
}

.mini-button:disabled {
  cursor: default;
  color: rgba(237, 250, 255, 0.42);
  border-color: rgba(73, 211, 236, 0.16);
  background: rgba(0, 0, 0, 0.2);
  transform: none;
  box-shadow: none;
}

.mini-button.danger {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.34);
}

.mini-button.approve {
  color: var(--green);
  border-color: rgba(38, 223, 146, 0.44);
}

.mini-button.danger:hover {
  border-color: rgba(255, 107, 107, 0.72);
  box-shadow: 0 0 18px rgba(255, 107, 107, 0.14);
}

.danger-action {
  color: #fff;
  border-color: rgba(255, 107, 107, 0.72);
  background: linear-gradient(180deg, rgba(123, 25, 35, 0.96), rgba(48, 5, 10, 0.96));
}

.record-dialog {
  width: min(560px, calc(100% - 28px));
  color: var(--text);
  border: 0;
  padding: 0;
  background: transparent;
}

.public-form-view {
  display: grid;
  align-content: center;
  min-height: 100vh;
  gap: 28px;
}

.public-form {
  width: min(760px, 100%);
  margin: 0 auto;
}

.reference-readonly dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}

.reference-readonly div {
  padding: 12px;
  border: 1px solid rgba(73, 211, 236, 0.16);
  background: rgba(0, 0, 0, 0.18);
}

.reference-readonly dt {
  margin-bottom: 7px;
  color: var(--cyan);
  text-transform: uppercase;
  font: 700 14px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.16em;
}

.reference-readonly dd {
  margin: 0;
  color: rgba(237, 250, 255, 0.78);
  font: 500 14px/1.45 Inter, sans-serif;
  overflow-wrap: anywhere;
}

.split-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.public-ref-links {
  display: grid;
  gap: 14px;
  width: min(720px, 100%);
  margin: 24px auto 0;
  text-align: left;
}

.public-ref-links > div {
  padding: 14px;
  border: 1px solid rgba(73, 211, 236, 0.22);
  background: rgba(0, 0, 0, 0.28);
}

.public-ref-links strong {
  display: block;
  margin-bottom: 10px;
  color: var(--cyan-strong);
  text-transform: uppercase;
  font: 700 18px/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.16em;
}

.public-link-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
  align-items: stretch;
}

.public-link-copy .copy-input {
  width: 100%;
  min-width: 0;
}

.public-link-copy .mini-button {
  min-height: 40px;
  white-space: nowrap;
}

.record-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.record-dialog form {
  padding: 24px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 20px;
}

.dialog-head h3 {
  margin: 4px 0 0;
  font: 700 38px/1 "Barlow Condensed", sans-serif;
  text-transform: uppercase;
}

.close-button {
  width: 40px;
  height: 40px;
  color: var(--text);
  border: 1px solid rgba(73, 211, 236, 0.28);
  background: rgba(0, 0, 0, 0.3);
  font-size: 28px;
}

@media (max-width: 820px) {
  .sound-toggle {
    right: 12px;
    bottom: 12px;
    min-height: 38px;
    padding: 0 12px;
    font-size: 14px;
  }

  .app-shell {
    display: block;
  }

  .side-rail {
    display: none;
  }

  .screen {
    width: 100%;
    padding: 18px 12px 30px;
    overflow-x: hidden;
  }

  .login-view,
  .public-form-view {
    align-content: start;
    min-height: 100svh;
    padding-top: 24px;
  }

  .system-status {
    max-width: 100%;
    font-size: 16px;
    letter-spacing: 0.16em;
    overflow-wrap: anywhere;
  }

  .brand-lockup h1,
  .compact-lockup h1 {
    font-size: clamp(70px, 28vw, 112px);
  }

  .brand-lockup p,
  .hero-strip p {
    font-size: 15px;
    line-height: 1.35;
  }

  .hero-strip {
    display: grid;
    gap: 16px;
    padding: 26px 0 20px;
  }

  .hero-strip h2 {
    font-size: clamp(42px, 18vw, 58px);
    line-height: 0.92;
    overflow-wrap: anywhere;
  }

  .primary-button.compact {
    min-width: 0;
    width: 100%;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-card {
    min-height: 118px;
    padding: 18px;
  }

  .metric-card strong {
    margin-top: 18px;
    font-size: 52px;
  }

  .metric-card span,
  .metric-card small {
    letter-spacing: 0.14em;
  }

  .records-head {
    display: none;
  }

  .record-row {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 12px;
  }

  .status-badge,
  .status-cell,
  .record-actions {
    grid-column: 2;
    width: 100%;
  }

  .status-badge {
    width: max-content;
    max-width: 100%;
    padding: 0 12px;
    font-size: 17px;
  }

  .ref-progress {
    width: 100%;
  }

  .record-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .record-actions .mini-button,
  .access-actions .mini-button,
  .link-row .mini-button {
    width: 100%;
  }

  .record-details {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .record-details dl {
    grid-template-columns: 1fr;
  }

  .record-details .detail-wide dd {
    grid-template-columns: 1fr;
  }

  .record-details div {
    min-width: 0;
  }

  .record-details audio,
  .audio-recorder audio {
    min-width: 0;
  }

  .reference-readonly dl,
  .split-actions {
    grid-template-columns: 1fr;
  }

  .link-head {
    display: none;
  }

  .link-row {
    grid-template-columns: 1fr;
    padding: 14px 12px;
  }

  .link-row > div,
  .access-row > div {
    min-width: 0;
  }

  .public-link-copy {
    grid-template-columns: 1fr;
  }

  .topbar {
    gap: 10px;
    align-items: start;
    flex-wrap: nowrap;
  }

  .menu-panel {
    top: calc(100% + 10px);
    width: min(260px, calc(100vw - 24px));
    transform: none;
  }

  .breadcrumb {
    padding-top: 13px;
    font-size: 16px;
    letter-spacing: 0.14em;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .access-head {
    display: none;
  }

  .access-row {
    grid-template-columns: 1fr;
  }

  .access-actions {
    flex-wrap: wrap;
  }

  .panel-title {
    display: grid;
    gap: 10px;
  }

  .auth-panel,
  .controls,
  .records-panel,
  .link-panel,
  .access-panel,
  .access-list-panel {
    width: 100%;
  }

  .registry-title {
    gap: 8px;
    padding: 18px 14px;
  }

  .registry-title strong {
    font-size: 23px;
  }

  .registry-title span {
    font-size: 12px;
    letter-spacing: 0.18em;
  }
}

@media (max-width: 460px) {
  .screen {
    padding-inline: 10px;
  }

  .metrics-grid,
  .record-actions {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 108px;
  }

  .record-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .record-id,
  .record-alias {
    font-size: 22px;
  }

  .filter-button,
  .primary-button,
  .ghost-button {
    min-height: 48px;
    letter-spacing: 0.16em;
  }

  .mini-button {
    min-height: 40px;
    font-size: 14px;
    letter-spacing: 0.08em;
  }

  .controls {
    padding: 14px 12px;
  }

  .public-ref-links > div,
  .audio-recorder,
  .reference-readonly div,
  .record-details div {
    padding: 10px;
  }
}
