:root {
  color-scheme: dark;
  font-family: "Cascadia Mono", "SFMono-Regular", "Roboto Mono", Consolas, monospace;
  --bg: #000807;
  --panel: rgba(0, 15, 12, .91);
  --panel-soft: rgba(2, 24, 19, .76);
  --line: rgba(37, 238, 146, .42);
  --line-soft: rgba(37, 238, 146, .16);
  --green: #39f39a;
  --green-hot: #5dff8a;
  --cyan: #22e6d0;
  --text: #e9fff6;
  --muted: #89afa2;
  --danger: #ff7288;
  --warning: #ffc06a;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(20, 195, 121, .08), transparent 24%),
    radial-gradient(circle at 15% 28%, rgba(0, 163, 119, .06), transparent 28%),
    radial-gradient(circle at 86% 22%, rgba(0, 224, 158, .045), transparent 25%),
    linear-gradient(180deg, #010b09 0%, #000504 70%, #010a08 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 44px 0 48px;
  pointer-events: none;
  opacity: .42;
  background-image:
    linear-gradient(rgba(48, 255, 160, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(48, 255, 160, .025) 1px, transparent 1px),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, .14) 4px);
  background-size: 48px 48px, 48px 48px, 100% 4px;
  animation: grid-drift 30s linear infinite;
}

body::after {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 44px 0 48px;
  pointer-events: none;
  background:
    linear-gradient(112deg, transparent 39%, rgba(69, 255, 164, .02) 47%, rgba(69, 255, 164, .07) 49%, rgba(69, 255, 164, .02) 52%, transparent 61%),
    radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, .5) 100%);
  animation: scan-beam 15s ease-in-out infinite alternate;
}

@keyframes grid-drift { to { background-position: 48px 48px, 48px 48px, 0 0; } }
@keyframes scan-beam { from { transform: translateX(-7%); opacity: .6; } to { transform: translateX(7%); opacity: 1; } }

.matrix-field {
  position: fixed;
  z-index: 0;
  inset: 44px 0 48px;
  display: flex;
  justify-content: space-around;
  overflow: hidden;
  pointer-events: none;
  color: var(--green);
  font-size: 10px;
  line-height: 1.65;
  opacity: .085;
  mask-image: linear-gradient(90deg, #000, transparent 36%, transparent 64%, #000);
}

.matrix-field span {
  width: 10px;
  word-break: break-all;
  text-shadow: 0 0 8px rgba(57, 243, 154, .8);
  animation: code-fall 22s linear infinite;
}

.matrix-field span:nth-child(2) { animation-duration: 28s; animation-delay: -8s; }
.matrix-field span:nth-child(3) { animation-duration: 19s; animation-delay: -13s; }
.matrix-field span:nth-child(4) { animation-duration: 26s; animation-delay: -4s; }
.matrix-field span:nth-child(5) { animation-duration: 24s; animation-delay: -17s; }
.matrix-field span:nth-child(6) { animation-duration: 29s; animation-delay: -10s; }
.matrix-field span:nth-child(7) { animation-duration: 21s; animation-delay: -6s; }
.matrix-field span:nth-child(8) { animation-duration: 27s; animation-delay: -19s; }
@keyframes code-fall { from { transform: translateY(-45vh); } to { transform: translateY(115vh); } }

.system-bar {
  position: relative;
  z-index: 5;
  height: 44px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(61, 255, 158, .42);
  background: rgba(0, 8, 7, .96);
  box-shadow: 0 5px 24px rgba(0, 255, 146, .035);
  color: #c1d9d1;
  font-size: 11px;
  letter-spacing: .045em;
}

.system-brand, .system-session { display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.system-brand strong, .system-encryption, .system-session time { color: var(--green); }
.system-brand b { color: #6c8f83; }
.system-session { justify-self: end; }
.system-session time { font-weight: 800; }
.diamond { width: 11px; height: 11px; background: var(--cyan); transform: rotate(45deg); border-radius: 2px; box-shadow: 0 0 12px rgba(34, 230, 208, .65); }
.online-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--green-hot); box-shadow: 0 0 14px var(--green-hot); animation: pulse-dot 1.8s ease-in-out infinite; }
@keyframes pulse-dot { 50% { opacity: .55; box-shadow: 0 0 5px var(--green-hot); } }

.shell {
  position: relative;
  z-index: 2;
  width: min(1720px, calc(100% - 42px));
  min-height: calc(100vh - 92px);
  margin: 0 auto;
  padding: 32px 0 66px;
}

.access-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 142px);
}

