:root {
  --bg: #0b1220;
  --panel: rgba(255, 255, 255, 0.06);
  --panel2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);
  --accent: #27c0ff;
  --amber: #ffb020;
  --red: #ff4d4f;
  --green: #2ecc71;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(
      1200px 600px at 20% 10%,
      rgba(39, 192, 255, 0.16),
      transparent 70%
    ),
    radial-gradient(
      900px 520px at 80% 0%,
      rgba(255, 176, 32, 0.14),
      transparent 60%
    ),
    var(--bg);
  color: var(--text);
}

.bootScreen {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 540px at 50% 12%, rgba(124, 58, 237, 0.24), transparent 62%),
    radial-gradient(900px 520px at 50% 100%, rgba(6, 182, 212, 0.2), transparent 65%),
    #050711;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.bootScreen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.bootScreen__core {
  width: min(320px, 86vw);
  padding: 28px 24px 20px;
  border-radius: 24px;
  border: 1px solid rgba(139, 92, 246, 0.32);
  background: linear-gradient(160deg, rgba(16, 20, 38, 0.95), rgba(9, 12, 24, 0.92));
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.6),
    0 0 26px rgba(139, 92, 246, 0.2);
  text-align: center;
}

.bootScreen__icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  display: block;
  margin: 0 auto 12px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 10px 28px rgba(0, 0, 0, 0.45),
    0 0 20px rgba(139, 92, 246, 0.25);
}

.bootScreen__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #c4b5fd 0%, #8b5cf6 46%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bootScreen__subtitle {
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.72);
}

.bootScreen__bar {
  position: relative;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 18px;
  background: rgba(148, 163, 184, 0.18);
}

.bootScreen__bar span {
  position: absolute;
  inset: 0 auto 0 -48%;
  width: 48%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8b5cf6 0%, #c4b5fd 48%, #06b6d4 100%);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.65);
  animation: bootBar 1.2s ease-in-out infinite;
}

@keyframes bootBar {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(320%);
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    to bottom,
    rgba(11, 18, 32, 0.92),
    rgba(11, 18, 32, 0.72)
  );
  backdrop-filter: blur(12px);
}

.brand {
  min-width: 0; /* allow ellipsis in meta without pushing controls */
  flex: 1 1 auto;
}

.brand__title {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand__meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  max-width: min(720px, 72vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn--chip {
  border-radius: 999px;
  padding: 0 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.btn--chip.is-busy {
  opacity: 0.75;
  cursor: wait;
}

.metaStatus {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.metaDot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.7);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}

.metaDot--ok {
  background: rgba(34, 197, 94, 0.95);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.metaDot--warn {
  background: rgba(245, 158, 11, 0.95);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.metaDot--err {
  background: rgba(239, 68, 68, 0.95);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.tab {
  height: 28px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.74);
  padding: 0 10px;
  cursor: pointer;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
}

.tab.is-active {
  border-color: rgba(39, 192, 255, 0.35);
  background: rgba(39, 192, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
}

.tab__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  opacity: 0.9;
}

.btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  opacity: 0.95;
}

.ctrl {
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0 10px;
}

.btn {
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  padding: 0 12px;
  cursor: pointer;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.03);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn--amber {
  border-color: rgba(255, 176, 32, 0.4);
  background: rgba(255, 176, 32, 0.14);
}

.btn--amber:hover {
  background: rgba(255, 176, 32, 0.22);
}

.btn--red {
  border-color: rgba(255, 77, 79, 0.4);
  background: rgba(255, 77, 79, 0.14);
}

.btn--red:hover {
  background: rgba(255, 77, 79, 0.22);
}

.main {
  padding: 14px 16px 60px;
}

.day {
  margin: 18px 0 22px;
}

.day__title {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.86);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.day__count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.masonry {
  columns: 5 240px;
  column-gap: 12px;
}

@media (max-width: 1100px) {
  .masonry {
    columns: 3 220px;
  }
}

@media (max-width: 720px) {
  .controls {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .masonry {
    columns: 2 180px;
  }
}

.card {
  break-inside: avoid;
  margin: 0 0 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.03)
  );
  position: relative;
}

.card img,
.card video {
  width: 100%;
  display: block;
  background: rgba(0, 0, 0, 0.2);
}

.overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 10px 10px 10px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.62),
    rgba(0, 0, 0, 0)
  );
  display: flex;
  gap: 8px;
  align-items: flex-end;
  justify-content: space-between;
}

.btns {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
}

@media (max-width: 520px) {
  .btns {
    gap: 6px;
  }
  .iconBtn {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }
}

.move {
  border: 1px solid rgba(255, 176, 32, 0.35);
  background: rgba(255, 176, 32, 0.14);
  color: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  height: 30px;
  padding: 0 10px;
  cursor: pointer;
}

.move:hover {
  background: rgba(255, 176, 32, 0.22);
}

.meta {
  min-width: 0;
}

.meta__path {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta__sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.68);
  margin-top: 2px;
}

.del {
  border: 1px solid rgba(255, 77, 79, 0.35);
  background: rgba(255, 77, 79, 0.14);
  color: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  height: 30px;
  padding: 0 10px;
  cursor: pointer;
  flex: 0 0 auto;
}

.del:hover {
  background: rgba(255, 77, 79, 0.22);
}

.iconBtn {
  height: 30px;
  width: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: 0 0 auto;
}

.iconBtn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.iconBtn--ghost {
  background: rgba(255, 255, 255, 0.03);
}

.iconBtn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.iconBtn--amber {
  border-color: rgba(255, 176, 32, 0.35);
  background: rgba(255, 176, 32, 0.14);
}

.iconBtn--amber:hover {
  background: rgba(255, 176, 32, 0.22);
}

.iconBtn--red {
  border-color: rgba(255, 77, 79, 0.35);
  background: rgba(255, 77, 79, 0.14);
}

.iconBtn--red:hover {
  background: rgba(255, 77, 79, 0.22);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

.modal__panel {
  position: relative;
  width: min(980px, calc(100vw - 32px));
  max-height: min(86vh, 820px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.06),
      rgba(255, 255, 255, 0.03)
    ),
    rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.modal__title {
  font-weight: 700;
  letter-spacing: 0.2px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal__body {
  padding: 12px;
  overflow: auto;
}

.props {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.props td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  vertical-align: top;
}

.props td:first-child {
  width: 180px;
  color: var(--muted);
}

.viewer {
  display: grid;
  place-items: center;
  min-height: 50vh;
}

.viewer img,
.viewer video {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
}

.loadMoreWrap {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  max-width: min(520px, calc(100vw - 28px));
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.9);
  color: var(--text);
  backdrop-filter: blur(10px);
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.toast__msg {
  flex: 1 1 auto;
  min-width: 0;
}

.toast__action {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.toast__action:hover {
  background: rgba(255, 255, 255, 0.10);
}

@media (max-width: 720px) {
  .props td:first-child {
    width: 140px;
  }
}
