@font-face {
  font-family: "Hoch und Hoch Sans";
  src: url("../assets/fonts/Roboto/roboto-v50-latin-regular.woff2")
    format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Hoch und Hoch Sans";
  src: url("../assets/fonts/Roboto/roboto-v50-latin-300.woff2") format("woff2");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #202a27;
  --ink-soft: #52625d;
  --ink-faint: #7a8882;
  --line: #e7dbcb;
  --line-strong: #d9c8b5;
  --surface: #fffcf7;
  --surface-soft: #f7efe4;
  --canvas: #eae5e5;
  --night: #2a2a2a;
  --night-soft: #343434;
  --accent: #155d57;
  --accent-deep: #0c4641;
  --accent-pale: #e4efea;
  --avatar: #52736b;
  --avatar-deep: #405e58;
  --mint: #9dcec0;
  --success: #2d7465;
  --danger: #c94150;
  --warning: #b26a10;
  --shadow-sm: 0 1px 2px rgba(32, 42, 39, 0.06);
  --shadow-md: 0 12px 30px rgba(32, 42, 39, 0.1);
  --shadow-lg: 0 24px 60px rgba(15, 32, 29, 0.24);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --sidebar-width: 278px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family:
    "Hoch und Hoch Sans",
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button {
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ui-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.ui-icon text {
  fill: currentColor;
  stroke: none;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: -0.6px;
}

:focus-visible {
  outline: 3px solid rgba(21, 93, 87, 0.32);
  outline-offset: 3px;
}

.brand-mark {
  display: block;
  width: 72px;
  height: 42px;
  flex: 0 0 72px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: #2a2a2a;
  box-shadow: none;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
  line-height: 1.1;
}

.brand-copy strong {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.97rem;
  letter-spacing: 0;
  white-space: nowrap;
}

.trademark-icon {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  align-self: flex-start;
  margin-top: -1px;
}

.trademark-icon-on-light {
  background: transparent;
  filter: invert(1);
}

.brand-copy span {
  color: var(--ink-faint);
  font-size: 0.73rem;
  letter-spacing: 0.02em;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.button:hover {
  transform: none;
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.button .ui-icon {
  width: 18px;
  height: 18px;
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: none;
  color: #fff7eb;
}

.button-primary:hover {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
  box-shadow: none;
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: #bdaf9f;
  background: var(--surface-soft);
}

.button-subtle {
  border-color: transparent;
  background: var(--surface-soft);
  color: var(--ink-soft);
}

.button-subtle:hover {
  background: #eee3d5;
}

.button-light {
  background: #fff;
  color: var(--night);
}

.button-wide {
  width: 100%;
  min-height: 54px;
  margin-top: 4px;
  border-radius: 14px;
}

.button-wide .ui-icon {
  margin-left: auto;
}

.button-small {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 0.84rem;
}

.icon-button,
.mini-button,
.logout-button,
.input-action,
.player-button {
  display: inline-grid;
  padding: 0;
  border: 0;
  cursor: pointer;
  place-items: center;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: transparent;
}

.icon-button:hover {
  background: var(--surface-soft);
}

.icon-button.bordered {
  border: 1px solid var(--line);
  background: #fff;
}

.mini-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.mini-button .ui-icon {
  width: 17px;
  height: 17px;
}

.notice {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid #cfe2dc;
  border-radius: 12px;
  background: #eff6f3;
  color: #24534e;
  font-size: 0.88rem;
  line-height: 1.5;
}

.notice-success {
  border-color: #c7eadc;
  background: #effbf6;
  color: #116745;
}

.notice-error {
  border-color: #f1ccd1;
  background: #fff3f4;
  color: #96343f;
}

.notice-info {
  border-color: #cfe2dc;
  background: #eff6f3;
  color: #24534e;
}

.notice [data-dismiss] {
  padding: 2px;
  border: 0;
  background: transparent;
  color: currentColor;
  cursor: pointer;
}

.notice [data-dismiss] .ui-icon {
  width: 17px;
  height: 17px;
}

.migration-notice {
  align-items: center;
}

.migration-notice form {
  flex: 0 0 auto;
}

/* Login */

.auth-body {
  overflow-x: hidden;
  background: var(--canvas);
}

.auth-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(440px, 1.08fr) minmax(460px, 0.92fr);
}

.auth-showcase {
  position: relative;
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(32px, 4.5vw, 70px);
  background:
    radial-gradient(circle at 77% 30%, rgba(21, 93, 87, 0.28), transparent 34%),
    radial-gradient(
      circle at 23% 78%,
      rgba(157, 206, 192, 0.11),
      transparent 30%
    ),
    linear-gradient(145deg, #303030 0%, #242424 68%);
  color: #fff;
  isolation: isolate;
}

.auth-showcase::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 58px 58px;
  content: "";
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
}

.auth-showcase::after {
  position: absolute;
  z-index: -1;
  width: 460px;
  height: 460px;
  right: -240px;
  bottom: 3%;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  box-shadow:
    0 0 0 70px rgba(255, 255, 255, 0.018),
    0 0 0 140px rgba(255, 255, 255, 0.012);
  content: "";
}

.auth-brand,
.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.auth-brand {
  position: absolute;
  z-index: 3;
  top: clamp(22px, 2.8vw, 44px);
  left: clamp(28px, 3.8vw, 58px);
  align-self: flex-start;
}

.auth-brand .brand-copy strong {
  color: #fff;
}

.auth-brand .brand-copy span {
  color: rgba(255, 255, 255, 0.48);
}

.showcase-copy {
  position: relative;
  z-index: 2;
  width: min(690px, 100%);
  margin-top: clamp(220px, 34vh, 355px);
}

.showcase-copy h1 {
  margin: 0 0 20px;
  font-size: clamp(2.7rem, 4.45vw, 4.9rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.showcase-copy h1 span {
  color: #b7d5cc;
}

.showcase-copy p {
  max-width: 590px;
  margin: 0;
  color: rgba(255, 255, 255, 0.54);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  font-weight: 300;
  line-height: 1.65;
}

.showcase-preview {
  position: absolute;
  right: clamp(-150px, -7vw, -70px);
  bottom: clamp(85px, 11vh, 140px);
  width: min(52vw, 680px);
  transform: perspective(1400px) rotateY(-11deg) rotateX(4deg) rotateZ(-1deg);
  transform-origin: right center;
  opacity: 0.9;
}

.preview-window {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  background: rgba(21, 29, 40, 0.86);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

.preview-top {
  display: flex;
  height: 35px;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.preview-top span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.preview-content {
  display: grid;
  min-height: 280px;
  grid-template-columns: 88px 1fr;
}

.preview-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 17px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.preview-sidebar i {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.preview-sidebar i:first-child {
  background: rgba(92, 151, 142, 0.75);
}

.preview-player {
  position: relative;
  display: grid;
  margin: 26px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 13px;
  background: radial-gradient(circle at 65% 30%, #23423f, #151d1c 65%);
  place-items: center;
}

.preview-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.52rem;
  letter-spacing: 0.15em;
}

.preview-play {
  display: grid;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  color: #17202d;
  place-items: center;
  box-shadow: 0 13px 35px rgba(0, 0, 0, 0.35);
}

.preview-play .ui-icon {
  width: 18px;
  height: 18px;
}

.preview-play .pause-shape {
  display: none;
}

.preview-track {
  position: absolute;
  right: 17px;
  bottom: 18px;
  left: 17px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

.preview-track b {
  display: block;
  width: 41%;
  height: 100%;
  background: #fff;
}

.auth-panel {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px clamp(34px, 6vw, 105px) 28px;
  background: var(--canvas);
}

.auth-card {
  width: min(450px, 100%);
}

.mobile-auth-brand {
  display: none;
  margin-bottom: 52px;
  align-items: center;
  gap: 11px;
}

.auth-heading {
  margin: 22px 0 34px;
}

.step-label,
.eyebrow {
  display: block;
  color: var(--accent);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.145em;
  text-transform: uppercase;
}

.auth-heading h2 {
  margin: 10px 0 12px;
  font-size: clamp(2rem, 3vw, 2.55rem);
  font-weight: 400;
  letter-spacing: -0.045em;
}

.auth-heading-login h2 {
  margin-bottom: 0;
}

.auth-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.93rem;
  line-height: 1.65;
}

.auth-form,
.dialog-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  color: #344155;
  font-size: 0.82rem;
  font-weight: 600;
}

.field > span:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.field small {
  color: var(--ink-faint);
  font-size: 0.7rem;
  font-weight: 400;
}

.field input,
.field textarea,
.field select,
.input-wrap,
.select-field {
  width: 100%;
}

.field input,
.field textarea,
.field select {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 0.91rem;
  font-weight: 400;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.field input,
.field select {
  height: 48px;
  padding: 0 13px;
}

.field textarea {
  min-height: 92px;
  padding: 13px;
  line-height: 1.5;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a1abba;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.input-wrap:focus-within,
.select-field:focus-within {
  border-color: rgba(21, 93, 87, 0.72);
  outline: none;
  box-shadow: 0 0 0 4px rgba(21, 93, 87, 0.1);
}

.input-wrap {
  display: flex;
  height: 52px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: #fff;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.input-wrap > .ui-icon {
  width: 18px;
  height: 18px;
  color: #8591a2;
}

.input-wrap input {
  width: 100%;
  height: 48px;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}

.input-wrap input:focus {
  border: 0;
  box-shadow: none;
}

.input-action {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: transparent;
  color: #778397;
}

.input-action:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.input-action .ui-icon {
  width: 17px;
  height: 17px;
}

.auth-privacy-note {
  margin: 14px 0 0;
  color: var(--ink-faint);
  font-size: 0.66rem;
  line-height: 1.55;
}

.auth-footer {
  margin-top: auto;
  padding-top: 50px;
  color: #9aa4b2;
  font-size: 0.7rem;
}

/* Application shell */

.portal-body {
  background: var(--canvas);
}

.portal-body.nav-open {
  overflow: hidden;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.065);
  background: var(--night);
  color: #fff;
}

.sidebar-head {
  display: flex;
  height: 92px;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.sidebar-brand .brand-copy strong {
  color: #fff;
}

.sidebar-brand .brand-copy span {
  color: rgba(255, 255, 255, 0.4);
}

.sidebar-close {
  display: none;
  color: #fff;
}

.workspace-switcher,
.workspace-static {
  margin: 5px 15px 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.035);
}

.workspace-switcher > label,
.workspace-label {
  display: block;
  margin: 0 0 10px 2px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.61rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
}

.select-wrap select {
  width: 100%;
  min-width: 0;
  padding: 4px 28px 4px 0;
  border: 0;
  outline: 0;
  appearance: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}

.select-wrap select option {
  background: var(--night-soft);
  color: #fff;
}

.select-wrap > .ui-icon {
  position: absolute;
  right: 0;
  width: 15px;
  height: 15px;
  transform: rotate(90deg);
  color: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.workspace-avatar,
.user-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--avatar);
  color: #fff7eb;
  font-size: 0.65rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.workspace-avatar {
  width: 33px;
  height: 33px;
}

.workspace-avatar-large {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  font-size: 0.88rem;
}

.workspace-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workspace-row strong {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-nav {
  display: flex;
  overflow: auto;
  flex: 1;
  flex-direction: column;
  padding: 13px 14px 20px;
  scrollbar-width: thin;
}

.nav-caption {
  padding: 0 12px 9px;
  color: rgba(255, 255, 255, 0.26);
  font-size: 0.61rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-caption-spaced {
  margin-top: 25px;
}

.nav-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.53);
  font-size: 0.8rem;
  text-decoration: none;
  transition:
    color 150ms ease,
    background 150ms ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.85);
}

.nav-link-disabled {
  cursor: default;
  color: rgba(255, 255, 255, 0.36);
}

.nav-link-disabled:hover {
  background: transparent;
  color: rgba(255, 255, 255, 0.36);
}

.nav-link-disabled .ui-icon {
  color: rgba(255, 255, 255, 0.25);
}

.nav-link.active {
  background: linear-gradient(
    90deg,
    rgba(157, 206, 192, 0.16),
    rgba(157, 206, 192, 0.06)
  );
  color: #fff;
}

.nav-link.active::before {
  position: absolute;
  width: 3px;
  height: 20px;
  left: 0;
  border-radius: 0 4px 4px 0;
  background: #9dc5ba;
  content: "";
}

.nav-link .ui-icon {
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.37);
}

.nav-link.active .ui-icon {
  color: #b7d5cc;
}

.nav-link span {
  min-width: 0;
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-link em {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.59rem;
  font-style: normal;
  text-align: center;
}

.nav-link .nav-status {
  min-width: auto;
  padding: 3px 7px;
  white-space: nowrap;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 17px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.signed-in-user {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--avatar-deep);
  color: rgba(255, 255, 255, 0.78);
}

.signed-in-user > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.signed-in-user strong {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.83);
  font-size: 0.73rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signed-in-user small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.61rem;
}

.logout-button {
  width: 37px;
  height: 37px;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
}

.logout-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.logout-button .ui-icon {
  width: 17px;
  height: 17px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin-left: var(--sidebar-width);
}

.mobile-topbar {
  display: none;
}

.main-content {
  width: min(1460px, 100%);
  flex: 1;
  margin: 0 auto;
  padding: 48px clamp(28px, 4vw, 64px) 80px;
}

.app-notice {
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 32px;
}

.page-header h1 {
  margin: 8px 0 8px;
  font-size: clamp(2rem, 3.2vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 1.1;
}

.page-header p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.91rem;
  line-height: 1.55;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-faint);
  font-size: 0.73rem;
}

.breadcrumbs a {
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs .ui-icon {
  width: 13px;
  height: 13px;
}

.search-box {
  display: flex;
  width: min(290px, 100%);
  height: 44px;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink-faint);
  transition:
    background 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.search-box:focus-within {
  border-color: rgba(21, 93, 87, 0.65);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(21, 93, 87, 0.09);
}

.search-box .ui-icon {
  width: 17px;
  height: 17px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.8rem;
}

.search-box input::placeholder {
  color: #9da7b5;
}

/* Player */

.featured-section {
  overflow: hidden;
  margin-bottom: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.section-label {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 19px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-label span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #536174;
}

.section-label i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-pale);
}

.player-shell {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #070b10;
  color: #fff;
  isolation: isolate;
}

.player-shell:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.portal-video {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #070b10;
  object-fit: contain;
}

.player-placeholder {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: clamp(26px, 5vw, 70px);
  background:
    radial-gradient(circle at 72% 25%, rgba(21, 93, 87, 0.42), transparent 35%),
    linear-gradient(135deg, #18302e 0%, #0b1211 66%);
  transition: opacity 300ms ease;
}

.player-placeholder::after {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 52px 52px;
  content: "";
  mask-image: linear-gradient(135deg, #000, transparent 78%);
}

.placeholder-kicker,
.player-placeholder strong,
.player-placeholder > span:last-child {
  position: relative;
  z-index: 1;
}

.placeholder-kicker {
  margin-bottom: 11px;
  color: #b7d5cc;
  font-size: clamp(0.58rem, 1vw, 0.72rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.player-placeholder strong {
  max-width: 80%;
  margin-bottom: 7px;
  font-size: clamp(1.55rem, 3.5vw, 3.7rem);
  font-weight: 300;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.player-placeholder > span:last-child {
  color: rgba(255, 255, 255, 0.48);
  font-size: clamp(0.72rem, 1.2vw, 0.9rem);
}

.player-shell.has-started .player-placeholder {
  opacity: 0;
  pointer-events: none;
}

.center-play {
  position: absolute;
  z-index: 7;
  top: 50%;
  left: 50%;
  display: grid;
  width: clamp(62px, 7vw, 84px);
  height: clamp(62px, 7vw, 84px);
  padding: 0;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.34);
  color: #101722;
  cursor: pointer;
  place-items: center;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    background 180ms ease;
}

.center-play:hover {
  transform: translate(-50%, -50%) scale(1.05);
  background: #fff;
}

.center-play .ui-icon {
  width: 28px;
  height: 28px;
  margin-left: 3px;
}

.center-play .pause-shape,
.player-button .pause-shape {
  display: none;
}

.player-shell.is-playing .center-play {
  opacity: 0;
  pointer-events: none;
}

.player-shell.is-playing .play-button .play-shape {
  display: none;
}

.player-shell.is-playing .play-button .pause-shape {
  display: block;
}

.player-loader {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  background: rgba(6, 9, 13, 0.25);
  place-items: center;
  pointer-events: none;
}

.player-loader span {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.23);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.player-error {
  position: absolute;
  z-index: 12;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(7, 11, 16, 0.94);
  text-align: center;
}

.player-error > span {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 16px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.08);
  place-items: center;
}

.player-error strong {
  font-size: 1.05rem;
}

.player-error p {
  margin: 7px 0 18px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
}

.player-controls {
  position: absolute;
  z-index: 10;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 55px clamp(13px, 2.1vw, 24px) clamp(12px, 1.8vw, 20px);
  background: linear-gradient(transparent, rgba(4, 6, 10, 0.9));
  transition:
    opacity 200ms ease,
    transform 200ms ease;
}

.player-shell.controls-hidden .player-controls,
.player-shell.controls-hidden .center-play {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.timeline-wrap {
  position: relative;
  height: 16px;
  cursor: pointer;
}

.timeline-buffered,
.timeline-played,
.timeline-input {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 4px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: transparent;
}

.timeline-buffered,
.timeline-played {
  overflow: hidden;
}

.timeline-buffered::-webkit-progress-bar,
.timeline-played::-webkit-progress-bar {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.timeline-buffered::-webkit-progress-value {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.31);
}

.timeline-played::-webkit-progress-bar {
  background: transparent;
}

.timeline-played::-webkit-progress-value {
  border-radius: 999px;
  background: #fff;
}

.timeline-buffered::-moz-progress-bar {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.31);
}

.timeline-played::-moz-progress-bar {
  border-radius: 999px;
  background: #fff;
}

.timeline-input {
  z-index: 2;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.timeline-input::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}

.timeline-input::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 2px solid #fff;
  border-radius: 50%;
  appearance: none;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.timeline-wrap:hover .timeline-input::-webkit-slider-thumb,
.timeline-input:focus-visible::-webkit-slider-thumb {
  opacity: 1;
}

.timeline-input::-moz-range-track {
  height: 4px;
  background: transparent;
}

.timeline-input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
}

.timeline-wrap:hover .timeline-input::-moz-range-thumb,
.timeline-input:focus-visible::-moz-range-thumb {
  opacity: 1;
}

.control-row,
.control-group {
  display: flex;
  align-items: center;
}

.control-row {
  justify-content: space-between;
  gap: 12px;
}

.control-group {
  gap: 3px;
}

.control-group-right {
  margin-left: auto;
}

.player-button {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.84);
}

.player-button:hover,
.player-button:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.player-button .ui-icon {
  width: 19px;
  height: 19px;
}

.play-button .ui-icon {
  width: 21px;
  height: 21px;
}

.skip-control .ui-icon {
  width: 21px;
  height: 21px;
}

.volume-control {
  display: flex;
  align-items: center;
}

.volume-control input {
  width: 0;
  height: 4px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  opacity: 0;
  transition:
    width 180ms ease,
    opacity 180ms ease,
    margin 180ms ease;
}

.volume-control:hover input,
.volume-control:focus-within input {
  width: 66px;
  margin-right: 8px;
  opacity: 1;
}

.volume-control input::-webkit-slider-thumb {
  width: 11px;
  height: 11px;
  appearance: none;
  border-radius: 50%;
  background: #fff;
}

.volume-control input::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

.player-shell.is-muted .volume-waves {
  display: none;
}

.volume-muted {
  display: none;
}

.player-shell.is-muted .volume-muted {
  display: block;
}

.time-code {
  margin-left: 7px;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(0.63rem, 1.15vw, 0.75rem);
  font-variant-numeric: tabular-nums;
}

.time-code i {
  margin: 0 3px;
  color: rgba(255, 255, 255, 0.32);
  font-style: normal;
}

.speed-button {
  width: 43px;
  font-size: 0.72rem;
  font-weight: 600;
}

.collapse-shape {
  display: none;
}

.player-shell.is-fullscreen .expand-shape {
  display: none;
}

.player-shell.is-fullscreen .collapse-shape {
  display: block;
}

.player-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  background: #000;
}

.player-shell:fullscreen .portal-video {
  object-fit: contain;
}

.video-detail-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 35px;
  padding: 28px 30px 30px;
}

.video-detail-copy {
  min-width: 0;
  max-width: 780px;
}

.folder-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 600;
}

.folder-tag .ui-icon {
  width: 14px;
  height: 14px;
}

.video-detail-copy h2 {
  margin: 0 0 9px;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.video-detail-copy > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.65;
}

.video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 17px;
  color: var(--ink-faint);
  font-size: 0.69rem;
}

.video-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.video-meta .ui-icon {
  width: 14px;
  height: 14px;
}

.video-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

/* Library */

.library-section {
  margin-top: 10px;
}

.library-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 19px;
}

.library-heading h2 {
  margin: 6px 0 0;
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: -0.035em;
}

.library-heading > span {
  color: var(--ink-faint);
  font-size: 0.72rem;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.video-card {
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition:
    transform 190ms ease,
    box-shadow 190ms ease,
    border-color 190ms ease;
}

.video-card:hover {
  transform: none;
  border-color: #d2c2af;
  box-shadow: var(--shadow-md);
}

.video-card.selected {
  border-color: rgba(21, 93, 87, 0.45);
  box-shadow:
    0 0 0 2px rgba(21, 93, 87, 0.08),
    var(--shadow-sm);
}

.video-card-visual {
  position: relative;
  display: flex;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px;
  background:
    radial-gradient(
      circle at 78% 20%,
      rgba(35, 113, 104, 0.55),
      transparent 38%
    ),
    linear-gradient(145deg, #1a2e2b, #0d1514);
  color: #fff;
}

.video-card:nth-child(3n + 2) .video-card-visual {
  background:
    radial-gradient(
      circle at 20% 25%,
      rgba(51, 195, 162, 0.32),
      transparent 40%
    ),
    linear-gradient(145deg, #18272b, #0b1218);
}

.video-card:nth-child(3n + 3) .video-card-visual {
  background:
    radial-gradient(
      circle at 75% 25%,
      rgba(138, 99, 68, 0.38),
      transparent 40%
    ),
    linear-gradient(145deg, #30261f, #151210);
}

.video-card-visual::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  content: "";
}

.card-monogram {
  position: absolute;
  top: 14px;
  left: 14px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.card-play {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: grid;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.93);
  color: #111827;
  place-items: center;
  transition: transform 180ms ease;
}

.video-card:hover .card-play {
  transform: translate(-50%, -50%) scale(1.08);
}

.card-play .ui-icon {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}

.card-play .pause-shape {
  display: none;
}

.card-date {
  position: relative;
  z-index: 1;
  margin-left: auto;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(8, 12, 18, 0.35);
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.58rem;
  backdrop-filter: blur(5px);
}

.video-card-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  padding: 17px 18px 18px;
}

.video-card-folder {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 600;
}

.video-card-body strong {
  overflow: hidden;
  margin-bottom: 7px;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-card-body > span:not(.video-card-folder) {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.73rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  max-height: 3em;
}

.video-card-body small {
  margin-top: auto;
  padding-top: 14px;
  color: var(--ink-faint);
  font-size: 0.63rem;
}

.library-empty,
.search-empty,
.portal-empty-state,
.empty-admin {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 65px 25px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: var(--accent);
  place-items: center;
}

.empty-icon.small {
  width: 43px;
  height: 43px;
  margin: 0;
  border-radius: 12px;
}

.empty-icon.small .ui-icon {
  width: 18px;
  height: 18px;
}

.library-empty h3,
.search-empty h3,
.portal-empty-state h1,
.empty-admin h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 500;
}

.library-empty p,
.search-empty p,
.portal-empty-state p,
.empty-admin p {
  max-width: 460px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.55;
}

.portal-empty-state .button,
.empty-admin .button {
  margin-top: 20px;
}

.search-empty {
  margin-top: 18px;
  padding: 40px 20px;
}

/* Admin */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 22px;
}

.stat-card {
  display: flex;
  min-height: 100px;
  align-items: center;
  gap: 15px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--accent-pale);
  color: var(--accent);
  place-items: center;
}

.stat-icon .ui-icon {
  width: 19px;
  height: 19px;
}

.stat-card div {
  display: flex;
  flex-direction: column;
}

.stat-card strong {
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.stat-card div span {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 0.69rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.customer-panel {
  position: sticky;
  top: 20px;
}

.panel-heading {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 19px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  margin: 5px 0 0;
  font-size: 1rem;
  font-weight: 500;
}

.customer-list {
  padding: 8px;
}

.customer-list-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 11px;
  text-decoration: none;
  transition: background 150ms ease;
}

.customer-list-item:hover {
  background: var(--surface-soft);
}

.customer-list-item.active {
  background: var(--accent-pale);
}

.customer-list-item > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.customer-list-item strong {
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-list-item small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 0.61rem;
}

.customer-list-item > .ui-icon {
  width: 14px;
  height: 14px;
  color: #a4adba;
}

.customer-list-item.active > .ui-icon {
  color: var(--accent);
}

.compact-empty {
  padding: 28px 20px;
  color: var(--ink-faint);
  font-size: 0.75rem;
  text-align: center;
}

.admin-detail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 20px;
}

.detail-summary {
  display: flex;
  min-height: 90px;
  align-items: center;
  gap: 25px;
  padding: 17px 20px;
}

.detail-customer {
  display: flex;
  min-width: 0;
  flex: 1 1 285px;
  align-items: center;
  gap: 13px;
}

.detail-customer > div {
  min-width: 0;
}

.detail-customer h2 {
  max-width: 270px;
  overflow: hidden;
  margin: 5px 0 0;
  font-size: 1.12rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-metrics {
  display: flex;
  flex: 0 1 auto;
  justify-content: center;
  gap: clamp(20px, 4vw, 48px);
}

.detail-metrics span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--ink-faint);
  font-size: 0.62rem;
}

