/* ── Shell ─────────────────────────────────────────────── */

.editor-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background:
    radial-gradient(ellipse 70% 55% at 12% -8%, rgba(124, 156, 245, 0.06), transparent 55%),
    radial-gradient(ellipse 55% 45% at 88% 105%, rgba(62, 207, 142, 0.04), transparent 50%),
    var(--editor-bg);
  overflow: hidden;
}

/* ── Header ────────────────────────────────────────────── */

.editor-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  height: 52px;
  background: color-mix(in srgb, var(--editor-bg-deep) 92%, transparent);
  border-bottom: 1px solid var(--editor-border);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--editor-accent), color-mix(in srgb, var(--editor-good) 60%, var(--editor-accent)));
  font-family: var(--mor-display);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.brand-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-text .subtitle {
  display: block;
  color: var(--editor-muted);
  font-size: 11px;
  font-weight: 400;
  margin-top: 1px;
}

.header-stats {
  display: flex;
  gap: 6px;
  margin-left: 8px;
}

.header-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--editor-panel);
  border: 1px solid var(--editor-border-soft);
}

.header-stat .value {
  font-family: var(--mor-mono);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.1;
}

.header-stat .label {
  font-size: 9px;
  color: var(--editor-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.header-stat.feed .value { color: var(--editor-accent); }
.header-stat.likes .value { color: var(--mor-like); }
.header-stat.today .value { color: var(--editor-good); }

.header-spacer { flex: 1; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Main grid ─────────────────────────────────────────── */

.editor-main {
  display: grid;
  grid-template-columns: 44px auto 1fr auto 44px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.mor-quick-launch-bar {
  width: 44px;
  background: var(--editor-bg-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12px;
  z-index: 100;
}

.mor-quick-launch-bar.launch-bar-left {
  grid-column: 1;
  border-right: 1px solid var(--editor-border);
}

.mor-quick-launch-bar.launch-bar-right {
  grid-column: 5;
  border-left: 1px solid var(--editor-border);
}

.launch-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--editor-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.launch-btn:hover,
.launch-btn.active {
  background: var(--editor-panel);
  color: var(--editor-text);
}

.panel-container {
  width: 280px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  background: var(--editor-panel);
  border-right: 1px solid var(--editor-border);
  transition: width 0.2s ease, min-width 0.2s ease, opacity 0.2s ease;
  overflow: hidden;
}

.panel-container.right {
  grid-column: 4;
  border-right: none;
  border-left: 1px solid var(--editor-border);
}

.panel-container.left {
  grid-column: 2;
}

.panel-container.collapsed {
  width: 0;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
  border: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--editor-muted);
  border-bottom: 1px solid var(--editor-border-soft);
  flex-shrink: 0;
}

.panel-badge {
  font-family: var(--mor-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--editor-panel-raised);
  color: var(--editor-accent);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 20px;
}

.panel-section {
  margin-bottom: 18px;
}

.panel-section-flush {
  margin-bottom: 0;
}

.panel-section-compact {
  margin-bottom: 12px;
}

.section-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--editor-muted);
}

.panel-hint {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--editor-muted-2);
  line-height: 1.45;
}

/* ── Feed workspace ──────────────────────────────────────── */

.feed-workspace {
  grid-column: 3;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
}

.feed-stage {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 40px;
  position: relative;
}

.stage-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 50% 40% at 50% 0%, var(--mor-accent-glow), transparent 70%);
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.empty-state {
  max-width: 420px;
  margin: 80px auto 0;
  text-align: center;
  position: relative;
  z-index: 1;
}

.empty-state.hidden {
  display: none;
}

.state-icon {
  font-size: 36px;
  color: var(--editor-muted);
  margin-bottom: 12px;
}

.empty-state h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 20px;
}

.empty-state p {
  margin: 0 0 16px;
  color: var(--editor-muted);
  line-height: 1.5;
}

/* ── Feed cards ──────────────────────────────────────────── */

