.dice-stats-shell {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  align-items: start;
}

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

.dice-stats-card h2 {
  margin-top: 0;
}

.dice-stats-field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.dice-stats-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d7ddeb;
  border-radius: 12px;
  font-size: 1.05rem;
  background: #fff;
}

.dice-stats-input:focus {
  outline: 2px solid #0b57d0;
  outline-offset: 2px;
}

.dice-stats-error {
  color: #c62828;
  font-size: 0.9rem;
  margin-top: 4px;
}

.dice-stats-toggle {
  display: inline-flex;
  border: 1px solid #d7ddeb;
  border-radius: 12px;
  background: #f7f9ff;
  overflow: hidden;
}

.dice-stats-toggle button {
  border: none;
  background: transparent;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  color: #1f2a44;
  transition: background 0.15s ease, color 0.15s ease;
}

.dice-stats-toggle button + button {
  border-left: 1px solid #d7ddeb;
}

.dice-stats-toggle button.is-active {
  background: linear-gradient(135deg, #0b57d0, #0a46aa);
  color: #fff;
}

.dice-stats-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}

.dice-stats-chip {
  border: 1px solid #d7ddeb;
  background: #fff;
  color: #0b264f;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.dice-stats-chip:hover,
.dice-stats-chip:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(11, 87, 208, 0.15);
}

.dice-stats-chip.is-active {
  background: #0b57d0;
  color: #fff;
  border-color: #0b57d0;
}

.dice-stats-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.dice-stats-actions button {
  min-width: 140px;
}

.dice-stats-steps {
  margin: 10px 0 0;
  padding-left: 1.2rem;
  color: #465069;
  display: grid;
  gap: 6px;
}

.dice-stats-steps li strong {
  display: block;
  font-size: 0.95rem;
}

.dice-stats-query {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.dice-stats-result {
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(145deg, #0f172a, #0a3c8a);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.dice-stats-result .big {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 800;
  margin: 4px 0;
}

.dice-stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.dice-stats-pill {
  padding: 12px;
  border: 1px solid #d7ddeb;
  border-radius: 12px;
  background: #fff;
}

.dice-stats-pill .label {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #4b5563;
}

.dice-stats-pill .value {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}

.dice-stats-pill .muted {
  display: block;
  margin-top: 4px;
  font-size: 0.9rem;
  color: #6b7280;
}

.dice-stats-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dice-stats-mode {
  background: #f3f6ff;
  color: #0b264f;
  border: 1px solid #d7ddeb;
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 700;
}

.dice-stats-canvas {
  width: 100%;
  height: 260px;
  border: 1px solid #d7ddeb;
  border-radius: 12px;
  background: #ffffff;
}

.dice-stats-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: #4b5563;
}

.dice-stats-table {
  margin-top: 10px;
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

.dice-stats-table th,
.dice-stats-table td {
  border: 1px solid #e5e7eb;
  padding: 8px;
  text-align: left;
}

.dice-stats-share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dice-stats-share button {
  flex: 1 1 180px;
}

.dice-stats-status {
  margin-top: 8px;
  color: #0b57d0;
  font-weight: 700;
}

.dice-stats-history {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.dice-stats-history li {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.dice-stats-history button {
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: #0f172a;
}

.dice-stats-history .meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
  color: #6b7280;
}

.dice-stats-history .expr {
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
  font-weight: 700;
  margin-top: 4px;
}

.dice-stats-history .prob {
  color: #0b57d0;
  font-weight: 700;
}

.dice-stats-muted {
  color: #6b7280;
}

.muted {
  color: #6b7280;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
