:root {
  --bg: #070707;
  --panel: #0d0d0d;
  --panel-2: #111111;
  --line: #2a2a2a;
  --line-soft: #1c1c1c;
  --text: #eeeeee;
  --muted: #9a9a9a;
  --faint: #686868;
  --accent: #b6ff4d;
  --warn: #ffcc66;
  --bad: #ff5f56;
  --ok: #70e07b;
  --mono: "IBM Plex Mono", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  text-shadow: none;
  filter: none;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px),
    #070707;
  background-size: 48px 48px;
  color: var(--text);
  font-family: var(--sans);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(210px, 280px) 1fr auto;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 7, 7, .94);
}

.brand,
.nav a,
.top-actions {
  display: flex;
  align-items: center;
}

.brand {
  padding: 0 22px;
  border-right: 1px solid var(--line);
  font-family: var(--mono);
  font-weight: 800;
  letter-spacing: .04em;
}

.nav {
  display: flex;
  min-width: 0;
}

.nav a {
  min-width: 112px;
  justify-content: center;
  padding: 0 16px;
  border-right: 1px solid var(--line-soft);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
  background: #111111;
}

.top-actions {
  gap: 10px;
  padding: 0 16px;
  border-left: 1px solid var(--line);
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 330px;
  min-height: 0;
}

.panel,
.content {
  min-width: 0;
}

.panel {
  background: rgba(13, 13, 13, .88);
  border-right: 1px solid var(--line);
}

.access-panel {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.side-panel,
.access-panel {
  padding: 22px;
}

.panel-title,
.section-label {
  display: block;
  margin-bottom: 12px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.node-card {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #111111;
}

.node-card span,
.muted {
  color: var(--muted);
}

.node-card strong {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 18px;
}

.kv {
  margin: 22px 0;
}

.kv div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}

.kv dt,
.kv dd,
.mini-log,
.statusbar,
.file-table,
.drop-meta,
.form-error {
  font-family: var(--mono);
}

.kv dt {
  color: var(--faint);
}

.kv dd {
  margin: 0;
  color: var(--text);
}

.dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 50%;
  vertical-align: 1px;
}

.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }

.meter-block {
  margin: 24px 0;
}

.meter-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.meter {
  height: 8px;
  border: 1px solid var(--line);
  background: #090909;
}

.meter span {
  height: 100%;
  display: block;
  background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 11px);
}

.mini-log {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.mini-log p {
  margin: 0 0 8px;
}

.mini-log span {
  color: var(--faint);
}

.content {
  padding: 28px;
  overflow: auto;
}

.hero-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}

.hero-line > div:first-child {
  min-width: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 3.6vw, 54px);
  line-height: 1.08;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.search {
  width: min(320px, 100%);
  position: relative;
}

input {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: #0b0b0b;
  color: var(--text);
  font-family: var(--mono);
}

input:focus {
  border-color: var(--accent);
}

.dropzone {
  position: relative;
  min-height: 272px;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(182,255,77,.12), transparent 1px) 0 0 / 18px 18px,
    linear-gradient(rgba(182,255,77,.08), transparent 1px) 0 0 / 18px 18px,
    #0d0d0d;
  cursor: pointer;
}

.dropzone.is-drag {
  border-color: var(--accent);
  background-color: #111111;
}

.drop-inner {
  width: min(760px, 100%);
  min-width: 0;
}

.drop-code {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
}

.dropzone h2 {
  margin-bottom: 10px;
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.05;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.dropzone p {
  margin-bottom: 20px;
  color: var(--muted);
}

.drop-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.drop-meta span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(7, 7, 7, .7);
}

.upload-progress {
  margin-top: 22px;
  display: none;
}

.upload-progress.active {
  display: block;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.progress-bar {
  height: 12px;
  border: 1px solid var(--line);
  background: #070707;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(90deg, var(--accent) 0 10px, transparent 10px 13px);
  transition: width .25s ease;
}

.stages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.stages span {
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
}

.stages .done {
  color: var(--accent);
  border-color: rgba(182,255,77,.5);
}

.table-wrap,
.page-card {
  margin-top: 24px;
  border: 1px solid var(--line);
  background: rgba(13, 13, 13, .92);
}

.table-head,
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  min-height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.file-table th,
.file-table td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  white-space: nowrap;
}

.file-table th {
  color: var(--faint);
  font-size: 11px;
  text-transform: uppercase;
}

.file-table td {
  color: var(--muted);
}

.file-table tr:hover td {
  background: #111111;
  color: var(--text);
}

.file-name {
  color: var(--text);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #383832;
  color: var(--muted);
  background: transparent;
}

.badge.ok {
  color: var(--accent);
  border-color: rgba(182, 255, 77, .46);
}

.badge.warn {
  color: var(--warn);
  border-color: rgba(255, 204, 102, .42);
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-family: var(--mono);
}

.link-button[disabled] {
  color: var(--faint);
  cursor: not-allowed;
}

.access-box {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #111111;
}

.access-box h2 {
  margin-bottom: 14px;
  font-size: 18px;
  text-transform: uppercase;
}

.access-box.compact p {
  margin-bottom: 14px;
  line-height: 1.45;
}

label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

label input {
  margin-top: 7px;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.solid {
  background: var(--text);
  color: #08090a;
}

.solid:hover {
  background: var(--accent);
}

.ghost {
  background: transparent;
  color: var(--text);
}

.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.wide {
  width: 100%;
}

.form-error,
.notice {
  margin: 12px 0 0;
  color: var(--bad);
  font-size: 12px;
}

.notice {
  color: var(--warn);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.status-tile {
  padding: 18px;
  border: 1px solid var(--line);
  background: #0d0d0d;
}

.status-tile strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
}

.status-tile span {
  color: var(--muted);
}

.help-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.help-list article {
  padding: 18px;
  border: 1px solid var(--line);
  background: #0d0d0d;
}

.modal-layer[hidden] {
  display: none;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .74);
}

.modal {
  position: relative;
  width: min(430px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0,0,0,.48);
}

.icon-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  min-height: 34px;
  background: transparent;
  color: var(--muted);
}

.statusbar {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  background: #070707;
  font-size: 11px;
  overflow: auto;
}

.statusbar span {
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .access-panel {
    display: none;
  }
}

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .brand,
  .top-actions {
    min-height: 58px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    display: none;
  }

  .content {
    padding: 18px;
  }

  .hero-line {
    align-items: stretch;
    flex-direction: column;
  }

  .file-table,
  .file-table tbody,
  .file-table tr,
  .file-table td {
    display: block;
  }

  .file-table thead {
    display: none;
  }

  .file-table tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .file-table td {
    border: 0;
    padding: 7px 14px;
    white-space: normal;
  }

  .file-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--faint);
    font-size: 10px;
    text-transform: uppercase;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }
}
