:root {
  --bg: #f5f7fa;
  --ink: #17202a;
  --muted: #687381;
  --line: #dce1e7;
  --panel: #ffffff;
  --blue: #1f6feb;
  --blue-soft: #e9f1ff;
  --green: #1f8f5f;
  --green-soft: #e8f6ef;
  --amber: #a36b00;
  --amber-soft: #fff4dc;
  --red: #c73535;
  --red-soft: #fdeaea;
  --nav: #202631;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  font-size: 20px;
}

.subtext,
.panel-heading p,
.phase-list li span {
  color: var(--muted);
}

.button,
button[type="submit"],
.form-actions button,
.small-button {
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: white;
  padding: 11px 16px;
  font-weight: 700;
  text-decoration: none;
}

.button.secondary,
.form-actions .secondary {
  background: #eef2f6;
  color: var(--ink);
}

.button.danger {
  background: var(--red-soft);
  color: var(--red);
}

.small-button {
  padding: 7px 10px;
  font-size: 13px;
  margin-right: 4px;
}

.icon-button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  margin-right: 8px;
}

.danger-button {
  background: var(--red-soft);
  color: var(--red);
}

.secondary-small {
  background: #eef2f6;
  color: var(--ink);
}

.success-button {
  background: var(--green);
  color: white;
}

.table-input {
  width: 100%;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
}

.source-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: white;
}

.interpretation-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 16px;
}

.audio-track-list {
  display: grid;
  gap: 10px;
}

.audio-track-row {
  display: grid;
  grid-template-columns: 34px minmax(160px, 1fr) 120px minmax(260px, 1.35fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #edf1f6;
  border-radius: 8px;
  background: white;
  padding: 14px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.audio-track-row label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.audio-track-row input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
}

.audio-track-row input[type="file"] {
  padding: 7px 10px;
}

.field-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.track-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.audio-track-row .remove-audio-track {
  align-self: end;
  min-height: 40px;
  margin-right: 0;
  white-space: nowrap;
}

.compact-empty {
  padding: 18px;
}

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

.login-view {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(180deg, #f9fbff 0%, #eef3f8 100%);
}

.login-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(23, 32, 42, 0.08);
}

.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
}

.otp-dialog {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.wide-dialog {
  width: min(640px, calc(100% - 32px));
}

#audioModal .wide-dialog {
  width: min(940px, calc(100% - 32px));
}

#audioModal .interpretation-panel {
  width: 100%;
  overflow: hidden;
}

#audioModal .audio-track-row {
  grid-template-columns: 34px minmax(140px, 1fr) 120px minmax(220px, 1.3fr) auto;
}

#audioModal .audio-file-field input[type="file"] {
  max-width: 100%;
}

#audioModal .form-actions {
  margin-top: 10px;
}

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

.quick-actions button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  padding: 8px 12px;
  font-weight: 700;
}

.inline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.inline-toolbar strong {
  color: var(--ink);
}

.inline-toolbar span {
  color: var(--muted);
  font-size: 13px;
}

.toolbar-controls {
  display: flex;
  gap: 8px;
}

.toolbar-controls select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
}

.otp-inputs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.otp-inputs input {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
}

.admin-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--nav);
  color: white;
  padding: 22px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--blue);
}

.nav {
  display: grid;
  gap: 4px;
}

.nav button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d9dee7;
  padding: 12px;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.admin-main {
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics,
.health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-bottom: 20px;
}

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

.operation-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.operation-summary strong {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.operation-summary span {
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
}

.rank-list {
  display: grid;
  gap: 8px;
}

.rank-list article {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.rank-list strong {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
}

.rank-list span {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.rank-list em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.refresh-stamp {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
}

.compact-metrics {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.metrics article,
.health-grid article,
.panel,
.auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metrics article,
.health-grid article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 18px;
}

.health-card {
  gap: 14px;
}

.health-card div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.health-card span:not(.status) {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.health-card-wide {
  grid-column: 1 / -1;
}

.status {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.status.ok {
  color: var(--green);
  background: var(--green-soft);
}

.status.warn {
  color: var(--amber);
  background: var(--amber-soft);
}

.status.danger {
  color: var(--red);
  background: var(--red-soft);
}

.status-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.status-guide span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  padding: 10px 12px;
}

.status-guide strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 3px;
}

.device-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.device-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 13px 14px;
}

.device-summary strong {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.device-summary span {
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
}

.panel {
  padding: 22px;
}

.panel + .panel {
  margin-top: 16px;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading p {
  margin-bottom: 0;
}

.phase-list {
  display: grid;
  gap: 12px;
  padding-left: 20px;
}

.phase-list li span {
  display: block;
  margin-top: 3px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.create-link-form {
  display: grid;
  gap: 16px;
}

.form-section {
  display: grid;
  gap: 14px;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #fbfdff;
  padding: 18px;
}

.form-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf1f6;
}

.form-section-heading span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-size: 13px;
  font-weight: 800;
}

.form-section-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
}

.form-section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.compact {
  max-width: 900px;
}

.form-grid label,
.option-grid {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.form-grid label {
  min-width: 0;
}

.form-grid input,
.form-grid select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 11px;
}

.form-grid input:focus,
.form-grid select:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(31, 111, 235, 0.14);
}

.form-grid .wide,
.form-actions.wide {
  grid-column: 1 / -1;
}

.option-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: white;
  margin: 0;
}

