* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  background: #05050a;
  color: white;
}

.hidden {
  display: none !important;
}

.wrap {
  width: min(1000px, 92vw);
  margin: 0 auto;
  padding: 32px 0;
}

.hero {
  padding: 28px;
  border: 1px solid rgba(0, 255, 255, 0.35);
  background:
    linear-gradient(135deg, rgba(255, 0, 255, 0.15), transparent),
    linear-gradient(45deg, rgba(0, 255, 255, 0.12), transparent),
    #080812;
  border-radius: 18px;
  box-shadow: 0 0 28px rgba(0, 255, 255, 0.15);
  margin-bottom: 24px;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 7vw, 72px);
  letter-spacing: 0.08em;
  color: #00ffff;
  text-shadow:
    0 0 12px #00ffff,
    0 0 28px #ff00ff;
}

h2 {
  margin-top: 0;
  color: #ff00ff;
  text-shadow: 0 0 12px rgba(255, 0, 255, 0.7);
}

.muted {
  color: rgba(255, 255, 255, 0.7);
}

.status {
  color: #00ffff;
  font-weight: bold;
}

.card {
  padding: 22px;
  border-radius: 16px;
  background: rgba(10, 10, 22, 0.92);
  border: 1px solid rgba(255, 0, 255, 0.25);
  margin-bottom: 22px;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.08);
}

.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

button,
.btn {
  appearance: none;
  border: 1px solid #00ffff;
  background: rgba(0, 255, 255, 0.08);
  color: white;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.2);
}

button:hover,
.btn:hover {
  background: rgba(0, 255, 255, 0.22);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.primary {
  border-color: #ff00ff;
  background: rgba(255, 0, 255, 0.22);
}

button.danger {
  border-color: #ff3b3b;
  background: rgba(255, 0, 0, 0.2);
}

input[type="text"],
input[type="number"] {
  width: 220px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 255, 0.5);
  background: #05050a;
  color: white;
}

input[type="color"] {
  width: 90px;
  height: 52px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid #00ffff;
  background: #05050a;
}

.list {
  display: grid;
  gap: 12px;
}

.sequence-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 255, 0.18);
}

video {
  width: 100%;
  max-height: 420px;
  background: #000;
  border-radius: 16px;
  margin-bottom: 16px;
}

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

.color-chip {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 11px;
  text-shadow: 0 0 5px black;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* index.html専用 */
#colorStage {
  position: fixed;
  inset: 0;
  background: #000000;
  z-index: 1;
  transition: background 0.15s linear;
}

.participant-ui {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  text-shadow: 0 0 14px black;
  pointer-events: none;
  text-align: center;
  padding: 20px;
}

.participant-ui h1 {
  font-size: clamp(32px, 9vw, 88px);
}

.version-badge {
  margin: -4px 0 10px;
  padding: 4px 10px;
  border: 1px solid rgba(0, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: bold;
  line-height: 1.2;
  text-shadow: 0 0 8px black;
  pointer-events: auto;
}

#colorText {
  font-size: 28px;
  font-weight: bold;
}

#logoutBtn {
  pointer-events: auto;
  margin-top: 14px;
}

.upload-progress {
  width: min(320px, 78vw);
  height: 10px;
  margin: 2px 0 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.18);
}

.upload-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00ffff, #ff00ff);
  transition: width 0.18s ease;
}

/* ログイン */
.login-panel {
  position: fixed;
  inset: 0;
  z-index: 10;
  background:
    linear-gradient(135deg, rgba(255, 0, 255, 0.22), transparent),
    linear-gradient(45deg, rgba(0, 255, 255, 0.18), transparent),
    #05050a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  color: white;
  padding: 24px;
}

.login-panel h1 {
  font-size: clamp(40px, 10vw, 92px);
}

/* カメラ */
.camera-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  font-size: 26px;
  padding: 0;
}

.camera-fab.is-open {
  border-color: #ff00ff;
  background: rgba(255, 0, 255, 0.24);
  box-shadow:
    0 0 16px rgba(255, 0, 255, 0.35),
    0 0 24px rgba(0, 255, 255, 0.16);
}

.mini-camera {
  position: fixed;
  right: 12px;
  bottom: 88px;
  z-index: 60;
  width: 190px;
  background: rgba(0, 0, 0, 0.78);
  border: 2px solid #00ffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 0 18px rgba(0, 255, 255, 0.35),
    0 0 28px rgba(255, 0, 255, 0.18);
}

