:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #14181e;
  --panel2: #1a2028;
  --text: #f4f7fb;
  --muted: #8e9aaa;
  --line: #28313d;
  --accent: #ffffff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(11,13,16,.94);
  backdrop-filter: blur(12px);
  z-index: 10;
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.userbox { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 60px; }
.hero h1, .page-head h1 { margin: 0; font-size: 30px; }
.hero p { color: var(--muted); margin: 8px 0 26px; }
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.category-card {
  position: relative;
  min-height: 150px;
  padding: 22px;
  overflow: hidden;
  background: linear-gradient(145deg, var(--panel), var(--panel2));
  border: 1px solid var(--line);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  transition: transform .18s ease, border-color .18s ease;
}
.category-card:hover { transform: translateY(-2px); border-color: #536173; }
.category-card.disabled { opacity: .45; pointer-events: none; }
.category-title { font-size: 23px; font-weight: 800; }
.muted { color: var(--muted); margin-top: 6px; font-size: 14px; }
.auth-wrap { min-height: calc(100vh - 160px); display: grid; place-items: center; }
.auth-card {
  width: min(430px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px;
}
.auth-card h1 { margin: 0 0 8px; }
.auth-card p { color: var(--muted); line-height: 1.55; }
.form { display: grid; gap: 16px; margin-top: 22px; }
.form label { display: grid; gap: 8px; color: #c8d0db; font-size: 14px; }
.form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 14px;
  background: #0e1217;
  color: var(--text);
  outline: none;
}
.form input:focus { border-color: #6a788b; }
.primary {
  border: 0;
  border-radius: 11px;
  padding: 13px 16px;
  background: var(--accent);
  color: #0b0d10;
  font-weight: 800;
  cursor: pointer;
}
.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
  cursor: pointer;
}
.error, .warn {
  border: 1px solid #8a4141;
  background: #2a1616;
  color: #ffcdcd;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 14px 0;
}
.warn { border-color: #6f5b28; background: #241e10; color: #f2dea0; }
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.eyebrow { color: var(--muted); font-size: 13px; margin-bottom: 5px; }
.ghost-link {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  color: #d9e0e9;
}
.file-list { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.file-row, .folder-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.file-row:last-child { border-bottom: 0; }
.file-row:hover, .folder-row:hover { background: var(--panel2); }
.folder-row { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; }
.icon { width: 24px; text-align: center; }
.grow { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.badge {
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
}
.empty { padding: 30px; color: var(--muted); background: var(--panel); }
.player {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
@media (max-width: 800px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 16px; }
}
@media (max-width: 520px) {
  .category-grid { grid-template-columns: 1fr; }
  .container { width: min(100% - 20px, 1180px); }
}

.transcode-box {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.transcode-title { font-weight: 800; font-size: 17px; }
.transcode-note { margin-top: 5px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.progress-track {
  height: 9px;
  margin: 14px 0 8px;
  overflow: hidden;
  background: #0d1116;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.progress-bar {
  height: 100%;
  background: #f4f7fb;
  transition: width .3s ease;
}

.codec-line {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.login-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-top: -2px;
}
.check-row {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  cursor: pointer;
  user-select: none;
}
.check-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #ffffff;
}
.login-security-note {
  margin-top: -2px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #0e1217;
  font-size: 12px;
  line-height: 1.5;
}

.seek-box {
  margin: 0 0 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.seek-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.seek-title {
  font-weight: 800;
  font-size: 15px;
}
.seek-range {
  width: 100%;
  cursor: pointer;
}
.seek-times {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.seek-times span:nth-child(2) { text-align: center; }
.seek-times span:nth-child(3) { text-align: right; }

@media (max-width: 620px) {
  .seek-head {
    align-items: stretch;
    flex-direction: column;
  }
}

/* v6 Random Seek */
.transcode-box .progress-bar {
  min-width: 0;
}

.playback-tools {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.playback-info,
.next-file-panel {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #7bd88f;
}
.next-file-panel {
  flex-wrap: wrap;
}
.auto-next-row {
  margin-right: 6px;
}
.next-file-name {
  flex: 1 1 260px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
}

/* v11 - Artplayer custom fullscreen transport controls */
.mystream-art-control {
  min-width: 32px;
  height: 34px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1;
  user-select: none;
}
.mystream-art-control b {
  font-size: 17px;
  font-weight: 700;
}
.mystream-art-control small {
  font-size: 9px;
  opacity: .9;
}
.next-file-panel .ghost:disabled {
  opacity: .35;
  cursor: default;
}
@media (max-width: 720px) {
  .mystream-art-control {
    min-width: 27px;
  }
  .mystream-art-control b {
    font-size: 15px;
  }
  .mystream-art-control small {
    font-size: 8px;
  }
}


/* v12 Admin */
.admin-nav {
  color: #f4f7fb;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
}
.role-badge,
.self-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 4px 7px;
  background: #242d38;
  border: 1px solid #3b4858;
  color: #dce7f5;
}
.self-badge {
  margin-left: 6px;
  font-size: 9px;
  padding: 3px 6px;
}
.flash-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}
.flash {
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.flash.success {
  border-color: #335b42;
  background: #132219;
  color: #bde7c7;
}
.flash.error {
  border-color: #7a3939;
  background: #281515;
  color: #ffc7c7;
}
.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.admin-head h1 {
  margin: 0;
  font-size: 30px;
}
.admin-head p {
  color: var(--muted);
  margin: 8px 0 0;
}
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.admin-stat {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, var(--panel), var(--panel2));
}
.admin-stat-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: auto;
}
.admin-stat-value {
  font-size: 27px;
  font-weight: 800;
  margin: 8px 0 3px;
}
.admin-section {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.admin-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.admin-section h2 {
  margin: 0;
  font-size: 20px;
}
.admin-section p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.admin-media-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.admin-media-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10151b;
}
.admin-media-name {
  font-weight: 800;
  margin-bottom: 8px;
}
.admin-status {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--line);
}
.admin-status.ok {
  color: #bde7c7;
  background: #14241a;
  border-color: #315b3d;
}
.admin-status.bad {
  color: #ffc7c7;
  background: #281515;
  border-color: #7a3939;
}
.admin-create-form {
  display: grid;
  grid-template-columns: 1.3fr 1.4fr .8fr auto;
  align-items: end;
  gap: 10px;
}
.admin-create-form label {
  display: grid;
  gap: 6px;
  color: #c8d0db;
  font-size: 13px;
}
.admin-create-form input,
.admin-create-form select,
.admin-inline-form input,
.admin-inline-form select {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0e1217;
  color: var(--text);
}
.admin-create-btn {
  min-height: 40px;
  white-space: nowrap;
}
.admin-user-list {
  display: grid;
  gap: 8px;
}
.admin-user-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(190px, .9fr) minmax(250px, 1.2fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10151b;
}
.admin-user-name {
  font-weight: 800;
  margin-bottom: 4px;
}
.admin-inline-form {
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-inline-form select {
  min-width: 80px;
}
.password-form input {
  min-width: 130px;
}
.danger-button {
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid #713737;
  background: #2b1515;
  color: #ffbcbc;
  cursor: pointer;
}
.danger-button:disabled {
  opacity: .35;
  cursor: default;
}
.admin-warning {
  margin-top: 14px;
  padding: 12px 13px;
  border-radius: 11px;
  border: 1px solid #6f5b28;
  background: #241e10;
  color: #f2dea0;
  font-size: 13px;
}

@media (max-width: 1000px) {
  .admin-stat-grid,
  .admin-media-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-user-row {
    grid-template-columns: 1fr 1fr;
  }
  .admin-create-form {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 620px) {
  .admin-head {
    flex-direction: column;
  }
  .admin-stat-grid,
  .admin-media-grid,
  .admin-create-form,
  .admin-user-row {
    grid-template-columns: 1fr;
  }
  .admin-inline-form {
    width: 100%;
  }
}


/* v13 - per-user streaming permissions */
.access-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
}
.access-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 800;
}
.access-badge.all {
  color: #bde7c7;
  background: #14241a;
  border-color: #315b3d;
}
.access-badge.selected {
  color: #c9dbff;
  background: #162036;
  border-color: #344e7c;
}
.access-badge.none {
  color: #ffc7c7;
  background: #281515;
  border-color: #7a3939;
}
.permission-link {
  font-size: 12px;
  color: #dce7f5;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.permission-form {
  padding-bottom: 88px;
}
.permission-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.permission-mode-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  column-gap: 10px;
  row-gap: 5px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #10151b;
  cursor: pointer;
}
.permission-mode-card input {
  grid-row: span 2;
  width: 17px;
  height: 17px;
  margin-top: 2px;
}
.permission-mode-title {
  font-weight: 800;
}
.permission-category {
  transition: opacity .15s ease;
}
.permission-category.inactive {
  opacity: .55;
}
.permission-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}
.permission-category-head h2 {
  margin: 0;
}
.permission-category-actions {
  display: flex;
  gap: 7px;
}
.permission-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  max-height: 440px;
  overflow: auto;
  padding-right: 4px;
}
.permission-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0e1319;
  cursor: pointer;
}
.permission-item:hover {
  background: #151c24;
}
.permission-item input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}
.permission-item-icon {
  flex: 0 0 auto;
}
.permission-item-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.permission-savebar {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 13px 15px;
  border: 1px solid #3a4654;
  border-radius: 13px;
  background: rgba(20,24,30,.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
}
.permission-savebar .primary {
  flex: 0 0 auto;
  min-width: 130px;
}

@media (max-width: 900px) {
  .permission-mode-grid {
    grid-template-columns: 1fr;
  }
  .permission-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .permission-category-head,
  .permission-savebar {
    align-items: stretch;
    flex-direction: column;
  }
  .permission-items {
    grid-template-columns: 1fr;
  }
}


/* v14 */
.library-empty {
  margin-top: 8px;
  padding: 28px 20px;
  text-align: center;
}


/* v15 - NAS folder linking */
.admin-media-path {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.folder-link-security {
  margin-bottom: 18px;
}
.library-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.library-link-card {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #10151b;
}
.library-link-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.library-key {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
  color: var(--muted);
}
.library-enable {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}
.library-enable input {
  width: 16px;
  height: 16px;
}
.library-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #c8d0db;
}
.library-field > input,
.library-path-row input {
  min-width: 0;
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0e1217;
  color: var(--text);
}
.library-path-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}
.library-current-path {
  min-width: 0;
  display: flex;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}
