:root {
  --bg-app: #121212;
  --bg-panel: #181818;
  --bg-elevated: #1f1f1f;
  --bg-input: #141414;
  --border: #333;
  --border-active: #555;
  --text: #ececec;
  --text-muted: #a3a3a3;
  --text-faint: #737373;
  --accent: #d4af37;
  --accent-soft: rgba(212, 175, 55, 0.15);
  --tab-hover: #252525;
  --radius: 4px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Consolas", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-app);
}

.app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 20px 28px;
}

.top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.top-bar__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.top-bar__meta {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.top-bar__meta code {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
}

.top-bar__status {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 400px;
  text-align: right;
}

@media (max-width: 720px) {
  .top-bar__status {
    text-align: left;
    max-width: none;
  }
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(260px, 300px) 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: calc(100vh - 120px);
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .panel--tabs {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .tabs {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
    padding: 10px;
    gap: 8px;
  }

  .tab {
    flex: 1 1 auto;
    min-width: calc(50% - 8px);
    padding: 12px 14px;
  }

  .tab__label {
    font-size: 14px;
  }
}

.panel {
  background: var(--bg-panel);
}

.panel--file {
  border-right: 1px solid var(--border);
}

.panel--tabs {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel--main {
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
  min-height: 480px;
}

.panel__head {
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.panel__head--tabs {
  padding-bottom: 12px;
}

.panel__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.tabs__hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

.panel__body {
  padding: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.field__input--file {
  width: 100%;
  padding: 8px;
  font-size: 12px;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.field__input--file::file-selector-button {
  margin-right: 10px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-active);
  border-radius: var(--radius);
  cursor: pointer;
}

.field__input--file::file-selector-button:hover {
  background: var(--tab-hover);
}

.btn {
  width: 100%;
  margin-top: 14px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius);
  border: none;
}

.btn--primary {
  background: var(--accent);
  color: #1a1a1a;
}

.btn--primary:hover {
  filter: brightness(1.05);
}

.btn--primary:active {
  filter: brightness(0.92);
}

.tabs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  overflow-y: auto;
  min-height: 0;
}

.tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 16px 18px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.tab:hover {
  background: var(--tab-hover);
  border-color: var(--border);
}

.tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tab--active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.tab__label {
  flex: 1;
  line-height: 1.3;
}

.tab__count {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--bg-app);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.tab--active .tab__count {
  color: var(--accent);
  border-color: rgba(212, 175, 55, 0.45);
}

.search-bar {
  flex-shrink: 0;
  padding: 14px 18px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.search-bar__label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.search-bar__input {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border-active);
  border-radius: var(--radius);
}

.search-bar__input::placeholder {
  color: var(--text-faint);
}

.search-bar__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.hidden {
  display: none !important;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}

.empty-state__title {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
}

.empty-state__text {
  margin: 0;
  max-width: 400px;
  font-size: 14px;
  color: var(--text-muted);
}

.empty-state__text code {
  font-family: var(--font-mono);
  font-size: 13px;
}

.results {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.results__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}

.results__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.results__count {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.results__scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.results__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.results__list > li {
  padding: 14px 18px;
  margin: 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.results__list > li:last-child {
  border-bottom: none;
}

.results__list > li:not(.results__notice):hover {
  background: rgba(255, 255, 255, 0.03);
}

.results__list > li.results__notice {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-panel);
}
