:root {
  color-scheme: light;
  --bg: #fff8e7;
  --surface: #fffefa;
  --surface-2: #fff0a8;
  --ink: #171322;
  --muted: #5f5972;
  --line: #171322;
  --green: #00a7a5;
  --green-2: #007a7b;
  --amber: #d79500;
  --red: #d62173;
  --cyan: #1687d9;
  --plum: #6a7bb4;
  --hot-pink: #ff71ce;
  --yellow: #ffce5c;
  --teal: #86ccca;
  --blue-purple: #6a7bb4;
  --code: #171322;
  --shadow: 8px 8px 0 #171322;
  --soft-shadow: 0 16px 38px rgba(23, 19, 34, 0.14);
  --radius: 8px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18px 18px, rgba(23, 19, 34, 0.14) 2px, transparent 2.5px) 0 0 / 36px 36px,
    repeating-linear-gradient(135deg, rgba(255, 113, 206, 0.16) 0 8px, transparent 8px 24px),
    linear-gradient(135deg, #fff8e7 0%, #f8f4ff 48%, #ecfffd 100%);
  color: var(--ink);
  min-width: 320px;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 210px;
  height: 210px;
  right: -62px;
  top: 84px;
  background:
    linear-gradient(90deg, var(--hot-pink) 0 18px, transparent 18px 30px) 0 0 / 30px 30px,
    var(--yellow);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  transform: rotate(12deg);
  mix-blend-mode: multiply;
  opacity: 0.9;
}

body::after {
  width: 260px;
  height: 96px;
  left: 292px;
  bottom: 22px;
  background:
    repeating-linear-gradient(90deg, var(--blue-purple) 0 14px, transparent 14px 28px),
    var(--teal);
  clip-path: polygon(0 18%, 86% 0, 100% 74%, 12% 100%);
  transform: rotate(-6deg);
  mix-blend-mode: multiply;
  opacity: 0.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  position: relative;
  z-index: 1;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    radial-gradient(circle at 20px 20px, rgba(255, 206, 92, 0.85) 3px, transparent 4px) 0 0 / 28px 28px,
    repeating-linear-gradient(-45deg, rgba(134, 204, 202, 0.22) 0 10px, transparent 10px 22px),
    #171322;
  color: #fffefa;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 4px solid var(--line);
  overflow: hidden;
}

.sidebar::before {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -84px;
  top: 118px;
  background: var(--hot-pink);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 92%, 50% 70%, 21% 92%, 32% 57%, 2% 35%, 39% 35%);
  transform: rotate(19deg);
  opacity: 0.88;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 48px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: var(--yellow);
  border-radius: 8px;
  padding: 6px;
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--hot-pink);
  transform: rotate(-4deg);
}

.brand strong {
  display: block;
  font-size: 19px;
  line-height: 1.2;
}

.brand small {
  display: block;
  color: #fff0a8;
  margin-top: 2px;
}

.side-card a {
  color: #ffffff;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  height: 42px;
  border: 2px solid var(--line);
  background: rgba(255, 254, 250, 0.92);
  color: var(--ink);
  border-radius: 8px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  font-weight: 850;
  box-shadow: 3px 3px 0 rgba(255, 113, 206, 0.65);
}

.nav-item:hover,
.nav-item.active {
  background: var(--yellow);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--hot-pink);
  transform: rotate(-1deg);
}

.nav-item svg,
.icon-button svg,
.mini-button svg,
.sample-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.side-card {
  margin-top: auto;
  display: grid;
  gap: 8px;
  color: #fffefa;
  border: 3px solid var(--line);
  background: rgba(255, 113, 206, 0.2);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 5px 5px 0 var(--teal);
}

.side-card code {
  font-size: 12px;
  color: #ffffff;
  white-space: normal;
  overflow-wrap: anywhere;
}