.library-current-path strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #d7e0ea;
}
.library-link-status {
  min-height: 25px;
}
.folder-browser-section {
  scroll-margin-top: 12px;
}
.folder-browser-path {
  margin-bottom: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1015;
  color: #dce7f5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.nas-root-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.nas-root-button,
.folder-browser-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f151b;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.nas-root-button:hover,
.folder-browser-item:hover {
  background: #17202a;
  border-color: #455465;
}
.nas-root-button span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.nas-root-button small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nas-root-icon,
.folder-browser-icon {
  flex: 0 0 auto;
  font-size: 20px;
}
.folder-browser-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.folder-browser-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#browserParent:disabled,
#useCurrentFolder:disabled {
  opacity: .35;
  cursor: default;
}

@media (max-width: 800px) {
  .library-link-grid,
  .nas-root-buttons {
    grid-template-columns: 1fr;
  }
  .folder-browser-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .folder-browser-grid,
  .library-path-row {
    grid-template-columns: 1fr;
  }
}


/* v17 - Dynamic categories + category-level grants */
.new-category-section {
  border-color: #40536a;
}
.new-category-form {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(300px, 1.6fr) auto;
  gap: 12px;
  align-items: end;
}
.new-category-form .library-current-path {
  grid-column: 1 / -1;
}
.custom-category-badge {
  display: inline-flex;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid #425a78;
  background: #152033;
  color: #c9dcfa;
  font-size: 9px;
  font-weight: 800;
}
.permission-category-title-group {
  min-width: 0;
}
.category-access-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.category-access-toggle input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.category-access-toggle span {
  display: grid;
  gap: 3px;
}
.category-access-toggle strong {
  font-size: 18px;
}
.category-access-toggle small {
  color: var(--muted);
  font-size: 11px;
}
.permission-category.category-blocked {
  border-color: #593538;
  opacity: .65;
}
.permission-category.items-inactive .permission-items {
  opacity: .45;
}
.permission-category.items-inactive .permission-category-actions {
  opacity: .55;
}