.detail-metrics strong {
  color: #3b4655;
  font-size: 0.79rem;
  font-weight: 600;
}

.detail-summary .button {
  flex: 0 0 auto;
}

.admin-section .panel-heading {
  min-height: 75px;
}

.inline-empty {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 22px 20px;
}

.inline-empty > div {
  min-width: 0;
  flex: 1;
}

.inline-empty strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.78rem;
}

.inline-empty p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.68rem;
}

.account-list,
.admin-video-list {
  display: flex;
  flex-direction: column;
}

.account-row,
.admin-video-row {
  display: flex;
  min-width: 0;
  min-height: 67px;
  align-items: center;
  gap: 12px;
  padding: 12px 19px;
  border-bottom: 1px solid var(--line);
}

.account-row:last-child,
.admin-video-row:last-child {
  border-bottom: 0;
}

.account-row .user-avatar {
  background: var(--avatar);
  color: #fff7eb;
}

.account-main,
.video-file-main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.account-main strong,
.video-file-main strong {
  overflow: hidden;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-main span,
.video-file-main small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 0.64rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eff9f5;
  color: var(--success);
  font-size: 0.61rem;
  font-weight: 600;
}

.status-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.inactive {
  background: #f3f4f6;
  color: #818b99;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.text-button {
  padding: 7px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 600;
}

