:root {
  --bg: #0a0a0a;
  --surface: #1a1a1a;
  --deep: #ffffff;
  --white: #ffffff;
  --ink: #ece9e2;
  --ink-muted: #a8a29a;
  --line: #333333;
  --accent: #d97b3f;
  --danger: #b3261e;
  --danger-text: #ff8a80;
  --success-text: #69db7c;
  --radius-md: 10px;
  --radius-sm: 6px;
  --max-width: 1100px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: "Segoe UI", system-ui, sans-serif; background: var(--bg);
  color: var(--ink); line-height: 1.5;
}
.tool-header {
  background: var(--surface); color: var(--white); padding: 1rem 1.5rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem;
}
.tool-header a { color: var(--white); text-decoration: none; }
.tool-header .tool-title { font-weight: 700; font-size: 1.1rem; }
.tool-header-links { display: flex; gap: 1rem; align-items: center; font-size: 0.9rem; }
.pill-link {
  background: rgba(255,255,255,0.12); padding: 0.4rem 0.9rem; border-radius: 999px;
}
.pill-link:hover { background: rgba(255,255,255,0.22); }
.tool-main { max-width: var(--max-width); margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.tool-main h1 { color: var(--deep); font-size: 1.6rem; }
.card {
  background: var(--surface); border-radius: var(--radius-md); padding: 1.5rem;
  margin-bottom: 1.5rem; box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
.tool-nav-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.tool-nav-grid a {
  display: block; background: var(--surface); padding: 1.25rem; border-radius: var(--radius-md);
  text-decoration: none; color: var(--deep); font-weight: 700; box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
.tool-nav-grid a span { display: block; font-weight: 400; color: var(--ink-muted); font-size: 0.85rem; margin-top: 0.35rem; }
label { font-weight: 600; display: block; margin-bottom: 0.3rem; }
input, textarea, select {
  width: 100%; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 1rem; margin-bottom: 0.9rem;
  background: var(--surface); color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
.btn {
  display: inline-block; padding: 0.6rem 1.3rem; border-radius: 999px; background: var(--accent);
  color: var(--white); border: none; cursor: pointer; font-weight: 600; font-size: 0.95rem; text-decoration: none;
}
.btn:hover { opacity: 0.9; }
.btn-secondary { background: transparent; border: 2px solid var(--white); }
.btn-danger { background: var(--danger); }
.btn-small { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.form-status { font-weight: 600; min-height: 1.4em; }
.form-status.error { color: var(--danger-text); }
.form-status.success { color: var(--success-text); }
.section-title { color: var(--deep); margin-top: 0; }
table { width: 100%; border-collapse: collapse; }
table th, table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); font-size: 0.9rem; }

.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
.thumb {
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface);
  cursor: pointer; position: relative;
}
.thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.thumb.selected { outline: 3px solid var(--accent); }
.thumb .thumb-name { font-size: 0.7rem; padding: 0.3rem; color: var(--ink-muted); word-break: break-all; }

.placement-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.placement-slot { background: var(--surface); border-radius: var(--radius-md); padding: 0.75rem; box-shadow: 0 2px 10px rgba(0,0,0,0.4); }
.placement-slot img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface); }
.placement-slot .slot-label { font-size: 0.8rem; font-weight: 600; margin: 0.5rem 0; color: var(--deep); }

.entry-row { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }

@media (max-width: 700px) {
  .tool-nav-grid { grid-template-columns: 1fr; }
  .tool-header { flex-direction: column; align-items: flex-start; }
}