@media (max-width: 900px) {
  .new-category-form {
    grid-template-columns: 1fr;
  }
  .new-category-form .library-current-path {
    grid-column: auto;
  }
}


/* v18 - 아트플레이어 볼륨 컨트롤 */
.daniel-volume-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 150px;
  height: 34px;
  padding: 0 4px;
}
.daniel-volume-mute {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 17px;
  line-height: 30px;
  cursor: pointer;
}
.daniel-volume-range {
  width: 78px;
  min-width: 60px;
  cursor: pointer;
  accent-color: currentColor;
}
.daniel-volume-value {
  flex: 0 0 32px;
  font-size: 10px;
  text-align: right;
  opacity: .9;
}
@media (max-width: 720px) {
  .daniel-volume-control {
    min-width: 108px;
    gap: 3px;
  }
  .daniel-volume-range {
    width: 50px;
    min-width: 45px;
  }
  .daniel-volume-value {
    display: none;
  }
}


/* v19 - Cache management */
.admin-stat-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.admin-stat-link:hover {
  border-color: #526477;
}
.cache-policy-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.cache-policy-summary > span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #10151b;
  color: var(--muted);
  font-size: 12px;
}
.cache-policy-summary strong {
  color: var(--text);
}
.cache-mode-value {
  font-size: 22px;
}
.cache-settings-form {
  display: grid;
  gap: 12px;
}
.cache-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10151b;
}
.cache-toggle-card > span {
  display: grid;
  gap: 5px;
}
.cache-toggle-card small,
.library-field small {
  color: var(--muted);
  font-size: 11px;
}
.cache-toggle-card input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
.cache-number-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.cache-number-grid input {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0e1217;
  color: var(--text);
}
.cache-settings-actions,
.cache-manual-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.cache-entry-list {
  display: grid;
  gap: 7px;
}
.cache-entry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10151b;
}
.cache-entry-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.cache-entry-main strong,
.cache-entry-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cache-entry-meta {
  flex: 0 0 auto;
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}
@media (max-width: 900px) {
  .cache-number-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .cache-number-grid {
    grid-template-columns: 1fr;
  }
  .cache-entry-row,
  .cache-toggle-card {
    align-items: stretch;
    flex-direction: column;
  }
  .cache-entry-meta {
    justify-content: space-between;
  }
}


