/* Logan — personal stock photos + gallery style fusion (TV-expansive preview) */

#panel-logan.panel[hidden] { display: none !important; }

#panel-logan.panel.active {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 5rem);
  max-height: calc(100dvh - 5rem);
  overflow: hidden;
  padding: 0;
  margin: 0;
}

body.lo-tab-active #panel-logan.panel.active {
  min-height: 100dvh;
  max-height: 100dvh;
}

body.lo-tab-active .site-footer,
body.lo-tab-active .site-header .subtitle { display: none; }

body.lo-tab-active .site-header {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.lo-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse 120% 80% at 50% -5%, #2a1a08 0%, #0c0806 50%, #000 100%);
}

.lo-top {
  flex: 0 0 auto;
  padding: 0.4rem 0.85rem 0.3rem;
  border-bottom: 1px solid rgba(220, 160, 80, 0.22);
}

.lo-top h2 {
  margin: 0 0 0.1rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  background: linear-gradient(90deg, #ffc86a, #e8a040, #fff0c8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lo-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.lo-hint strong { color: #ffd898; font-weight: 600; }

.lo-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 12.5rem);
  gap: 0.5rem;
  padding: 0.45rem 0.65rem 0;
  overflow: hidden;
}

.lo-main {
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.4rem;
  overflow: hidden;
}

.lo-stage-wrap {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: hidden;
}

.lo-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(200, 140, 60, 0.28);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.55) inset;
}

.lo-controls-dock {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem 0.35rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid rgba(200, 140, 60, 0.28);
  background: rgba(0, 0, 0, 0.42);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
}

.lo-stage:fullscreen,
.lo-stage:-webkit-full-screen {
  border-radius: 0;
  border: none;
  min-height: 100%;
  width: 100%;
  height: 100%;
}

.lo-stage-toolbar {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.lo-view-btn {
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius);
  border: 1px solid rgba(200, 140, 60, 0.3);
  background: rgba(0, 0, 0, 0.35);
  color: #ffe0b0;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.lo-view-btn:hover:not(:disabled) {
  border-color: rgba(255, 200, 100, 0.55);
}

.lo-view-btn.active {
  border-color: rgba(255, 190, 80, 0.7);
  background: rgba(80, 50, 15, 0.55);
  color: #fff4d8;
}

.lo-view-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.lo-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  text-align: center;
}

.lo-preview-empty p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 36rem;
}

.lo-preview-empty strong { color: #ffcc80; }

.lo-preview-image,
.lo-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
  z-index: 2;
}

.lo-preview-video.is-playing {
  opacity: 1;
}

.lo-preview-badge {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 200, 100, 0.35);
  font-size: 0.68rem;
  color: #ffe8c0;
}

.lo-sidebar {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-left: 0.15rem;
}

.lo-section-label {
  margin: 0.15rem 0 0;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(220, 170, 90, 0.75);
}

.lo-stock-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.lo-stock-count {
  font-size: 0.6rem;
  color: var(--text-muted);
}

.lo-stock-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.3rem;
}

.lo-stock-card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid rgba(200, 140, 60, 0.2);
  background: #000;
  cursor: pointer;
  padding: 0;
}

.lo-stock-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lo-stock-card.active {
  border-color: rgba(255, 200, 100, 0.85);
  box-shadow: 0 0 0 1px rgba(255, 200, 100, 0.4);
}

.lo-stock-rm {
  position: absolute;
  top: 0.15rem;
  right: 0.15rem;
  width: 1.1rem;
  height: 1.1rem;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffd0a0;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.lo-scene-panel {
  border: 1px solid rgba(200, 140, 60, 0.28);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
  padding: 0.45rem;
  margin-bottom: 0.45rem;
}

.lo-scene-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.lo-scene-panel-title {
  margin: 0;
}

.lo-scene-secondary-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.56rem;
  color: rgba(255, 220, 160, 0.75);
  cursor: pointer;
  white-space: nowrap;
}

.lo-scene-secondary-toggle input {
  accent-color: #d4a040;
}