.option-grid legend {
  padding: 0 6px;
}

.option-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  min-height: 34px;
}

.option-grid input {
  width: auto;
  min-height: auto;
}

.inline-check {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.inline-check input {
  width: auto;
  min-height: auto;
}

.create-submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  bottom: 0;
  z-index: 5;
  border: 1px solid #cad6e4;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 14px 16px;
  box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
}

.create-submit-bar div {
  display: grid;
  gap: 3px;
}

.create-submit-bar strong {
  color: var(--ink);
}

.create-submit-bar span {
  color: var(--muted);
  font-size: 13px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.message {
  color: var(--red);
  min-height: 20px;
  margin: 12px 0 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

[data-view-panel="devices"] table {
  table-layout: fixed;
  min-width: 1180px;
}

[data-view-panel="devices"] th:nth-child(1),
#devicesTableBody td:nth-child(1) {
  width: 16%;
}

[data-view-panel="devices"] th:nth-child(2),
#devicesTableBody td:nth-child(2) {
  width: 14%;
}

[data-view-panel="devices"] th:nth-child(3),
#devicesTableBody td:nth-child(3) {
  width: 15%;
}

[data-view-panel="devices"] th:nth-child(4),
#devicesTableBody td:nth-child(4) {
  width: 7%;
}

[data-view-panel="devices"] th:nth-child(5),
#devicesTableBody td:nth-child(5) {
  width: 11%;
}

[data-view-panel="devices"] th:nth-child(6),
#devicesTableBody td:nth-child(6) {
  width: 10%;
}

[data-view-panel="devices"] th:nth-child(7),
#devicesTableBody td:nth-child(7) {
  width: 8%;
}

[data-view-panel="devices"] th:nth-child(8),
#devicesTableBody td:nth-child(8) {
  width: 10%;
}

[data-view-panel="devices"] th:nth-child(9),
#devicesTableBody td:nth-child(9) {
  width: 9%;
}

[data-view-panel="links"] table {
  table-layout: fixed;
}

[data-view-panel="links"] th:nth-child(1),
#linksTableBody td:nth-child(1) {
  width: 36%;
}

[data-view-panel="links"] th:nth-child(2),
#linksTableBody td:nth-child(2) {
  width: 10%;
}

[data-view-panel="links"] th:nth-child(3),
#linksTableBody td:nth-child(3) {
  width: 11%;
}

[data-view-panel="links"] th:nth-child(4),
#linksTableBody td:nth-child(4) {
  width: 22%;
}

[data-view-panel="links"] th:nth-child(5),
#linksTableBody td:nth-child(5) {
  width: 21%;
}

