:root {
  --bg: #0b0f17;
  --panel: #11192a;
  --text: #e9eefc;
  --muted: #9fb0d0;
  --accent: #5aa2ff;
  --accent2: #6cffc7;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--text);
  min-height: 100svh;
  background:
    radial-gradient(1200px 700px at 20% 15%, rgba(90, 162, 255, 0.18), transparent 60%),
    radial-gradient(900px 600px at 80% 0%, rgba(108, 255, 199, 0.12), transparent 55%),
    var(--bg);
  background-repeat: no-repeat, no-repeat, no-repeat;
  font: 15px/1.4 var(--sans);
}
.app {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 14px;
}
.hero,
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow);
}
.hero {
  padding: 16px;
}
.hero h1 {
  margin: 0 0 4px;
}
.hero p {
  margin: 0;
  color: rgba(233, 238, 252, 0.78);
}
.hero-controls-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.hero-tabs {
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}
.hero-tab {
  appearance: none;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 7px 12px;
  color: rgba(233, 238, 252, 0.82);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.hero-tab:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.hero-tab.is-active {
  border-color: rgba(90, 162, 255, 0.42);
  background: linear-gradient(180deg, rgba(90, 162, 255, 0.28), rgba(90, 162, 255, 0.12));
  color: #f5f9ff;
}
.hero-export-btn {
  padding: 7px 12px;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
}
.tab-panel[hidden] {
  display: none;
}
.card {
  padding: 14px;
  display: grid;
  gap: 10px;
}
label {
  display: grid;
  gap: 5px;
  color: rgba(233, 238, 252, 0.72);
  font-size: 13px;
}
input,
button {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 11px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.18);
  font-size: 15px;
}
input {
  font-family: var(--mono);
  outline: none;
}
input:focus {
  border-color: rgba(90, 162, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(90, 162, 255, 0.15);
}
.actions {
  margin-top: 4px;
}
.nav-rail {
  width: min(280px, 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
  padding: 10px;
}
.nav-rail-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(233, 238, 252, 0.9);
  margin: 0;
}
.nav-rail-toggle {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
  color: var(--text);
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
}
.nav-rail-sections {
  display: grid;
  gap: 10px;
}
.nav-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.14);
  padding: 8px;
}
.nav-home-card {
  display: grid;
  gap: 8px;
}
.nav-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.nav-group {
  display: grid;
  gap: 6px;
}
.nav-group-title {
  color: rgba(233, 238, 252, 0.62);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0 2px;
}
.nav-rail-list {
  display: grid;
  gap: 8px;
}
.nav-rail-link {
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.18);
  font-size: 14px;
  font-weight: 650;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.06s ease;
}
.nav-rail-link:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.24);
}
.nav-rail-link:active {
  transform: translateY(1px);
}
.nav-rail-link.is-active {
  border-color: rgba(90, 162, 255, 0.38);
  background: linear-gradient(180deg, rgba(90, 162, 255, 0.22), rgba(90, 162, 255, 0.09));
}
.nav-rail.is-collapsed {
  width: 64px;
  padding: 10px 8px;
}
.nav-rail.is-collapsed .nav-card:not(.nav-home-card) {
  display: none;
}
.nav-rail.is-collapsed .nav-home-card .nav-rail-list,
.nav-rail.is-collapsed .nav-home-card .nav-rail-title {
  display: none;
}
button {
  cursor: pointer;
  font-weight: 650;
  transition: transform 0.06s ease, border-color 0.15s ease, background 0.15s ease;
}
button:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.24);
}
button:active {
  transform: translateY(1px);
}
.btn-link {
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 11px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.18);
  font-size: 15px;
  font-weight: 650;
}
.btn-link:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.24);
}
.status {
  margin: 0;
  min-height: 20px;
  font-weight: 600;
}
.status.ok {
  color: #6cffc7;
}
.status.err {
  color: #ff7a95;
}
.note {
  margin: 0;
  color: rgba(233, 238, 252, 0.62);
  font-size: 12px;
}
.fk-panel {
  gap: 14px;
}
.fk-head {
  display: grid;
  gap: 4px;
}
.fk-title {
  margin: 0;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.2;
}
.fk-subtitle {
  margin: 0;
  color: rgba(233, 238, 252, 0.8);
}
.fk-input-wrap {
  border: 1px solid rgba(112, 168, 255, 0.48);
  border-radius: 0;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: start;
  gap: 18px;
}
.fk-input-left {
  display: grid;
  gap: 10px;
}
.fk-input-right {
  justify-self: end;
  display: grid;
  justify-items: end;
  gap: 10px;
  text-align: right;
}
.fk-input-title {
  margin: 0;
  font-size: 24px;
}
.fk-field {
  display: grid;
  gap: 3px;
}
.fk-field > span {
  color: rgba(233, 238, 252, 0.74);
  font-size: 13px;
}
.fk-field input,
.fk-field strong {
  font-size: 38px;
  line-height: 1;
  font-weight: 700;
}
.fk-field input {
  max-width: 240px;
  padding: 10px 12px;
}
.fk-field input.is-invalid {
  border-color: rgba(255, 129, 129, 0.8);
  box-shadow: 0 0 0 4px rgba(255, 129, 129, 0.2);
}
.fk-field-readonly strong {
  font-family: var(--mono);
}
.fk-field-error {
  color: #ffb4b4;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.fk-rows {
  display: grid;
  gap: 8px;
}
.fk-row {
  display: grid;
  grid-template-columns: 48px 48px 84px minmax(120px, 220px) 1fr;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.09);
}
.fk-bit,
.fk-weight {
  margin: 0;
  font-weight: 700;
}
.fk-name,
.fk-desc {
  margin: 0;
}
.fk-name {
  font-weight: 700;
}
.fk-desc {
  color: rgba(233, 238, 252, 0.72);
}
.fk-pill {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.fk-pill:hover {
  border-color: rgba(255, 255, 255, 0.28);
}
.fk-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(90, 162, 255, 0.25);
}
.fk-pill.is-on {
  background: rgba(74, 211, 134, 0.9);
  color: #08190f;
}
.fk-pill.is-off {
  background: rgba(233, 99, 110, 0.92);
  color: #2a0d11;
}
.fk-foot {
  display: grid;
  gap: 6px;
}
.fk-summary {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}
.fk-summary-list {
  font-size: 14px;
  font-weight: 400;
  color: rgba(233, 238, 252, 0.78);
}
@media (min-width: 1280px) {
  .nav-rail {
    position: fixed;
    left: 16px;
    top: 16px;
    z-index: 5;
  }
}
@media (max-width: 860px) {
  .fk-input-wrap {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .fk-input-right {
    justify-self: start;
    justify-items: start;
    text-align: left;
  }
  .fk-row {
    grid-template-columns: 48px 48px 84px 1fr;
    gap: 10px;
  }
  .fk-desc {
    grid-column: 1 / -1;
  }
}
