@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;0,700;1,400&family=Barlow+Condensed:wght@500;600;700&family=Cormorant+SC:wght@500;600;700&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Source+Serif+4:ital,wght@0,400;0,600;1,400&family=JetBrains+Mono:wght@500;600&family=Rajdhani:wght@500;600;700&family=Share+Tech+Mono&display=swap");
:root {
  color-scheme: dark;
  --ddb-ink: #121212;
  --ddb-surface-1: #1b1b1d;
  --ddb-surface-2: #252527;
  --ddb-surface-3: #303033;
  --ddb-sunken: #0c0c0d;
  --ddb-hairline: #3d3d41;
  --ddb-hairline-soft: #2c2c30;
  --ddb-text: #ededed;
  --ddb-text-muted: #a6a6ad;
  --ddb-text-faint: #8c8c94;
  --ddb-red: #f73b3b;
  --ddb-red-text: #ff6666;
  --ddb-red-fill: #c53131;
  --ddb-red-fill-hi:#d13838;
  --ddb-red-deep: #8a1f1f;
  --ddb-success: #4caf7a;
  --ddb-warning: #e6a93a;
  --ddb-danger: #f26a6a;
  --ddb-info: #5ba8d6;
  --book-parchment: #fdf1dc;
  --book-parchment-2: #f4e4c1;
  --book-rule: #922610;
  --book-ink: #58180d;
  --book-text: #2a1c14;
  --book-amber: #e69a28;
  --font-ui: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --font-book-head: "Cormorant SC", "Spectral SC", Georgia, serif;
  --font-book: "Source Sans 3", "Roboto", system-ui, sans-serif;
  --font-prose: "Source Serif 4", "Crimson Pro", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-data: 4px;
  --r-tile: 12px;
  --r-pill: 999px;
  --target: 44px;
  --bg-deep: var(--ddb-ink);
  --bg-panel: var(--ddb-surface-1);
  --bg-panel-alt: var(--ddb-surface-2);
  --bg-panel-2: var(--ddb-surface-2);
  --bg-hover: var(--ddb-surface-3);
  --bg-sunken: var(--ddb-sunken);
  --border: var(--ddb-hairline-soft);
  --border-soft: var(--ddb-hairline-soft);
  --border-bright: var(--ddb-hairline);
  --text-primary: var(--ddb-text);
  --text: var(--ddb-text);
  --text-muted: var(--ddb-text-muted);
  --text-dim: var(--ddb-text-muted);
  --text-faint: var(--ddb-text-faint);
  --text-secondary: var(--ddb-text-muted);
  --text-error: var(--ddb-danger);
  --accent: var(--ddb-red-text);
  --accent-hi: #ff8585;
  --accent-dk: var(--ddb-red-deep);
  --accent-fill: var(--ddb-red-fill);
  --accent-fill-hi: var(--ddb-red-fill-hi);
  --on-accent: #ffffff;
  --accent-glow: rgba(247, 59, 59, 0.16);
  --accent-active: var(--ddb-red-fill);
  --accent-active-glow: rgba(247, 59, 59, 0.2);
  --gold: var(--ddb-red-text);
  --gold-bright: var(--ddb-text);
  --gold-deep: var(--ddb-hairline);
  --gold-glow: rgba(247, 59, 59, 0.16);
  --danger: var(--ddb-danger);
  --danger-glow: rgba(242, 106, 106, 0.18);
  --crit: var(--ddb-warning);
  --crit-glow: rgba(230, 169, 58, 0.28);
  --fail: var(--ddb-danger);
  --fail-glow: rgba(242, 106, 106, 0.24);
  --roll-border: var(--ddb-hairline-soft);
  --roll-border-soft: var(--ddb-hairline-soft);
  --roll-text-dim: var(--ddb-text-muted);
  --roll-text-faint: var(--ddb-text-faint);
  --mono: var(--font-mono);
  --radius-sm: var(--r-data);
  --radius-md: var(--r-data);
  --radius-lg: var(--r-tile);
  --transition: 120ms ease;
  --focus: 2px solid var(--ddb-text);
}