#cameraPreview {
  width: 100%;
  height: 128px;
  object-fit: cover;
  display: block;
  background: #000;
  border-radius: 0;
  margin: 0;
}

.mini-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
}

.mini-controls button {
  padding: 8px 0;
  border-radius: 8px;
  font-size: 16px;
  min-width: 0;
  height: 38px;
  display: grid;
  place-items: center;
}

.record-toggle {
  border-color: #ff3b3b;
  background: rgba(255, 59, 59, 0.24);
  color: #fff;
}

.record-toggle.is-recording {
  border-color: #ffffff;
  background: #ff3030;
  color: #ffffff;
  box-shadow:
    0 0 14px rgba(255, 48, 48, 0.65),
    0 0 22px rgba(255, 255, 255, 0.16);
}

#openGallery {
  border-color: #ff00ff;
  background: rgba(255, 0, 255, 0.18);
}

#cameraStatus {
  margin: 0;
  padding: 0 6px 8px;
  font-size: 11px;
  text-align: center;
  color: #00ffff;
}

/* スマホ調整 */
@media (max-width: 480px) {
  .participant-ui h1 {
    font-size: 34px;
  }

  .participant-ui p {
    margin: 5px 0;
  }

  .camera-fab {
    right: 14px;
    bottom: 14px;
    width: 58px;
    height: 58px;
  }

  .mini-camera {
    right: 10px;
    bottom: 80px;
    width: 165px;
  }

  #cameraPreview {
    height: 112px;
  }

  .mini-controls button {
    font-size: 12px;
    padding: 7px 0;
  }
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(0, 255, 255, 0.22);
  box-shadow: 0 0 16px rgba(0, 255, 255, 0.08);
}

.gallery-toolbar {
  align-items: center;
}

.gallery-select {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.38);
}

.gallery-select input {
  width: 18px;
  height: 18px;
  accent-color: #ff00ff;
}

.gallery-preview {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: #000;
}

.gallery-video-preview {
  object-fit: contain;
  background: #0f172a;
}

.gallery-video-placeholder {
  height: 180px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255, 0, 255, 0.25), transparent),
    linear-gradient(45deg, rgba(0, 255, 255, 0.18), transparent),
    #05050a;
  color: #00ffff;
  font-size: 28px;
  font-weight: bold;
  text-shadow: 0 0 12px #00ffff;
}

.gallery-info {
  padding: 14px;
}

.gallery-info p {
  margin: 6px 0;
  font-size: 13px;
}

.gallery-actions {
  margin-top: 12px;
}

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

.heart-btn {
  border-color: #ffd84d;
  background: rgba(255, 216, 77, 0.12);
}

.heart-btn.liked {
  background: rgba(255, 216, 77, 0.32);
  box-shadow:
    0 0 12px rgba(255, 216, 77, 0.32),
    0 0 20px rgba(255, 0, 255, 0.12);
}

.btn.small {
  padding: 8px 12px;
  font-size: 13px;
}

/* v0.6 light explorer theme */
:root {
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --surface-tint: #eef6ff;
  --line: #d8e1ec;
  --text: #172033;
  --muted-text: #66748a;
  --brand: #2563eb;
  --brand-2: #00a6a6;
  --danger: #dc2626;
  --shadow: 0 18px 44px rgba(31, 47, 71, 0.12);
}

body {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 34%),
    linear-gradient(45deg, rgba(0, 166, 166, 0.08), transparent 38%),
    #f7fafc;
  color: var(--text);
}

.wrap {
  width: min(1180px, 94vw);
}

h1 {
  color: var(--brand);
  letter-spacing: 0.02em;
  text-shadow: none;
}

h2 {
  color: var(--brand);
  text-shadow: none;
}

.muted {
  color: var(--muted-text);
}

.status {
  color: var(--brand);
}

.hero,
.card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

button,
.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 22px rgba(31, 47, 71, 0.08);
}

button:hover,
.btn:hover {
  background: var(--surface-tint);
}

button.primary,
.btn.primary,
.explorer-nav-item.primary {
  border-color: rgba(37, 99, 235, 0.38);
  background: #eaf2ff;
  color: #174ea6;
}

button.danger,
.btn.danger {
  border-color: rgba(220, 38, 38, 0.32);
  background: #fff1f2;
  color: var(--danger);
}

.participant-ui {
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.62);
}

.participant-ui h1 {
  color: #ffffff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.version-badge {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.login-panel {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.16), transparent),
    linear-gradient(45deg, rgba(0, 166, 166, 0.12), transparent),
    #f7fafc;
  color: var(--text);
}