/* v20 - 자막 크기 표준화
   기준: 1280px 전체화면에서 약 38px, 사진과 비슷한 가독성.
   원본 ASS/VTT/SRT의 개별 font-size가 있어도 이 값을 우선합니다. */
#artplayer .art-subtitle,
#artplayer .art-subtitle *,
#artplayer .art-subtitle-text,
#artplayer .art-subtitle-text * {
  font-size: clamp(30px, 3vw, 48px) !important;
  line-height: 1.32 !important;
  font-weight: 600 !important;
  color: #fff !important;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 1),
    0 0 2px rgba(0, 0, 0, 1) !important;
}

/* 작은 플레이어/모바일에서는 화면을 과도하게 가리지 않도록 하한 조정 */
@media (max-width: 720px) {
  #artplayer .art-subtitle,
  #artplayer .art-subtitle *,
  #artplayer .art-subtitle-text,
  #artplayer .art-subtitle-text * {
    font-size: clamp(24px, 5vw, 34px) !important;
  }
}


/* v21 - System Dashboard */
.system-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.system-overview-grid > div,
.library-result-grid > div {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #10151b;
}
.system-overview-grid span,
.library-result-grid span {
  color: var(--muted);
  font-size: 11px;
}
.system-overview-grid strong,
.library-result-grid strong {
  font-size: 21px;
}
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #bde7c7;
  font-size: 11px;
  font-weight: 800;
}
.live-indicator > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}
.system-table-wrap {
  overflow-x: auto;
}
.system-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.system-table th,
.system-table td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
}
.system-table th {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.system-media-cell {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.system-media-cell > span {
  color: var(--muted);
  font-size: 10px;
}
.system-media-cell > strong {
  max-width: 320px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.system-mode-badge,
.system-active-badge {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid #40536a;
  background: #142034;
  color: #c9dcfa;
  font-size: 10px;
  font-weight: 800;
}
.system-active-badge {
  border-color: #315b3d;
  background: #14241a;
  color: #bde7c7;
}
.system-error {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ffc7c7;
}
.ua-cell {
  max-width: 360px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.system-action-cell {
  text-align: right !important;
}
.system-small-button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 10px;
}
.library-scan-box {
  margin-bottom: 14px;
}
.library-scan-box .progress-track {
  margin-bottom: 8px;
}
.library-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.codec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.codec-panel {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10151b;
}
.codec-panel h3 {
  margin: 0 0 10px;
  font-size: 13px;
}
.codec-list {
  display: grid;
  gap: 6px;
}
.codec-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
}
.codec-list span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
}
@media (max-width: 900px) {
  .system-overview-grid,
  .library-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .codec-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .system-overview-grid,
  .library-result-grid {
    grid-template-columns: 1fr;
  }
}


/* v22 - 자막 위치 고정
   아트플레이어 네비게이션이 숨겨져도 자막이 화면 맨 아래로 내려가지 않게,
   '네비게이션이 보일 때의 자막 최하단' 위치를 항상 유지합니다. */
#artplayer .art-subtitle,
#artplayer .art-subtitle-text {
  bottom: calc(var(--art-control-height, 46px) + 18px) !important;
  transition: none !important;
}

/* Artplayer 5.x의 subtitle line에도 동일 기준을 적용 */
#artplayer .art-subtitle-line {
  margin-top: 0 !important;
}