:root[data-theme=light] {
  color-scheme: light;
  --ddb-ink: #f6f4f0;
  --ddb-surface-1: #ffffff;
  --ddb-surface-2: #f0ede7;
  --ddb-surface-3: #e6e2da;
  --ddb-sunken: #ebe8e1;
  --ddb-hairline: #cfc9be;
  --ddb-hairline-soft: #ded9cf;
  --ddb-text: #1b1b1d;
  --ddb-text-muted: #55555c;
  --ddb-text-faint: #6c6c74;
  --ddb-red-text: #c53131;
  --accent-hi: #a82626;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
:root {
  --header-h: 2.75rem;
  --rail-w: 15rem;
  --tabbar-h: 2.25rem;
  --status-h: 1.75rem;
}

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

html, body, #root {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.3rem 0.55rem;
  transition: color var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
button:hover {
  color: var(--text-primary);
  border-color: var(--border-bright);
  background: var(--bg-hover);
}
button.primary {
  background: var(--accent-active);
  color: white;
  border-color: transparent;
}
button.primary:hover {
  filter: brightness(1.1);
}
button.ghost-accent {
  color: var(--accent);
  border-color: var(--border);
}
button.ghost-accent:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}
button.icon {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
}
button.danger {
  color: var(--text-error);
  border-color: var(--border);
}
button.danger:hover {
  color: var(--text-error);
  border-color: var(--text-error);
  background: rgba(242, 106, 106, 0.1);
}

input, textarea, select {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: inherit;
  font-size: inherit;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent-active);
}

.app {
  display: grid;
  grid-template-rows: var(--header-h) 1fr var(--status-h);
  height: 100%;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.85rem;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
}
.app-header button {
  flex-shrink: 0;
}
.app-header .brand {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.03rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-decoration: none;
}
.app-header a.brand:hover {
  filter: brightness(1.15);
}
.app-header .crumb {
  color: var(--text-faint);
  font-size: 0.85rem;
}
.app-header .doc-name {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  padding: 0.25rem 0.45rem;
  font-size: 0.95rem;
  min-width: 14rem;
}
.app-header .doc-name:hover {
  border-color: var(--border);
}
.app-header .doc-name:focus {
  border-color: var(--accent-active);
  background: var(--bg-sunken);
}
.app-header .doc-version {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.app-header .spacer {
  flex: 1;
}
.app-header .actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

@media (max-width: 1180px) {
  .app-header .crumb,
  .app-header .doc-version {
    display: none;
  }
  .app-header .doc-name {
    min-width: 9rem;
  }
}
.workspace {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr var(--preview-w, 38rem);
  min-height: 0;
  overflow: hidden;
}
.workspace.layout-tabbed {
  grid-template-columns: var(--rail-w) 1fr;
}
.workspace.resizing-preview {
  user-select: none;
  cursor: ew-resize;
}

.rail {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.rail-section {
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.rail-section.grow {
  flex: 1;
  overflow: hidden;
}

.rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem 0.4rem;
  font-family: var(--font-head);
  font-size: 0.798rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.rail-header .count {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  letter-spacing: 0;
}

.rail-body {
  padding: 0 0.4rem 0.6rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  user-select: none;
  border: 1px solid transparent;
}
.file-row:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.file-row.active {
  background: var(--bg-panel-alt);
  color: var(--text-primary);
  border-color: var(--border);
}
.file-row .ext {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  color: var(--bg-deep);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.file-row .ext.html {
  background: #e89a4a;
}
.file-row .ext.css {
  background: #5eb0ef;
}
.file-row .ext.js {
  background: #d4c25c;
}
.file-row .meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-faint);
}
.file-row .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-active);
  margin-left: 0.25rem;
  opacity: 0;
  transition: opacity var(--transition);
}
.file-row.dirty .dot {
  opacity: 1;
}

.snippets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  padding: 0 0.25rem;
}

.snippet {
  background: var(--bg-panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-primary);
  cursor: grab;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
  transition: all var(--transition);
}
.snippet:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}
.snippet .ttl {
  font-weight: 500;
  letter-spacing: 0.02em;
}
.snippet .tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-faint);
}
.snippet:hover .tag {
  color: var(--accent);
  opacity: 0.8;
}

.rail-help {
  font-size: 0.7rem;
  color: var(--text-faint);
  padding: 0.6rem 0.25rem 0;
  line-height: 1.5;
}
.rail-help .key {
  color: var(--accent);
}
.rail-help code {
  font-family: var(--mono);
}

.rail-bindings {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0 0.25rem;
  font-size: 0.8rem;
}
.rail-bindings .row {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}
.rail-bindings .v {
  font-family: var(--mono);
}
.rail-bindings .v.tops {
  color: var(--accent);
}
.rail-bindings .v.repeats {
  color: var(--accent-active);
}
.rail-bindings .v.rolls {
  color: var(--text-primary);
}

.editor-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-deep);
}

.tabbar {
  display: flex;
  align-items: stretch;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  height: var(--tabbar-h);
  flex-shrink: 0;
}
.tabbar .actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.5rem;
}
.tabbar .actions button {
  color: var(--text-faint);
  font-size: 0.78rem;
  height: 1.6rem;
}

.tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  border-right: 1px solid var(--border);
  border-bottom: 2px solid transparent;
  user-select: none;
  position: relative;
}
.tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.tab.active {
  color: var(--text-primary);
  background: var(--bg-deep);
  border-bottom-color: var(--accent);
}
.tab .ext {
  font-family: var(--mono);
  font-size: 0.6rem;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  color: var(--bg-deep);
  font-weight: 600;
}
.tab .ext.html {
  background: #e89a4a;
}
.tab .ext.css {
  background: #5eb0ef;
}
.tab .ext.js {
  background: #d4c25c;
}
.tab .dirty-dot {
  color: var(--accent);
  font-size: 0.7rem;
}

@media (max-width: 1280px) {
  .tabbar .actions {
    display: none;
  }
  .tab {
    padding: 0 0.6rem;
  }
  .tab .ext {
    display: none;
  }
}
.editor {
  flex: 1;
  display: grid;
  grid-template-columns: 3rem 1fr;
  min-height: 0;
  min-width: 0;
  position: relative;
  background: var(--bg-deep);
  overflow: hidden;
}

.line-numbers {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-faint);
  padding: 0.75rem 0.5rem 0.75rem 0;
  text-align: right;
  user-select: none;
  background: var(--bg-deep);
  border-right: 1px solid var(--border);
  overflow: hidden;
  line-height: 1.55;
}
.line-numbers div {
  height: 19.375px;
}

.editor-text {
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.editor-text pre,
.editor-text textarea,
.editor-text code {
  margin: 0;
  padding: 0.75rem 1rem;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.55;
  letter-spacing: 0;
  word-spacing: 0;
  white-space: pre;
  tab-size: 2;
  -moz-tab-size: 2;
  text-rendering: auto;
  -webkit-text-size-adjust: 100%;
  box-sizing: border-box;
}
.editor-text pre,
.editor-text textarea {
  position: absolute;
  inset: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}
.editor-text pre {
  pointer-events: none;
  color: var(--text-primary);
}
.editor-text code {
  display: block;
  padding: 0;
  background: transparent;
  white-space: pre;
}
.editor-text textarea {
  background: transparent;
  border: none;
  color: transparent;
  caret-color: var(--accent);
  resize: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.editor-text textarea::selection {
  background: rgba(247, 59, 59, 0.35);
}

.token.tag, .token.keyword {
  color: #e89a4a;
}

.token.attr-name {
  color: #5eb0ef;
}

.token.attr-value, .token.string {
  color: var(--accent);
}

.token.punctuation {
  color: var(--text-muted);
}

.token.comment {
  color: var(--text-faint);
  font-style: italic;
}

.token.number, .token.boolean {
  color: #9a8df0;
}

.token.function {
  color: #d4c25c;
}

.token.selector {
  color: #e89a4a;
}

.token.property {
  color: #5eb0ef;
}

.token.operator {
  color: var(--text-muted);
}

.preview-pane {
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
}

.preview-resize {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -3px;
  width: 6px;
  cursor: ew-resize;
  z-index: 5;
  background: transparent;
  transition: background var(--transition);
}
.preview-resize:hover, .workspace.resizing-preview .preview-resize {
  background: var(--accent-active-glow);
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  height: var(--tabbar-h);
  flex-shrink: 0;
}
.preview-header .title {
  font-family: var(--font-head);
  font-size: 0.821rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.preview-header .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4caf7a;
  animation: pulse 2s ease-in-out infinite;
}
.preview-header .spacer {
  flex: 1;
}
.preview-header .seg {
  display: flex;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.preview-header .seg button {
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  border-radius: 3px;
  height: auto;
}
.preview-header .seg button.active {
  background: var(--bg-panel-alt);
  color: var(--text-primary);
  border-color: var(--border-bright);
}

@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}
.preview-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  justify-content: center;
  padding: 1rem;
  background: var(--bg-deep);
}

.preview-frame {
  background: var(--book-parchment);
  color: var(--book-text);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-bright);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  transition: max-width var(--transition);
  align-self: flex-start;
}
.preview-frame.width-mobile {
  max-width: 380px;
}
.preview-frame.width-tablet {
  max-width: 640px;
}
.preview-frame iframe {
  width: 100%;
  min-height: 760px;
  display: block;
  background: transparent;
  border: 0;
}

.inspector {
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  height: var(--inspector-h, 40%);
  min-height: 2.25rem;
  max-height: 90%;
  transition: height 140ms ease;
}
.inspector.collapsed {
  height: 2.25rem !important;
  min-height: 2.25rem;
}
.inspector.collapsed .inspector-body, .inspector.collapsed .inspector-resize {
  display: none;
}
.inspector.resizing {
  transition: none;
}