.lo-scenes {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: 8.5rem;
  overflow-y: auto;
  padding-right: 0.1rem;
}

.lo-scene {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.06rem;
  padding: 0.3rem 0.4rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(200, 140, 60, 0.16);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.62rem;
  text-align: left;
  cursor: pointer;
}

.lo-scene:hover {
  border-color: rgba(220, 160, 80, 0.4);
  background: rgba(40, 25, 8, 0.45);
}

.lo-scene.active {
  border-color: rgba(255, 190, 90, 0.55);
  background: rgba(60, 35, 10, 0.4);
  color: #ffe8c0;
}

.lo-scene-label { font-weight: 600; color: #ffcc80; }

.lo-scene-hint { font-size: 0.54rem; opacity: 0.85; }

.lo-scene-id {
  font-size: 0.5rem;
  opacity: 0.62;
  font-family: ui-monospace, Consolas, monospace;
}

.lo-scene-add-btn {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.38rem 0.5rem;
  border-radius: var(--radius);
  border: 1px dashed rgba(200, 140, 60, 0.38);
  background: rgba(0, 0, 0, 0.22);
  color: #ffcc80;
  font-size: 0.64rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.lo-scene-add-btn:hover:not(:disabled) {
  border-color: rgba(255, 190, 90, 0.55);
  background: rgba(60, 35, 10, 0.35);
}

.lo-scene-add-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lo-scene-token-hint {
  margin: 0.35rem 0 0.15rem;
  font-size: 0.52rem;
  color: rgba(255, 220, 160, 0.58);
  line-height: 1.4;
}

.lo-scene-token-hint code {
  font-size: 0.5rem;
  color: #9fd0ff;
}

.lo-scene-reset-link {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.15rem 0;
  border: none;
  background: none;
  color: rgba(255, 220, 160, 0.5);
  font-size: 0.52rem;
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}

.lo-scene-reset-link:hover {
  color: rgba(255, 220, 160, 0.8);
}

.lo-scene-dialog {
  width: min(92vw, 26rem);
  max-height: 90vh;
  padding: 0;
  border: 1px solid rgba(200, 140, 60, 0.45);
  border-radius: var(--radius);
  background: #1a1208;
  color: #fff0d8;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.lo-scene-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.lo-scene-dialog-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 1rem 1rem;
}

.lo-scene-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.lo-scene-dialog-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #ffcc80;
}

.lo-scene-dialog-close {
  border: none;
  background: none;
  color: rgba(255, 220, 160, 0.7);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
}

.lo-scene-dialog-close:hover {
  color: #ffe8c8;
}

.lo-scene-dialog-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  color: rgba(255, 220, 160, 0.78);
}

.lo-scene-dialog-input,
.lo-scene-dialog-textarea {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius);
  border: 1px solid rgba(200, 140, 60, 0.28);
  background: rgba(0, 0, 0, 0.4);
  color: #fff0d8;
  font-size: 0.82rem;
  font-family: inherit;
  resize: vertical;
}

.lo-scene-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.lo-slider-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.35rem;
  align-items: center;
  font-size: 0.62rem;
  color: var(--text-muted);
}

.lo-slider-row input[type="range"] { grid-column: 1 / -1; width: 100%; }

.lo-face-hint {
  margin: 0;
  font-size: 0.56rem;
  color: rgba(255, 220, 160, 0.65);
  line-height: 1.3;
}

.lo-attire {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
}

.lo-attire-btn {
  font-size: 0.58rem;
  padding: 0.35rem 0.4rem;
  border-radius: var(--radius);
  border: 1px solid rgba(200, 140, 60, 0.28);
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 228, 190, 0.82);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.lo-attire-btn:hover {
  border-color: rgba(255, 190, 90, 0.45);
  color: #ffe8c8;
}

.lo-attire-btn.active {
  border-color: rgba(255, 190, 90, 0.55);
  background: rgba(60, 35, 10, 0.4);
  color: #ffcc80;
  font-weight: 600;
}

.lo-attire-hint {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.56rem;
  color: rgba(255, 220, 160, 0.65);
  line-height: 1.3;
}

