:root {
  --bg: #0b0b0b;
  --fg: #d7ffd7;
  --accent: #00e676;
  --muted: #6ecf9d;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial;
}
header {
  border-bottom: 1px solid var(--accent);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
h1 {
  margin: 0;
  color: var(--accent);
}
nav .tab {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--fg);
  padding: 8px 12px;
  margin-left: 8px;
  cursor: pointer;
}
nav .tab.active {
  background: rgba(0, 230, 118, 0.1);
}
main {
  padding: 16px;
  max-width: 1000px;
  margin: 0 auto;
  padding-bottom: 64px;
}
.panel {
  display: none;
}
.panel.active {
  display: block;
}
.input-block,
.output-block {
  border: 1px solid var(--accent);
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.2);
}
label {
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}
textarea {
  width: 100%;
  min-height: 160px;
  background: #111;
  color: var(--fg);
  border: 1px solid #124;
  padding: 8px;
}
input {
  width: 100%;
  background: #111;
  color: var(--fg);
  border: 1px solid #124;
  padding: 8px;
  margin-bottom: 8px;
}
.actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
}
.actions button {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--fg);
  padding: 8px 12px;
  margin-right: 8px;
  cursor: pointer;
}
.icon-btn {
  background: var(--accent) !important;
  color: #000 !important;
  border: none !important;
  font-size: 20px;
  font-weight: bold;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  line-height: 1;
}

/* Modal */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal.hidden {
  display: none;
}
.modal-content {
  background: #222;
  border: 1px solid var(--accent);
  padding: 20px;
  border-radius: 8px;
  min-width: 300px;
  text-align: center;
  box-shadow: 0 0 15px rgba(0, 230, 118, 0.3);
}
.modal-header {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--accent);
}
.modal-body {
  margin-bottom: 20px;
}
#modal-close {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: bold;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}
.loading-overlay.hidden {
  display: none;
}
.loading-text {
  margin-top: 20px;
  color: var(--accent);
  font-size: 18px;
}
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(0, 230, 118, 0.3);
  border-top: 5px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* KB Nav */
.kb-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid #333;
  padding-bottom: 8px;
}
.kb-filter {
  background: transparent;
  border: 1px solid #333;
  color: #888;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s;
}
.kb-filter:hover {
  border-color: var(--accent);
  color: var(--fg);
}
.kb-filter.active {
  background: rgba(0, 230, 118, 0.2);
  border-color: var(--accent);
  color: var(--accent);
}