.text-button:hover {
  color: var(--accent);
}

.login-history-panel {
  padding: 18px 20px 20px;
  border-top: 1px solid var(--line);
  background: rgba(247, 239, 228, 0.38);
}

.login-history-heading,
.login-history-heading > div {
  display: flex;
  align-items: center;
}

.login-history-heading {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.login-history-heading > div {
  min-width: 0;
  gap: 10px;
}

.history-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent);
  place-items: center;
}

.history-icon .ui-icon {
  width: 16px;
  height: 16px;
}

.login-history-heading strong,
.login-history-heading span {
  display: block;
}

.login-history-heading strong {
  font-size: 0.75rem;
}

.login-history-heading > div > div > span {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 0.63rem;
}

.history-retention {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.6rem;
  font-weight: 600;
}

.login-history-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.login-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.68rem;
  text-align: left;
}

.login-history-table th,
.login-history-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.login-history-table th {
  color: var(--ink-faint);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-history-table tr:last-child td {
  border-bottom: 0;
}

.login-history-table code {
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.66rem;
}

.login-history-empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--ink-faint);
  font-size: 0.68rem;
  text-align: center;
}

.login-history-empty.error {
  border-color: #e9b8be;
  color: var(--danger);
}

.login-history-note {
  margin: 11px 0 0;
  color: var(--ink-faint);
  font-size: 0.61rem;
  line-height: 1.5;
}