.lo-select {
  grid-column: 1 / -1;
  width: 100%;
  font-size: 0.68rem;
  padding: 0.3rem 0.4rem;
  border-radius: var(--radius);
  border: 1px solid rgba(200, 140, 60, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #ffe8c8;
}

.lo-style-rack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-height: 2.8rem;
  padding: 0.35rem;
  border: 1px dashed rgba(200, 140, 60, 0.35);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

.lo-style-rack.drop-active {
  border-color: rgba(255, 200, 100, 0.7);
  background: rgba(50, 30, 8, 0.35);
}

.lo-rack-empty {
  margin: 0;
  font-size: 0.56rem;
  color: var(--text-muted);
  width: 100%;
}

.lo-style-chip {
  position: relative;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.35rem;
  overflow: hidden;
  border: 1px solid rgba(255, 200, 100, 0.35);
}

.lo-style-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lo-style-chip-rm {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.lo-style-chip:hover .lo-style-chip-rm { opacity: 1; }

.lo-btn {
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid rgba(200, 140, 60, 0.3);
  background: rgba(0, 0, 0, 0.35);
  color: #ffe0b0;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.lo-btn:hover:not(:disabled) {
  border-color: rgba(255, 200, 100, 0.55);
  background: rgba(50, 30, 10, 0.5);
}

.lo-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.lo-btn.accent {
  border-color: rgba(255, 190, 80, 0.55);
  background: linear-gradient(135deg, rgba(120, 70, 20, 0.65), rgba(80, 45, 10, 0.75));
  color: #fff4d8;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

.lo-status {
  margin: 0;
  font-size: 0.72rem;
  min-height: 1.1rem;
  color: var(--text-muted);
}

.lo-status-main {
  font-size: 0.82rem;
  padding: 0.15rem 0;
}

.lo-status.ok { color: #a8e8a0; }
.lo-status.error { color: #ff9aaa; }
.lo-status.pending { color: #ffd080; }

.lo-prompt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: stretch;
}

.lo-prompt {
  flex: 1 1 16rem;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid rgba(200, 140, 60, 0.28);
  background: rgba(0, 0, 0, 0.35);
  color: #fff0d8;
  font-size: 0.85rem;
}

.lo-prompt.lo-prompt--fresh {
  border-color: rgba(120, 200, 255, 0.45);
  box-shadow: inset 0 0 0 1px rgba(120, 200, 255, 0.12);
}

.lo-prompt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
}

.lo-prompt-memory {
  flex: 1 1 12rem;
  max-width: 18rem;
}

.lo-btn-compact {
  font-size: 0.62rem;
  padding: 0.35rem 0.55rem;
}

.lo-prompt-memory-hint {
  margin: 0;
  font-size: 0.58rem;
  color: rgba(255, 220, 160, 0.62);
  line-height: 1.35;
}

.lo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.lo-history {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  overflow-y: auto;
  max-height: 8rem;
  padding-bottom: 0.15rem;
}

.lo-history-card {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(200, 140, 60, 0.25);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem;
  cursor: pointer;
  text-align: left;
}

.lo-history-card img {
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 0.25rem;
  display: block;
}

.lo-history-label {
  display: block;
  margin: 0;
  flex: 1 1 auto;
  font-size: 0.52rem;
  color: var(--text-muted);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lo-history-empty {
  margin: 0;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.lo-tray {
  flex: 0 0 auto;
  border-top: 1px solid rgba(200, 140, 60, 0.18);
}

.lo-spell.st-spell { cursor: grab; }

@media (min-width: 1400px) {
  .lo-preview-empty p {
    font-size: 1.15rem;
  }

  .lo-btn {
    font-size: 0.88rem;
  }

  .lo-btn.accent {
    font-size: 0.95rem;
    padding: 0.55rem 1.15rem;
  }
}

@media (max-width: 900px) {
  .lo-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .lo-sidebar {
    max-height: 14rem;
    order: 2;
  }

  .lo-main {
    grid-template-rows: minmax(12rem, 1fr) auto;
  }
}