/* 작은 화면에서는 컨트롤 높이는 유지하되 여백만 조금 줄임 */
@media (max-width: 720px) {
  #artplayer .art-subtitle,
  #artplayer .art-subtitle-text {
    bottom: calc(var(--art-control-height, 46px) + 10px) !important;
  }
}


/* v23 - Background Jobs */
.admin-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.background-job-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.background-job-title-row h2 {
  margin: 3px 0 0;
}
.background-job-type {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
}
.job-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #10151b;
  color: #dce7f5;
  font-size: 11px;
  font-weight: 800;
}
.job-status-badge[data-status="scanning"],
.job-status-badge[data-status="starting"] {
  border-color: #315b3d;
  background: #14241a;
  color: #bde7c7;
}
.job-status-badge[data-status="paused"] {
  border-color: #715f2e;
  background: #271f0f;
  color: #f3dda0;
}
.job-status-badge[data-status="failed"],
.job-status-badge[data-status="canceled"],
.job-status-badge[data-status="interrupted"] {
  border-color: #713737;
  background: #2b1515;
  color: #ffbcbc;
}
.background-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.background-progress-row .progress-track {
  margin: 0;
}
.background-scan-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.background-scan-numbers > span,
.background-job-counts > span {
  display: inline-flex;
  gap: 5px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #10151b;
  color: var(--muted);
  font-size: 11px;
}
.background-scan-numbers strong,
.background-job-counts strong {
  color: var(--text);
}
.background-current-file {
  display: grid;
  gap: 5px;
  margin-top: 13px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0e1319;
}
.background-current-file span {
  color: var(--muted);
  font-size: 10px;
}
.background-current-file strong {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
}
.background-job-message {
  margin-top: 10px;
}
.background-job-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}
.background-job-controls form {
  margin: 0;
}
.background-job-controls button:disabled {
  opacity: .35;
  cursor: default;
}
.warning-button {
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid #735e2b;
  background: #281f0f;
  color: #f1d58d;
  cursor: pointer;
}
.background-control-help {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 14px;
}
.background-control-help > div {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #0d1217;
}
.background-control-help strong {
  font-size: 11px;
}
.background-control-help span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}
.background-job-counts {
  display: flex;
  gap: 6px;
}
@media (max-width: 700px) {
  .background-control-help {
    grid-template-columns: 1fr;
  }
}


/* v24 Admin Operations */
.ops-error-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border: 1px solid #713737;
  border-radius: 999px;
  background: #281515;
  color: #ffc7c7;
  font-size: 12px;
  text-decoration: none;
}
.user-session-limit-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}
.user-session-limit-form select {
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1217;
  color: var(--text);
}
.category-order-list {
  display: grid;
  gap: 7px;
}
.category-order-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10151b;
}
.category-order-row > div:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.category-order-row small {
  color: var(--muted);
}
.category-order-handle {
  color: var(--muted);
  font-size: 18px;
}
.category-order-actions {
  display: flex;
  gap: 5px;
}
.settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.settings-grid-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.settings-grid-form input[type="number"],
.settings-grid-form input[type="text"],
.settings-grid-form input[type="color"] {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0e1217;
  color: var(--text);
}
.settings-grid-form input[type="color"] {
  padding: 4px;
}
.settings-full-row {
  grid-column: 1 / -1;
}
.maintenance-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10151b;
}
.maintenance-toggle-card > span {
  display: grid;
  gap: 4px;
}
.maintenance-toggle-card small {
  color: var(--muted);
  font-size: 10px;
}
.maintenance-toggle-card input {
  width: 20px;
  height: 20px;
}
.subtitle-preview-video {
  position: relative;
  height: 220px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background:
    linear-gradient(to bottom, #23405e, #0f1720 70%, #050607);
}
.subtitle-preview-video::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42px;
  background: rgba(0,0,0,.75);
}
#subtitlePreviewText {
  position: absolute;
  z-index: 2;
  left: 50%;
  transform: translateX(-50%);
  width: 95%;
  text-align: center;
  font-weight: 600;
  line-height: 1.32;
  text-shadow: 0 2px 4px #000, 0 0 2px #000;
  white-space: nowrap;
}
.blocked-login-list {
  display: grid;
  gap: 7px;
}
.blocked-login-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #713737;
  border-radius: 10px;
  background: #211313;
}
.blocked-login-row > div {
  display: grid;
  gap: 3px;
}
.blocked-login-row span {
  color: var(--muted);
  font-size: 11px;
}
.thumbnail-job-box {
  display: grid;
  gap: 7px;
}
.thumbnail-current {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 11px;
}
.backup-download-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.video-file-row {
  min-height: 60px;
}
.video-thumb {
  flex: 0 0 80px;
  width: 80px;
  height: 45px;
  object-fit: cover;
  border-radius: 6px;
  background: #0a0d11;
}
.maintenance-page {
  max-width: 620px;
  margin: 12vh auto 0;
  padding: 28px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.maintenance-icon {
  font-size: 42px;
  margin-bottom: 12px;
}
.maintenance-page h1 {
  margin: 7px 0 10px;
}
.maintenance-page p {
  color: var(--muted);
  line-height: 1.7;
}
.playback-error-message {
  max-width: 440px;
  display: grid;
  gap: 3px;
}
.playback-error-message strong {
  color: #ffc7c7;
}
.playback-error-message span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
}