.login-panel h1 {
  color: var(--brand);
  text-shadow: none;
}

.camera-fab,
.mini-camera {
  border-color: rgba(37, 99, 235, 0.44);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  box-shadow: var(--shadow);
}

.camera-fab.is-open {
  border-color: rgba(0, 166, 166, 0.5);
  background: #e9fbfb;
  box-shadow: var(--shadow);
}

.mini-controls button {
  background: #f8fbff;
}

#openGallery {
  border-color: rgba(37, 99, 235, 0.35);
  background: #eaf2ff;
}

#switchCamera {
  border-color: rgba(0, 166, 166, 0.38);
  background: #e9fbfb;
  color: #047b7b;
}

#cameraStatus {
  color: var(--brand);
}

.upload-progress {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.24);
}

.upload-progress-bar {
  background: linear-gradient(90deg, #22c55e, #2563eb);
}

.explorer-wrap {
  padding-top: 22px;
}

.explorer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0 20px;
}

.explorer-header h1 {
  margin-bottom: 4px;
}

.explorer-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.explorer-sidebar,
.explorer-content {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.explorer-sidebar {
  position: sticky;
  top: 18px;
  padding: 14px;
}

.sidebar-label {
  margin: 4px 8px 12px;
  color: var(--muted-text);
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

.explorer-nav-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  width: 100%;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: left;
  box-shadow: none;
}

.nav-icon {
  color: var(--brand-2);
  font-size: 11px;
}

.explorer-content {
  min-height: 520px;
  padding: 16px;
}

.explorer-commandbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

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

.explorer-file-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.gallery-card {
  border-color: var(--line);
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(31, 47, 71, 0.08);
}

.gallery-info {
  color: var(--text);
}

.gallery-video-placeholder {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.14), transparent),
    linear-gradient(45deg, rgba(0, 166, 166, 0.12), transparent),
    #f1f5f9;
  color: var(--brand);
  text-shadow: none;
}

.heart-btn {
  border-color: rgba(245, 158, 11, 0.38);
  background: #fff8e6;
}

.heart-btn.liked {
  background: #ffefb0;
}

@media (max-width: 760px) {
  .explorer-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .explorer-shell {
    grid-template-columns: 1fr;
  }

  .explorer-sidebar {
    position: static;
  }

  .explorer-commandbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* v0.6.1 UI suite */
.app-console,
.movie-studio {
  padding-top: 22px;
}

.app-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0 22px;
}

.page-kicker {
  margin: 0 0 8px;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.page-version {
  display: inline-block;
  margin: -4px 0 8px;
  border-color: rgba(37, 99, 235, 0.22);
  background: #edf4ff;
  color: #174ea6;
  text-shadow: none;
}

.panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-heading h2,
.panel h2 {
  margin: 0 0 6px;
  color: var(--text);
  text-shadow: none;
}

.admin-status-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.admin-status-strip > div {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 26px rgba(31, 47, 71, 0.08);
}

.metric-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted-text);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.admin-activity-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
}

.activity-panel {
  padding: 18px;
}

.presence-columns {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.presence-columns h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 15px;
}

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

.activity-list.tall {
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.activity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: #ffffff;
}

.activity-row b,
.activity-row span,
.activity-row time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-row span,
.activity-row time {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
}

.activity-row strong {
  grid-row: span 2;
  min-width: 42px;
  padding: 5px 8px;
  border-radius: 999px;
  text-align: center;
  font-size: 11px;
}

.activity-row.is-online strong {
  background: #dcfce7;
  color: #166534;
}

.activity-row.is-offline {
  opacity: 0.72;
}

.activity-row.is-offline strong {
  background: #f1f5f9;
  color: #64748b;
}

.gallery-id-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 4px 0 0;
  padding: 5px 10px;
  border: 1px solid rgba(15, 159, 159, 0.2);
  border-radius: 999px;
  background: rgba(15, 159, 159, 0.1);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.sequence-panel,
.control-panel,
.setup-panel,
.preview-panel {
  padding: 18px;
}