.feed-card {
  background: var(--editor-panel);
  border: 1px solid var(--editor-border-soft);
  border-radius: var(--radius-lg);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.feed-card:hover {
  border-color: var(--editor-border);
}

.feed-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  background: var(--editor-panel-raised);
  border: 1px solid var(--editor-border-soft);
}

.platform-icon {
  font-size: 12px;
}

.feed-score {
  font-family: var(--mor-mono);
  font-size: 11px;
  color: var(--editor-accent);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--editor-accent) 12%, transparent);
}

.feed-card-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.feed-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--editor-muted);
  margin-bottom: 12px;
}

.feed-card-body {
  margin-bottom: 12px;
  min-height: 24px;
}

.feed-card-body.loading {
  color: var(--editor-muted);
  font-size: 12px;
}

.content-body-text {
  margin: 0;
  line-height: 1.55;
  color: color-mix(in srgb, var(--editor-text) 92%, var(--editor-muted));
}

.content-source-link {
  margin: 10px 0 0;
  font-size: 12px;
}

.content-source-link a {
  color: var(--editor-accent);
  text-decoration: none;
}

.content-source-link a:hover {
  text-decoration: underline;
}

.youtube-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  background: #000;
}

.feed-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.tag-chip {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--editor-accent) 10%, var(--editor-panel-raised));
  color: var(--editor-accent);
  border: 1px solid color-mix(in srgb, var(--editor-accent) 20%, transparent);
}

.tag-chip.muted {
  color: var(--editor-muted);
  background: var(--editor-panel-raised);
  border-color: var(--editor-border-soft);
}

.feed-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--editor-border-soft);
}

.feedback-btn.like {
  color: var(--mor-like);
  border-color: color-mix(in srgb, var(--mor-like) 35%, var(--editor-border));
}

.feedback-btn.like:hover {
  background: color-mix(in srgb, var(--mor-like) 12%, var(--editor-panel-raised));
}

.feedback-btn.dislike {
  color: var(--editor-danger);
  border-color: color-mix(in srgb, var(--editor-danger) 35%, var(--editor-border));
}

.feedback-btn.dislike:hover {
  background: color-mix(in srgb, var(--editor-danger) 12%, var(--editor-panel-raised));
}

/* Platform colors */
.platform-youtube { color: var(--mor-youtube); }
.platform-wikipedia { color: var(--mor-wikipedia); }
.platform-x { color: var(--editor-text); }
.platform-tumblr { color: #7c5cbf; }
.platform-wordpress { color: #21759b; }
.platform-neocities { color: var(--editor-good); }

/* ── Forms & buttons ─────────────────────────────────────── */

.mor-input-wrapper {
  margin-bottom: 10px;
}

.mor-input-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--editor-muted);
  margin-bottom: 4px;
}

.mor-input,
.mor-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--editor-border);
  border-radius: var(--radius-sm);
  background: var(--editor-bg);
  color: var(--editor-text);
  font-family: inherit;
  font-size: 12px;
}

.mor-input:focus,
.mor-textarea:focus {
  outline: none;
  border-color: var(--editor-accent);
  box-shadow: 0 0 0 3px var(--editor-focus);
}

.mor-textarea {
  min-height: 72px;
  resize: vertical;
}

.mor-textarea.bulk-list {
  min-height: 100px;
  font-family: var(--mor-mono);
  font-size: 11px;
}

.mor-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mor-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border: 1px solid var(--editor-border);
  border-radius: var(--radius-sm);
  background: var(--editor-panel-raised);
  color: var(--editor-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.mor-btn:hover {
  background: var(--mor-btn-hover);
}

.mor-btn.primary {
  background: var(--editor-accent);
  border-color: var(--editor-accent);
  color: #fff;
}

.mor-btn.primary:hover {
  background: var(--editor-accent-warm);
}

.mor-btn.danger {
  color: var(--editor-danger);
  border-color: color-mix(in srgb, var(--editor-danger) 40%, var(--editor-border));
}

.mor-btn.ghost {
  background: transparent;
}

.mor-btn.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
}