.side-stack { display: grid; gap: 18px; align-self: stretch; align-content: center; }
.hud-card, .access-stage, .table-wrap, dialog {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(24, 112, 77, .09), transparent 35%), var(--panel);
  box-shadow: inset 0 0 40px rgba(29, 241, 143, .025), 0 20px 70px rgba(0, 0, 0, .28);
  clip-path: polygon(0 12px, 12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px));
}

.hud-card { min-height: 150px; padding: 42px 18px 17px; color: #a5beb5; font-size: 11px; }
.hud-card h3 {
  position: absolute;
  inset: 0 0 auto;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 0 18px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(12, 50, 38, .18);
  color: var(--green);
  font-size: 11px;
  letter-spacing: .05em;
}

.hud-card h3 span { font-size: 17px; font-weight: 400; opacity: .7; }
.hud-card dl { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; margin: 0; }
.hud-card dt { color: #8ba69d; }
.hud-card dd { margin: 0; color: var(--green); text-align: right; }
.hud-card p { margin: 5px 0; }
.threat-card svg { width: 100%; height: 72px; overflow: visible; }
.threat-card polyline { fill: none; stroke: var(--green); stroke-width: 1.5; filter: drop-shadow(0 0 3px rgba(57, 243, 154, .6)); stroke-dasharray: 620; animation: waveform 5s linear infinite; }
@keyframes waveform { from { stroke-dashoffset: 620; } to { stroke-dashoffset: 0; } }
.threat-card strong { display: block; color: var(--green); margin-top: 4px; }
.terminal-card p, .log-card p { color: #64d897; line-height: 1.55; }

.network-card { min-height: 250px; }
.network-map {
  position: relative;
  height: 180px;
  overflow: hidden;
  opacity: .85;
  background:
    radial-gradient(ellipse at 27% 45%, rgba(36, 243, 147, .18) 0 7%, transparent 8%),
    radial-gradient(ellipse at 50% 35%, rgba(36, 243, 147, .14) 0 13%, transparent 14%),
    radial-gradient(ellipse at 73% 52%, rgba(36, 243, 147, .18) 0 10%, transparent 11%),
    radial-gradient(ellipse at 46% 65%, rgba(36, 243, 147, .12) 0 9%, transparent 10%),
    linear-gradient(rgba(40, 255, 153, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(40, 255, 153, .06) 1px, transparent 1px);
  background-size: auto, auto, auto, auto, 16px 16px, 16px 16px;
}
.network-map::before, .network-map::after { content: ""; position: absolute; border: 1px solid rgba(52, 255, 160, .34); border-radius: 50%; transform: rotate(-12deg); }
.network-map::before { inset: 25px 34px 34px 24px; }
.network-map::after { inset: 53px 70px 42px 45px; transform: rotate(18deg); }
.network-map i { position: absolute; z-index: 2; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px 4px rgba(34, 230, 208, .52); animation: map-node 2s ease-in-out infinite; }
.network-map i:nth-child(1) { left: 24%; top: 43%; }.network-map i:nth-child(2) { left: 49%; top: 36%; animation-delay: -.5s; }.network-map i:nth-child(3) { right: 23%; top: 55%; animation-delay: -1s; }.network-map i:nth-child(4) { left: 53%; bottom: 20%; animation-delay: -1.5s; }
@keyframes map-node { 50% { transform: scale(1.8); opacity: .5; } }
.node-card { min-height: 190px; }
.log-card { min-height: 180px; }

.access-stage {
  width: min(760px, 100%);
  min-height: 670px;
  padding: 52px 76px 42px;
  border-color: rgba(71, 255, 164, .65);
  background:
    radial-gradient(circle at 50% 26%, rgba(29, 236, 139, .07), transparent 30%),
    linear-gradient(180deg, rgba(0, 12, 10, .94), rgba(0, 7, 6, .98));
  box-shadow: 0 0 65px rgba(41, 242, 145, .055), inset 0 0 80px rgba(35, 241, 144, .03), 0 24px 80px rgba(0, 0, 0, .55);
  animation: access-breathe 6s ease-in-out infinite;
}

@keyframes access-breathe {
  50% { box-shadow: 0 0 78px rgba(41, 242, 145, .09), inset 0 0 95px rgba(35, 241, 144, .045), 0 28px 90px rgba(0, 0, 0, .62); }
}

.access-stage::before, .access-stage::after { content: ""; position: absolute; left: 20%; right: 20%; height: 2px; background: linear-gradient(90deg, transparent, var(--green), transparent); box-shadow: 0 0 14px rgba(57, 243, 154, .7); }
.access-stage::before { top: -1px; }.access-stage::after { bottom: -1px; }
.access-frame i { position: absolute; width: 58px; height: 58px; border-color: var(--green); opacity: .9; }
.access-frame i:nth-child(1) { left: 12px; top: 12px; border-left: 2px solid; border-top: 2px solid; }
.access-frame i:nth-child(2) { right: 12px; top: 12px; border-right: 2px solid; border-top: 2px solid; }
.access-frame i:nth-child(3) { left: 12px; bottom: 12px; border-left: 2px solid; border-bottom: 2px solid; }
.access-frame i:nth-child(4) { right: 12px; bottom: 12px; border-right: 2px solid; border-bottom: 2px solid; }

.access-heading { display: flex; align-items: center; justify-content: center; gap: 28px; margin: 0 auto 30px; padding: 0 0 29px; border-bottom: 1px solid var(--line-soft); }
.access-heading p { margin: 0 0 4px; color: #f6fff9; font-family: Arial, sans-serif; font-size: clamp(30px, 3vw, 48px); font-weight: 900; letter-spacing: -.03em; }
.access-heading small { color: var(--green-hot); font-size: 15px; letter-spacing: .04em; }
.lock-hex { width: 76px; height: 84px; display: grid; place-items: center; color: var(--green-hot); border: 3px solid currentColor; clip-path: polygon(50% 0, 94% 24%, 94% 76%, 50% 100%, 6% 76%, 6% 24%); filter: drop-shadow(0 0 10px rgba(65, 255, 139, .28)); }
.lock-hex span { position: relative; width: 31px; height: 28px; margin-top: 12px; border-radius: 4px; background: currentColor; }
.lock-hex span::before { content: ""; position: absolute; left: 6px; top: -19px; width: 19px; height: 22px; border: 5px solid currentColor; border-bottom: 0; border-radius: 13px 13px 0 0; }
.lock-hex span::after { content: ""; position: absolute; left: 14px; top: 8px; width: 4px; height: 11px; background: #012018; border-radius: 4px; }

.panel { position: relative; width: min(100%, 540px); margin: 0 auto; padding: 0; background: transparent; border: 0; box-shadow: none; clip-path: none; }
.panel h2 { margin: 0 0 9px; color: #f2fff8; font-size: 21px; letter-spacing: .07em; }
.panel > .muted, .panel > div > .muted { margin-bottom: 20px; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; letter-spacing: .03em; }
h2 { font-size: 21px; }
.muted { color: var(--muted); line-height: 1.55; }
.notice { color: var(--green); line-height: 1.5; }
.warning { color: var(--warning); line-height: 1.55; }
.error { color: var(--danger); min-height: 20px; }
.error:empty { display: none; }
.hidden { display: none !important; }

label { display: grid; gap: 8px; margin: 16px 0; color: #c4ddd4; font-size: 12px; font-weight: 800; letter-spacing: .035em; }
input, textarea, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(73, 193, 143, .48);
  border-radius: 1px;
  outline: 0;
  background: rgba(0, 8, 7, .9);
  color: #f2fff9;
  padding: 12px 14px;
  font: inherit;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--green); background: rgba(2, 20, 15, .95); box-shadow: 0 0 0 2px rgba(57, 243, 154, .08), 0 0 20px rgba(57, 243, 154, .09); }
textarea { min-height: 90px; resize: vertical; }

.field-control { position: relative; }
.field-control > span {
  position: absolute;
  z-index: 1;
  left: 17px;
  top: 50%;
  width: 24px;
  transform: translateY(-50%);
  color: var(--green);
  font-size: 19px;
  text-align: center;
  text-shadow: 0 0 10px rgba(57, 243, 154, .45);
  pointer-events: none;
}
.field-control input { min-height: 54px; padding-left: 54px; font-size: 14px; }
.field-control input::placeholder { color: #58786d; }
.field-control:focus-within > span { color: var(--green-hot); filter: brightness(1.2); }

button {
  min-height: 44px;
  border: 1px solid rgba(101, 255, 169, .7);
  border-radius: 1px;
  background: linear-gradient(90deg, #36df92, #5dff98);
  color: #00160c;
  padding: 11px 18px;
  font-family: inherit;
  font-weight: 900;
  letter-spacing: .035em;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(57, 243, 154, .12);
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
}
button:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 0 28px rgba(57, 243, 154, .25); transform: translateY(-1px); }
button:active:not(:disabled) { transform: translateY(0); }
button.quiet { border-color: rgba(58, 203, 146, .38); background: rgba(4, 33, 25, .88); color: #bcebd9; box-shadow: none; }
button.danger { border-color: rgba(255, 114, 136, .7); background: rgba(72, 10, 23, .88); color: #ffc6d0; box-shadow: none; }
button.danger:hover:not(:disabled) { box-shadow: 0 0 24px rgba(255, 78, 110, .22); }
button:disabled { cursor: not-allowed; opacity: .38; }

#login-panel form > button, #setup-panel form > button { width: 100%; margin-top: 4px; }
.access-submit { position: relative; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 14px; }
.access-submit b { position: absolute; right: 22px; font-size: 27px; line-height: 1; }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#login-panel .actions button { flex: 1; }
#login-notice, #login-error { margin: 12px 0 0; }
.access-assurance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 25px; border: 1px solid var(--line-soft); background: rgba(5, 27, 21, .55); }
.access-assurance span { min-height: 60px; display: grid; align-content: center; padding: 10px 12px; border-right: 1px solid var(--line-soft); color: #a3beb4; font-size: 9px; line-height: 1.5; }
.access-assurance span:last-child { border-right: 0; }.access-assurance b { color: var(--green); font-size: 9px; }

.setup-qr { display: block; width: 190px; height: 190px; margin: 18px auto; border: 8px solid #fff; }
.qr-label { margin: 20px 0 -8px; color: #c9e4da; text-align: center; font-weight: 800; }

.workspace { padding: 22px 0 32px; }
.workspace-head, .toolbar, .pagination { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.workspace-head { padding: 0 0 22px; border-bottom: 1px solid var(--line); }
.section-code { margin-bottom: 7px; color: var(--green); font-size: 11px; letter-spacing: .14em; }
.toolbar { margin: 24px 0 14px; }
.toolbar p { margin: 0; }
.toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.sort-select { width: auto; min-width: 230px; min-height: 44px; padding: 10px 12px; }
.table-wrap { overflow: auto; border-color: rgba(54, 229, 148, .32); }
.table-wrap::before { content: ""; position: absolute; left: 0; top: 0; width: 110px; height: 2px; background: linear-gradient(90deg, var(--green), transparent); }
table { width: 100%; min-width: 1240px; border-collapse: collapse; background: rgba(0, 10, 8, .82); }
th, td { padding: 15px; border-bottom: 1px solid rgba(53, 219, 143, .14); text-align: left; vertical-align: middle; }
tbody tr { transition: background .14s ease; } tbody tr:hover { background: rgba(33, 190, 125, .045); } tbody tr:last-child td { border-bottom: 0; }
th { color: #60d69e; background: rgba(15, 66, 47, .16); font-size: 10px; letter-spacing: .1em; }
.compact { max-width: 300px; overflow-wrap: anywhere; white-space: pre-line; line-height: 1.6; }
.mono { font-family: inherit; font-size: 12px; }.masked { color: #668f80; letter-spacing: .12em; }
.note-cell { min-width: 180px; max-width: 300px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; color: #b6d8cb; }
.row-actions { min-width: 250px; white-space: normal; }
.row-action-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination { margin-top: 18px; }.pagination-actions { display: flex; gap: 10px; }

dialog { width: min(520px, calc(100% - 24px)); padding: 30px; color: inherit; border-color: rgba(72, 255, 164, .68); }
dialog::backdrop { background: rgba(0, 5, 4, .9); backdrop-filter: blur(6px); }
.wide-dialog { width: min(700px, calc(100% - 24px)); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }.amount-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 24px 0; padding: 18px; border: 1px solid var(--line-soft); background: rgba(0, 9, 7, .72); }
.summary dt { color: #75ad9a; }.summary dd { margin: 0; overflow-wrap: anywhere; }
.delete-target { margin: 18px 0 24px; padding: 14px; border: 1px solid rgba(255, 114, 136, .35); background: rgba(45, 8, 16, .45); overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 20; right: 24px; bottom: 62px; max-width: 440px; padding: 14px 18px; border: 1px solid var(--line); background: rgba(2, 32, 23, .97); color: #caffeb; box-shadow: 0 0 28px rgba(45, 224, 151, .15); }

.data-rail {
  position: fixed;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 22px;
  border-top: 1px solid rgba(61, 255, 158, .35);
  background: rgba(0, 8, 7, .96);
  color: #86ad9f;
  font-size: 10px;
}
.data-rail strong { color: var(--green); }.stream-bars { width: min(360px, 30vw); height: 21px; background: repeating-linear-gradient(90deg, transparent 0 3px, var(--cyan) 4px 5px, transparent 6px 8px); clip-path: polygon(0 47%, 5% 43%, 9% 72%, 14% 20%, 19% 61%, 25% 35%, 30% 79%, 36% 28%, 42% 58%, 49% 9%, 54% 70%, 59% 34%, 65% 79%, 72% 24%, 78% 65%, 84% 31%, 90% 75%, 95% 38%, 100% 48%, 100% 55%, 0 55%); animation: stream 2.2s linear infinite; }
@keyframes stream { to { background-position: 32px 0; } }
.rail-icons { margin-left: auto; color: var(--green); font-size: 20px; letter-spacing: .12em; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 1220px) {
  .access-stage { min-height: 650px; padding-inline: 58px; }
  .system-encryption { display: none; }.system-bar { grid-template-columns: 1fr auto; }
}
@media (max-width: 860px) {
  .system-brand span, .system-brand b, .system-session > span { display: none; }.system-brand { gap: 10px; }
  .shell { width: min(100% - 20px, 720px); padding-top: 20px; }.access-grid { display: block; min-height: auto; }.access-stage { min-height: calc(100vh - 132px); padding: 38px 24px 32px; }
  .access-heading { gap: 16px; }.access-heading p { font-size: 30px; }.access-heading small { font-size: 11px; }.lock-hex { width: 58px; height: 64px; }
  .toolbar, .workspace-head, .pagination { align-items: flex-start; flex-direction: column; }.toolbar-actions { width: 100%; flex-direction: column; align-items: stretch; }.sort-select { width: 100%; }
  .field-grid { grid-template-columns: 1fr; }.summary { grid-template-columns: 1fr; }.summary dd { margin-bottom: 8px; }
  .data-rail span, .rail-icons { display: none; }.stream-bars { width: 60%; }.access-assurance { grid-template-columns: 1fr; }.access-assurance span { border-right: 0; border-bottom: 1px solid var(--line-soft); }.access-assurance span:last-child { border-bottom: 0; }
}
