:root {
  --bg: #eef2f6;
  --surface: #fff;
  --ink: #14202e;
  --muted: #5d6b7b;
  --line: #d6dee7;
  --brand: #0b4f8a;
  --done: #177a4b;
  --done-bg: #e3f4ea;
  --warn: #9a5b00;
  --warn-bg: #fdf0d8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1720;
    --surface: #17222f;
    --ink: #e8eef4;
    --muted: #93a3b5;
    --line: #2a3a4b;
    --brand: #6db3f2;
    --done: #5fd196;
    --done-bg: #16382a;
    --warn: #f0b955;
    --warn-bg: #3a2d12;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 150px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

header.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: 16px 0 12px;
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.bar {
  flex: 1;
  height: 10px;
  border-radius: 6px;
  background: var(--line);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--done);
  transition: width .25s;
}

.count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tools input[type=search] {
  flex: 1 1 200px;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.seg {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}

.seg button {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

.seg button[aria-pressed=true] {
  background: var(--brand);
  color: var(--surface);
  font-weight: 600;
}

.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--brand);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

section {
  margin-top: 28px;
}

h2 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 10px;
  font-size: 1.05rem;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--brand);
}

h2 small {
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

li {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

li.done {
  background: var(--done-bg);
  border-color: var(--done);
}

li label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  min-width: 0;
}

li input {
  width: 18px;
  height: 18px;
  accent-color: var(--done);
  flex: none;
  margin: 0;
}

li .name {
  overflow-wrap: anywhere;
}

li.done .name {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.tag {
  flex: none;
  font-size: .72rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--warn-bg);
  color: var(--warn);
  cursor: help;
}

li a {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--brand);
  text-decoration: none;
  border-left: 1px solid var(--line);
  font-size: .85rem;
}

li a:hover {
  text-decoration: underline;
}

.empty {
  display: none;
  margin-top: 40px;
  text-align: center;
  color: var(--muted);
}

.note {
  margin-top: 30px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: .88rem;
}

.status-db {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  margin-left: 8px;
  background: var(--line);
}

@media (max-width: 520px) {
  ul {
    grid-template-columns: 1fr;
  }
}

/* ===== Tab navigasi ===== */
.tabs {
  display: flex;
  gap: 4px;
  padding-top: 12px;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--muted);
  padding: 8px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tabs button[aria-selected=true] {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

[hidden] {
  display: none !important;
}

/* ===== Kit Konten Havindo ===== */
.kit-head {
  padding: 20px 0 4px;
}

.kit-head p {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
}

.kit-tool {
  margin-top: 28px;
}

.kit-tool h3 {
  margin: 0 0 2px;
  font-size: 1.05rem;
}

.kit-desc {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .9rem;
}

.kit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}

.kit-panel {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.kit-field + .kit-field {
  margin-top: 12px;
}

.kit-field label,
.kit-label {
  display: block;
  margin-bottom: 6px;
  font-size: .85rem;
  font-weight: 600;
}

.kit-panel input[type=text],
.kit-panel textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font: .85rem/1.6 ui-monospace, "SFMono-Regular", Consolas, monospace;
  resize: none;
}

#listInput {
  height: 190px;
}

#codeOutput,
#listOutput {
  flex: 1;
  min-height: 190px;
}

.kit-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: .85rem;
  font-weight: 600;
}

.kit-count {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.kit-copy {
  padding: 5px 12px;
  font-size: .85rem;
}

.kit-copy.copied {
  background: var(--done-bg);
  border-color: var(--done);
  color: var(--done);
}

.kit-preview {
  margin-top: auto;
  padding-top: 16px;
}

.kit-stage {
  display: flex;
  justify-content: center;
  padding: 26px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
}

@media (max-width: 760px) {
  .kit-grid {
    grid-template-columns: 1fr;
  }
}
