:root {
  --bg: #f7f8fa;
  --ink: #1c1917;
  --muted: #57534e;
  --line: #e7e5e4;
  --accent: #15803d;
  --board: #1b2436;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
a { color: #166534; }
.wrap { width: min(980px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  background: rgba(247, 248, 250, 0.94);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 750; letter-spacing: -0.03em; text-decoration: none; color: inherit; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: #1b2436; color: #ff6b6b; display: grid; place-items: center; font-size: 0.95rem; font-weight: 800; }
.nav { display: flex; gap: 6px; }
.nav a { text-decoration: none; color: var(--muted); font-size: 0.86rem; font-weight: 650; padding: 7px 10px; border-radius: 999px; }
.nav a.active, .nav a:hover { background: #fff; color: var(--ink); }

.hero { padding: 22px 0 8px; text-align: center; }
h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.title-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 16px 14px;
}
.title-field, .note-field { display: block; font-size: 0; }
#list-title {
  width: min(100%, 640px);
  border: 0;
  background: transparent;
  text-align: center;
  font: 700 2rem/1.15 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  letter-spacing: -0.03em;
}
#list-note {
  width: min(100%, 520px);
  margin-top: 4px;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  font-size: 0.95rem;
  color: var(--muted);
}
#list-title:focus, #list-note:focus { outline: none; }
.lede { color: var(--muted); font-size: 0.95rem; max-width: 44rem; margin: 14px auto 0; }

.maker { margin-top: 16px; }
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.toolbar-main, .toolbar-side { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar-side { flex: 0 0 auto; }
.hint { margin: 0 0 10px; color: var(--muted); font-size: 0.92rem; }
.hint[hidden] { display: none; }
.adder {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}
.adder[hidden] { display: none; }
.names-field { display: grid; gap: 4px; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-align: left; }
.maker textarea, .move select {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
}
.maker textarea { width: 100%; min-height: 76px; resize: vertical; }
.adder-actions { display: flex; flex-direction: column; gap: 8px; }
button, .file {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-add { background: #22a34a; color: #fff; white-space: nowrap; }
.btn-ghost { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--ink); border: 1px solid #ddd9d6; white-space: nowrap; }
.btn-ghost svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.file { position: relative; display: inline-flex; align-items: center; justify-content: center; background: #fff; color: var(--ink); border: 1px solid var(--line); }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.btn-done { background: #2c384e; color: #e8eef8; white-space: nowrap; padding: 8px 12px; font-size: 0.82rem; }
.status { min-height: 1.2em; margin: 0 0 8px; color: var(--muted); font-size: 0.86rem; text-align: left; }

.board-shell { background: var(--board); border-radius: 16px; padding: 8px 16px 14px; }
.tier {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
button.grip {
  width: 14px;
  height: 22px;
  flex: 0 0 14px;
  padding: 0;
  border-radius: 4px;
  background-color: transparent;
  background-image: radial-gradient(circle, #8b97ad 1.15px, transparent 1.3px);
  background-size: 6px 7px;
  background-position: center;
  cursor: grab;
}
button.grip:active { cursor: grabbing; }
.tier.is-row-over { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45); }
.tier-label {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 10px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0;
  padding: 4px;
}
.tier-label input[type="text"] {
  width: 100%;
  text-align: center;
  font-weight: 800;
  font-size: 1.25rem;
  background: transparent;
  border: 0;
  color: #1a1816;
  padding: 0;
}
.tier-side {
  position: absolute;
  left: 28px;
  bottom: 2px;
  display: flex;
  gap: 2px;
  align-items: center;
  opacity: 0;
  pointer-events: none;
}
.tier:hover .tier-side,
.tier:focus-within .tier-side { opacity: 1; pointer-events: auto; }
.tier-side input[type="color"] { width: 16px; height: 14px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.tier-pool { border-bottom: 0; align-items: center; }
.tier-pool .tier-label {
  width: 110px;
  height: auto;
  flex-basis: 110px;
  background: transparent !important;
  padding: 0;
  justify-items: start;
}
.tier-pool .tier-label input[type="text"] {
  text-align: left;
  color: #9aa6bd;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tier-tools { display: flex; }
.row-remove {
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: #8b97ad;
  font-size: 0.85rem;
  line-height: 1;
}
.tier-cards {
  flex: 1;
  min-height: 64px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: center;
  background: transparent;
  border-radius: 10px;
  padding: 4px;
}
.tier-cards.is-over { outline: 2px dashed rgba(255, 255, 255, 0.45); outline-offset: 2px; }
.empty { margin: 0; color: #8b97ad; font-size: 0.92rem; }

.add-tier {
  width: 100%;
  margin: 10px 0 4px;
  background: transparent;
  color: #c5cedd;
  border: 1px dashed rgba(197, 206, 221, 0.5);
  border-radius: 12px;
}
.pool-line { display: flex; align-items: center; gap: 12px; }
#pool { flex: 1; min-width: 0; }
.pool-line .tier { border-bottom: 0; min-height: 52px; }

.card {
  position: relative;
  width: 108px;
  min-height: 72px;
  background: #121a2b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px;
  touch-action: none;
  cursor: grab;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #f5f5f4;
}
.card.is-dragging { opacity: 0.35; }
.card img { width: calc(100% + 16px); height: 56px; object-fit: cover; border-radius: 8px 8px 0 0; display: block; margin: -8px -8px 6px; }
.card p {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  word-break: break-word;
  cursor: text;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile-edit {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: center;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0;
}
.card-actions {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  display: flex;
  gap: 4px;
  align-items: center;
  opacity: 0;
}
.card:hover .card-actions,
.card:focus-within .card-actions { opacity: 1; }
.move { flex: 1; min-width: 0; }
.move select { width: 100%; padding: 2px 4px; font-size: 0.72rem; border-radius: 6px; background: #0c1220; color: #f5f5f4; border-color: #334155; }
.card-actions .remove {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  background: #334155;
  color: #fecdd3;
  flex: 0 0 22px;
}
.ghost { position: fixed; z-index: 40; pointer-events: none; margin: 0; opacity: 0.92; }

.section { padding: 28px 0; text-align: left; }
.prose { max-width: 740px; }
.prose h2 { font-size: 1.25rem; letter-spacing: -0.02em; text-transform: none; color: var(--ink); }
.prose p, .prose li { color: var(--muted); }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.faq summary { font-weight: 700; cursor: pointer; color: var(--ink); }
.site-footer { border-top: 1px solid var(--line); padding: 22px 0 40px; color: var(--muted); font-size: 0.9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.footer-links a { text-decoration: none; }

@media (max-width: 720px) {
  .adder { grid-template-columns: 1fr; }
  .tier-label { width: 48px; height: 48px; flex-basis: 48px; }
}
@media (max-width: 560px) {
  .toolbar { flex-wrap: wrap; }
  .toolbar-side { width: 100%; }
  .toolbar-side button { flex: 1; }
  .card-actions,
  .tier-side { opacity: 1; pointer-events: auto; }
}
