/* The look follows the YouTube home page, like the thumbnail tester: dark by default, light on request. */
:root {
  --bg: #0f0f0f;
  --text: #f1f1f1;
  --muted: #aaaaaa;
  --line: #303030;
  --red: #ff0000;
  --blue: #3ea6ff;
  --button: #272727;
  --button-hover: #3f3f3f;
  --placeholder: #1f1f1f;
  --input: #121212;
  --error: #ff6b6b;
  color-scheme: dark;
}
body.light-theme {
  --bg: #ffffff;
  --text: #030303;
  --muted: #606060;
  --line: #cccccc;
  --button: #f2f2f2;
  --button-hover: #e6e6e6;
  --placeholder: #f2f2f2;
  --input: #ffffff;
  --error: #c00000;
  color-scheme: light;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font: 16px/1.4 Roboto, Arial, sans-serif; padding-bottom: 50px; transition: background-color 0.2s, color 0.2s; }
a { color: inherit; }
input, textarea, button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.small { color: var(--muted); font-size: 14px; }
.error { color: var(--error); }
.center { text-align: center; margin-top: 80px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; height: 56px; background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; }
.logo { display: flex; align-items: center; white-space: nowrap; }
.logo-icon { background: var(--red); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 14px; }
.logo-text { font-size: 20px; margin-left: 8px; font-weight: bold; }
.topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.status { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-toggle { background: none; border: none; font-size: 24px; cursor: pointer; padding: 5px; line-height: 1; border-radius: 50%; }
.theme-toggle:hover { background: var(--button-hover); }

.content { padding: 24px 16px; max-width: 1400px; margin: 0 auto; }
.content h1 { font-size: 22px; font-weight: 500; margin-bottom: 6px; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.pill { padding: 8px 15px; background: var(--button); border: 1px solid var(--line); border-radius: 18px; cursor: pointer; font-size: 14px; font-weight: 500; white-space: nowrap; }
.pill:hover { background: var(--button-hover); }
.pill.danger { color: var(--error); }

.welcome { max-width: 440px; margin: 10vh auto 0; padding: 0 16px; display: grid; gap: 14px; }
.welcome h1 { font-size: 28px; }
.welcome input { width: 100%; padding: 12px; border-radius: 4px; background: var(--input); border: 1px solid var(--line); }
.primary { padding: 12px 15px; background: var(--text); color: var(--bg); border: none; border-radius: 22px; font-weight: 500; cursor: pointer; }

/* The rows on the left, the list of all outliers on the right. */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.rows { display: grid; gap: 36px; }
.row-title { display: block; width: 100%; font-size: 20px; font-weight: 500; margin-bottom: 14px; }
input.row-title { padding: 8px 2px; background: none; border: none; border-bottom: 1px solid var(--line); border-radius: 0; }
input.row-title:hover, input.row-title:focus { border-bottom-color: var(--text); outline: none; }
input.row-title::placeholder { color: var(--muted); font-weight: 400; }
.panel { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; padding: 16px; background: var(--placeholder); border-radius: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.panel h2 { font-size: 16px; font-weight: 500; }
.panel .pill { padding: 5px 12px; font-size: 13px; }
.outlier-row { margin: 16px 0 8px; color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.outlier { display: flex; gap: 10px; margin-bottom: 10px; text-decoration: none; }
.outlier img { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: var(--bg); }
.outlier .title { font-size: 14px; line-height: 1.3; margin-bottom: 3px; }
.outlier .channel { font-size: 12px; }
.outlier:hover .title { text-decoration: underline; }
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .panel { position: static; max-height: none; }
}

/* Three thumbnails per row, like the tester. */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 16px; }
.item { display: flex; flex-direction: column; min-width: 0; }
.item.dragging { opacity: 0.4; }
.item.over .box { outline: 2px dashed var(--blue); outline-offset: 2px; }
.box { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; background: var(--placeholder); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.box[draggable="true"] { cursor: grab; }
.box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.empty .box { cursor: pointer; border: 1px dashed var(--line); }
.placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px 8%; color: var(--muted); font-size: 13px; text-align: center; }
.placeholder svg { width: 36px; height: 36px; fill: var(--muted); }
.link-input { width: 100%; max-width: 320px; padding: 9px 12px; font-size: 14px; text-align: center; background: var(--input); border: 1px solid var(--line); border-radius: 18px; }
.clear { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; background: rgba(0, 0, 0, 0.65); color: #fff; border: none; border-radius: 50%; font-size: 18px; line-height: 24px; cursor: pointer; opacity: 0; transition: opacity 0.2s; }
.box:hover .clear, .clear:focus-visible { opacity: 1; }
@media (hover: none) { .clear { opacity: 1; } }

.details { display: flex; align-items: flex-start; padding-right: 24px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #555; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 500; margin: 2px 12px 0 0; flex-shrink: 0; }
body.light-theme .avatar { background: #909090; }
.text { flex: 1; min-width: 0; }
.title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 16px; font-weight: 500; line-height: 1.4; margin-bottom: 4px; text-decoration: none; overflow-wrap: anywhere; }
.channel, .meta { display: block; color: var(--muted); font-size: 14px; line-height: 1.3; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
a.channel:hover { color: var(--text); }
.meta { font-size: 13px; }
.ghost .avatar { background: var(--placeholder); }
.line { height: 14px; border-radius: 4px; background: var(--placeholder); margin: 4px 0 8px; }
.line.short { width: 55%; }
.note { margin: 8px 0 0 48px; font-size: 14px; }
textarea.note { padding: 8px 10px; background: var(--input); border: 1px solid var(--line); border-radius: 8px; resize: vertical; min-height: 36px; field-sizing: content; }
p.note { white-space: pre-wrap; overflow-wrap: anywhere; border-left: 3px solid var(--line); padding-left: 10px; }
.empty-note, p.empty { color: var(--muted); padding: 48px 16px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; margin-top: 20px; }

.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 30px 16px; }
.board { display: grid; gap: 2px; text-decoration: none; }
.strip { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--placeholder); margin-bottom: 10px; }
.strip img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 0; }

@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; gap: 25px 0; }
  .details { padding-right: 0; }
  .content { padding: 16px 8px; }
}

/* Outlier score: views against what is normal for the channel. */
.score { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 10px; font-size: 12px; font-weight: 700; line-height: 1.5; background: var(--button); color: var(--muted); }
.score.good { background: #1f6f3d; color: #fff; }
.score.high { background: #0a9d4c; color: #fff; }