.sequence-list-modern {
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.sequence-row {
  border-radius: 14px;
  background: #f8fbff;
  border-color: var(--line);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.sequence-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(31, 47, 71, 0.1);
}

.sequence-row.is-selected {
  border-color: rgba(37, 99, 235, 0.42);
  background: #edf4ff;
}

.sequence-meta {
  display: grid;
  gap: 4px;
}

.sequence-meta span {
  color: var(--muted-text);
  font-size: 13px;
}

.control-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.control-button {
  min-height: 52px;
  border-radius: 14px;
  font-size: 16px;
}

.manual-card {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.manual-color-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.manual-color-row input[type="color"] {
  width: 76px;
}

.full-width {
  width: 100%;
}

.studio-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.drop-zone {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px dashed rgba(37, 99, 235, 0.42);
  border-radius: 18px;
  background: #f8fbff;
  cursor: pointer;
}

.drop-zone input {
  display: none;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #eaf2ff;
  color: var(--brand);
  font-size: 26px;
  font-weight: 800;
}

.drop-zone small {
  display: block;
  margin-top: 4px;
  color: var(--muted-text);
}

.field-grid {
  display: grid;
  gap: 12px;
}

.field-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted-text);
  font-size: 13px;
  font-weight: 700;
}

.field-grid input {
  width: 100%;
}

.studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.inline-check input {
  width: auto;
}

.preview-panel video {
  max-height: 520px;
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(31, 47, 71, 0.12);
}

.color-timeline {
  padding-top: 6px;
}

.timeline-chip {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.color-editor-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--stroke);
}

.compact-heading {
  margin-bottom: 12px;
}

.editor-grid {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: end;
}

.editor-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted-text);
  font-size: 13px;
  font-weight: 700;
}

.editor-grid input[type="color"] {
  width: 92px;
  height: 48px;
  border-radius: 14px;
}

.studio-actions.compact {
  margin-top: 12px;
}

.movie-admin {
  padding-top: 22px;
}

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

.sequence-admin-list-panel,
.sequence-admin-editor-panel {
  padding: 18px;
}

.sequence-admin-list {
  display: grid;
  gap: 10px;
  max-height: 680px;
  overflow: auto;
  padding-right: 4px;
}

.sequence-admin-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.sequence-editor {
  display: grid;
  gap: 16px;
}

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

.empty-editor {
  min-height: 260px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--stroke-strong);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
}

.frame-editor {
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: #ffffff;
}

.frame-editor-head,
.frame-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(90px, 0.8fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
}

.frame-editor-head {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  background: #f8fbff;
  border-bottom: 1px solid var(--stroke);
}

.frame-rows {
  display: grid;
  max-height: 520px;
  overflow: auto;
}

.frame-row {
  border-bottom: 1px solid var(--stroke);
}

.frame-row:last-child {
  border-bottom: 0;
}

.frame-row input[type="number"],
.frame-row input[type="color"] {
  width: 100%;
}

@media (max-width: 860px) {
  .app-topbar {
    flex-direction: column;
  }

  .app-nav {
    justify-content: flex-start;
  }

  .admin-status-strip,
  .admin-grid,
  .admin-activity-grid,
  .sequence-admin-grid,
  .studio-grid {
    grid-template-columns: 1fr;
  }

  .field-grid.two-col,
  .frame-editor-head,
  .frame-row {
    grid-template-columns: 1fr;
  }

  .presence-columns {
    grid-template-columns: 1fr;
  }
}

/* v0.7.0 polished UI pass */
:root {
  --ink: #152033;
  --ink-soft: #5c6880;
  --paper: #ffffff;
  --paper-2: #f8fafc;
  --paper-3: #eef4fb;
  --stroke: rgba(24, 42, 68, 0.12);
  --stroke-strong: rgba(24, 42, 68, 0.2);
  --blue: #2563eb;
  --blue-2: #1d4ed8;
  --cyan: #0f9f9f;
  --gold: #f5b72e;
  --red: #e5484d;
  --radius-lg: 22px;
  --radius-md: 16px;
  --elev-1: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.08);
  --elev-2: 0 4px 12px rgba(15, 23, 42, 0.08), 0 24px 60px rgba(15, 23, 42, 0.12);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 8%, rgba(37, 99, 235, 0.18), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(15, 159, 159, 0.14), transparent 24%),
    linear-gradient(180deg, #fbfdff 0%, #edf4fb 100%);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 72%);
}

.wrap {
  width: min(1240px, 94vw);
  padding-top: 24px;
}

h1 {
  color: var(--ink);
  font-weight: 900;
  letter-spacing: 0;
}

.app-topbar,
.explorer-header {
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 255, 0.78)),
    linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(15, 159, 159, 0.06));
  box-shadow: var(--elev-2);
  backdrop-filter: blur(18px);
}

.app-topbar h1,
.explorer-header h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.92;
}

