/* 投稿ラボ Live Ops — AlphaNine premium control room */
:root {
  --navy: #292666;
  --navy-deep: #1a1840;
  --cyan: #009fe8;
  --cyan-dim: rgba(0, 159, 232, 0.35);
  --cyan-glow: rgba(0, 159, 232, 0.18);
  --bg: #0a0918;
  --bg-elev: #10102a;
  --glass: rgba(24, 22, 55, 0.55);
  --glass-border: rgba(0, 159, 232, 0.14);
  --paper: #f2f4f8;
  --muted: #9aa3b8;
  --muted-dim: #6b7389;
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, 0.2);
  --yellow: #fbbf24;
  --yellow-dim: rgba(251, 191, 36, 0.18);
  --red: #f87171;
  --hold: #fb923c;
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--paper);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(41, 38, 102, 0.55), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(0, 159, 232, 0.08), transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(41, 38, 102, 0.35), transparent 60%);
}

/* —— Top bar —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  background: rgba(10, 9, 24, 0.72);
  border-bottom: 1px solid var(--glass-border);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 8px var(--cyan-glow));
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.brand-text strong {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-text span {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.clock {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  tabular-nums: true;
  font-variant-numeric: tabular-nums;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(52, 211, 153, 0.35);
}

.status-pill[data-state="idle"] {
  background: rgba(154, 163, 184, 0.12);
  color: var(--muted);
  border-color: rgba(154, 163, 184, 0.25);
}

.status-pill .pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse-ring 2s var(--ease) infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.about-btn {
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.about-btn:hover {
  color: var(--cyan);
  border-color: var(--cyan-dim);
  background: var(--cyan-glow);
}

/* —— Layout —— */
.ops {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ops-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1.25rem;
  align-items: start;
}

.ops-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.panel-head {
  margin-bottom: 1rem;
}

.panel-head h1,
.panel-head h2 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--paper);
}

.panel-sub {
  font-size: 0.75rem;
  color: var(--muted-dim);
  margin-top: 0.2rem;
}

/* —— Staff grid —— */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}

.staff-card {
  position: relative;
  background: rgba(16, 16, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 0.9rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s;
  overflow: hidden;
}

.staff-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: transparent;
  transition: background 0.25s;
}

.staff-card[data-status="working"]::before {
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 12px var(--cyan-dim);
}

.staff-card[data-status="working"] {
  border-color: rgba(0, 159, 232, 0.28);
  box-shadow: 0 0 20px rgba(0, 159, 232, 0.06);
}

.staff-card[data-status="hold"] {
  border-color: rgba(251, 146, 60, 0.35);
}

.staff-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 159, 232, 0.35);
}

.staff-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--cyan);
  background: linear-gradient(145deg, var(--navy), var(--navy-deep));
  border: 1px solid rgba(0, 159, 232, 0.35);
  box-shadow: inset 0 0 12px rgba(0, 159, 232, 0.12);
}

.staff-name {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.staff-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  width: fit-content;
}

.staff-status[data-status="working"] {
  color: var(--cyan);
  background: var(--cyan-glow);
}

.staff-status[data-status="idle"] {
  color: var(--muted);
  background: rgba(154, 163, 184, 0.1);
}

.staff-status[data-status="hold"] {
  color: var(--hold);
  background: rgba(251, 146, 60, 0.15);
}