.label,
.eyebrow,
.panel-title small,
.field span {
  color: var(--blue-purple);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.workspace {
  min-width: 0;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  position: relative;
}

.workspace::before {
  content: "";
  position: absolute;
  width: 116px;
  height: 116px;
  right: 36px;
  top: 112px;
  background:
    repeating-linear-gradient(0deg, #171322 0 5px, transparent 5px 12px),
    var(--teal);
  clip-path: polygon(0 0, 100% 16%, 80% 100%, 10% 84%);
  transform: rotate(11deg);
  opacity: 0.24;
  pointer-events: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 4px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(255, 206, 92, 0.92), rgba(134, 204, 202, 0.82)),
    var(--surface);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 34px;
  right: 92px;
  top: 12px;
  background: repeating-linear-gradient(90deg, var(--hot-pink) 0 9px, transparent 9px 18px);
  transform: rotate(-7deg);
  opacity: 0.55;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--red);
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  font-size: 17px;
  line-height: 1.25;
}

.refresh-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin: 6px 0 0;
}

.toolbar,
.button-row,
.sample-row,
.event-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-button,
.mini-button,
.sample-button {
  border: 3px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--line);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  position: relative;
  z-index: 1;
}

.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
}

.mini-button,
.sample-button {
  min-height: 38px;
  padding: 0 13px;
  gap: 8px;
  white-space: nowrap;
}

.sample-button {
  background: var(--surface-2);
}

.mini-button:hover,
.icon-button:hover,
.sample-button:hover {
  box-shadow: 2px 2px 0 var(--line);
  transform: translate(2px, 2px) rotate(-1deg);
}

.mini-button:disabled,
.icon-button:disabled,
.sample-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  box-shadow: 2px 2px 0 rgba(23, 19, 34, 0.5);
  transform: none;
}

.mini-button {
  background: var(--hot-pink);
  color: var(--ink);
  border-color: var(--line);
  font-weight: 900;
}

.mini-button.quiet {
  background: var(--teal);
  color: var(--ink);
  border-color: var(--line);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.96), rgba(255, 254, 250, 0.96)),
    radial-gradient(circle at 12px 12px, rgba(255, 113, 206, 0.24) 2px, transparent 2.5px) 0 0 / 24px 24px;
  border: 4px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
  position: relative;
}

.panel::before {
  content: "";
  position: absolute;
  width: 56px;
  height: 56px;
  right: 12px;
  top: -16px;
  background: var(--yellow);
  border: 3px solid var(--line);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: rotate(12deg);
  opacity: 0.9;
  pointer-events: none;
}

.panel:nth-of-type(2n)::before {
  background: var(--teal);
  clip-path: polygon(0 0, 100% 18%, 78% 100%, 10% 74%);
  transform: rotate(-8deg);
}

