:root {
  color-scheme: light;
  --blue: #2c9cdb;
  --blue-dark: #096c9f;
  --gold: #ffd700;
  --pink: #ff69b4;
  --green: #25d366;
  --red: #e53935;
  --ink: #15151f;
  --paper: #fffdf7;
  --muted: #667085;
  --line: #141414;
  --shadow: 7px 7px 0 #141414;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #19afe7;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 215, 0, 0.9), transparent 22rem),
    radial-gradient(circle at 86% 18%, rgba(255, 105, 180, 0.75), transparent 20rem),
    linear-gradient(135deg, #2c9cdb 0%, #ff69b4 52%, #ffd700 100%);
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  min-height: 100dvh;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.listener-shell {
  display: grid;
  place-items: stretch center;
}

.page {
  width: min(100%, 620px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 14px;
}

.brand {
  margin: 0;
  color: #fff;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(2.15rem, 11vw, 4rem);
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow: 4px 4px 0 #15151f;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: var(--gold);
  box-shadow: 4px 4px 0 var(--line);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.panel {
  background: rgba(255, 253, 247, 0.94);
  border: 4px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.listener-card {
  min-height: calc(100dvh - 128px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(16px, 5vw, 28px);
}

.copy h2 {
  margin: 0;
  font-size: clamp(1.85rem, 9vw, 3.8rem);
  line-height: 0.98;
  font-family: "Arial Black", Impact, sans-serif;
  letter-spacing: 0;
}

.copy p {
  margin: 12px 0 0;
  color: #303347;
  font-size: clamp(1.05rem, 4.3vw, 1.25rem);
  line-height: 1.35;
}

.form-stack {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 52px;
  padding: 13px 14px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  box-shadow: 3px 3px 0 rgba(20, 20, 20, 0.35);
  font-size: 1rem;
}

.textarea {
  min-height: 84px;
  resize: vertical;
}

.bell-wrap {
  position: sticky;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 3;
  padding-top: 12px;
}

.bell-button {
  width: 100%;
  min-height: clamp(132px, 32dvh, 220px);
  border: 5px solid var(--line);
  border-radius: 999px;
  color: var(--line);
  background:
    radial-gradient(circle at 50% 32%, #fff8b0 0 16%, transparent 17%),
    linear-gradient(180deg, #ffef66 0%, #ffd700 46%, #ff69b4 100%);
  box-shadow: 0 12px 0 #9c3c73, 0 18px 0 var(--line);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(1.85rem, 11vw, 4.6rem);
  line-height: 1;
  text-transform: uppercase;
  transition: transform 120ms ease, box-shadow 120ms ease;
  touch-action: manipulation;
}

.bell-button:active {
  transform: translateY(8px);
  box-shadow: 0 4px 0 #9c3c73, 0 8px 0 var(--line);
}

.status-box {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 12px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #e8f7ff;
  font-weight: 800;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--gold);
}

.dot.live {
  background: var(--green);
  animation: pulse 1s infinite;
}

.dot.error {
  background: var(--red);
}

.notice {
  color: #303347;
  font-size: 0.95rem;
  line-height: 1.35;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.btn {
  min-height: 50px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 4px 4px 0 var(--line);
  color: var(--ink);
  font-weight: 900;
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--line);
}

.btn.primary {
  background: var(--blue);
  color: #fff;
}

.btn.good {
  background: var(--green);
}

.btn.warn {
  background: var(--gold);
}

.btn.danger {
  background: var(--red);
  color: #fff;
}

.btn.ghost {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.75);
}

.hidden {
  display: none !important;
}

.admin-page {
  width: min(100%, 1220px);
  margin: 0 auto;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(330px, 0.7fr);
  gap: 18px;
}

.admin-panel {
  padding: 16px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.admin-header h2,
.section-title {
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 1;
}

.login-card {
  width: min(100%, 460px);
  margin: 12vh auto 0;
  padding: 18px;
}

.queue {
  display: grid;
  gap: 12px;
}

.caller-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 4px 4px 0 rgba(20, 20, 20, 0.45);
}

.caller-card.active {
  background: #e9fff1;
  border-width: 4px;
}

.caller-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.caller-title {
  margin: 0;
  font-size: clamp(1.3rem, 4vw, 2.1rem);
  line-height: 1.1;
}

.caller-note {
  margin: 0;
  color: #303347;
  line-height: 1.35;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.button-row .btn {
  flex: 1 1 132px;
}

.meter {
  height: 18px;
  overflow: hidden;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: #161616;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #14d948, #ffd700 65%, #e53935);
  transition: width 90ms linear;
}

.device-stack {
  display: grid;
  gap: 12px;
}

.warning {
  padding: 10px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #fff2a6;
  font-weight: 800;
  line-height: 1.35;
}

.small {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.ticker {
  overflow: hidden;
  margin-bottom: 14px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: var(--gold);
  box-shadow: 4px 4px 0 var(--line);
}

.ticker span {
  display: inline-block;
  white-space: nowrap;
  padding: 7px 0;
  font-weight: 1000;
  text-transform: uppercase;
  animation: marquee 18s linear infinite;
}

@keyframes marquee {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.35);
  }
}

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

  .admin-header {
    display: grid;
  }
}

@media (max-width: 480px) {
  .topbar {
    align-items: flex-start;
  }

  .badge {
    max-width: 126px;
    font-size: 0.72rem;
    line-height: 1.1;
  }

  .listener-card {
    min-height: calc(100dvh - 112px);
  }

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

.meter-block {
  display: grid;
  gap: 6px;
}

.meter-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

.studio-meter {
  height: 22px;
}

.brand {
  font-size: 3.35rem;
}

.copy h2 {
  font-size: 2.65rem;
}

.copy p {
  font-size: 1.12rem;
}

.bell-button {
  font-size: 3.2rem;
}

.admin-header h2,
.section-title {
  font-size: 2.1rem;
}

.caller-title {
  font-size: 1.65rem;
}

@media (max-width: 560px) {
  :root {
    --shadow: 4px 4px 0 #141414;
  }

  body {
    background:
      radial-gradient(circle at 0% 0%, rgba(255, 215, 0, 0.76), transparent 13rem),
      radial-gradient(circle at 100% 12%, rgba(255, 105, 180, 0.65), transparent 12rem),
      linear-gradient(135deg, #2c9cdb 0%, #ff69b4 58%, #ffd700 100%);
  }

  .app-shell {
    min-height: 100svh;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .page {
    width: 100%;
  }

  .topbar {
    padding: 4px 0 8px;
    gap: 8px;
  }

  .brand {
    font-size: 2.05rem;
    line-height: 0.95;
    text-shadow: 2px 2px 0 #15151f;
  }

  .badge {
    min-height: 30px;
    max-width: none;
    padding: 5px 7px;
    border-width: 2px;
    box-shadow: 2px 2px 0 var(--line);
    font-size: 0.68rem;
  }

  .ticker {
    margin-bottom: 8px;
    border-width: 2px;
    box-shadow: 2px 2px 0 var(--line);
  }

  .ticker span {
    padding: 4px 0;
    font-size: 0.72rem;
  }

  .panel {
    border-width: 3px;
  }

  .listener-card {
    min-height: auto;
    padding: 11px;
    gap: 10px;
  }

  .copy h2 {
    font-size: 1.65rem;
    line-height: 1;
  }

  .copy p {
    margin-top: 5px;
    font-size: 0.96rem;
    line-height: 1.25;
  }

  .form-stack {
    gap: 8px;
    margin: 10px 0;
  }

  .field label {
    margin-bottom: 4px;
    font-size: 0.72rem;
  }

  .input,
  .textarea,
  .select {
    min-height: 44px;
    padding: 9px 10px;
    border-width: 2px;
    box-shadow: 2px 2px 0 rgba(20, 20, 20, 0.35);
    font-size: 1rem;
  }

  .textarea {
    min-height: 58px;
  }

  .status-box {
    gap: 5px;
    margin-top: 10px;
    padding: 8px;
    border-width: 2px;
    font-size: 0.9rem;
  }

  .notice {
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .bell-wrap {
    bottom: max(8px, env(safe-area-inset-bottom));
    padding-top: 8px;
  }

  .bell-button {
    min-height: 92px;
    border-width: 4px;
    font-size: 2rem;
    box-shadow: 0 7px 0 #9c3c73, 0 11px 0 var(--line);
  }

  .bell-button:active {
    transform: translateY(5px);
    box-shadow: 0 2px 0 #9c3c73, 0 5px 0 var(--line);
  }

  .btn {
    min-height: 44px;
    border-width: 2px;
    box-shadow: 2px 2px 0 var(--line);
    font-size: 0.94rem;
  }

  .controls {
    gap: 8px;
    margin-top: 9px;
  }
}

@media (max-width: 380px) {
  .brand {
    font-size: 1.82rem;
  }

  .copy h2 {
    font-size: 1.48rem;
  }

  .bell-button {
    min-height: 82px;
    font-size: 1.75rem;
  }
}

html,
body {
  width: 100%;
  max-width: 100%;
}

.app-shell,
.page,
.panel,
.listener-card,
.status-box,
.notice,
.status-line,
#statusText {
  min-width: 0;
}

.app-shell,
.listener-card {
  overflow-x: clip;
}

.status-box,
.notice,
#statusText {
  overflow-wrap: anywhere;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: #e8f7ff;
  font-weight: 900;
}

.toggle-row span {
  display: grid;
  gap: 2px;
}

.toggle-row small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.25;
}

.toggle-row input {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  accent-color: var(--green);
}

.call-screen {
  display: grid;
  place-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, #11131f, #25345a 55%, #2c9cdb);
  color: #fff;
  text-align: center;
  box-shadow: 4px 4px 0 var(--line);
}

.call-avatar {
  display: grid;
  place-items: center;
  width: 92px;
  aspect-ratio: 1;
  border: 4px solid #fff;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold), var(--pink));
  color: var(--line);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1.15rem;
  box-shadow: 0 0 0 4px var(--line);
}

.call-screen h2 {
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1.45rem;
  line-height: 1.05;
}

.call-screen p {
  margin: 0;
  color: #d8ecff;
  font-weight: 800;
}

.call-meters {
  display: grid;
  gap: 10px;
  width: 100%;
}

.call-screen .meter-head {
  color: #fff;
}

.call-meter {
  height: 20px;
  border-color: #fff;
}

body.in-call .status-box {
  margin-top: 10px;
}

@media (max-width: 700px) {
  .app-shell {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  .page {
    width: 100%;
    max-width: calc(100vw - 20px);
  }
}

@media (max-width: 560px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
  }

  .page {
    max-width: calc(100vw - 16px);
  }

  .panel {
    box-shadow: 2px 2px 0 var(--line);
  }

  .listener-card {
    width: 100%;
    padding: 9px;
  }

  .brand {
    font-size: 1.72rem;
    text-shadow: 2px 2px 0 #15151f;
  }

  .copy h2 {
    font-size: 1.36rem;
  }

  .copy p {
    font-size: 0.9rem;
  }

  .input,
  .textarea,
  .select {
    min-height: 40px;
    font-size: 0.95rem;
  }

  .textarea {
    min-height: 48px;
  }

  .status-line {
    align-items: flex-start;
  }

  .bell-button {
    min-height: 76px;
    font-size: 1.55rem;
  }

  .call-screen {
    margin-top: 9px;
    padding: 12px;
    gap: 9px;
  }

  .call-avatar {
    width: 72px;
    border-width: 3px;
    box-shadow: 0 0 0 3px var(--line);
    font-size: 0.95rem;
  }

  .call-screen h2 {
    font-size: 1.18rem;
  }

  .call-screen p,
  .meter-head {
    font-size: 0.78rem;
  }

  .toggle-row {
    border-width: 2px;
    padding: 8px;
  }
}

@media (max-width: 380px) {
  .brand {
    font-size: 1.55rem;
  }

  .copy h2 {
    font-size: 1.24rem;
  }

  .bell-button {
    min-height: 68px;
    font-size: 1.38rem;
  }
}


.mic-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 3px solid #fff;
  border-radius: 999px;
  color: var(--line);
  font-weight: 1000;
  box-shadow: 3px 3px 0 var(--line);
}

.mic-state.is-on {
  background: var(--green);
}

.mic-state.is-off {
  background: var(--red);
  color: #fff;
  animation: pulse 1s infinite;
}

@media (max-width: 560px) {
  .mic-state {
    min-height: 30px;
    padding: 6px 10px;
    border-width: 2px;
    font-size: 0.8rem;
  }
}

.mic-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--line);
  font-size: 0.78rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.mic-pill.is-open {
  background: var(--green);
}

.mic-pill.is-muted {
  background: var(--red);
  color: #fff;
}