.page-kicker,
.sidebar-label {
  color: var(--cyan);
  letter-spacing: 0.16em;
}

.version-badge,
.page-version {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin: 10px 0 8px;
  padding: 5px 10px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: #eef5ff;
  color: var(--blue-2);
  font-size: 12px;
  font-weight: 800;
  text-shadow: none;
}

button,
.btn {
  min-height: 42px;
  border: 1px solid var(--stroke);
  border-radius: 13px;
  background: linear-gradient(180deg, #ffffff, #f7faff);
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, var(--elev-1);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.24);
  background: linear-gradient(180deg, #ffffff, #eef5ff);
  box-shadow: var(--elev-2);
}

button.primary,
.btn.primary,
.explorer-nav-item.primary {
  border-color: rgba(37, 99, 235, 0.42);
  background: linear-gradient(180deg, #2f6df3, #1f55d6);
  color: #ffffff;
}

button.danger,
.btn.danger {
  border-color: rgba(229, 72, 77, 0.3);
  background: linear-gradient(180deg, #fff4f4, #ffe7e8);
  color: #b4232a;
}

.panel,
.card,
.hero,
.explorer-sidebar,
.explorer-content,
.admin-status-strip > div {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--elev-1);
  backdrop-filter: blur(14px);
}

.explorer-shell,
.admin-grid,
.studio-grid {
  gap: 20px;
}

.explorer-shell {
  grid-template-columns: 248px minmax(0, 1fr);
}

.explorer-sidebar {
  padding: 18px;
}

.explorer-nav-item {
  grid-template-columns: 48px 1fr;
  min-height: 48px;
  margin-bottom: 10px;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}

.explorer-nav-item:hover {
  transform: none;
  background: #f1f6ff;
  box-shadow: none;
}

.explorer-nav-item.primary {
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(15, 159, 159, 0.12);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
}

.nav-icon.image-icon {
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
}

.nav-icon.image-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.explorer-nav-item.primary .nav-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.explorer-content {
  padding: 20px;
}

.explorer-commandbar {
  align-items: center;
  margin-bottom: 18px;
  padding: 0 0 16px;
}

.explorer-file-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.gallery-card {
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 30px rgba(15, 23, 42, 0.08);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--elev-2);
}

.gallery-preview,
.gallery-video-placeholder {
  height: 172px;
  border-bottom: 1px solid var(--stroke);
}

.drive-private-image:not([src]),
.drive-private-image.is-unavailable {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), transparent),
    linear-gradient(45deg, rgba(15, 159, 159, 0.1), transparent),
    #eef4fb;
}

.drive-private-image.is-unavailable {
  opacity: 0.72;
}

.gallery-info {
  padding: 14px 14px 16px;
}

.gallery-info b {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.3;
  word-break: break-word;
}

.gallery-info p {
  margin: 4px 0;
}

.gallery-select {
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
}

.compact-actions {
  gap: 8px;
}

.btn.small {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 11px;
  font-size: 12px;
}

.heart-btn {
  border-color: rgba(245, 183, 46, 0.36);
  background: linear-gradient(180deg, #fff8df, #fff0b8);
  color: #8a5b00;
}

.heart-btn.liked,
.heart-btn[aria-pressed="true"] {
  background: linear-gradient(180deg, #ffd95a, #ffc52f);
  color: #5f3b00;
}

.admin-status-strip {
  gap: 14px;
}

.admin-status-strip > div {
  padding: 18px;
}

.metric-label {
  color: var(--ink-soft);
}

.sequence-row {
  padding: 16px;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: #ffffff;
}

.sequence-row.is-selected {
  border-color: rgba(37, 99, 235, 0.42);
  background: #eef5ff;
}

.control-button {
  min-height: 58px;
  border-radius: 18px;
}

.drop-zone {
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(244, 248, 255, 0.86)),
    #ffffff;
}

.drop-icon {
  border-radius: 16px;
  background: linear-gradient(180deg, #eaf2ff, #dceaff);
}

.preview-panel video {
  background: #0f172a;
}

input[type="text"],
input[type="number"] {
  border-color: var(--stroke);
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

@media (max-width: 760px) {
  .app-topbar,
  .explorer-header {
    border-radius: 22px;
    padding: 18px;
  }

  .explorer-shell {
    grid-template-columns: 1fr;
  }

  .explorer-sidebar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
  }

  .sidebar-label {
    grid-column: 1 / -1;
    margin: 0 4px;
  }

  .explorer-nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 10px 8px;
  }
}