.folder-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.folder-admin-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.folder-icon,
.video-file-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: var(--accent);
  place-items: center;
}

.folder-icon .ui-icon,
.video-file-icon .ui-icon {
  width: 17px;
  height: 17px;
}

.folder-admin-card > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.folder-admin-card strong {
  overflow: hidden;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-admin-card div span {
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-admin-card em {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: var(--ink-faint);
  font-size: 0.59rem;
  font-style: normal;
}

.admin-video-row {
  color: inherit;
  text-decoration: none;
  transition: background 150ms ease;
}

.admin-video-link {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.admin-video-row:hover {
  background: var(--surface-soft);
}

.admin-video-link > .ui-icon {
  width: 15px;
  height: 15px;
  color: var(--ink-faint);
}

.archive-form {
  display: flex;
  flex: 0 0 auto;
}

.archive-button:hover {
  border-color: #f1b8b8;
  background: #fff2f2;
  color: #b83b3b;
}

.file-size {
  color: var(--ink-faint);
  font-size: 0.64rem;
  white-space: nowrap;
}

.empty-admin {
  min-height: 330px;
  border: 0;
}

.app-footer {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(28px, 4vw, 64px);
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.65rem;
}

/* Dialogs */

.app-dialog {
  width: min(520px, calc(100vw - 28px));
  max-height: min(850px, calc(100vh - 35px));
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  color: var(--ink);
}

.app-dialog::backdrop {
  background: rgba(5, 10, 18, 0.67);
  backdrop-filter: blur(5px);
}

.app-dialog[open] {
  animation: dialog-in 180ms ease-out;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.dialog-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dialog-head h2 {
  margin: 4px 0 0;
  font-size: 1.14rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.dialog-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--accent-pale);
  color: var(--accent);
  place-items: center;
}

.dialog-icon .ui-icon {
  width: 19px;
  height: 19px;
}

.dialog-form {
  padding: 22px;
}

.dialog-form .input-wrap {
  height: 48px;
  border-radius: 12px;
}

.field-hint {
  margin: -5px 0 0;
  color: var(--ink-faint);
  font-size: 0.69rem;
  line-height: 1.5;
}

.form-error {
  padding: 11px 13px;
  border: 1px solid #f1ccd1;
  border-radius: 10px;
  background: #fff3f4;
  color: #96343f;
  font-size: 0.75rem;
  line-height: 1.45;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin: 4px -22px -22px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.summary-dialog {
  width: min(760px, calc(100vw - 28px));
}

.summary-content {
  display: grid;
  gap: 25px;
  padding: 24px 26px 28px;
}

.summary-section h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 0.93rem;
  font-weight: 600;
}

.summary-section ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 19px;
}

.summary-section li {
  padding-left: 3px;
  color: var(--ink-soft);
  font-size: 0.77rem;
  line-height: 1.58;
}

.summary-section li::marker {
  color: var(--accent);
}

.summary-section li strong {
  color: var(--ink);
  font-weight: 600;
}

.summary-dialog-actions {
  display: flex;
  justify-content: flex-end;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.upload-dialog {
  width: min(680px, calc(100vw - 28px));
}

.upload-dropzone {
  position: relative;
  display: flex;
  min-height: 175px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border: 1.5px dashed #bcc8d8;
  border-radius: 15px;
  background: var(--surface-soft);
  cursor: pointer;
  text-align: center;
  transition:
    border-color 150ms ease,
    background 150ms ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-pale);
}

.upload-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-mark {
  display: grid;
  width: 45px;
  height: 45px;
  margin-bottom: 10px;
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: var(--accent);
  place-items: center;
}

.upload-dropzone strong {
  font-size: 0.83rem;
}

.upload-dropzone > span:not(.upload-mark) {
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 0.67rem;
}

.upload-dropzone em {
  max-width: 90%;
  overflow: hidden;
  margin-top: 11px;
  padding: 5px 8px;
  border-radius: 7px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.63rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.select-field {
  position: relative;
  display: block;
}

.select-field select {
  padding-right: 38px;
  appearance: none;
}

.select-field .ui-icon {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 15px;
  height: 15px;
  transform: translateY(-50%) rotate(90deg);
  color: var(--ink-faint);
  pointer-events: none;
}

.check-field {
  display: flex;
  min-height: 48px;
  align-items: center;
  align-self: end;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  cursor: pointer;
}

.check-field > input {
  width: 16px;
  height: 16px;
  margin: 0 9px 0 2px;
  accent-color: var(--accent);
}

.check-field > span {
  display: grid;
  min-width: 0;
  flex: 1;
  grid-template-columns: 23px 1fr;
  grid-template-rows: auto auto;
}

.check-field i {
  display: grid;
  grid-row: 1 / 3;
  color: var(--success);
  place-items: center start;
}

.check-field i .ui-icon {
  width: 16px;
  height: 16px;
}

.check-field strong {
  font-size: 0.7rem;
}

.check-field small {
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 0.59rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 11px;
  background: var(--accent-pale);
}

.upload-status div {
  display: flex;
  justify-content: space-between;
  color: #365c56;
  font-size: 0.67rem;
}

.upload-status progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
}

.upload-status progress::-webkit-progress-bar {
  background: rgba(21, 93, 87, 0.14);
}

.upload-status progress::-webkit-progress-value {
  background: var(--accent);
}

.upload-status progress::-moz-progress-bar {
  background: var(--accent);
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  display: flex;
  width: min(380px, calc(100vw - 32px));
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-md);
  color: var(--ink-soft);
  font-size: 0.75rem;
  animation: toast-in 180ms ease-out;
}

.toast.error {
  border-color: #f1ccd1;
  color: #96343f;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-overlay {
  position: fixed;
  z-index: 25;
  inset: 0;
  background: rgba(5, 10, 18, 0.58);
  backdrop-filter: blur(3px);
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 252px;
  }
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .detail-metrics {
    display: none;
  }
}

