:root {
  color-scheme: dark;
  --bg: #0b0e14;
  --panel: #141924;
  --panel-2: #1b2230;
  --border: #262f42;
  --text: #e8ecf4;
  --text-dim: #8a93a8;
  --accent: #6ea8fe;
  --good: #33d17a;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0) + 16px) 20px 12px;
  background: linear-gradient(to bottom, var(--bg) 70%, transparent);
}

.topbar h1 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.date {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.intake {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 16px;
}

.intake-form {
  display: flex;
  gap: 8px;
}

.intake-input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  padding: 12px 14px;
}

.intake-input:focus {
  outline: none;
  border-color: var(--accent);
}

.intake-mic,
.intake-submit {
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.intake-mic {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
  width: 48px;
}

.intake-mic.recording {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.intake-submit {
  background: var(--accent);
  color: #0b0e14;
  padding: 0 18px;
  font-size: 0.95rem;
}

.intake-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.intake-hint {
  min-height: 18px;
  font-size: 0.8rem;
  color: var(--good);
  padding: 6px 2px 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.intake-hint.show {
  opacity: 1;
}

.intake-hint.error {
  color: #ff6b6b;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 4px 16px 32px;
  max-width: 720px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .card-wide { grid-column: 1 / -1; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.card[data-world="maxbanda"] .dot { background: #f5b942; }
.card[data-world="misc"] .dot { background: #8a93a8; }

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.field-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.action-input {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  padding: 10px 12px;
  resize: vertical;
  min-height: 44px;
}

.action-input:focus {
  outline: none;
  border-color: var(--accent);
}

.card-foot {
  display: flex;
  justify-content: flex-end;
  height: 14px;
}

.saved-hint {
  font-size: 0.7rem;
  color: var(--good);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.saved-hint.show {
  opacity: 1;
}

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

.add-input {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  padding: 10px 12px;
}

.add-input:focus {
  outline: none;
  border-color: var(--accent);
}

.add-btn {
  background: var(--accent);
  color: #0b0e14;
  border: none;
  border-radius: 10px;
  padding: 0 16px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.add-btn:active {
  transform: scale(0.97);
}

.stream-list, .misc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
}

.stream-item, .misc-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.item-text {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
}

.item-text.done {
  text-decoration: line-through;
  color: var(--text-dim);
}

.item-time {
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
  margin-top: 2px;
}

.item-checkbox {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--good);
}

.item-del {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
}

.item-del:active {
  color: #ff6b6b;
}

.empty-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 8px 2px;
  text-align: center;
}