.panel > * {
  position: relative;
  z-index: 1;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-title.compact {
  margin-bottom: 10px;
}

.hero-media {
  position: relative;
  overflow: hidden;
  border: 4px solid var(--line);
  border-radius: 8px;
  height: 190px;
  background: var(--ink);
  margin-bottom: 16px;
  box-shadow: 6px 6px 0 var(--teal);
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: auto 12px 12px 12px;
  border: 3px solid var(--line);
  background: rgba(255, 254, 250, 0.92);
  color: var(--ink);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-overlay strong {
  font-size: 22px;
  color: var(--red);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  border: 3px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-height: 84px;
  display: grid;
  align-content: space-between;
  background:
    linear-gradient(135deg, rgba(255, 254, 250, 0.94), rgba(255, 254, 250, 0.94)),
    repeating-linear-gradient(45deg, rgba(255, 206, 92, 0.38) 0 8px, transparent 8px 18px);
  box-shadow: 4px 4px 0 var(--line);
  transform: rotate(-0.4deg);
}

.metric:nth-child(2n) {
  background:
    linear-gradient(135deg, rgba(255, 254, 250, 0.94), rgba(255, 254, 250, 0.94)),
    radial-gradient(circle at 8px 8px, rgba(255, 113, 206, 0.55) 2px, transparent 2.5px) 0 0 / 18px 18px;
  transform: rotate(0.5deg);
}

.metric:nth-child(3n) {
  background:
    linear-gradient(135deg, rgba(255, 254, 250, 0.94), rgba(255, 254, 250, 0.94)),
    repeating-linear-gradient(90deg, rgba(134, 204, 202, 0.65) 0 7px, transparent 7px 16px);
}

.metric small {
  color: var(--muted);
  font-weight: 700;
}

.metric strong {
  font-size: 24px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.metric.green strong {
  color: var(--green-2);
}

.metric.amber strong {
  color: var(--amber);
}

.metric.cyan strong {
  color: var(--cyan);
}

.metric.plum strong {
  color: var(--plum);
}

.online-summary {
  border: 4px solid var(--line);
  border-radius: 8px;
  min-height: 92px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background:
    radial-gradient(circle at 18px 18px, rgba(23, 19, 34, 0.22) 2px, transparent 2.5px) 0 0 / 30px 30px,
    linear-gradient(135deg, var(--teal) 0%, #fffefa 100%);
  box-shadow: 6px 6px 0 var(--hot-pink);
  transform: rotate(1deg);
}

.online-summary strong {
  font-size: 42px;
  line-height: 1;
  color: var(--green-2);
}

.online-summary span {
  color: var(--muted);
  margin-top: -22px;
}

.form-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

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

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

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

.span-2 {
  grid-column: span 2;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
  box-shadow: 3px 3px 0 rgba(23, 19, 34, 0.18);
}

.field textarea {
  resize: vertical;
  min-height: 108px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--line);
  box-shadow: 4px 4px 0 var(--yellow), 0 0 0 4px rgba(255, 113, 206, 0.18);
}

.secret-field {
  position: relative;
}

.secret-field input {
  padding-right: 52px;
}

.icon-button.inline {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 34px;
  height: 34px;
  background: transparent;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
  padding-right: 2px;
}

.chip {
  border: 3px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px 6px 6px;
  background: #fffefa;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.player-avatar-frame {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  box-shadow: 3px 3px 0 var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.player-avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  image-rendering: pixelated;
  object-fit: cover;
  background: transparent;
}

.avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(255, 206, 92, 0.86), rgba(134, 204, 202, 0.86)),
    #fffefa;
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
}

.avatar-failed .avatar-placeholder {
  background:
    repeating-linear-gradient(45deg, rgba(255, 113, 206, 0.42) 0 6px, transparent 6px 12px),
    #fffefa;
}

.player-avatar-frame.avatar-large {
  width: 64px;
  height: 64px;
}

.player-avatar-frame.avatar-medium {
  width: 54px;
  height: 54px;
}

.player-avatar-frame.avatar-chip {
  width: 30px;
  height: 30px;
  border-width: 2px;
  border-radius: 6px;
  box-shadow: 2px 2px 0 var(--line);
}

.chip:nth-child(3n + 1) {
  background: var(--yellow);
}

.chip:nth-child(3n + 2) {
  background: var(--teal);
}

.chip:nth-child(3n + 3) {
  background: #ffd7f0;
}

.chip small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.check-panel {
  border: 3px solid var(--line);
  background:
    radial-gradient(circle at 10px 10px, rgba(106, 123, 180, 0.22) 2px, transparent 2.5px) 0 0 / 22px 22px,
    #fffefa;
  border-radius: 8px;
  padding: 12px;
  margin: 14px 0;
  box-shadow: 5px 5px 0 var(--blue-purple);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.check-item {
  min-height: 38px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.check-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--hot-pink);
}

.field-check {
  min-height: 74px;
  align-content: center;
}

.check-item span {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.result-area {
  margin-top: 14px;
}

.result-note {
  border: 3px solid var(--line);
  background: var(--yellow);
  border-radius: 8px;
  color: var(--ink);
  padding: 11px 12px;
  margin-bottom: 12px;
  box-shadow: 4px 4px 0 var(--line);
  font-weight: 800;
}

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

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

.result-card {
  border: 3px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.96), rgba(255, 254, 250, 0.96)),
    repeating-linear-gradient(-45deg, rgba(134, 204, 202, 0.42) 0 7px, transparent 7px 18px);
  padding: 14px;
  min-width: 0;
  display: grid;
  gap: 12px;
  box-shadow: 5px 5px 0 var(--line);
  position: relative;
  overflow: hidden;
}

.result-card::after {
  content: "";
  position: absolute;
  width: 54px;
  height: 54px;
  right: -16px;
  bottom: -18px;
  background: var(--hot-pink);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  transform: rotate(18deg);
  opacity: 0.76;
}

