/* Madifyx Clips: design tokens taken from the Madifyx logo and madifyx.com */
:root {
  --bg: #07080D;            /* deeper than the logo tile, so cards can sit on it */
  --bg-2: #0A0B12;
  --surface: #0F111A;       /* close to the logo tile #0D0D1A */
  --surface-2: #151826;
  --surface-3: #1B1F2F;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --ink: #F4F6FA;
  --ink-2: #B4BBC8;
  --muted: #7D8597;
  --brand: #00C3FF;         /* madifyx.com primary */
  --brand-2: #00C8D7;       /* logo teal */
  --brand-ink: #5AD8FF;
  --brand-soft: rgba(0, 195, 255, .12);
  --brand-glow: rgba(0, 195, 255, .35);
  --on-brand: #021018;
  --rec: #FF4D5E;
  --rec-soft: rgba(255, 77, 94, .14);
  --ok: #2FD58A;
  --warn: #F7B955;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --shadow-pop: 0 0 0 1px rgba(255, 255, 255, .06), 0 24px 60px rgba(0, 0, 0, .55);
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
/* Faint brand glow and grid behind everything */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 480px at 78% -8%, rgba(0, 195, 255, .13), transparent 62%),
    radial-gradient(700px 420px at -10% 110%, rgba(0, 200, 215, .07), transparent 60%);
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 70% 0%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 0%, #000 0%, transparent 70%);
}
::selection { background: rgba(0, 195, 255, .35); color: #fff; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.025em; margin: 0; }
h1 { font-size: 30px; line-height: 1.12; }
h2 { font-size: 18px; line-height: 1.25; letter-spacing: -0.015em; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- logo (the real Madifyx mark) ---------- */
.logo { display: inline-flex; align-items: center; gap: 11px; }
.logo img { width: 34px; height: 34px; border-radius: 9px; display: block; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 6px 20px rgba(0, 200, 215, .18); }
.logo .wm { display: flex; flex-direction: column; line-height: 1; }
.logo .wm b { font-weight: 800; font-size: 17px; letter-spacing: .02em; color: #fff; }
.logo .wm small { font-size: 9.5px; font-weight: 600; letter-spacing: .32em; color: var(--brand); margin-top: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .03); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .2s, transform .05s;
}
.btn:hover { border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: transparent; color: var(--on-brand); box-shadow: 0 0 0 1px rgba(0, 195, 255, .4), 0 8px 24px -8px var(--brand-glow); }
.btn.primary:hover { background: #2BCEFF; box-shadow: 0 0 0 1px rgba(0, 195, 255, .6), 0 10px 30px -6px var(--brand-glow); }
.btn.dark { background: var(--surface-3); border-color: var(--line-2); color: var(--ink); }
.btn.dark:hover { background: #232839; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, .06); }
.btn.danger-text { color: #FF7A86; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.icon { width: 36px; padding: 0; }
.btn.block { width: 100%; }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .03); color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s;
}
select.input option { background: var(--surface-2); color: var(--ink); }
textarea.input { height: auto; min-height: 80px; padding: 10px 13px; resize: vertical; line-height: 1.45; }
.input:hover { border-color: rgba(255, 255, 255, .18); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: rgba(0, 195, 255, .03); }
.input::placeholder { color: #5E6577; }
input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--surface-2) inset; -webkit-text-fill-color: var(--ink); }

/* ---------- app shell (Loom style: slim icon rail + top bar) ---------- */
.shell { display: grid; grid-template-columns: 76px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 18px 0; background: rgba(10, 11, 18, .8); border-right: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.rail-logo img { width: 40px; height: 40px; border-radius: 11px; display: block; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 6px 20px rgba(0, 200, 215, .2); }
.rail-nav { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding-top: 10px; }
.rail-nav a { position: relative; width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: var(--muted); transition: background .15s, color .15s; }
.rail-nav a svg.i { width: 21px; height: 21px; }
.rail-nav a span { display: none; }
.rail-nav a:hover { background: rgba(255, 255, 255, .06); color: var(--ink); }
.rail-nav a.active { background: rgba(0, 195, 255, .14); color: var(--brand); box-shadow: inset 0 0 0 1px rgba(0, 195, 255, .3); }
/* Record button sits at the bottom of the rail, like Loom */
.rail-rec { order: 9; margin-top: auto; width: 50px; height: 50px; border-radius: 15px; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--on-brand);
  background: linear-gradient(135deg, #22D3FF, var(--brand) 50%, var(--brand-2)); box-shadow: 0 0 0 1px rgba(0, 195, 255, .45), 0 10px 26px -8px rgba(0, 195, 255, .8), inset 0 1px 0 rgba(255, 255, 255, .35); position: relative; }
.rail-rec svg.i { width: 23px; height: 23px; stroke-width: 2; }
.rail-rec:hover { filter: brightness(1.08); }
[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); white-space: nowrap; padding: 6px 10px; border-radius: 8px; background: var(--surface-3); color: #fff; font-size: 12.5px; font-weight: 500; box-shadow: var(--shadow-pop); pointer-events: none; z-index: 40; }

.main { min-width: 0; padding: 0 44px 72px; }
.appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; margin: 0 -44px 30px; padding: 16px 44px; background: rgba(7, 8, 13, .78); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.top-logo { display: none; }
.top-logo img { width: 34px; height: 34px; border-radius: 9px; display: block; }
.tsearch { position: relative; flex: 1; max-width: 680px; margin: 0 auto; }
.tsearch svg.i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.tsearch input { width: 100%; height: 44px; padding: 0 16px 0 44px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s, background .15s; }
.tsearch input::placeholder { color: #6A7183; }
.tsearch input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: rgba(0, 195, 255, .03); }
.tright { display: flex; align-items: center; gap: 12px; }
.newv { height: 42px; }
.newv .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rec); box-shadow: 0 0 0 2px rgba(255, 255, 255, .6); }
.avwrap { position: relative; }
.avbtn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; display: flex; }
.avbtn .avatar { width: 40px; height: 40px; font-size: 14px; }
.avmenu { right: 0; top: 50px; min-width: 250px; }
.avhead { display: flex; align-items: center; gap: 11px; padding: 10px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.avhead .nm { font-weight: 600; }
.avhead .em { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .sub { margin-top: 7px; color: var(--muted); }
.lib-head { margin-bottom: 14px; }

/* Tabs under the page title */
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.tabs button { position: relative; border: 0; background: none; padding: 0 0 13px; color: var(--muted); font-weight: 600; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-pressed="true"] { color: #fff; }
.tabs button[aria-pressed="true"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); box-shadow: 0 0 10px var(--brand); }
.tcount { font: 600 12px var(--mono); padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .07); color: var(--ink-2); }
.tcount:empty { display: none; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12.5px; color: #fff; background: var(--surface-3);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px rgba(255, 255, 255, .1);
}
.avatar.lg { width: 40px; height: 40px; font-size: 14.5px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; box-shadow: none; }

@media (max-width: 860px) {
  /* Phones: the rail becomes a bottom tab bar with the record button in the middle */
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; justify-content: center; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: rgba(10, 11, 18, .92); }
  .rail-logo { display: none; }
  .rail-nav { flex-direction: row; justify-content: space-around; padding: 0; max-width: 420px; }
  .rail-nav a { flex-direction: column; gap: 3px; width: 76px; height: 52px; font-size: 11px; font-weight: 500; }
  .rail-nav a span { display: block; }
  .rail-nav a.active { background: none; box-shadow: none; }
  .rail-rec { order: 0; margin: -22px 0 0; width: 58px; height: 58px; border-radius: 50%; }
  [data-tip]:hover::after { display: none; }
  .main { padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
  .appbar { margin: 0 -16px 22px; padding: 10px 16px; gap: 10px; }
  .top-logo { display: block; }
  .tsearch input { height: 40px; }
  .newv { display: none; }
  .avbtn .avatar { width: 36px; height: 36px; }
  h1 { font-size: 25px; }
  .recbar, .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .live:not(.hidden) + .recbar { bottom: calc(24px + env(safe-area-inset-bottom)); }
}
}

/* ---------- segmented control ---------- */
.seg { display: inline-flex; padding: 3px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 11px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 13px; border-radius: 8px; font-weight: 500; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: #fff; box-shadow: 0 0 0 1px var(--line-2); }

/* ---------- stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: 30px; }
.stat { background: rgba(15, 17, 26, .85); padding: 16px 18px; }
.stat .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.stat .k svg.i { width: 15px; height: 15px; color: var(--brand); }
.stat .v { font-family: var(--mono); font-size: 24px; font-weight: 600; margin-top: 6px; letter-spacing: -0.02em; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat .v { font-size: 20px; } }

/* ---------- library grid ---------- */
.lib-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.search .input { padding-left: 36px; width: 250px; height: 38px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 30px 22px; }
.vid { position: relative; display: flex; flex-direction: column; gap: 11px; }
.vid .thumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--surface-2); display: block;
  box-shadow: 0 0 0 1px var(--line); transition: box-shadow .25s, transform .25s;
}
.vid:hover .thumb { box-shadow: 0 0 0 1px rgba(0, 195, 255, .55), 0 18px 40px -16px rgba(0, 195, 255, .45); transform: translateY(-2px); }
.vid .thumb img, .vid .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vid .thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .55)); pointer-events: none; }
.vid .play { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px; border-radius: 50%; z-index: 1; display: flex; align-items: center; justify-content: center; background: rgba(7, 8, 13, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); opacity: 0; transform: scale(.9); transition: opacity .2s, transform .2s; color: #fff; }
.vid .play svg.i { width: 18px; height: 18px; fill: #fff; stroke: none; margin-left: 2px; }
.vid:hover .play { opacity: 1; transform: none; }
.vid .dur { position: absolute; left: 9px; bottom: 9px; z-index: 1; background: rgba(7, 8, 13, .72); color: #fff; font: 600 11.5px var(--mono); padding: 3px 7px; border-radius: 6px; backdrop-filter: blur(6px); }
.vid .proc { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; font-size: 13px; font-weight: 500; background: rgba(7, 8, 13, .6); backdrop-filter: blur(3px); }
.vid .proc::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.vid .tools { position: absolute; top: 9px; right: 9px; z-index: 2; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.vid:hover .tools, .vid:focus-within .tools { opacity: 1; }
.vid .tools .btn { height: 32px; background: rgba(7, 8, 13, .7); border-color: rgba(255, 255, 255, .14); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.vid .tools .btn:hover { border-color: var(--brand); }
.vid .t { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vid .t:hover { color: var(--brand-ink); }
.vid .meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.vid .meta .by { color: var(--ink-2); font-weight: 500; }
.vid .meta .stat-i { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 12px; }
.vid .meta .stat-i:first-of-type { margin-left: auto; }
.vid .meta svg.i { width: 14px; height: 14px; }
@media (hover: none) { .vid .tools { opacity: 1; } .vid .tools .btn.sm:first-child { width: 32px; padding: 0; font-size: 0; gap: 0; } }

.menu { position: absolute; z-index: 30; min-width: 180px; padding: 6px; background: rgba(21, 24, 38, .96); border: 1px solid var(--line-2); border-radius: 13px; box-shadow: var(--shadow-pop); backdrop-filter: blur(14px); }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: 8px; font-size: 14px; cursor: pointer; text-align: left; color: var(--ink); }
.menu button:hover, .menu a:hover { background: rgba(255, 255, 255, .06); }
.menu .danger { color: #FF7A86; }

.empty { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 76px 20px; border: 1px solid var(--line); border-radius: 20px; background: radial-gradient(500px 240px at 50% 0%, rgba(0, 195, 255, .1), transparent 70%), rgba(15, 17, 26, .6); }
.empty h2 { margin-top: 20px; font-size: 24px; }
.empty p { color: var(--muted); max-width: 400px; margin: 8px 0 24px; }
.bigdot { position: relative; width: 76px; height: 76px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(0, 195, 255, .08); box-shadow: 0 0 0 1px rgba(0, 195, 255, .3); }
.bigdot::before { content: ''; position: absolute; inset: -12px; border-radius: 50%; border: 1px solid rgba(0, 195, 255, .18); }
.bigdot::after { content: ''; width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #7BE6FF, var(--brand) 55%, var(--brand-2)); box-shadow: 0 0 24px var(--brand-glow); }

/* ---------- dialogs ---------- */
dialog { border: 0; padding: 0; border-radius: 22px; background: linear-gradient(180deg, #141726, #0E1019); color: var(--ink); box-shadow: var(--shadow-pop), inset 0 1px 0 rgba(255, 255, 255, .06); width: min(540px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(3, 4, 8, .7); backdrop-filter: blur(6px); }
dialog[open] { animation: pop .2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 0; }
.dlg-body { padding: 18px 24px 24px; }

/* ---------- recorder ---------- */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 15px 8px 13px; border: 1px solid var(--line-2); border-radius: 15px; background: rgba(255, 255, 255, .02); cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); transition: border-color .15s, background .15s, box-shadow .2s; }
.mode:hover { border-color: rgba(255, 255, 255, .2); color: var(--ink); }
.mode[aria-pressed="true"] { border-color: rgba(0, 195, 255, .7); background: rgba(0, 195, 255, .08); color: #fff; box-shadow: 0 0 0 1px rgba(0, 195, 255, .35), 0 10px 30px -14px var(--brand-glow); }
.mode[aria-pressed="true"] svg { color: var(--brand); }
.mode svg.i { width: 24px; height: 24px; }
.stage { margin: 18px 0 16px; height: 220px; border-radius: 16px; background: radial-gradient(400px 200px at 30% 20%, rgba(0, 195, 255, .1), transparent 70%), #06070B; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.stage .screen-hint { color: #6C7385; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.stage .screen-hint svg.i { width: 30px; height: 30px; color: #4A5163; }
.cam { position: absolute; right: 16px; bottom: 16px; width: 124px; height: 124px; border-radius: 50%; overflow: hidden; border: 2px solid var(--brand); box-shadow: 0 0 0 5px rgba(0, 195, 255, .14), 0 10px 30px rgba(0, 0, 0, .6); background: #000; }
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.stage.cam-only .cam { position: static; width: 100%; height: 100%; border-radius: 0; border: 0; box-shadow: none; }
.devices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dev { position: relative; }
.dev svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.dev select { padding-left: 36px; height: 40px; font-size: 13px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; text-overflow: ellipsis; }
.meter { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .06); overflow: hidden; margin-top: 9px; }
.meter > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-2), var(--brand)); box-shadow: 0 0 10px var(--brand); transition: width .08s; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; font-size: 13px; color: var(--ink-2); }
.toggle-row label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle-row input { accent-color: var(--brand); width: 16px; height: 16px; }
/* The signature moment: a live cyan ring around the start button */
.start { position: relative; margin-top: 20px; height: 54px; border-radius: 15px; font-size: 16px; font-weight: 700; border: 0; color: var(--on-brand);
  background: linear-gradient(135deg, #22D3FF 0%, var(--brand) 50%, var(--brand-2) 100%);
  box-shadow: 0 0 0 1px rgba(0, 195, 255, .5), 0 14px 40px -12px rgba(0, 195, 255, .8), inset 0 1px 0 rgba(255, 255, 255, .4); }
.start:hover { filter: brightness(1.06); background: linear-gradient(135deg, #22D3FF 0%, var(--brand) 50%, var(--brand-2) 100%); border: 0; }
.start .ring { position: relative; width: 14px; height: 14px; border-radius: 50%; background: var(--rec); box-shadow: 0 0 0 3px rgba(255, 255, 255, .7); }
.start .ring::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .8); animation: ripple 1.8s ease-out infinite; }
@keyframes ripple { from { transform: scale(1); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
.tip { margin-top: 11px; font-size: 12.5px; color: var(--muted); text-align: center; }

.recbar {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 18px; border-radius: 999px;
  background: rgba(14, 16, 25, .9); color: #fff; border: 1px solid var(--line-2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6), 0 0 0 1px rgba(0, 195, 255, .15); backdrop-filter: blur(16px);
}
.recbar .pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); box-shadow: 0 0 12px var(--rec); animation: pulse 1.2s infinite; }
.recbar.paused .pulse { animation: none; background: var(--warn); box-shadow: 0 0 12px var(--warn); }
@keyframes pulse { 50% { opacity: .35; } }
.recbar .timer { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; min-width: 58px; margin: 0 8px 0 4px; }
.recbar button { height: 40px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .08); color: #fff; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 14px; }
.recbar button:hover { background: rgba(255, 255, 255, .15); }
.recbar button.finish { background: var(--brand); color: var(--on-brand); }
.recbar button.finish:hover { background: #2BCEFF; }
.recbar button.finish .sq { width: 10px; height: 10px; border-radius: 2px; background: var(--on-brand); }
.recbar .icon-only { width: 40px; padding: 0; justify-content: center; }

.countdown { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(3, 4, 8, .7); backdrop-filter: blur(4px); }
.countdown span { width: 160px; height: 160px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 600 76px var(--mono); color: #fff; background: radial-gradient(circle, rgba(0, 195, 255, .2), rgba(0, 195, 255, .03) 70%); box-shadow: 0 0 0 2px var(--brand), 0 0 60px var(--brand-glow); animation: tick .8s ease-out; }
@keyframes tick { from { transform: scale(1.25); opacity: 0; } }

.progress { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-2), var(--brand)); box-shadow: 0 0 12px var(--brand); transition: width .2s; }

/* ---------- panels (team page) ---------- */
.panel { background: linear-gradient(180deg, rgba(21, 24, 38, .7), rgba(15, 17, 26, .7)); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.people { display: flex; flex-direction: column; }
.person { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.person .info { flex: 1; min-width: 0; }
.person .nm { font-weight: 600; }
.person .em { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .06); color: var(--ink-2); white-space: nowrap; border: 1px solid var(--line); }
.pill.admin { background: var(--brand-soft); color: var(--brand-ink); border-color: rgba(0, 195, 255, .3); }
.linkbox { display: flex; gap: 8px; }
.linkbox .input { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr !important; } .person .count { display: none; } }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; display: inline-flex; align-items: center; gap: 9px; padding: 11px 16px; border-radius: 13px; background: rgba(21, 24, 38, .96); color: #fff; font-weight: 500; font-size: 14px; border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); backdrop-filter: blur(12px); animation: pop .18s ease-out; }
.toast svg.i { color: var(--brand); }

/* ---------- floating recording window (Chrome, Edge) ---------- */
body.float { margin: 0; height: 100vh; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; overflow: hidden; }
body.float::before, body.float::after { display: none; }
body.float .fcam { width: 190px; height: 190px; border-radius: 50%; overflow: hidden; border: 2px solid var(--brand); box-shadow: 0 0 0 6px rgba(0, 195, 255, .15); background: #000; }
body.float .fcam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
body.float .recbar { position: static; transform: none; box-shadow: none; padding: 6px 6px 6px 14px; }

/* ---------- uploads, camera flip and phone recording ---------- */
.upload { margin-top: 10px; height: 44px; color: var(--ink-2); }
.upload svg.i { width: 17px; height: 17px; }
.flip { display: none; position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(7, 8, 13, .55); color: #fff; align-items: center; justify-content: center; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
video.unmirror { transform: none !important; }
.live { position: fixed; inset: 0; z-index: 55; background: #000; }
.live video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
@media (min-width: 861px) { .live video { object-fit: contain; } }
.live-badge { position: absolute; top: max(16px, env(safe-area-inset-top)); left: 16px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; background: rgba(7, 8, 13, .6); color: #fff; font: 600 12px var(--mono); letter-spacing: .08em; backdrop-filter: blur(8px); }
.live-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--rec); box-shadow: 0 0 10px var(--rec); animation: pulse 1.2s infinite; }
.recbar { padding-bottom: 8px; }

/* Phones: the recorder becomes a full screen camera sheet */
dialog.phone .flip { display: inline-flex; }
dialog.phone .modes { display: none; }
dialog.phone .stage { margin-top: 6px; }
dialog.phone #camDev, dialog.phone #sysRow { display: none !important; }
dialog.phone .devices { grid-template-columns: 1fr; }
@media (max-width: 860px) {
  dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  dialog#recorder { height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  dialog#recorder .dlg-body { padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; height: calc(100dvh - 62px); }
  dialog#recorder .dlg-head { padding: calc(14px + env(safe-area-inset-top)) 16px 0; }
  dialog#recorder .stage { flex: 1; height: auto; min-height: 240px; margin: 14px 0 12px; }
  dialog#recorder .tip { display: none; }
  .recbar button { height: 46px; }
  .recbar .icon-only { width: 46px; }
  .countdown span { width: 130px; height: 130px; font-size: 62px; }
  .vid .tools .btn.sm:first-child { padding: 0 10px; }
}

/* ---------- switches, plans and upgrade ---------- */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 44px; height: 26px; border-radius: 999px; background: rgba(255,255,255,.12); position: relative; transition: background .15s, box-shadow .2s; flex: none; }
.switch span::after { content: ''; position: absolute; left: 4px; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--brand); box-shadow: 0 0 16px -2px var(--brand-glow); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch input:disabled + span { opacity: .4; }
.msg { font-size: 13px; margin-top: 10px; }
.msg.bad { color: #FF7A86; } .msg.good { color: var(--ok); }

.upg { height: 42px; color: var(--brand-ink); border-color: rgba(0, 195, 255, .45); background: rgba(0, 195, 255, .08); }
.upg:hover { border-color: var(--brand); background: rgba(0, 195, 255, .14); }
.plan-badge { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--ink-2); white-space: nowrap; }
.plan-badge.pro { background: var(--brand-soft); color: var(--brand-ink); box-shadow: inset 0 0 0 1px rgba(0, 195, 255, .35); }
.avws { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 10px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.avws span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.planbar { display: flex; align-items: center; gap: 18px; padding: 12px 14px 12px 18px; margin: -4px 0 22px; border-radius: 14px; border: 1px solid rgba(0, 195, 255, .25); background: linear-gradient(90deg, rgba(0, 195, 255, .09), rgba(0, 195, 255, .02)); }
.planbar.full { border-color: rgba(247, 185, 85, .45); background: linear-gradient(90deg, rgba(247, 185, 85, .12), rgba(247, 185, 85, .02)); }
.pb-text { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.pb-text b { color: #fff; }
.pb-meter { flex: 1; max-width: 220px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-left: auto; }
.pb-meter > div { height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); }
.planbar.full .pb-meter > div { background: var(--warn); }
@media (max-width: 720px) { .planbar { flex-wrap: wrap; gap: 10px; } .pb-meter { max-width: none; margin-left: 0; flex-basis: 100%; order: 3; } .planbar .btn { margin-left: auto; } }
.limit-note { margin-top: 12px; padding: 9px 12px; border-radius: 10px; background: rgba(0, 195, 255, .07); border: 1px solid rgba(0, 195, 255, .22); font-size: 13px; color: var(--ink-2); }
.limit-note b { color: #fff; } .limit-note a { color: var(--brand-ink); font-weight: 600; }

dialog.upgrade { width: min(440px, calc(100vw - 32px)); }
.up-body { position: relative; padding: 30px 28px 26px; text-align: left; }
.up-x { position: absolute; top: 14px; right: 14px; }
.up-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: 12.5px; box-shadow: inset 0 0 0 1px rgba(0, 195, 255, .35); }
.up-badge svg.i { width: 15px; height: 15px; }
.up-body h2 { font-size: 24px; margin: 14px 0 16px; }
.up-perks { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.up-perks li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-size: 15px; }
.up-perks svg.i { color: var(--brand); width: 18px; height: 18px; margin-top: 2px; }
.up-price { margin-bottom: 16px; color: var(--muted); font-size: 14px; }
.up-price .num { font-size: 28px; font-weight: 600; color: #fff; margin-right: 4px; }
.up-go { height: 48px; font-size: 15px; }
.up-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 0 10px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .sub { color: var(--muted); font-size: 12.5px; }
.tscroll { overflow-x: auto; margin: 0 -8px; }
@media (max-width: 860px) {
  .upg span { display: none; }
  .upg { width: 40px; padding: 0; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
