/* MUTE production design system — derived from the approved animated preview.
   This layer changes presentation only; call signaling and WebRTC selectors stay intact. */
:root {
  --product-bg: #080b0d;
  --product-panel: #101518;
  --product-panel-2: #141b1e;
  --product-line: #253034;
  --product-text: #eef4f1;
  --product-muted: #8d9a97;
  --product-quiet: #7f8d89;
  --product-mint: #79efc8;
  --product-mint-dim: rgba(121, 239, 200, .11);
  --product-red: #ff705f;
}

body.app-product,
body.auth-product,
body.policy-product,
body.mute-room {
  --ink: var(--product-bg);
  --panel: var(--product-panel);
  --panel-raised: var(--product-panel-2);
  --line: var(--product-line);
  --text: var(--product-text);
  --text-dim: var(--product-muted);
  --text-faint: var(--product-quiet);
  --signal: var(--product-mint);
  --signal-strong: #9af8d8;
  --signal-dim: var(--product-mint-dim);
  --signal-ink: #07140f;
  background: var(--product-bg);
  color: var(--product-text);
}

.product-kicker {
  display: block;
  margin-bottom: 10px;
  color: var(--product-mint);
  font: 700 11px/1.2 var(--mono);
  letter-spacing: .14em;
}

.product-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--product-text);
  text-decoration: none;
}
.product-brand > span:last-child { display: grid; }
.product-brand strong { font: 700 15px/1 var(--display); letter-spacing: .08em; }
.product-brand small { margin-top: 5px; color: var(--product-muted); font: 9px/1 var(--mono); }
.product-brand-mark {
  position: relative;
  width: 25px;
  height: 25px;
  border: 1px solid #56635f;
  border-radius: 50%;
}
.product-brand-mark::before,
.product-brand-mark::after {
  position: absolute;
  border-radius: 50%;
  background: var(--product-mint);
  content: "";
}
.product-brand-mark::before { width: 6px; height: 6px; inset: 9px; box-shadow: 0 0 15px rgba(121,239,200,.55); }
.product-brand-mark::after { width: 3px; height: 3px; left: 3px; top: 4px; box-shadow: 14px 12px 0 var(--product-mint); }
.product-brand-mark i { position: absolute; width: 12px; height: 1px; left: 6px; top: 11px; background: #56635f; transform: rotate(-36deg); }

/* Authenticated shell */
body.app-product > .shell { width: 254px; background: rgba(13,18,20,.985); }
body.app-product > .shell .shell-inner { padding: 28px 20px 22px; }
body.app-product > .shell .brand { padding-left: 8px; letter-spacing: .1em; }
body.app-product > .shell .brand::after { content: "BY TERRASAFE"; color: var(--product-muted); }
body.app-product > .shell .dot,
body.mute-room .brand .dot {
  position: relative;
  width: 25px;
  height: 25px;
  border: 1px solid #56635f;
  background: transparent;
  box-shadow: none;
}
body.app-product > .shell .dot::before,
body.mute-room .brand .dot::before {
  position: absolute;
  inset: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--product-mint);
  box-shadow: 0 0 14px rgba(121,239,200,.6);
  content: "";
}
body.app-product > .shell .shell-nav { flex: 0 1 auto; padding-bottom: 16px; }
body.app-product > .shell .shell-link { font-family: var(--display); font-size: 13px; }
body.app-product > .shell .shell-link[aria-current="page"] { color: var(--product-text); }
body.app-product > .shell .shell-link[aria-current="page"]::before { color: var(--product-mint); }
.shell-privacy {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--product-line);
  border-radius: 9px;
  background: rgba(121,239,200,.035);
}
.shell-privacy > span { color: var(--product-mint); font-size: 20px; }
.shell-privacy strong, .shell-privacy small { display: block; }
.shell-privacy strong { margin-top: 8px; font-size: 12px; }
.shell-privacy small { margin-top: 5px; color: var(--product-quiet); font-size: 10px; line-height: 1.5; }
body.app-product > .shell .shell-end { margin-top: 18px; }
.shell-avatar { color: var(--product-mint); font-size: 9px; text-shadow: 0 0 10px var(--product-mint); }
body.app-product > .page-dash,
body.app-product > .page-narrow,
body.app-product > .chats-page { margin-left: 254px; }
body.app-product > .page-dash main,
body.app-product > .page-narrow main,
body.app-product > .chats-page main { padding-top: 48px; }
body.app-product .dash-head { min-height: 96px; display: flex; align-items: flex-end; }
body.app-product h1 { font-size: clamp(36px,4vw,52px); }
body.app-product .dash-head h1::first-letter { color: var(--product-text); }
body.app-product .start-strip,
body.app-product .dash-section,
body.app-product .settings-card,
body.app-product .chats,
body.app-product .toolbar,
body.app-product .stat {
  border-color: var(--product-line);
  background: linear-gradient(145deg, rgba(20,28,30,.96), rgba(11,16,18,.98));
}
body.app-product .start-strip { border-color: rgba(121,239,200,.28); }
body.app-product .start-strip::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--pointer-x,82%) var(--pointer-y,12%), rgba(121,239,200,.14), transparent 34%);
  content: "";
  pointer-events: none;
}
body.app-product .segmented-options span { min-height: 51px; }
body.app-product .stat { isolation: isolate; }
body.app-product .stat::before,
body.app-product .dash-section::before,
body.app-product .settings-card::before,
body.app-product .room-card::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--pointer-x,50%) var(--pointer-y,20%), rgba(121,239,200,.10), transparent 65%);
  opacity: 0;
  transition: opacity .25s ease;
  content: "";
  pointer-events: none;
}
body.app-product .dash-section,
body.app-product .settings-card,
body.app-product .room-card { position: relative; isolation: isolate; overflow: hidden; }
body.app-product .stat:hover::before,
body.app-product .dash-section:hover::before,
body.app-product .settings-card:hover::before,
body.app-product .room-card:hover::before { opacity: 1; }
body.app-product .stat dd { color: var(--product-mint); }
body.app-product .btn-primary { background: var(--product-mint); color: #07140f; }
body.app-product .btn-primary:hover { background: #9af8d8; }

/* Login and register: same centered instrument panel as the final preview. */
body.auth-product {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(121,239,200,.08), transparent 29rem),
    var(--product-bg);
}
body.auth-product .landing {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "intro" "card";
  grid-template-rows: auto auto;
  width: min(480px, calc(100% - 32px));
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  padding: 44px 0;
  gap: 28px;
  align-content: center;
  align-items: stretch;
}
body.auth-product .landing-intro { min-height: 34px; display: flex; justify-content: center; }
body.auth-product .landing-intro > div { display: none; }
body.auth-product .landing-brand { position: relative; color: var(--product-text); }
body.auth-product .landing-brand::after { position: absolute; left: 40px; top: 27px; content: "BY TERRASAFE"; color: var(--product-muted); font: 8px var(--mono); letter-spacing: .15em; }
body.auth-product .landing-title { max-width: 500px; font-size: clamp(40px,4.5vw,64px); line-height: 1.02; letter-spacing: -.055em; }
body.auth-product .landing-title::first-line { color: var(--product-text); }
body.auth-product .landing-lede { max-width: 470px; color: var(--product-muted); font-size: 16px; line-height: 1.7; }
body.auth-product .landing-card {
  width: 100%;
  padding: 34px;
  border-color: var(--product-line);
  border-radius: 12px;
  background: rgba(16,21,24,.96);
  box-shadow: 0 32px 90px rgba(0,0,0,.42);
}
body.auth-product .landing-card::before { display: block; margin-bottom: 22px; color: var(--product-mint); font: 700 10px var(--mono); letter-spacing: .14em; content: "WELCOME TO MUTE"; }
body.auth-product .landing-card .card-title { margin-bottom: 8px; font-size: 32px; letter-spacing: -.04em; }
body.auth-product .landing-card input { min-height: 49px; border-color: #34413f; background: #0b1012; }
body.auth-product .landing-card input:focus { border-color: var(--product-mint); box-shadow: 0 0 0 3px var(--product-mint-dim), 0 0 26px rgba(121,239,200,.07); }
body.auth-product .landing-card .btn-primary { min-height: 49px; background: var(--product-mint); color: #06130f; }
body.auth-product .landing-card .btn-primary:hover { background: #9af8d8; transform: translateY(-2px); }
body.auth-product .form-footer { border-top: 1px solid var(--product-line); padding-top: 18px; }
body.auth-product .guest-hint { border-color: var(--product-line); background: rgba(121,239,200,.045); }
body.auth-product .landing-more { display: none; }
body.auth-product > .site-footer { min-height: 64px; border-top: 1px solid #18201f; color: var(--product-quiet); }
.footer-policy-links { display: inline-flex; gap: 16px; margin-left: 18px; }
.footer-policy-links a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding-block: 3px;
  color: var(--product-muted);
  font-size: 12px;
}
body.auth-product .pw-rules,
body.auth-product .pw-rules li::before { color: var(--text-dim); }
body.auth-utility {
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 0,rgba(121,239,200,.075),transparent 28rem),var(--product-bg);
}
body.auth-utility > .page { width: min(480px,calc(100% - 32px)); max-width: none; flex: 1; padding-top: 54px; }
body.auth-utility .topbar { justify-content: center; margin-bottom: 28px; }
body.auth-utility .topbar .brand { position: relative; color: var(--product-text); letter-spacing: .09em; }
body.auth-utility .topbar .brand::after { position: absolute; left: 38px; top: 28px; content: "BY TERRASAFE"; color: var(--product-muted); font: 7px var(--mono); letter-spacing: .15em; }
body.auth-utility .card { border-color: var(--product-line); border-radius: 12px; background: var(--product-panel); box-shadow: 0 30px 80px rgba(0,0,0,.38); }
body.auth-utility .card h1 { font-size: 32px; letter-spacing: -.04em; }

/* Settings */
.settings-wrap main { max-width: 1120px !important; }
.settings-heading { justify-content: space-between; gap: 20px; }
.settings-heading .btn-secondary { flex: none; }
.settings-layout { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 26px; }
.settings-nav { position: sticky; top: 26px; align-self: start; display: grid; gap: 4px; }
.settings-nav a { min-height: 42px; padding: 11px 13px; border-left: 2px solid transparent; color: var(--product-muted); font-size: 13px; }
.settings-nav a:hover, .settings-nav a[aria-current="page"] { border-color: var(--product-mint); background: var(--product-mint-dim); color: var(--product-text); text-decoration: none; }
.settings-content { display: grid; gap: 16px; }
.settings-card { padding: 28px; border: 1px solid var(--product-line); border-radius: 10px; }
.settings-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.settings-card-head h2, .danger-zone h2 { margin: 0 0 7px; font-size: 22px; }
.settings-card-head p, .danger-zone p, .photo-setting p { margin: 0; color: var(--product-muted); font-size: 13px; line-height: 1.6; }
.security-badge, .policy-status { padding: 6px 9px; border: 1px solid #315247; border-radius: 999px; background: var(--product-mint-dim); color: var(--product-mint); font: 9px var(--mono); letter-spacing: .09em; white-space: nowrap; }
.photo-setting { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 20px; padding: 20px; margin-bottom: 22px; border: 1px solid var(--product-line); border-radius: 9px; background: #0b1012; }
.profile-photo { width: 76px; height: 76px; border: 1px solid #365a50; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #1d332d; color: var(--product-mint); font: 700 20px var(--display); }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-actions { display: flex; gap: 8px; margin-top: 12px; }
.photo-actions label { display: inline-flex; margin: 0; text-transform: none; letter-spacing: 0; color: var(--product-text); cursor: pointer; }
.settings-fields.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.setting-toggle { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 0; border-bottom: 1px solid var(--product-line); text-transform: none; letter-spacing: 0; }
.setting-toggle strong, .setting-toggle small { display: block; }
.setting-toggle strong { color: var(--product-text); font: 600 14px var(--display); }
.setting-toggle small { margin-top: 4px; color: var(--product-muted); font: 12px var(--sans); }
.setting-toggle input { appearance: none; position: relative; width: 42px; height: 24px; flex: none; border: 1px solid #3a4744; border-radius: 999px; background: #27312f; }
.setting-toggle input::after { position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: #7a8581; transition: transform .22s ease, background .22s ease; content: ""; }
.setting-toggle input:checked { border-color: #397963; background: #255b4a; }
.setting-toggle input:checked::after { transform: translateX(18px); background: var(--product-mint); }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 28px; border-color: rgba(255,112,95,.25); }

/* Public policy pages */
body.policy-product { min-height: 100vh; background: radial-gradient(circle at 50% 0,rgba(121,239,200,.065),transparent 28rem),var(--product-bg); }
.policy-header, .policy-footer { width: min(1120px,calc(100% - 40px)); margin: auto; display: flex; align-items: center; justify-content: space-between; }
.policy-header { min-height: 84px; border-bottom: 1px solid #182120; }
.policy-header nav { display: flex; align-items: center; gap: 20px; }
.policy-header nav > a:not(.btn-secondary) { color: var(--product-muted); }
.policy-shell { width: min(820px,calc(100% - 40px)); margin: auto; padding: 86px 0 110px; }
.policy-heading { text-align: center; }
.policy-heading h1 { margin: 14px 0 9px; font-size: clamp(42px,6vw,64px); line-height: 1.02; letter-spacing: -.055em; }
.policy-heading p { color: var(--product-quiet); font: 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.policy-card { margin-top: 48px; padding: clamp(26px,5vw,46px); border: 1px solid var(--product-line); border-radius: 12px; background: rgba(16,21,24,.92); box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.policy-card h2 { margin-top: 22px; font-size: 29px; }
.policy-card h3 { margin-top: 30px; font-size: 18px; }
.policy-card p { color: var(--product-muted); font-size: 15px; line-height: 1.75; }
.policy-facts { display: grid; gap: 1px; margin: 28px 0; border: 1px solid var(--product-line); border-radius: 9px; overflow: hidden; background: var(--product-line); }
.policy-facts > div { padding: 20px; background: #0c1113; }
.policy-facts strong { color: var(--product-text); }
.policy-facts p { margin: 6px 0 0; font-size: 13px; }
.policy-footer { min-height: 88px; border-top: 1px solid #182120; color: var(--product-quiet); font: 10px var(--mono); }
.policy-footer a { display: inline-flex; align-items: center; min-height: 24px; padding-block: 5px; }

/* Real room/pre-join in the same visual language as the preview. */
body.mute-room .prejoin { background: radial-gradient(circle at 18% 38%,#10201c 0,transparent 35%),var(--product-bg); }
body.mute-room .prejoin > .brand { position: absolute; top: 28px; left: 32px; letter-spacing: .1em; }
body.mute-room .prejoin-card { border-color: var(--product-line); border-radius: 12px; background: var(--product-panel); box-shadow: 0 34px 90px rgba(0,0,0,.45); }
body.mute-room .prejoin-preview { background: radial-gradient(circle at 50% 35%,#21322f,#0b1012); }
body.mute-room .room-header { min-height: 66px; background: rgba(8,12,14,.96); }
body.mute-room .video-stage { background: radial-gradient(circle at 50% 42%,#202a2b,#0d1113 58%); }
body.mute-room .tile { border-color: #344042; background: radial-gradient(circle,#23322f,#111719); }
body.mute-room .control-dock { border: 1px solid var(--product-line); border-radius: 13px; background: rgba(10,14,16,.92); box-shadow: 0 20px 60px rgba(0,0,0,.44); }
body.mute-room .control-dock .icon-btn { border-color: transparent; background: #171d1f; }
body.mute-room .control-dock .icon-btn:hover { border-color: rgba(121,239,200,.45); background: #1e2a28; transform: translateY(-2px); }
body.mute-room .rail, body.mute-room .chat { background: #0f1416; border-color: var(--product-line); }
body.mute-room .call-statusbar { border-color: var(--product-line); background: #0a0e10; color: var(--product-muted); }

/* Always-on entrance/count motion. There is intentionally no motion toggle. */
.motion-ready .product-reveal { opacity: 0; transform: translateY(18px) scale(.992); }
.motion-ready.motion-entered .product-reveal { animation: product-enter .65s cubic-bezier(.2,.8,.2,1) calc(var(--reveal-index,0) * 55ms) forwards; }
.motion-ready.motion-entered body.app-product .start-strip.product-reveal {
  animation:
    product-enter .65s cubic-bezier(.2,.8,.2,1) calc(var(--reveal-index,0) * 55ms) forwards,
    product-pulse 5s ease-in-out .8s infinite;
}
@keyframes product-enter { to { opacity: 1; transform: none; } }
@keyframes product-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(121,239,200,.06); } 50% { box-shadow: 0 0 28px rgba(121,239,200,.08); } }

@media (max-width: 900px) {
  body.auth-product .landing { width: min(480px,calc(100% - 32px)); gap: 24px; padding: 30px 0; }
  body.auth-product .landing-intro { min-height: 34px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; }
  .settings-nav a { white-space: nowrap; }
}

@media (max-width: 760px) {
  body.app-product > .shell { width: 100%; }
  body.app-product > .page-dash,
  body.app-product > .page-narrow,
  body.app-product > .chats-page { margin-left: 0; }
  .shell-privacy { display: none; }
}

@media (max-width: 620px) {
  body.auth-product .landing-card { padding: 25px 20px; }
  body.auth-product .landing-title { font-size: 40px; }
  .settings-heading { align-items: flex-start !important; flex-direction: column; }
  .settings-fields.two-column { grid-template-columns: 1fr; }
  .photo-setting { grid-template-columns: 1fr; text-align: center; }
  .profile-photo { margin: auto; }
  .photo-actions { justify-content: center; }
  .settings-card { padding: 22px; }
  .settings-card-head, .danger-zone { flex-direction: column; align-items: flex-start; }
  .policy-header { min-height: 72px; }
  .policy-header nav > a:not(.btn-secondary) { display: none; }
  .policy-shell { padding: 56px 0 80px; }
}

