:root {
  --bg: #0b0d10;
  --panel: #11151b;
  --panel-2: #0f1318;
  --text: #e7ecf3;
  --muted: #9aa7b6;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #66e3b4;
  --danger: #ff6b6b;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  background: radial-gradient(1200px 600px at 20% 0%, rgba(102, 227, 180, 0.15), transparent 60%),
    radial-gradient(1000px 500px at 100% 20%, rgba(122, 162, 255, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92em;
}

.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: 18px;
  background: linear-gradient(180deg, rgba(17, 21, 27, 0.96), rgba(17, 21, 27, 0.88));
}

.brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 14px;
}

.brand-title {
  font-weight: 800;
  letter-spacing: 0.2px;
}

.status {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.status.ok {
  color: #113b2a;
  background: rgba(102, 227, 180, 0.92);
  border-color: rgba(102, 227, 180, 0.6);
}

.status.bad {
  color: #2a0f0f;
  background: rgba(255, 107, 107, 0.92);
  border-color: rgba(255, 107, 107, 0.6);
}

.panel {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow);
  margin: 12px 0;
}

.panel-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 10px;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.filter-group {
  display: grid;
  gap: 8px;
}

.filter-group + .filter-group {
  margin-top: 12px;
}

.filter-label {
  font-size: 12px;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(102, 227, 180, 0.35);
  background: rgba(102, 227, 180, 0.12);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  font-weight: 650;
}

.btn:hover { filter: brightness(1.06); }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.btn-active {
  border-color: rgba(102, 227, 180, 0.6);
  background: rgba(102, 227, 180, 0.12);
}

.btn-danger {
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.12);
}

.form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.label-text {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 19, 24, 0.65);
  color: var(--text);
}

.input:focus {
  outline: none;
  border-color: rgba(102, 227, 180, 0.55);
  box-shadow: 0 0 0 4px rgba(102, 227, 180, 0.12);
}

.error {
  color: var(--danger);
  font-size: 13px;
  line-height: 1.4;
}

.muted { color: var(--muted); font-size: 12px; }

.sidebar-footer {
  padding: 8px 10px;
}

.topics {
  display: grid;
  gap: 8px;
}

.suggestions {
  display: grid;
  gap: 8px;
}

.topic-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.suggestion-row {
  display: grid;
  gap: 6px;
}

.suggestion-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.suggestion-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.topic-btn {
  text-align: left;
  justify-content: flex-start;
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.suggestion-btn {
  text-align: left;
  justify-content: flex-start;
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 12px;
}

.btn-small {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 650;
}

.main {
  padding: 22px;
}

.toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  max-width: 640px;
}

.search-input {
  flex: 1;
  min-width: 220px;
}

.title {
  margin: 0;
  font-size: 22px;
}

.sub-title {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.tweets {
  display: grid;
  gap: 12px;
}

.tweet {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow);
}

.tweet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.tweet-author {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tweet-author strong { font-size: 14px; }

.tweet-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(102, 227, 180, 0.35);
  background: rgba(102, 227, 180, 0.1);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.badge.muted {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.tweet-text {
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 14px;
}

.tweet-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.badge-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.used-pill {
  border-color: rgba(122, 162, 255, 0.35);
  background: rgba(122, 162, 255, 0.1);
  color: var(--text);
}

.tweet.used {
  border-color: rgba(122, 162, 255, 0.28);
}

.tweet-notes {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 19, 24, 0.4);
  white-space: pre-wrap;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.notes-editor {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.notes-textarea {
  min-height: 90px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12.5px;
}

.notes-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.media img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.pager {
  display: flex;
  justify-content: center;
  margin: 18px 0 40px;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .button-grid {
    grid-template-columns: 1fr;
  }
}