/* v24 subtitle defaults from Admin Settings */
#artplayer .art-subtitle,
#artplayer .art-subtitle *,
#artplayer .art-subtitle-text,
#artplayer .art-subtitle-text * {
  font-size: var(--daniel-subtitle-size, 38px) !important;
  color: var(--daniel-subtitle-color, #ffffff) !important;
}
#artplayer .art-subtitle,
#artplayer .art-subtitle-text {
  bottom: calc(
    var(--art-control-height, 46px)
    + var(--daniel-subtitle-bottom, 18px)
  ) !important;
}

@media (max-width: 900px) {
  .settings-grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 620px) {
  .settings-grid-form {
    grid-template-columns: 1fr;
  }
  .settings-full-row {
    grid-column: auto;
  }
  .blocked-login-row {
    align-items: stretch;
    flex-direction: column;
  }
  .video-thumb {
    width: 64px;
    height: 36px;
    flex-basis: 64px;
  }
}


/* v25 - Per-user Favorites */
.favorites-nav {
  color: #f5d675;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}
.home-hero,
.section-title-row,
.watch-head-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.home-favorites {
  margin-bottom: 24px;
}
.section-title-row h2 {
  margin: 3px 0 0;
}
.favorite-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 11px;
}
.favorite-preview-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10151b;
  color: inherit;
  text-decoration: none;
}
.favorite-preview-card img,
.favorite-folder-art {
  width: 100%;
  height: 105px;
  object-fit: cover;
  background: #0b1015;
}
.favorite-folder-art {
  display: grid;
  place-items: center;
  font-size: 38px;
}
.favorite-preview-text {
  display: grid;
  gap: 3px;
  padding: 9px 10px 11px;
}
.favorite-preview-text span {
  color: var(--muted);
  font-size: 10px;
}
.favorite-preview-text strong {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
}
.media-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: stretch;
}
.media-list-main {
  min-width: 0;
}
.favorite-inline-form {
  display: flex;
  margin: 0;
}
.favorite-star {
  width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10151b;
  color: #8994a1;
  font-size: 23px;
  cursor: pointer;
}
.favorite-star:hover,
.favorite-star.active {
  border-color: #796424;
  background: #29210d;
  color: #f5d675;
}
.favorite-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.favorite-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10151b;
}
.favorite-card-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.favorite-card-thumb,
.favorite-card-folder {
  width: 110px;
  height: 62px;
  border-radius: 8px;
  object-fit: cover;
  background: #0b1015;
}
.favorite-card-folder {
  display: grid;
  place-items: center;
  font-size: 30px;
}
.favorite-card-text {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.favorite-card-text span,
.favorite-card-text small {
  color: var(--muted);
  font-size: 10px;
}
.favorite-card-text strong,
.favorite-card-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.favorite-remove-button {
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #796424;
  border-radius: 9px;
  background: #29210d;
  color: #f5d675;
  cursor: pointer;
}
.favorite-empty {
  line-height: 1.8;
}
.watch-favorite-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #10151b;
  color: var(--text);
  cursor: pointer;
}
.watch-favorite-button.active {
  border-color: #796424;
  background: #29210d;
  color: #f5d675;
}
.watch-favorite-button:disabled {
  opacity: .5;
  cursor: default;
}

@media (max-width: 900px) {
  .favorite-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .favorite-list-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .favorite-preview-grid {
    grid-template-columns: 1fr;
  }
  .favorite-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .favorite-card-main {
    grid-template-columns: 80px minmax(0, 1fr);
  }
  .favorite-card-thumb,
  .favorite-card-folder {
    width: 80px;
    height: 45px;
  }
}


