:root {
  --bg: #0b0e13;
  --bg-soft: #121722;
  --card: #141a25;
  --line: #232b3a;
  --text: #e8edf6;
  --dim: #8b96a9;
  --accent: #c8f751;
  --accent-dim: #93b93a;
  --radius: 18px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

body::before {
  content: "";
  position: fixed;
  inset: -20% -20% auto -20%;
  height: 60vh;
  background: radial-gradient(60% 60% at 50% 0%, rgba(200, 247, 81, 0.10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
  background: linear-gradient(to bottom, rgba(11, 14, 19, 0.96), rgba(11, 14, 19, 0.82));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(35, 43, 58, 0.6);
}

.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #0b0e13;
  font-size: 20px;
  font-weight: 700;
}
h1 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.sub { margin: 0; font-size: 12px; color: var(--dim); }

.add-btn {
  border: 1px solid var(--line);
  background: var(--accent);
  color: #0b0e13;
  font-weight: 650;
  font-size: 14px;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.add-btn:active { transform: scale(0.97); }

.search-wrap { padding: 14px 16px 6px; position: relative; z-index: 5; }

#search {
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 15px;
  outline: none;
}
#search:focus { border-color: var(--accent-dim); }
#search::placeholder { color: #66718a; }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #0b0e13; font-weight: 600; }
.chip .n { opacity: 0.6; margin-left: 5px; font-size: 12px; }

/* tag row: same chips, quieter, so categories stay the primary filter */
.tags-row { padding-top: 0; }
.tag-chip { font-size: 12px; padding: 6px 11px; }
.tag-chip.on { background: transparent; border-color: var(--accent-dim); color: var(--accent); font-weight: 600; }

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.card-tags span { font-size: 11px; color: #6f7c93; }

.queue {
  margin: 8px 16px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(200, 247, 81, 0.08);
  border: 1px solid rgba(200, 247, 81, 0.25);
  color: var(--accent);
  font-size: 13px;
}

.grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px 16px 90px;
}
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(2, 1fr); padding: 18px 24px 90px; }
  .top, .search-wrap { padding-left: 24px; padding-right: 24px; }
}
@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(3, 1fr); max-width: 1240px; margin: 0 auto; }
}

.card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.card:active { transform: scale(0.995); }
.card:hover { border-color: #33405a; }

.thumb {
  flex: 0 0 92px;
  width: 92px;
  height: 122px;
  border-radius: 12px;
  object-fit: cover;
  background: linear-gradient(150deg, #1d2637, #131a26);
}
.thumb.ph { display: grid; place-items: center; color: #3b4a63; font-size: 26px; }

.card-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.card-title { font-size: 15px; font-weight: 650; line-height: 1.3; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-line { font-size: 13px; color: var(--dim); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.meta { margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(200, 247, 81, 0.10);
  color: var(--accent);
  border: 1px solid rgba(200, 247, 81, 0.18);
}
.stars { font-size: 12px; color: var(--accent-dim); letter-spacing: 1px; }
.who { font-size: 11px; color: #5f6b80; margin-left: auto; max-width: 45%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }

/* sheet */
.sheet[hidden] { display: none !important; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade 0.15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet-inner {
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 20px 18px calc(28px + env(safe-area-inset-bottom));
  animation: rise 0.18s ease;
}
@keyframes rise { from { transform: translateY(24px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@media (min-width: 720px) {
  .sheet { align-items: center; padding: 24px; }
  .sheet-inner { border-radius: 22px; border-bottom: 1px solid var(--line); }
}
.sheet-inner.compact { max-width: 520px; }

.sheet-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.sheet-head h2 { margin: 0; font-size: 21px; line-height: 1.25; letter-spacing: -0.01em; }
.ghost {
  margin-left: auto;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  width: 32px; height: 32px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
}

.detail-thumb { width: 100%; max-height: 46vh; object-fit: cover; border-radius: 14px; margin: 8px 0 12px; }
.kicker { font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; }
.one-liner { font-size: 16px; margin: 6px 0 14px; }
.summary { font-size: 15px; color: #cbd4e4; margin: 0 0 18px; white-space: pre-line; }

h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); margin: 20px 0 8px; }

ol.steps { margin: 0; padding-left: 20px; }
ol.steps li { margin-bottom: 8px; font-size: 14.5px; }

.tools { display: flex; flex-direction: column; gap: 8px; }
.tool { padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.tool b { color: var(--accent); font-weight: 600; }
.tool span { color: var(--dim); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; color: var(--dim); border: 1px solid var(--line); padding: 4px 9px; border-radius: 999px; }
button.tag { background: transparent; font-family: var(--sans); cursor: pointer; }
button.tag:hover, button.tag:active { border-color: var(--accent-dim); color: var(--accent); }

.cta { margin-top: 14px; padding: 11px 13px; border-radius: 12px; background: rgba(200, 247, 81, 0.07);
  border: 1px dashed rgba(200, 247, 81, 0.3); font-size: 14px; color: #dbe6c4; }

.actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
a.btn, button.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 16px; border-radius: 12px; font-size: 14px; text-decoration: none;
  border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer;
}
a.btn.ig { background: var(--accent); color: #0b0e13; border-color: var(--accent); font-weight: 650; }
button.btn.danger { color: #ff7b72; }

details.tx { margin-top: 18px; }
details.tx summary { cursor: pointer; color: var(--dim); font-size: 13px; }
details.tx pre { white-space: pre-wrap; font-family: var(--sans); font-size: 13px; color: #a9b4c7;
  background: var(--card); padding: 12px; border-radius: 12px; margin-top: 8px; }

textarea {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  resize: vertical;
}
.row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.primary {
  padding: 11px 18px; border-radius: 12px; border: none; background: var(--accent);
  color: #0b0e13; font-weight: 650; font-size: 15px; cursor: pointer;
}
.dim { color: var(--dim); }
.small { font-size: 13px; }

.empty { text-align: center; padding: 60px 24px; color: var(--text); }
.foot { position: fixed; bottom: 0; left: 0; right: 0; padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  font-size: 11px; color: #4f5a6e; text-align: center; background: linear-gradient(to top, var(--bg), transparent); }