.staff-status .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.staff-status[data-status="working"] .dot {
  animation: blink 1.4s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.staff-today {
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* —— Side stack —— */
.side-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.side-panel {
  padding: 1rem 1.1rem;
}

.side-panel h2 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

.side-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.side-note {
  font-size: 0.72rem;
  color: var(--muted-dim);
  line-height: 1.4;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.chip {
  font-size: 0.68rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 159, 232, 0.08);
  border: 1px solid rgba(0, 159, 232, 0.22);
  color: var(--paper);
  transition: box-shadow 0.3s, border-color 0.3s;
}

.chip:hover {
  box-shadow: 0 0 14px var(--cyan-glow);
  border-color: var(--cyan-dim);
}

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.badge-hold {
  color: var(--hold);
  background: rgba(251, 146, 60, 0.15);
  border: 1px solid rgba(251, 146, 60, 0.3);
}

.badge-ok {
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.badge-warn {
  color: var(--yellow);
  background: var(--yellow-dim);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.hold-panel {
  border-color: rgba(251, 146, 60, 0.22);
}

/* —— Lane —— */
.lane-panel { overflow: hidden; }

.lane-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.lane-hint {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted-dim);
  white-space: nowrap;
}

.lane-track-wrap {
  overflow: hidden;
  margin: 0 -0.25rem;
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}

.lane-track {
  display: flex;
  gap: 0.75rem;
  width: max-content;
  padding: 0.35rem 0.25rem 0.5rem;
  animation: lane-scroll 48s linear infinite;
}

.lane-track:hover { animation-play-state: paused; }

@keyframes lane-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.lane-card {
  flex: 0 0 220px;
  background: rgba(16, 16, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lane-card:hover {
  border-color: rgba(0, 159, 232, 0.4);
  box-shadow: 0 0 18px var(--cyan-glow);
}

.lane-theme {
  font-size: 0.62rem;
  font-family: var(--mono);
  color: var(--cyan);
  letter-spacing: 0.06em;
}

.lane-title {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--paper);
}

.lane-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  color: var(--muted-dim);
}

.lane-stage {
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  background: rgba(0, 159, 232, 0.1);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
}

/* —— Quality —— */
.quality-body {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.quality-meter {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.meter-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.meter-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 8;
}

.meter-fg {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 301.6;
  stroke-dashoffset: 301.6;
  filter: drop-shadow(0 0 6px var(--cyan-dim));
  transition: stroke-dashoffset 1.2s var(--ease);
}

.meter-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.meter-score {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--paper);
  line-height: 1;
}

.meter-unit {
  font-size: 0.65rem;
  color: var(--muted-dim);
  margin-top: 0.15rem;
}

.threshold {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.threshold strong {
  color: var(--cyan);
  font-family: var(--mono);
}

.quality-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

/* —— Approval —— */
.approval-body {
  position: relative;
}

.approval-count {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.count-num {
  font-family: var(--mono);
  font-size: 2.75rem;
  font-weight: 500;
  color: var(--cyan);
  line-height: 1;
  text-shadow: 0 0 24px var(--cyan-glow);
}

.count-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--paper);
}

.approval-note {
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 28rem;
}

.approval-desk {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100px;
  height: 40px;
  opacity: 0.5;
  pointer-events: none;
}

.desk-line {
  position: absolute;
  bottom: 8px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan-dim), transparent);
  border-radius: 2px;
}

.desk-glow {
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 24px;
  background: radial-gradient(ellipse at center, var(--cyan-glow), transparent 70%);
}

/* —— Footer —— */
.site-footer {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
  text-align: center;
}

.site-footer p {
  font-size: 0.75rem;
  color: var(--muted-dim);
}

.footer-meta {
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.65rem !important;
}

.footer-meta .sep { margin: 0 0.4rem; opacity: 0.5; }

/* —— About dialog —— */
.about-dialog {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--paper);
  padding: 0;
  max-width: 440px;
  width: calc(100% - 2rem);
  box-shadow: var(--shadow), 0 0 60px rgba(0, 159, 232, 0.08);
}

.about-dialog::backdrop {
  background: rgba(5, 4, 14, 0.72);
  backdrop-filter: blur(4px);
}

.about-inner { padding: 1.35rem 1.5rem 1.5rem; }

.about-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.about-head h2 {
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.about-close {
  font-size: 1.4rem;
  line-height: 1;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.about-close:hover { color: var(--paper); }

.about-body p {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.about-body strong { color: var(--paper); font-weight: 600; }

.about-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.about-body li {
  font-size: 0.8rem;
  color: var(--muted);
  padding-left: 0.9rem;
  position: relative;
}

.about-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
}

/* —— Responsive —— */
@media (max-width: 1024px) {
  .ops-grid { grid-template-columns: 1fr; }
  .side-stack {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .staff-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; }
  .ops { padding: 1rem 1rem 2rem; }
  .staff-grid { grid-template-columns: repeat(2, 1fr); }
  .ops-bottom { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr; }
  .lane-hint { display: none; }
  .quality-body { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .lane-track { animation: none; }
  .status-pill .pulse,
  .staff-status[data-status="working"] .dot { animation: none; }
  .meter-fg { transition: none; }
}