/* v26 - Search */
.global-search {
  display: flex;
  align-items: center;
  min-width: 220px;
  max-width: 360px;
  flex: 1 1 260px;
  margin-left: auto;
}
.global-search input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 9px 0 0 9px;
  background: #0c1117;
  color: var(--text);
  outline: none;
}
.global-search input:focus {
  border-color: #596877;
}
.global-search button {
  width: 38px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 0 9px 9px 0;
  background: #141a21;
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
}
.home-search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: -2px 0 22px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #10151b;
}
.home-search-box > span {
  color: var(--muted);
  font-size: 22px;
}
.home-search-box input {
  min-width: 0;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  font-size: 14px;
}
.search-filter-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 150px auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.search-filter-form input,
.search-filter-form select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0e1217;
  color: var(--text);
}
.search-main-input {
  font-size: 14px;
}
.search-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0 11px;
}
.search-summary span {
  color: var(--muted);
  font-size: 12px;
}
.search-result-list {
  display: grid;
  gap: 8px;
}
.search-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: stretch;
}
.search-result-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-height: 84px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #10151b;
  color: inherit;
  text-decoration: none;
}
.search-result-main:hover {
  border-color: #586676;
  background: #141b23;
}
.search-result-media {
  position: relative;
  width: 96px;
  height: 54px;
  overflow: hidden;
  border-radius: 7px;
  background: #0b1015;
}
.search-result-folder,
.search-result-video-fallback {
  display: grid;
  place-items: center;
  font-size: 28px;
}
.search-result-video-fallback {
  position: absolute;
  inset: 0;
}
.search-result-thumb {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 7px;
  background: #0b1015;
}
.search-result-video.has-thumb .search-result-video-fallback {
  display: none;
}
.search-result-text {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.search-result-meta {
  display: flex;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}
.search-result-text strong,
.search-result-text small {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.search-result-name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  white-space: normal;
  line-height: 1.35;
  font-size: 14px;
}
.search-result-path {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  white-space: normal;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}
.search-tips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 8px;
}
.search-tips > div {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #10151b;
}
.search-tips span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.search-empty {
  line-height: 1.8;
}

@media (max-width: 900px) {
  .global-search {
    min-width: 160px;
    max-width: none;
  }
  .search-filter-form {
    grid-template-columns: minmax(0, 1fr) 1fr 1fr;
  }
  .search-filter-form .primary {
    grid-column: 1 / -1;
  }
  .search-tips {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .global-search {
    order: 10;
    flex-basis: 100%;
    width: 100%;
  }
  .search-filter-form {
    grid-template-columns: 1fr;
  }
  .search-filter-form .primary {
    grid-column: auto;
  }
  .search-result-main {
    grid-template-columns: 72px minmax(0, 1fr);
  }
  .search-result-media,
  .search-result-thumb {
    width: 72px;
    height: 41px;
  }
  .home-search-box {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .home-search-box .primary {
    grid-column: 1 / -1;
  }
}


/* v26.2 - Long search filenames */
.search-result-text {
  padding: 2px 0;
}
.search-result-row:hover .search-result-name {
  -webkit-line-clamp: 5;
  line-clamp: 5;
}
@media (max-width: 620px) {
  .search-result-name {
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }
  .search-result-path {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}


/* v26.3 - Search file cards use the same geometry as folder cards */
.search-result-main {
  grid-template-columns: 96px minmax(0, 1fr);
}
.search-result-text {
  width: 100%;
  min-width: 0;
}
.search-result-name {
  width: 100%;
}
@media (max-width: 620px) {
  .search-result-main {
    grid-template-columns: 72px minmax(0, 1fr);
  }
}


/* v27 - Admin TOTP 2FA */
.twofa-auth-wrap { align-items: flex-start; padding-top: 5vh; }
.twofa-card { width: min(760px, 100%); }
.twofa-setup-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  margin-top: 20px;
}
.twofa-qr {
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
}
.twofa-qr img { display: block; width: 100%; max-width: 236px; height: auto; }
.twofa-steps { display: grid; align-content: start; gap: 14px; }
.twofa-steps > div { display: grid; gap: 6px; }
.twofa-steps span { color: var(--muted); font-size: 12px; line-height: 1.55; }
.twofa-secret {
  display: block;
  padding: 10px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0a0e13;
  color: #f0d977;
  letter-spacing: .08em;
  user-select: all;
}
.twofa-code-form input {
  text-align: center;
  letter-spacing: .14em;
  font-size: 18px;
}
.twofa-cancel-form { margin-top: 12px; text-align: center; }
.twofa-recovery-card { max-width: 680px; }
.recovery-code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}
.recovery-code-grid code {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0b1015;
  color: #f2dc80;
  text-align: center;
  letter-spacing: .08em;
  user-select: all;
}
.twofa-recovery-actions { display: flex; justify-content: flex-end; gap: 8px; }
.security-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.security-status-badge.enabled {
  border-color: #315b3d;
  background: #14241a;
  color: #bde7c7;
}
.twofa-admin-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.twofa-admin-summary > div {
  display: grid;
  gap: 3px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f151b;
}
.twofa-admin-summary span { color: var(--muted); font-size: 10px; }
.twofa-reconfigure {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d1217;
}
.twofa-reconfigure summary { cursor: pointer; font-weight: 700; }
.twofa-reconfigure p { color: var(--muted); font-size: 11px; }

@media (max-width: 720px) {
  .twofa-setup-grid { grid-template-columns: 1fr; }
  .twofa-qr { width: min(280px, 100%); margin: 0 auto; }
  .recovery-code-grid { grid-template-columns: 1fr; }
  .twofa-admin-summary { grid-template-columns: 1fr; }
}


/* v28 Security Suite */
.audit-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}
.audit-search input {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0e1217;
  color: var(--text);
}
.audit-ok {
  color: #bde7c7;
  font-weight: 700;
}
.audit-fail {
  color: #ffbcbc;
  font-weight: 700;
}


