:root {
  --bg: #f6f5f3;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --surface-3: #f1efeb;
  --border: #e9e5df;
  --border-strong: #d8d2c8;
  --text: #1d1b18;
  --text-2: #5e5850;
  --text-3: #908a80;
  --accent: #ee6417;
  --accent-hover: #d95712;
  --accent-ink: #ffffff;
  --accent-soft: #fff0e5;
  --accent-text: #b8480b;
  --ok: #178a4c;
  --ok-soft: #e7f6ee;
  --warn: #a86f00;
  --warn-soft: #fff5dc;
  --bad: #c9362f;
  --bad-soft: #fdeeed;
  --ig: #d62976;
  --tt: #111111;
  --yt: #e62117;
  --shadow: 0 1px 2px rgba(29, 27, 24, .04), 0 1px 6px rgba(29, 27, 24, .04);
  --shadow-lg: 0 18px 50px rgba(29, 27, 24, .22), 0 2px 8px rgba(29, 27, 24, .08);
  --radius: 14px;
  --radius-sm: 9px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131211;
    --surface: #1c1b19;
    --surface-2: #211f1d;
    --surface-3: #2a2825;
    --border: #2e2b28;
    --border-strong: #3d3a35;
    --text: #f3f0ea;
    --text-2: #b9b2a7;
    --text-3: #8a847a;
    --accent: #ff7a2e;
    --accent-hover: #ff8c47;
    --accent-ink: #1a0d04;
    --accent-soft: #3a2314;
    --accent-text: #ffa266;
    --ok: #4cc884;
    --ok-soft: #15301f;
    --warn: #f1b93b;
    --warn-soft: #33290f;
    --bad: #ff6f66;
    --bad-soft: #3a1917;
    --tt: #eeeeee;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
img { display: block; }
.icon { flex: none; }
[hidden] { display: none !important; }

/* ---------- header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.top-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-3);
  border-radius: 11px;
}
.tabs a {
  padding: 6px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-2);
  font-weight: 550;
  font-size: 14px;
  transition: background .15s, color .15s;
}
.tabs a:hover { color: var(--text); }
.tabs a.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.health {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.health:hover { background: var(--surface-3); }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  flex: none;
}
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.dot.busy { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent); }
.dot.down { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }

main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

/* ---------- basics ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 560;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; gap: 5px; }
.btn.icon-only { width: 36px; padding: 0; }
.btn.sm.icon-only { width: 30px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 11px; }

.input {
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  outline: none;
  min-width: 0;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  animation: spin .8s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--text-3); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip .n { opacity: .7; font-variant-numeric: tabular-nums; }

.pchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .01em;
}
.pchip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--text-3);
}
.pchip.instagram::before { background: var(--ig); }
.pchip.tiktok::before { background: var(--tt); }
.pchip.youtube::before { background: var(--yt); }

.section-title {
  font-size: 22px;
  font-weight: 680;
  letter-spacing: -0.02em;
  margin: 0;
}
.lede { color: var(--text-2); margin: 4px 0 0; }

.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-2);
}
.empty h3 { color: var(--text); margin: 14px 0 6px; font-size: 17px; }
.empty p { margin: 0 auto; max-width: 440px; }
.empty .art {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* ---------- Script tab ---------- */

.composer { padding: 14px; }
.composer textarea {
  width: 100%;
  min-height: 92px;
  max-height: 320px;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
  padding: 12px 14px;
  outline: none;
  line-height: 1.55;
  display: block;
}
.composer textarea::placeholder { color: var(--text-3); }
.composer-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.composer-foot .found { font-size: 13px; color: var(--text-3); margin-right: auto; }
.composer-foot .found.has { color: var(--accent-text); font-weight: 600; }
.select {
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 0 30px 0 10px;
  font-size: 13px;
  color: var(--text-2);
  outline: none;
  max-width: 220px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23908a80' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.kbd { font-size: 12px; color: var(--text-3); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 26px 0 14px;
  flex-wrap: wrap;
}
.searchbox {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 220px;
  max-width: 320px;
}
.searchbox .icon { position: absolute; left: 11px; color: var(--text-3); pointer-events: none; }
.searchbox .input { width: 100%; padding-left: 34px; height: 36px; }
.toolbar .spacer { flex: 1; }

.jobs { display: flex; flex-direction: column; gap: 12px; }

.job {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 16px;
  padding: 14px;
}
.thumb {
  position: relative;
  width: 86px;
  aspect-ratio: 9 / 16;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-3);
  display: block;
  align-self: start;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .dur {
  position: absolute;
  right: 5px;
  bottom: 5px;
  background: rgba(0, 0, 0, .66);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}
.thumb .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-3);
}
.thumb.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--surface) 55%, transparent) 50%, transparent 70%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.job-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 13px;
  color: var(--text-2);
}
.meta a { text-decoration: none; font-weight: 600; color: var(--text); }
.meta a:hover { text-decoration: underline; }
.meta .stat { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.job-title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.job-url { font-size: 13px; color: var(--text-3); overflow-wrap: anywhere; }

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-2);
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-top: 2px;
}
.status.running { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
.status.waiting { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.status.failed { color: var(--bad); background: var(--bad-soft); border-color: transparent; align-items: flex-start; }
.status.failed .icon { margin-top: 2px; }
.status .grow { flex: 1; min-width: 0; }
.status .actions { display: flex; gap: 6px; flex: none; }

.hook {
  margin-top: 2px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 4px 10px 10px 4px;
  font-weight: 600;
  line-height: 1.45;
}
.hook .label, .caption .label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 2px;
}
.script {
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  position: relative;
}
.script.clamped {
  max-height: 6.5em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}
.script .ts {
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin-right: 8px;
  user-select: none;
}
.script .line { display: block; padding: 1px 0; }
.more-toggle {
  align-self: flex-start;
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent-text);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.caption {
  font-size: 13.5px;
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.caption .label { color: var(--text-3); }
.nospeech { color: var(--text-2); font-style: italic; }
.foot {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.foot .stats { font-size: 12.5px; color: var(--text-3); margin-right: auto; font-variant-numeric: tabular-nums; }

.load-older { display: flex; justify-content: center; margin-top: 18px; }

/* ---------- Discover ---------- */

.hero { margin-bottom: 18px; }
.bigsearch {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  position: relative;
}
.bigsearch .icon { position: absolute; left: 15px; top: 14px; color: var(--text-3); pointer-events: none; }
.bigsearch .input { flex: 1; height: 46px; padding-left: 42px; font-size: 16px; border-radius: 12px; }
.recent { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 14px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-2);
}
.controls .count { margin-right: auto; }
.seg {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-3);
  border-radius: 10px;
}
.seg button {
  border: 0;
  background: none;
  height: 28px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 560;
  color: var(--text-2);
  cursor: pointer;
}
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.toggle { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; font-size: 13px; font-weight: 560; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 16px;
}
.tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.tile-thumb {
  position: relative;
  aspect-ratio: 9 / 14;
  background: var(--surface-3);
  border: 0;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: block;
  width: 100%;
}
.tile-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.tile:hover .tile-thumb img { transform: scale(1.03); }
.tile-thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); }
.overlay-badges {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, .68);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  padding: 2px 7px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
}
.badge.views { font-size: 13px; }
.badge.right { margin-left: auto; }
.badge.short { position: absolute; top: 8px; left: 8px; background: var(--yt); }
.badge.done { position: absolute; top: 8px; right: 8px; background: var(--ok); }
.tile-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tile-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.tile-meta { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-hook {
  font-size: 12.5px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  border-left: 2px solid var(--accent);
  padding-left: 7px;
  margin-top: 2px;
}
.tile-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 8px; }
.tile-actions .btn:first-child { flex: 1; }
.tile-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
}
.tile:hover .tile-remove, .tile-remove:focus-visible { opacity: 1; }
@media (hover: none) { .tile-remove { opacity: 1; } }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 560;
  flex: 1;
}
.pill.working { background: var(--accent-soft); color: var(--accent-text); }
.pill.waiting { background: var(--warn-soft); color: var(--warn); }
.pill.failed { background: var(--bad-soft); color: var(--bad); cursor: help; }

