:root {
  --bg: #07111f;
  --bg-2: #0c1c2f;
  --panel: rgba(9, 17, 28, 0.82);
  --border: rgba(255, 255, 255, 0.08);
  --text: #edf4ff;
  --muted: #9aabc0;
  --green: #4be3b1;
  --amber: #ffcf66;
  --red: #ff6f7d;
  --blue: #6ea8ff;
  --cyan: #44dfff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(75, 227, 177, 0.16), transparent 24%),
    radial-gradient(circle at right center, rgba(110, 168, 255, 0.16), transparent 24%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
}

.shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 34px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--cyan);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  max-width: 14ch;
}

h2 {
  font-size: 1.15rem;
}

.lede {
  margin-top: 14px;
  max-width: 72ch;
  color: var(--muted);
  line-height: 1.7;
}

.lede code {
  padding: 0 0.35em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-family: inherit;
}

.info-card,
.frame-card,
.log-panel,
.stat-card {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.info-card {
  border-radius: 22px;
  padding: 18px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.connection-card {
  position: relative;
  overflow: hidden;
}

.connection-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -55% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(68, 223, 255, 0.22), transparent 68%);
  pointer-events: none;
}

.info-card strong {
  font-size: 1.05rem;
}

.info-card p {
  color: var(--muted);
  line-height: 1.5;
}

.chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(75, 227, 177, 0.14);
  color: #8ef2d0;
  font-size: 0.78rem;
  font-weight: 700;
}

.chip-connection {
  background: rgba(110, 168, 255, 0.16);
  color: #b5d3ff;
}

.chip-connection.is-offline {
  background: rgba(255, 111, 125, 0.18);
  color: #ffb0ba;
}

.chip-connection.is-retrying {
  background: rgba(255, 207, 102, 0.18);
  color: #ffe08d;
}

.chip-connection.is-online {
  background: rgba(75, 227, 177, 0.18);
  color: #8ef2d0;
}

.connection-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.connection-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.connection-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--green));
  box-shadow: 0 0 14px rgba(75, 227, 177, 0.24);
  transition: width 180ms linear;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.frame-card,
.log-panel {
  border-radius: 24px;
  overflow: hidden;
}

.frame-card {
  min-height: calc(100vh - 170px);
}

.frame-head,
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 0;
}

.open-link,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.frame-card iframe {
  display: block;
  width: 100%;
  height: calc(100vh - 240px);
  margin-top: 14px;
  border: 0;
  background: #fff;
}

.log-panel {
  padding-bottom: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.stat-card {
  border-radius: 18px;
  padding: 14px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 1.55rem;
  line-height: 1;
}

.stat-running strong {
  color: #8ef2d0;
}

.stat-stopped strong {
  color: #ffe08d;
}

.stat-complete strong {
  color: #8ef2d0;
}

.stat-error strong {
  color: #ff9aa4;
}

.stat-pause strong {
  color: #ffe08d;
}

.stat-reset strong {
  color: #9ed0ff;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: rgba(68, 223, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(68, 223, 255, 0.08);
}

.auto-hint {
  padding: 0 18px 14px;
  color: var(--muted);
  line-height: 1.55;
}

.table-wrap {
  padding: 0 18px 18px;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.tag.start,
.tag.resume {
  background: rgba(75, 227, 177, 0.14);
  color: #8ef2d0;
}

.tag.complete,
.tag.tone-green {
  background: rgba(75, 227, 177, 0.16);
  color: #8ef2d0;
}

.tag.stop {
  background: rgba(255, 207, 102, 0.14);
  color: #ffe08d;
}

.tag.pause,
.tag.tone-yellow {
  background: rgba(255, 207, 102, 0.16);
  color: #ffe08d;
}

.tag.error {
  background: rgba(255, 111, 125, 0.14);
  color: #ffb0ba;
}

.tag.error_clear,
.tag.tone-blue {
  background: rgba(110, 168, 255, 0.16);
  color: #b5d3ff;
}

.tag.reset,
.tag.target,
.tag.part_done,
.tag.change,
.tag.progress {
  background: rgba(110, 168, 255, 0.14);
  color: #b5d3ff;
}

.tag.tone-red {
  background: rgba(255, 111, 125, 0.16);
  color: #ffb0ba;
}

@media (max-width: 1100px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .frame-card,
  .frame-card iframe {
    min-height: 70vh;
    height: 70vh;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1480px);
    padding: 16px 0 20px;
  }

  .stats-grid,
  .entry-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 16ch;
  }
}