.link-title-main {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.link-group-row td {
  background: #fbfcfe;
}

.link-group-row {
  cursor: pointer;
}

.link-group-row.expanded td {
  background: var(--blue-soft);
}

.link-detail-row td {
  background: #ffffff;
  padding: 0;
}

.link-detail-list {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.link-detail-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  background: white;
  padding: 14px 16px;
}

.link-detail-item span,
.link-detail-item code {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.cell-subtext {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.cell-main {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.fingerprint-code,
.mono-text {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.fingerprint-code {
  display: inline-block;
  max-width: 100%;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
  padding: 5px 7px;
  overflow-wrap: anywhere;
}

.device-row td {
  vertical-align: middle;
}

.agent-state-cell .status {
  display: inline-block;
  min-width: 60px;
  text-align: center;
}

.device-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.device-actions .small-button {
  margin-right: 0;
  min-width: 52px;
  padding: 7px 9px;
  white-space: nowrap;
}

.link-detail-item code {
  max-width: 760px;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.link-detail-actions {
  white-space: nowrap;
}

.link-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.link-row-actions .small-button {
  margin-right: 0;
  min-width: 72px;
  text-align: center;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 34px;
  text-align: center;
}

.result-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  margin-top: 16px;
  padding: 14px;
}

.result-box.error {
  color: var(--red);
  background: var(--red-soft);
}

.link-output {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.link-output span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.link-output a {
  color: var(--blue);
  overflow-wrap: anywhere;
}

.player-page {
  min-height: 100vh;
  color: white;
  background:
    radial-gradient(circle at 20% 0%, rgba(31, 111, 235, 0.24), transparent 28%),
    linear-gradient(180deg, #0e141d 0%, #111827 54%, #090d13 100%);
}

.watch-layout {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-panel {
  width: min(440px, 100%);
  padding: 26px;
  color: var(--ink);
}

.auth-panel input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  margin-bottom: 12px;
  font-size: 16px;
}

.auth-panel button {
  width: 100%;
}

.agent-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  margin-top: 16px;
  padding: 16px;
}

.agent-panel strong {
  color: var(--ink);
  font-size: 18px;
}

.agent-panel p {
  color: var(--muted);
  margin-bottom: 0;
}

.agent-steps {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 4px 0;
  padding: 0;
}

.agent-steps li {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px 10px 34px;
}

.agent-steps li::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #cbd5e1;
  transform: translateY(-50%);
}

.agent-steps li.active {
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--blue);
  background: #eff6ff;
}

.agent-steps li.active::before {
  background: var(--blue);
}

.agent-steps li.complete {
  color: var(--green);
  background: #f0fdf4;
}

.agent-steps li.complete::before {
  background: var(--green);
}

.agent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.agent-actions .button,
.agent-actions button {
  display: grid;
  place-items: center;
  min-height: 42px;
  text-align: center;
}

.secure-player {
  width: min(1240px, 100%);
}

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

.player-header h1 {
  color: white;
  font-size: 24px;
}

.player-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.player-badges span {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dbe7ff;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
}

.video-wrap {
  position: relative;
  overflow: hidden;
  background: black;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  aspect-ratio: 16 / 9;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
}

video {
  width: 100%;
  height: 100%;
  display: block;
  background: black;
}

.watermark {
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background: transparent;
  mix-blend-mode: screen;
}

.watermark::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-28deg);
  color: rgba(255, 255, 255, 0.62);
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.32);
}

.waiting {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 8px;
  place-items: center;
  color: white;
  background: rgba(0, 0, 0, 0.55);
  font-weight: 700;
  text-align: center;
}

.waiting span {
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 500;
}

.center-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: white;
  font-size: 28px;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(8px);
}

.player-controls {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: auto auto minmax(140px, 1fr) auto 100px auto auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(10, 15, 22, 0.78);
  padding: 10px;
  backdrop-filter: blur(12px);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 16px;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.time-readout {
  display: flex;
  gap: 5px;
  color: #e5edf8;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.seek-bar,
.volume-bar {
  accent-color: var(--blue);
}

.seek-bar {
  width: 100%;
}

.volume-bar {
  width: 100px;
}

.quality-select {
  min-width: 86px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 13px;
  padding: 0 8px;
}

.audio-select {
  min-width: 104px;
}

.quality-select option {
  color: #0f172a;
}

.embed-mode .watch-layout {
  min-height: 100vh;
  padding: 0;
}

.embed-mode .secure-player {
  width: 100%;
  height: 100vh;
}

.embed-mode .player-header {
  display: none;
}

.embed-mode .video-wrap {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  aspect-ratio: auto;
  box-shadow: none;
}

.embed-mode .auth-panel {
  width: min(420px, calc(100% - 32px));
}

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

  .metrics,
  .health-grid,
  .dashboard-grid,
  .form-grid.two-columns,
  .option-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .top-actions,
  .inline-toolbar,
  .create-submit-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-controls {
    width: 100%;
    flex-direction: column;
  }

  .toolbar-controls select {
    width: 100%;
  }

  .create-submit-bar {
    position: static;
  }

  .create-submit-bar button {
    width: 100%;
  }

  .player-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .volume-bar,
  .quality-select,
  .audio-select {
    display: none;
  }

  .audio-track-row {
    grid-template-columns: 34px 1fr;
  }

  .audio-track-row .audio-file-field,
  .audio-track-row .remove-audio-track {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  #audioModal .audio-track-row {
    grid-template-columns: 34px 1fr;
  }

  #audioModal .audio-file-field,
  #audioModal .remove-audio-track {
    grid-column: 1 / -1;
  }
}