.inspector-resize {
  position: absolute;
  left: 0;
  right: 0;
  top: -3px;
  height: 6px;
  cursor: ns-resize;
  z-index: 2;
  background: transparent;
  transition: background var(--transition);
}
.inspector-resize:hover, .inspector.resizing .inspector-resize {
  background: var(--accent-active-glow);
}

.inspector-head .toggle {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.inspector-head .toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-bright);
  background: var(--bg-hover);
}

.inspector-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.inspector-head .title {
  font-family: var(--font-head);
  font-size: 0.821rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.inspector-head .spacer {
  flex: 1;
}
.inspector-head .badge {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.inspector-body {
  overflow-y: auto;
  padding: 0.5rem 0.75rem 0.75rem;
}

.attr-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 0.75rem;
}
.attr-group .gh {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.attr-group .gh .line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.attr-row {
  display: grid;
  grid-template-columns: 1fr 6.5rem auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}
.attr-row:hover {
  background: var(--bg-panel-alt);
}
.attr-row .nm {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-primary);
}
.attr-row .nm .prefix {
  color: var(--text-faint);
}
.attr-row input {
  padding: 0.2rem 0.4rem;
  width: 100%;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.attr-row .src {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-faint);
}

.repeating-group {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  margin-bottom: 0.6rem;
}
.repeating-group .gh {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent-active);
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.repeating-group .gh .line {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.repeating-group .add {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--accent-active);
  width: 100%;
  border: 1px dashed var(--border);
}
.repeating-group .add:hover {
  border-color: var(--accent-active);
  background: var(--accent-active-glow);
  color: var(--accent-active);
}

.repeating-row {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  gap: 0.4rem;
  align-items: center;
  padding: 0.25rem 0.2rem;
  border-bottom: 1px solid var(--border);
}
.repeating-row:last-child {
  border-bottom: none;
}
.repeating-row .idx {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  text-align: center;
}
.repeating-row .summary {
  font-size: 0.8rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.repeating-row .summary .k {
  color: var(--text-muted);
  margin-right: 0.4rem;
}
.repeating-row button.del {
  color: var(--text-faint);
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
}
.repeating-row button.del:hover {
  color: var(--text-error);
  border-color: var(--text-error);
  background: transparent;
}

.status {
  height: var(--status-h);
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  gap: 1rem;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-faint);
}
.status .pill {
  color: var(--text-muted);
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}
.status .pill b {
  color: var(--text-primary);
  font-weight: 500;
}
.status .spacer {
  flex: 1;
}
.status .ok {
  color: #4caf7a;
}
.status .warn {
  color: var(--accent);
}
.status .err {
  color: var(--text-error);
}

.rollfeed {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  pointer-events: none;
  z-index: 30;
}

.roll-toast {
  background: rgba(18, 18, 18, 0.92);
  border: 1px solid var(--border-bright);
  border-left: 3px solid var(--accent-active);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-primary);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  max-width: 22rem;
  animation: rollin 220ms ease;
}
.roll-toast .name {
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 0.798rem;
  letter-spacing: 0.06em;
}
.roll-toast .result {
  font-size: 1rem;
  font-weight: 500;
}
.roll-toast .expr {
  color: var(--text-muted);
  font-size: 0.68rem;
}

@keyframes rollin {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.14);
  background-clip: content-box;
  border: 2px solid transparent;
}

.modal-veil {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  width: 28rem;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal h2 {
  margin: 0;
  padding: 0.75rem 1rem;
  font-family: var(--font-head);
  font-size: 0.969rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
}
.modal .modal-body {
  padding: 0.75rem 1rem;
  overflow-y: auto;
  flex: 1;
}
.modal .modal-footer {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
}
.modal .sheet-pick-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.modal .sheet-pick-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.85rem;
  user-select: none;
}
.modal .sheet-pick-list li:hover {
  background: var(--bg-hover);
}
.modal .sheet-pick-list li .id {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-faint);
}
.modal .modal-empty {
  color: var(--text-faint);
  font-style: italic;
  padding: 1rem 0.5rem;
  text-align: center;
}

.toast {
  position: fixed;
  bottom: calc(var(--status-h) + 0.6rem);
  right: 1rem;
  background: var(--bg-panel-alt);
  border: 1px solid var(--border-bright);
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-primary);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  z-index: 40;
  animation: rollin 220ms ease;
}
.toast.toast--error {
  border-left-color: var(--text-error);
}
.toast.toast--ok {
  border-left-color: #4caf7a;
}