.result-card:nth-child(2n) {
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.96), rgba(255, 254, 250, 0.96)),
    radial-gradient(circle at 8px 8px, rgba(255, 206, 92, 0.72) 2px, transparent 2.5px) 0 0 / 20px 20px;
  transform: rotate(0.35deg);
}

.result-card > * {
  position: relative;
  z-index: 1;
}

.result-head {
  display: grid;
  gap: 4px;
}

.result-head.with-avatar {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
}

.result-title-wrap {
  min-width: 0;
}

.result-type {
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.result-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-row span {
  border-radius: 8px;
  padding: 5px 8px;
  background: var(--teal);
  border: 2px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 2px 2px 0 var(--line);
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fact-grid.small {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fact {
  min-width: 0;
  border: 3px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: #fffefa;
}

.fact small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.fact strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.fact-link {
  color: var(--blue-purple);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 3px solid var(--line);
  padding-top: 10px;
}

.group-list {
  display: grid;
  gap: 8px;
}

.group-list div {
  border-top: 3px solid var(--line);
  padding-top: 9px;
}

.group-list strong {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.group-list p {
  margin: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.data-table-wrap {
  overflow: auto;
  border: 3px solid var(--line);
  border-radius: 8px;
  max-height: 520px;
  box-shadow: 5px 5px 0 var(--line);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 3px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}

.data-table th {
  position: sticky;
  top: 0;
  background: var(--yellow);
  z-index: 1;
  color: var(--ink);
  font-size: 12px;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table code {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.empty-state,
.inline-error,
.inline-warning,
.event-status {
  border: 3px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background:
    radial-gradient(circle at 9px 9px, rgba(255, 113, 206, 0.32) 2px, transparent 2.5px) 0 0 / 18px 18px,
    #fffefa;
}

.inline-error {
  border-color: var(--red);
  background: #fff0f8;
  color: var(--red);
}

.inline-warning {
  border-style: solid;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 800;
  margin-bottom: 12px;
}

.result-dock {
  position: static;
}

.json-output {
  margin: 0;
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  background: var(--code);
  color: #e9f3ef;
  border-radius: 8px;
  padding: 14px;
  line-height: 1.55;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.event-choice {
  border: 3px solid var(--line);
  border-radius: 8px;
  min-height: 54px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  background: #fffefa;
  box-shadow: 3px 3px 0 rgba(23, 19, 34, 0.24);
}

.event-choice input {
  width: 16px;
  height: 16px;
  accent-color: var(--hot-pink);
}

.event-choice span {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.event-choice small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.event-log {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  max-height: 460px;
  overflow: auto;
}

.event-item {
  border: 3px solid var(--line);
  border-left: 8px solid var(--hot-pink);
  border-radius: 8px;
  padding: 10px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 206, 92, 0.32) 0 8px, transparent 8px 18px),
    #fffefa;
}

.event-item.rule-hit {
  border-left-color: var(--red);
  background:
    repeating-linear-gradient(90deg, rgba(255, 113, 206, 0.28) 0 8px, transparent 8px 18px),
    var(--yellow);
}

.event-item strong {
  display: block;
  margin-bottom: 6px;
}

.rule-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 7px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 2px 2px 0 var(--line);
}

.event-item pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.media-grid a {
  display: block;
  border: 3px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--line);
}

.media-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.loading {
  opacity: 0.75;
  pointer-events: none;
}

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

  .sidebar {
    position: relative;
    height: auto;
    padding: 14px;
    gap: 14px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
  }

  .nav-item span {
    display: none;
  }

  .side-card {
    display: none;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

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

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

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

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

@media (max-width: 720px) {
  .workspace {
    padding: 16px;
  }

  .topbar,
  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar,
  .button-row {
    width: 100%;
  }

  .form-grid.two,
  .form-grid.three,
  .form-grid.four,
  .event-grid,
  .check-grid,
  .card-grid,
  .card-grid.compact,
  .fact-grid,
  .fact-grid.small,
  .media-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  h1 {
    font-size: 24px;
  }

  .result-dock {
    position: static;
  }
}