/* v28.1 - Animation library artwork */
.category-card-content {
  position: relative;
  z-index: 3;
}
.category-card-animation {
  min-height: 190px;
  background: #080a0d;
}
.category-card-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 43%;
  transform: scale(1.01);
  transition: transform .25s ease, filter .25s ease;
}
.category-card-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(
      to top,
      rgba(5, 7, 10, .96) 0%,
      rgba(5, 7, 10, .72) 32%,
      rgba(5, 7, 10, .20) 68%,
      rgba(5, 7, 10, .06) 100%
    );
}
.category-card-animation .category-title {
  color: #fff;
  text-shadow: 0 2px 7px rgba(0, 0, 0, .9);
}
.category-card-animation .muted {
  color: rgba(255, 255, 255, .78);
  text-shadow: 0 1px 5px rgba(0, 0, 0, .9);
}
.category-card-animation:hover .category-card-art {
  transform: scale(1.045);
  filter: brightness(1.04);
}


/* v28.2 - Drama / Movie library artwork */
.category-card-drama,
.category-card-movie {
  min-height: 190px;
  background: #080a0d;
}
.category-card-art-drama {
  object-position: 50% 50%;
}
.category-card-art-movie {
  object-position: 50% 42%;
}
.category-card-drama .category-title,
.category-card-movie .category-title {
  color: #fff;
  text-shadow: 0 2px 7px rgba(0, 0, 0, .9);
}
.category-card-drama .muted,
.category-card-movie .muted {
  color: rgba(255, 255, 255, .78);
  text-shadow: 0 1px 5px rgba(0, 0, 0, .9);
}
.category-card-drama:hover .category-card-art,
.category-card-movie:hover .category-card-art {
  transform: scale(1.045);
  filter: brightness(1.04);
}


/* v28.3 - Admin category artwork upload */
.category-card-with-art {
  min-height: 190px;
  background: #080a0d;
}
.category-card-with-art .category-title {
  color: #fff;
  text-shadow: 0 2px 7px rgba(0, 0, 0, .9);
}
.category-card-with-art .muted {
  color: rgba(255, 255, 255, .78);
  text-shadow: 0 1px 5px rgba(0, 0, 0, .9);
}
.category-card-with-art:hover .category-card-art {
  transform: scale(1.045);
  filter: brightness(1.04);
}

.category-art-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.category-art-card {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f151b;
}
.category-art-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 6;
  overflow: hidden;
  border-radius: 9px;
  background: #090d11;
}
.category-art-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.category-art-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .12em;
}
.category-art-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.category-art-info > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.category-art-info small,
.category-art-file {
  color: var(--muted);
  font-size: 10px;
}
.category-art-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
}
.category-art-status.custom {
  border-color: #796424;
  color: #f2dc80;
  background: #29210d;
}
.category-art-status.default {
  border-color: #315b3d;
  color: #bde7c7;
  background: #14241a;
}
.category-art-upload-form {
  display: grid;
  gap: 8px;
}
.category-art-upload-form input[type="file"] {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0a0f14;
  color: var(--text);
}

@media (max-width: 800px) {
  .category-art-grid {
    grid-template-columns: 1fr;
  }
}
