:root {
  --bg0: #05060a;
  --bg1: #070a12;
  --panel: #0b1220cc;
  --panel2: #0e1a2fcc;
  --text: #d7f8ff;
  --muted: #7ab8c7;
  --danger: #ff3b7a;
  --ok: #48ffd6;
  --line: color-mix(in srgb, var(--accent) 35%, transparent);
  --accent: #00e5ff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --radius: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  overflow: hidden;
}

.bg {
  background: radial-gradient(
      1200px 800px at 15% 10%,
      color-mix(in srgb, var(--accent) 18%, transparent) 0%,
      transparent 60%
    ),
    radial-gradient(
      900px 700px at 80% 40%,
      rgba(255, 0, 120, 0.1) 0%,
      transparent 60%
    ),
    linear-gradient(180deg, var(--bg1), var(--bg0));
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035) 0px,
    rgba(255, 255, 255, 0.035) 1px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0) 6px
  );
  opacity: 0.18;
}

code {
  font-family: var(--mono);
  color: color-mix(in srgb, var(--accent) 60%, white);
}

.center {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.1));
  backdrop-filter: blur(10px);
}

.topbar__left,
.topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  user-select: none;
}
.brand__sig {
  font-family: var(--mono);
  letter-spacing: 0.14em;
  font-weight: 700;
  text-shadow: 0 0 22px color-mix(in srgb, var(--accent) 40%, transparent);
}
.brand__sub {
  font-size: 12px;
  color: var(--muted);
}
.brand--small .brand__sig {
  font-size: 14px;
}
.brand--small .brand__sub {
  font-size: 11px;
}

.statuspill {
  font-family: var(--mono);
  font-size: 12px;
  color: color-mix(in srgb, var(--accent) 60%, white);
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 8px;
}
.statuspill .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 14px rgba(72, 255, 214, 0.55);
}

.shell {
  height: calc(100% - 68px);
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  padding: 16px;
}

.nav {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(5, 10, 18, 0.7), rgba(0, 0, 0, 0.2));
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.nav__item {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}
.nav__item:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.nav__item.is-active {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 16%, transparent),
    transparent
  );
  box-shadow: inset 0 0 0 1px var(--line);
}
.nav__glyph {
  width: 22px;
  display: inline-flex;
  justify-content: center;
  color: color-mix(in srgb, var(--accent) 70%, white);
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent);
}
.nav__badge {
  display: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent);
}
.nav__badge:not(:empty) {
  display: block;
}

.nav__footer {
  margin-top: auto;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tiny {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.muted {
  color: color-mix(in srgb, var(--muted) 70%, #ffffff);
}

.workspace {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.12));
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.workspace__chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.24);
  gap: 12px;
}
.breadcrumbs {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workspace__body {
  padding: 14px;
  overflow: auto;
  min-height: 0;
}

.panel {
  width: min(820px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.14));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel__header {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.25);
}
.panel__body {
  padding: 16px;
}

.panel--login {
  width: min(560px, 100%);
}

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: color-mix(in srgb, var(--accent) 70%, white);
  margin-bottom: 14px;
}

.form {
  display: grid;
  gap: 12px;
}
.label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 12px;
  color: var(--text);
  outline: none;
  font-family: var(--mono);
}
.input:focus {
  border-color: color-mix(in srgb, var(--accent) 65%, #ffffff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.input--small {
  padding: 10px 10px;
  font-size: 12px;
  border-radius: 12px;
  min-width: 240px;
}
.input-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  position: relative;
  overflow: hidden;
  transition: transform 0.08s ease, border-color 0.12s ease,
    background 0.12s ease;
}
.btn:hover {
  border-color: var(--line);
  background: color-mix(in srgb, var(--accent) 10%, rgba(0, 0, 0, 0.22));
}
.btn:active {
  transform: translateY(1px);
}
.btn--primary {
  border-color: color-mix(in srgb, var(--accent) 45%, rgba(255, 255, 255, 0.2));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 18%, rgba(0, 0, 0, 0.15)),
    rgba(0, 0, 0, 0.25)
  );
}
.btn__glow {
  position: absolute;
  inset: -30%;
  background: radial-gradient(
    circle at 20% 30%,
    color-mix(in srgb, var(--accent) 40%, transparent),
    transparent 60%
  );
  opacity: 0.7;
  filter: blur(10px);
  pointer-events: none;
}

.btn--ghost {
  padding: 10px 10px;
  background: rgba(0, 0, 0, 0.16);
}

.error {
  color: var(--danger);
  font-family: var(--mono);
  font-size: 12px;
  min-height: 16px;
}
.hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.whoami {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 6px 10px 6px 6px;
  background: rgba(0, 0, 0, 0.2);
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: radial-gradient(
    circle at 30% 30%,
    color-mix(in srgb, var(--accent) 25%, #fff0),
    rgba(255, 255, 255, 0.05)
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-size: cover;
  background-position: center;
}
.whoami__meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.whoami__name {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.whoami__sub {
  font-size: 11px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 980px) {
  body {
    overflow: auto;
  }
  .shell {
    grid-template-columns: 1fr;
    height: auto;
  }
  .nav {
    position: sticky;
    top: 12px;
  }
  .input--small {
    min-width: 0;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
  border-radius: 16px;
  padding: 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
}
.table th,
.table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}
.table th {
  color: var(--muted);
  font-weight: 600;
  text-align: left;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.row {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.row > div:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.row > button {
  flex-shrink: 0;
}
.row__title {
  font-family: var(--mono);
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge {
  font-family: var(--mono);
  font-size: 11px;
  color: color-mix(in srgb, var(--accent) 70%, white);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
}

.split {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
  min-height: 520px;
}
@media (max-width: 980px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.hex {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.28);
  padding: 10px;
}
.hexline {
  display: flex;
  gap: 12px;
}
.hexoff {
  width: 96px;
  color: var(--muted);
}
.hexhex {
  width: 430px;
  color: color-mix(in srgb, var(--accent) 35%, white);
}
.hexasc {
  color: color-mix(in srgb, var(--text) 85%, #fff);
}
.hex-highlight {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--accent);
  font-weight: bold;
  padding: 2px 0;
  border-radius: 2px;
}

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

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  min-height: 48px;
  align-items: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.tag-remove {
  cursor: pointer;
  font-weight: bold;
  color: var(--danger);
  padding: 0 4px;
  line-height: 1;
}

.tag-remove:hover {
  color: #ff6b9d;
}

.tag-add-btn {
  cursor: pointer;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  transition: all 0.2s;
}

.tag-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.tag-search-popup {
  position: absolute;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  min-width: 300px;
  max-height: 300px;
  overflow-y: auto;
}

.tag-search-input {
  width: 100%;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  margin-bottom: 8px;
}

.tag-search-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tag-search-item {
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  transition: all 0.2s;
}

.tag-search-item:hover {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: var(--accent);
}

.small-btn {
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.small-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
}

.small-btn.danger {
  border-color: rgba(255, 80, 80, 0.3);
  color: #ff8888;
}

.small-btn.danger:hover {
  background: rgba(255, 80, 80, 0.15);
  border-color: #ff5050;
}
