* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #071018;
  color: #e7fbff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body {
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    radial-gradient(circle at 18% 0%, rgba(26, 233, 255, 0.14), transparent 34rem),
    radial-gradient(circle at 85% 18%, rgba(255, 211, 106, 0.08), transparent 28rem),
    #071018;
  background-size: 32px 32px, 32px 32px, auto, auto, auto;
}

a {
  color: #63e7ff;
}

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

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

.hero,
.tool-panel,
.info-card,
.series-section,
.app-comment-section {
  border: 1px solid rgba(111, 228, 255, 0.18);
  background: rgba(8, 20, 28, 0.78);
  box-shadow: 0 0 38px rgba(0, 216, 255, 0.08);
  border-radius: 14px;
}

.hero {
  padding: clamp(26px, 5vw, 56px);
  margin-bottom: 22px;
}

.series-label,
.section-kicker {
  margin: 0 0 9px;
  color: #6befff;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 7vw, 4.8rem);
  letter-spacing: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.15rem, 3vw, 1.7rem);
}

h3 {
  margin: 16px 0 10px;
  font-size: 1rem;
}

.subtitle {
  margin: 8px 0 0;
  color: #bdf7ff;
  font-weight: 700;
  font-size: clamp(1rem, 2.4vw, 1.45rem);
}

.lead {
  max-width: 780px;
  margin: 18px 0 0;
  color: rgba(231, 251, 255, 0.82);
  line-height: 1.85;
}

.hero-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hero-pills span {
  border: 1px solid rgba(111, 228, 255, 0.22);
  background: rgba(2, 8, 12, 0.72);
  color: #cff9ff;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.tool-panel {
  padding: clamp(18px, 4vw, 32px);
}