.skeleton .tile-thumb { animation: pulse 1.2s ease-in-out infinite; }
.skeleton .bar { height: 12px; border-radius: 6px; background: var(--surface-3); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* ---------- Boards ---------- */

.boards-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: start;
}
.board-list { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 84px; }
.board-list .new { margin-bottom: 8px; justify-content: flex-start; }
.board-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-2);
}
.board-link:hover { background: var(--surface-3); color: var(--text); }
.board-link.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); border: 1px solid var(--border); padding: 6px 7px; }
.board-link .cover {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-3);
  flex: none;
  display: grid;
  place-items: center;
  color: var(--text-3);
}
.board-link .cover img { width: 100%; height: 100%; object-fit: cover; }
.board-link .name { flex: 1; min-width: 0; font-weight: 580; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-link .count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.board-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.board-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; font-weight: 680; }
.board-head .count { color: var(--text-3); font-size: 14px; margin-right: auto; }
.addlinks { display: flex; gap: 8px; margin: 16px 0 20px; }
.addlinks .input { flex: 1; }

/* ---------- Status ---------- */

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.svc { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.svc .row { display: flex; align-items: center; gap: 9px; font-weight: 650; }
.svc p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.panel { padding: 18px 20px; margin-top: 16px; }
.panel h3 { margin: 0 0 4px; font-size: 16px; }
.panel > p { margin: 0 0 12px; color: var(--text-2); font-size: 14px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 14px; align-items: baseline; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv code {
  font: 13px ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface-3);
  padding: 2px 6px;
  border-radius: 6px;
}
.panel .actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.auto-list { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.auto-list li { display: flex; gap: 10px; font-size: 14px; }
.auto-list .icon { color: var(--ok); margin-top: 2px; }
.auto-list b { font-weight: 620; }
.auto-list span { color: var(--text-2); }
.stats-row { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 4px; }
.stat-big b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-big span { color: var(--text-3); font-size: 13px; }

/* ---------- menu, modal, toast, login ---------- */

.menu {
  position: fixed;
  z-index: 60;
  min-width: 200px;
  max-width: 280px;
  max-height: min(380px, 70vh);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 5px;
  animation: pop .12s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu-title { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); padding: 7px 10px 4px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-3); outline: none; }
.menu-item.danger { color: var(--bad); }
.menu-item .icon { color: var(--text-3); }
.menu-item.danger .icon { color: inherit; }
.menu-item .check { margin-left: auto; color: var(--ok); }
.menu-new { display: flex; align-items: center; gap: 6px; padding: 5px; border-top: 1px solid var(--border); margin-top: 4px; }
.menu-new .input { height: 34px; flex: 1; font-size: 13.5px; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; }

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 13, 11, .48);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  position: relative;
  width: min(900px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  animation: pop .16s ease-out;
}
.modal-media { background: #000; position: relative; }
.modal-media img { width: 100%; height: 100%; object-fit: cover; max-height: calc(100vh - 48px); }
.modal-media .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #777; }
.modal-media a.open {
  position: absolute;
  left: 12px;
  bottom: 12px;
  right: 12px;
  justify-content: center;
  background: rgba(255, 255, 255, .92);
  color: #111;
  border: 0;
}
.modal-content {
  padding: 22px 24px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 48px);
}
.modal-content h2 { margin: 0; font-size: 19px; line-height: 1.3; letter-spacing: -0.01em; padding-right: 32px; overflow-wrap: anywhere; }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 2; }

#toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 560;
  box-shadow: var(--shadow-lg);
  animation: pop .16s ease-out;
  transition: opacity .3s, transform .3s;
  max-width: calc(100vw - 32px);
}
.toast.bad { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }

.login {
  min-height: 70vh;
  display: grid;
  place-items: center;
}
.login .card { padding: 28px; width: min(380px, 100%); text-align: center; }
.login img { margin: 0 auto 12px; }
.login h2 { margin: 0 0 4px; font-size: 20px; }
.login p { margin: 0 0 18px; color: var(--text-2); font-size: 14px; }
.login form { display: flex; flex-direction: column; gap: 10px; }

.offline {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
}

/* ---------- small screens ---------- */

@media (max-width: 820px) {
  .boards-layout { grid-template-columns: 1fr; gap: 16px; }
  .board-list { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .board-list .new { margin: 0; }
  .board-link { flex: none; max-width: 200px; }
  .modal { grid-template-columns: 1fr; overflow-y: auto; }
  .modal-media { max-height: 40vh; }
  .modal-media img { max-height: 40vh; }
  .modal-content { max-height: none; overflow: visible; }
}

@media (max-width: 640px) {
  .top-inner { flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; }
  .brand span { font-size: 15px; }
  .tabs { order: 3; width: 100%; }
  .tabs a { flex: 1; text-align: center; padding: 6px 4px; }
  .health .label { display: none; }
  main { padding: 18px 16px 72px; }
  .job { grid-template-columns: 64px 1fr; gap: 12px; padding: 12px; }
  .thumb { width: 64px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile-body { padding: 8px 9px 10px; }
  .searchbox { max-width: none; flex-basis: 100%; }
  .kbd { display: none; }
  .backdrop { padding: 0; align-items: end; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; }
  .offline { top: 104px; }
}
