:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #666666;
  --line: #d9d9d9;
  --panel: #f5f5f5;
  --panel-2: #fafafa;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  min-height: 100vh;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.header {
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 600;
}

.intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.script-list {
  display: grid;
  gap: 12px;
}

.script-entry {
  border: 1px solid var(--line);
  background: #fff;
}

.script-entry[open] {
  background: var(--panel-2);
}

.script-summary {
  cursor: pointer;
  padding: 14px 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.script-summary::-webkit-details-marker {
  display: none;
}

.script-name {
  font-size: 0.95rem;
}

.script-type {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 2px 6px;
  flex-shrink: 0;
}

.script-body {
  border-top: 1px solid var(--line);
  padding: 16px;
}

.script-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.script-actions a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--fg);
}

.script-actions a:hover {
  opacity: 0.7;
}

.status {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.error {
  color: var(--fg);
}

.code-block {
  margin: 0;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.6;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85rem;
}

/* Syntax highlighting */
.token-comment {
  color: #777777;
}

.token-keyword {
  font-weight: 700;
}

.token-string {
  color: #444444;
}

.token-number {
  color: #555555;
}

.token-operator {
  color: #222222;
}

.token-tag {
  font-weight: 700;
}

.token-attr {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.token-selector {
  font-weight: 700;
}

.token-property {
  text-decoration: underline;
  text-underline-offset: 2px;
}