.tool-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.tool-head p {
  margin: 0;
  color: rgba(231, 251, 255, 0.75);
  line-height: 1.7;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

button {
  border: 1px solid rgba(98, 230, 255, 0.36);
  background: linear-gradient(180deg, rgba(19, 205, 241, 0.25), rgba(12, 98, 128, 0.25));
  color: #effeff;
  padding: 11px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

button:hover,
button:focus-visible {
  border-color: rgba(98, 230, 255, 0.78);
}

.quiet-button {
  background: rgba(255, 255, 255, 0.05);
  color: #d8f9ff;
}

.capture-zone {
  min-height: 148px;
  border: 1px dashed rgba(255, 216, 112, 0.42);
  border-radius: 12px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 10px),
    rgba(5, 14, 19, 0.86);
  padding: 18px;
  outline: none;
}

.capture-zone.is-active {
  border-color: rgba(96, 245, 255, 0.72);
  box-shadow: inset 0 0 32px rgba(0, 216, 255, 0.1);
}

.capture-zone p {
  margin: 12px 0 0;
  color: rgba(231, 251, 255, 0.68);
}

.capture-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.capture-status span {
  color: #6befff;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

.capture-status strong {
  color: #ffe28a;
}

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

.metric {
  min-width: 0;
  border: 1px solid rgba(111, 228, 255, 0.16);
  background: rgba(1, 8, 12, 0.72);
  padding: 12px;
  border-radius: 10px;
}

.metric span {
  display: block;
  color: rgba(178, 235, 244, 0.67);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.metric strong {
  display: block;
  margin-top: 6px;
  color: #ffffff;
  font-size: clamp(1.05rem, 2.6vw, 1.55rem);
  overflow-wrap: anywhere;
}

.mode-panel,
.tool-panel > section {
  margin-top: 18px;
}

body[data-keyboard-mode="key"] .mode-rollover,
body[data-keyboard-mode="key"] .mode-chattering,
body[data-keyboard-mode="rollover"] .mode-key,
body[data-keyboard-mode="rollover"] .mode-chattering,
body[data-keyboard-mode="chattering"] .mode-key,
body[data-keyboard-mode="chattering"] .mode-rollover {
  display: none;
}

.key-chip-list,
.compact-log,
.event-log {
  min-height: 58px;
  border: 1px solid rgba(111, 228, 255, 0.13);
  background: rgba(0, 6, 10, 0.56);
  border-radius: 10px;
  padding: 10px;
}

.key-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.key-chip,
.log-item {
  border: 1px solid rgba(111, 228, 255, 0.22);
  background: rgba(11, 38, 50, 0.72);
  color: #e8fbff;
  border-radius: 8px;
}

.key-chip {
  padding: 7px 9px;
  font-size: 0.88rem;
}

.warning-list .key-chip,
.key-chip.warning {
  border-color: rgba(255, 119, 119, 0.55);
  background: rgba(78, 16, 18, 0.72);
  color: #ffd9d9;
}

.event-log,
.compact-log {
  display: grid;
  gap: 7px;
  max-height: 260px;
  overflow: auto;
}

.log-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  overflow-wrap: anywhere;
}

.log-item small {
  color: rgba(231, 251, 255, 0.55);
}

.log-item.warning {
  border-color: rgba(255, 119, 119, 0.55);
  background: rgba(78, 16, 18, 0.72);
}

.mini-note {
  color: rgba(231, 251, 255, 0.68);
  line-height: 1.75;
}

.ad-row {
  margin: 22px 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 12px;
}

.ad-label {
  margin-bottom: 8px;
  color: rgba(231, 251, 255, 0.42);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
}

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

.info-card,
.series-section,
.app-comment-section {
  padding: clamp(18px, 3vw, 26px);
}

.info-card p,
.info-card li {
  color: rgba(231, 251, 255, 0.77);
  line-height: 1.8;
}

.series-section {
  margin-top: 18px;
}

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

.series-card {
  display: block;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(111, 228, 255, 0.17);
  border-radius: 10px;
  background: rgba(3, 13, 18, 0.75);
  text-decoration: none;
  color: #e8fbff;
}

.series-card span {
  display: block;
  font-weight: 800;
}

.series-card small {
  display: block;
  margin-top: 5px;
  color: rgba(231, 251, 255, 0.62);
  line-height: 1.5;
}

.series-card.is-current {
  border-color: rgba(255, 216, 112, 0.45);
  color: #ffe28a;
}

.app-comment-section {
  margin-top: 18px;
}

.app-comments,
.app-comment-form-section {
  background: rgba(6, 18, 24, 0.92) !important;
  border: 1px solid rgba(112, 220, 240, 0.22) !important;
  color: #e8fbff !important;
}

.app-comment-form input,
.app-comment-form textarea,
.app-comment-form select {
  background: rgba(3, 10, 14, 0.9) !important;
  color: #e8fbff !important;
  border: 1px solid rgba(112, 220, 240, 0.28) !important;
}

.app-comment-form input::placeholder,
.app-comment-form textarea::placeholder {
  color: rgba(232, 251, 255, 0.48) !important;
}

.site-return-link,
.mothership-link,
.page-footer {
  width: min(520px, 100%);
  margin: 18px auto 0;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
}

.site-return-link {
  border: 1px solid rgba(111, 228, 255, 0.17);
  background: rgba(6, 18, 24, 0.72);
}

.site-return-link span,
.mothership-link span {
  display: block;
  color: #6befff;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.site-return-link a,
.mothership-link a {
  display: inline-block;
  margin-top: 4px;
  font-weight: 800;
}

.site-return-link p,
.mothership-link p,
.page-footer p {
  margin: 5px 0 0;
  color: rgba(231, 251, 255, 0.62);
  font-size: 0.84rem;
}

.mothership-link {
  border: 1px solid rgba(255, 216, 112, 0.18);
  background: rgba(20, 18, 11, 0.55);
}

.page-footer {
  color: rgba(231, 251, 255, 0.58);
}

@media (max-width: 820px) {
  .tool-head,
  .info-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .action-row {
    justify-content: stretch;
  }

  .action-row button {
    flex: 1 1 160px;
  }

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

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

@media (max-width: 420px) {
  .site-shell {
    width: min(100% - 18px, 1120px);
    padding-top: 18px;
  }

  .hero,
  .tool-panel,
  .info-card,
  .series-section,
  .app-comment-section {
    border-radius: 10px;
  }

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

  .capture-status,
  .log-item {
    grid-template-columns: 1fr;
    display: grid;
  }
}
