:root {
  --bg: #0b0b0c;
  --bg-card: #16161a;
  --border: #2a2a30;
  --text: #e8e8ea;
  --text-dim: #8a8a92;
  --accent: #c8ff00;
  --danger: #ff4d4d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
  text-align: center;
}

.topbar h1 {
  margin: 0;
  font-family: "Courier New", monospace;
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 22px;
}

.whoami {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
}

.who-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
}

.who-btn.active {
  color: #0b0b0c;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 210px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

@media (min-width: 860px) {
  main {
    max-width: 1140px;
    flex-direction: row;
    align-items: flex-start;
  }

  .section {
    flex: 1;
    min-width: 0;
  }

  .composer {
    max-width: 1140px;
  }
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-title {
  margin: 0;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

.section-count {
  font-family: "Courier New", monospace;
  font-size: 13px;
  color: var(--text-dim);
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}

.item:last-child { border-bottom: none; }

.item-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.item-check {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--text-dim);
  background: transparent;
  cursor: pointer;
  position: relative;
}

.item.checked .item-check {
  background: var(--accent);
  border-color: var(--accent);
}

.item.checked .item-check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #0b0b0c;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}

.item-tipo {
  font-family: "Courier New", monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

.item-label {
  font-size: 15px;
  text-transform: uppercase;
  word-break: break-word;
}

.item.checked .item-label {
  color: var(--text-dim);
}

.item-thumb {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #1f1f24 center/cover no-repeat;
  cursor: pointer;
  font-size: 22px;
  color: var(--text-dim);
}

.item-thumb.has-image { border-color: var(--accent); }

.item-drag {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1;
  padding: 4px 6px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.item-actions {
  display: flex;
  justify-content: flex-end;
  padding-right: 2px;
}

.item-delete {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
}

.item-delete:hover { color: var(--danger); }

.item.dragging { opacity: .35; }

.drag-ghost {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  opacity: .95;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,.55);
  list-style: none;
}

.drop-placeholder {
  height: 44px;
  margin: 2px 0;
  border: 2px dashed var(--accent);
  border-radius: 8px;
  background: rgba(200, 255, 0, .08);
  list-style: none;
}

.section.drag-over {
  border-color: var(--accent);
}

body.dragging-active {
  user-select: none;
  -webkit-user-select: none;
}

.composer-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}

.composer {
  max-width: 640px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.composer-row {
  display: flex;
  gap: 6px;
}

.chip {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 20px;
  padding: 7px 4px;
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 700;
  cursor: pointer;
}

.chip.active {
  background: var(--accent);
  color: #0b0b0c;
  border-color: var(--accent);
}

.composer-input-row {
  display: flex;
  gap: 8px;
}

.composer-input-row input {
  flex: 1;
  background: #0f0f12;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  font-size: 16px;
  text-transform: uppercase;
}

.composer-input-row input:focus { outline: 1px solid var(--accent); }

.composer-input-row button {
  background: var(--accent);
  color: #0b0b0c;
  border: none;
  border-radius: 8px;
  width: 44px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.empty-hint {
  color: var(--text-dim);
  font-size: 13px;
  padding: 6px 4px;
}

.hidden { display: none !important; }

.lock-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lock-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 300px;
}

.lock-logo {
  font-family: "Courier New", monospace;
  font-weight: 800;
  letter-spacing: 3px;
  font-size: 28px;
  margin: 0 0 8px;
  color: var(--accent);
}

.lock-form input {
  width: 100%;
  background: #0f0f12;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  font-size: 18px;
  text-align: center;
  letter-spacing: 4px;
}

.lock-form input:focus { outline: 1px solid var(--accent); }

.lock-form button {
  width: 100%;
  background: var(--accent);
  color: #0b0b0c;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
}

.lock-err {
  color: var(--danger);
  font-size: 13px;
  min-height: 16px;
  margin: 0;
}