@media (max-width: 980px) {
  .auth-layout {
    grid-template-columns: minmax(390px, 0.85fr) minmax(420px, 1fr);
  }
  .showcase-preview {
    display: none;
  }
  .showcase-copy h1 {
    font-size: clamp(3rem, 6vw, 4.8rem);
  }

  .sidebar {
    width: min(290px, 88vw);
    transform: translateX(-102%);
    box-shadow: 25px 0 60px rgba(0, 0, 0, 0.3);
    transition: transform 220ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-close {
    display: grid;
  }
  .app-shell {
    margin-left: 0;
  }
  .mobile-topbar {
    display: flex;
    height: 76px;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 247, 235, 0.94);
    backdrop-filter: blur(12px);
  }
  .mobile-topbar .sidebar-brand .brand-copy strong {
    color: var(--ink);
  }
  .mobile-topbar .sidebar-brand .brand-copy span {
    color: var(--ink-faint);
  }
  .main-content {
    padding-top: 35px;
  }
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .customer-panel {
    position: static;
  }
  .customer-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .auth-layout {
    display: block;
    background: var(--canvas);
  }
  .auth-showcase {
    display: none;
  }
  .auth-panel {
    min-height: 100vh;
    justify-content: flex-start;
    padding: 24px 24px;
  }
  .mobile-auth-brand {
    display: flex;
    margin-bottom: 34px;
  }
  .auth-footer {
    text-align: center;
  }
  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .portal-page-header {
    gap: 20px;
  }
  .search-box {
    width: 100%;
  }
  .header-actions {
    width: 100%;
  }
  .header-actions .button {
    flex: 1;
  }
  .video-detail-row {
    flex-direction: column;
    padding: 23px;
  }
  .video-actions {
    justify-content: flex-start;
  }
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .stat-card {
    min-height: 80px;
  }
  .detail-summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .detail-summary .button {
    margin-left: auto;
  }
}

