:root {
  --bg: #061322;
  --bg-soft: #0e1e31;
  --card: rgba(8, 26, 44, 0.78);
  --card-edge: rgba(163, 222, 255, 0.22);
  --text: #e9f5ff;
  --text-soft: #8fb0ca;
  --ok: #37d49b;
  --warn: #ffc95f;
  --bad: #ff6f7d;
  --accent: #7ad9ff;
  --accent-2: #85ffb8;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: "Space Grotesk", "IBM Plex Sans JP", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 20%, #113156 0%, transparent 44%),
    radial-gradient(circle at 88% 8%, #16324f 0%, transparent 38%),
    linear-gradient(135deg, var(--bg) 0%, #040a14 60%, #091b2f 100%);
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  width: 40vmax;
  height: 40vmax;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.2;
  pointer-events: none;
  z-index: -1;
}

.bg-glow-a {
  background: #48c8ff;
  top: -10vmax;
  left: -12vmax;
}

.bg-glow-b {
  background: #54fcb4;
  right: -14vmax;
  bottom: -14vmax;
}

.shell {
  width: min(1200px, 94vw);
  margin: 2.2rem auto 4rem;
  display: grid;
  gap: 1rem;
}

.card {
  position: relative;
  backdrop-filter: blur(8px);
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1rem 1.05rem;
}

.rise {
  animation: rise 0.44s ease both;
}

.hero h1 {
  margin: 0.1rem 0 0.45rem;
  letter-spacing: 0.02em;
  font-size: clamp(1.7rem, 2.5vw, 2.3rem);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 700;
}

.subtitle {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

h2,
h3 {
  margin: 0 0 0.8rem;
  font-size: 1.02rem;
}

.grid {
  display: grid;
  gap: 0.7rem;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panels {
  align-items: start;
}

label {
  display: grid;
  gap: 0.32rem;
  color: var(--text-soft);
  font-size: 0.84rem;
}

input,
textarea,
select {
  width: 100%;
  color: var(--text);
  border-radius: 12px;
  border: 1px solid rgba(130, 187, 221, 0.34);
  background: rgba(3, 12, 22, 0.65);
  padding: 0.58rem 0.68rem;
  font-size: 0.9rem;
  font-family: "IBM Plex Sans JP", "Space Grotesk", sans-serif;
  transition: border-color 0.18s ease;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}

.toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.toolbar .helper {
  margin: 0;
  align-self: center;
}

.inline-control {
  display: inline-grid;
  align-items: center;
  gap: 0.28rem;
}

.inline-control input {
  width: 120px;
}

.helper {
  margin: 0.55rem 0 0;
  color: var(--text-soft);
  font-size: 0.83rem;
}

.access-panels {
  margin-top: 0.7rem;
}

.access-card {
  border: 1px solid rgba(120, 179, 216, 0.24);
  border-radius: 12px;
  padding: 0.72rem;
  background: rgba(3, 14, 26, 0.52);
}

.badge {
  margin: 0 0 0.45rem;
  display: inline-block;
  border-radius: 999px;
  border: 1px solid rgba(132, 186, 218, 0.42);
  padding: 0.18rem 0.52rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.neutral {
  color: var(--text-soft);
}

.badge.ok {
  color: var(--ok);
  border-color: rgba(55, 212, 155, 0.6);
}

.badge.warn {
  color: var(--warn);
  border-color: rgba(255, 201, 95, 0.62);
}

.badge.bad {
  color: var(--bad);
  border-color: rgba(255, 111, 125, 0.62);
}

.badge.locked {
  color: #ff9ea8;
  border-color: rgba(255, 158, 168, 0.62);
}

.guide-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-soft);
  line-height: 1.6;
}

.guide-list li {
  margin: 0.15rem 0;
}

.role-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tab-btn {
  border: 1px solid rgba(140, 190, 220, 0.42);
  background: rgba(14, 35, 57, 0.7);
  color: var(--text);
  border-radius: 10px;
  padding: 0.45rem 0.8rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: linear-gradient(135deg, #2587b8 0%, #0b5f8b 100%);
  border-color: rgba(156, 225, 255, 0.85);
}

.tab-btn.disabled,
.tab-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

.role-panel.hidden {
  display: none;
}

.btn {
  border: 1px solid rgba(147, 197, 227, 0.4);
  background: rgba(16, 40, 67, 0.7);
  color: var(--text);
  border-radius: 10px;
  padding: 0.44rem 0.72rem;
  font-weight: 600;
  font-family: "Space Grotesk", sans-serif;
  cursor: pointer;
}

.btn:hover {
  border-color: rgba(169, 222, 255, 0.8);
}

.btn.solid {
  background: linear-gradient(135deg, #3ba7d6 0%, #007fae 100%);
  border-color: rgba(153, 228, 255, 0.75);
}

.btn.accent {
  background: linear-gradient(135deg, #16b784 0%, #1e8f65 100%);
  border-color: rgba(155, 255, 208, 0.72);
}

.status {
  margin: 0.62rem 0 0;
  font-size: 0.86rem;
}

.status.neutral {
  color: var(--text-soft);
}

.status.ok {
  color: var(--ok);
}

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

.status.bad {
  color: var(--bad);
}

.status.locked {
  color: #ff9ea8;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.56rem;
  align-items: end;
}

.trader-form {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

th,
td {
  padding: 0.5rem 0.4rem;
  text-align: left;
  border-bottom: 1px solid rgba(146, 192, 224, 0.2);
  vertical-align: top;
}

th {
  color: var(--text-soft);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mono {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  border-radius: 12px;
  padding: 0.75rem;
  background: rgba(2, 10, 20, 0.78);
  border: 1px solid rgba(125, 179, 212, 0.2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-size: 0.76rem;
  line-height: 1.5;
}

.mono.empty,
.muted {
  color: #88a7c1;
}

#roleSummary {
  margin: 0.7rem 0 0.45rem;
}

.book-price-btn {
  width: 100%;
  background: rgba(13, 35, 56, 0.6);
  border: 1px solid rgba(128, 186, 223, 0.35);
  color: var(--text);
  border-radius: 8px;
  padding: 0.2rem 0.34rem;
  text-align: right;
  font-size: 0.78rem;
  cursor: pointer;
}

.book-price-btn:hover {
  border-color: rgba(168, 227, 255, 0.82);
}

.action-stack {
  display: flex;
  gap: 0.38rem;
  flex-wrap: wrap;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .grid.two,
  .inline-form,
  .trader-form,
  .grid.compact {
    grid-template-columns: 1fr;
  }

  .shell {
    width: min(100%, 96vw);
    margin-top: 1rem;
  }
}