.import-btn {
  cursor: pointer;
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

/* ── Item list (sidebar) ─────────────────────────────────── */

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  cursor: default;
}

.item-row:hover {
  background: var(--editor-panel-raised);
}

.platform-pill {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  background: var(--editor-panel-raised);
  flex-shrink: 0;
}

.item-row .info {
  flex: 1;
  min-width: 0;
}

.item-row .title {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-row .meta-line {
  font-size: 10px;
  color: var(--editor-muted);
}

.item-remove-btn {
  border: none;
  background: transparent;
  color: var(--editor-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
  line-height: 1;
}

.item-remove-btn:hover {
  color: var(--editor-danger);
}

/* ── Algorithm config ────────────────────────────────────── */

.config-field {
  margin-bottom: 14px;
}

.config-field-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.config-field-head label {
  font-size: 12px;
  font-weight: 500;
}

.config-value {
  font-family: var(--mor-mono);
  font-size: 12px;
  color: var(--editor-accent);
}

.config-slider {
  width: 100%;
  accent-color: var(--editor-accent);
}

/* ── Stats ───────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.stat-card {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--editor-panel-raised);
  border: 1px solid var(--editor-border-soft);
}

.stat-card.wide {
  grid-column: 1 / -1;
}

.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--editor-muted);
}

.stat-value {
  font-family: var(--mor-mono);
  font-size: 18px;
  font-weight: 500;
  margin-top: 2px;
}

.stat-card.accent .stat-value { color: var(--editor-accent); }
.stat-card.good .stat-value { color: var(--editor-good); }
.stat-card.danger .stat-value { color: var(--editor-danger); }
.stat-card.new .stat-value { color: var(--editor-new); }

.feedback-log,
.profile-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feedback-log li,
.profile-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--editor-border-soft);
  font-size: 11px;
}

.feedback-tag {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}

.feedback-tag.like {
  background: color-mix(in srgb, var(--mor-like) 18%, transparent);
  color: var(--mor-like);
}

.feedback-tag.dislike {
  background: color-mix(in srgb, var(--editor-danger) 18%, transparent);
  color: var(--editor-danger);
}

.feedback-label,
.profile-key {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-count {
  font-family: var(--mor-mono);
  font-weight: 500;
}

.profile-count.good { color: var(--editor-good); }
.profile-count.danger { color: var(--editor-danger); }

.feedback-empty {
  font-size: 11px;
  color: var(--editor-muted);
  margin: 0;
}

.taste-layer-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.taste-layer-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--editor-border-soft);
  font-size: 11px;
}

.taste-layer-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.taste-layer-meta {
  font-family: var(--mor-mono);
  color: var(--editor-muted);
  font-size: 10px;
}

.taste-remove-btn {
  border: none;
  background: transparent;
  color: var(--editor-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
}

.taste-remove-btn:hover {
  color: var(--editor-danger);
}

.panel-hint code {
  font-family: var(--mor-mono);
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--editor-panel-raised);
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 900px) {
  .panel-container {
    width: 240px;
    min-width: 240px;
  }

  .feed-stage {
    padding: 16px;
  }
}

@media (max-width: 700px) {
  .editor-main {
    grid-template-columns: 44px 1fr 44px;
  }

  .panel-container.left,
  .panel-container.right {
    position: absolute;
    top: 52px;
    bottom: 0;
    z-index: 200;
    box-shadow: var(--shadow-card);
  }

  .panel-container.left {
    left: 44px;
  }

  .panel-container.right {
    right: 44px;
  }

  .header-stats {
    display: none;
  }
}
/* Items already liked/disliked sort below fresh ones and render dimmed */
.feed-card.seen {
  opacity: 0.55;
}
.feed-card.seen:hover {
  opacity: 1;
}

/* Per-layer influence slider inside the taste layer list */
.taste-layer-weight {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}
.taste-layer-weight input[type="range"] {
  flex: 1;
  min-width: 0;
}
.taste-layer-list li {
  flex-wrap: wrap;
}