@media (max-width: 620px) {
  .mobile-topbar {
    height: 68px;
    padding: 0 17px;
  }
  .mobile-topbar .brand-mark {
    width: 64px;
    height: 36px;
    flex-basis: 64px;
    border-radius: 10px;
  }
  .main-content {
    padding: 27px 14px 55px;
  }
  .page-header {
    margin-bottom: 24px;
  }
  .page-header h1 {
    font-size: 2rem;
  }
  .page-header p {
    font-size: 0.82rem;
  }
  .featured-section {
    margin-bottom: 38px;
    border-radius: 16px;
  }
  .section-label {
    min-height: 41px;
    padding: 0 13px;
    font-size: 0.58rem;
  }
  .player-shell {
    aspect-ratio: 16 / 10;
  }
  .player-placeholder {
    padding: 23px;
  }
  .player-placeholder strong {
    max-width: 90%;
  }
  .center-play {
    width: 58px;
    height: 58px;
  }
  .center-play .ui-icon {
    width: 23px;
    height: 23px;
  }
  .player-controls {
    padding: 45px 9px 8px;
  }
  .player-button {
    width: 34px;
    height: 34px;
  }
  .skip-control,
  .pip-button {
    display: none;
  }
  .volume-control input {
    display: none;
  }
  .time-code {
    margin-left: 2px;
  }
  .video-detail-row {
    gap: 20px;
    padding: 19px 17px 21px;
  }
  .video-actions {
    width: 100%;
  }
  .video-actions .button {
    flex: 1;
    font-size: 0.75rem;
  }
  .library-heading h2 {
    font-size: 1.25rem;
  }
  .video-grid {
    grid-template-columns: 1fr;
  }
  .customer-list {
    grid-template-columns: 1fr;
  }
  .folder-admin-grid {
    grid-template-columns: 1fr;
  }
  .account-row {
    flex-wrap: wrap;
  }
  .account-main {
    min-width: calc(100% - 55px);
  }
  .status-pill {
    margin-left: 48px;
  }
  .row-actions {
    margin-left: auto;
  }
  .login-history-panel {
    padding: 16px 14px 18px;
  }
  .login-history-heading {
    align-items: flex-start;
  }
  .history-retention {
    display: none;
  }
  .admin-video-row {
    padding: 12px 14px;
  }
  .file-size {
    display: none;
  }
  .detail-summary {
    gap: 13px;
  }
  .detail-summary .button {
    width: 100%;
    margin-left: 0;
  }
  .two-columns {
    grid-template-columns: 1fr;
  }
  .dialog-head,
  .dialog-form {
    padding: 17px;
  }
  .summary-content {
    gap: 22px;
    padding: 20px 17px 23px;
  }
  .summary-dialog-actions {
    padding: 13px 17px;
  }
  .summary-dialog-actions .button {
    width: 100%;
  }
  .dialog-actions {
    margin: 4px -17px -17px;
    padding: 13px 17px;
  }
  .dialog-actions .button {
    flex: 1;
    padding: 0 11px;
  }
  .app-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 19px;
  }
  .toast-region {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 420px) {
  .auth-panel {
    padding-inline: 18px;
  }
  .mobile-auth-brand {
    margin-bottom: 38px;
  }
  .auth-heading {
    margin-bottom: 28px;
  }
  .header-actions {
    flex-direction: column;
  }
  .control-group {
    gap: 0;
  }
  .speed-button {
    display: none;
  }
  .time-code {
    font-size: 0.6rem;
  }
  .video-actions {
    flex-direction: column;
  }
  .video-actions .button {
    width: 100%;
  }
}

@media (hover: none) {
  .timeline-input::-webkit-slider-thumb {
    opacity: 1;
  }
  .timeline-input::-moz-range-thumb {
    opacity: 1;
  }
  .volume-control input {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
