/* --- Active value display --- */
.sm-active-value {
  font-size: 0.65rem;
  color: var(--accent-gold);
  font-weight: 600;
  margin-top: 2px;
}
.sm-active-table-btn {
  font-size: 0.7rem;
  padding: 2px 8px;
}
.sm-active-table {
  width: 100%;
  font-size: 0.8rem;
  border-collapse: collapse;
  text-align: center;
}
.sm-active-table th {
  position: sticky;
  top: 0;
  background: var(--el-chaos);
  color: rgba(255, 255, 255, 0.65);
  padding: 6px 4px;
  font-weight: 600;
  border-bottom: 2px solid rgba(255, 255, 255, 0.18);
  z-index: 1;
}
.sm-active-table td {
  padding: 4px 4px;
  border-bottom: 1px solid var(--border-subtle);
}
.sm-active-lv {
  color: #888;
  font-weight: 600;
}
.sm-active-cell {
  color: #000;
}
.sm-active-cell.current {
  background: #0d6efd33;
  color: #fff;
  font-weight: 700;
  outline: 2px solid #0d6efd;
}
.sm-active-cell.disabled {
  background: #3d3d50;
}
.sm-active-desc {
  background: var(--el-chaos);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.87);
  font-size: 0.85rem;
  line-height: 1.45;
}
.sm-active-desc-text {
  color: #e6e6e6;
}
.sm-active-desc-primary {
  color: #0d6efd;
  font-weight: 700;
  background: #0d6efd22;
  padding: 0 4px;
  border-radius: 3px;
}
.sm-active-desc-placeholder {
  color: #c8a84e;
  font-weight: 600;
  background: #c8a84e22;
  padding: 0 4px;
  border-radius: 3px;
  font-family: monospace;
}
.sm-active-desc-secondary {
  color: #7ed957;
  font-weight: 700;
  background: #7ed95722;
  padding: 0 4px;
  border-radius: 3px;
}
.sm-active-desc-constant {
  color: #e6e6e6;
  font-weight: 700;
}
/* Per-placeholder palette — same colors are reused in the grid cells so
   the user can trace a single value's progression down its column. */
.sm-active-color-0 {
  color: #5aa4ff;
} /* primary — blue */
.sm-active-color-1 {
  color: #7ed957;
} /* green */
.sm-active-color-2 {
  color: #ff9966;
} /* orange */
.sm-active-color-3 {
  color: #c8a84e;
} /* gold */
.sm-active-color-4 {
  color: #ce93d8;
} /* purple */
.sm-active-desc-primary.sm-active-color-0 {
  color: #0d6efd;
  background: #0d6efd22;
}
.sm-active-desc-secondary.sm-active-color-1 {
  color: #3fa01a;
  background: #7ed95722;
}
.sm-active-desc-secondary.sm-active-color-2 {
  color: #cc5500;
  background: #ff996622;
}
.sm-active-desc-secondary.sm-active-color-3 {
  color: #8a6f1a;
  background: #c8a84e22;
}
.sm-active-desc-secondary.sm-active-color-4 {
  color: #8e24aa;
  background: #ce93d822;
}
.sm-active-cell-sep {
  color: var(--content-text-muted);
  font-weight: 400;
}
.sm-active-cell.current .sm-active-color-0,
.sm-active-cell.current .sm-active-color-1,
.sm-active-cell.current .sm-active-color-2,
.sm-active-cell.current .sm-active-color-3,
.sm-active-cell.current .sm-active-color-4 {
  color: inherit;
}
.sm-active-desc-hint {
  font-size: 0.7rem;
  color: #888;
  margin-top: 6px;
}
.sm-active-desc-timing {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #333;
  font-size: 0.8rem;
}
.sm-active-desc-timing-item {
  color: #ddd;
  font-weight: 600;
}
.sm-active-desc-timing-label {
  color: #888;
  font-weight: 500;
  margin-right: 4px;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

/* ===== Shareable snapshot view ===== */

.sm-share-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--accent-gold, #d4a937);
  background: var(--surface-800, #252220);
  border-radius: 8px;
  color: #f5f5f5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.sm-share-banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1 1 auto;
  min-width: 0;
}

.sm-share-banner-text > span:first-child {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--accent-gold-light, #f5d77a);
}

.sm-share-banner-meta {
  font-size: 0.8rem;
  color: #d6d2cc;
}

.sm-share-banner-cta {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  background: var(--accent-gold-light, #f5d77a);
  color: #1a1a1a !important;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s ease;
}

.sm-share-banner-cta:hover {
  transform: translateY(-1px);
}

@media (max-width: 480px) {
  .sm-share-banner {
    padding: 0.6rem 0.8rem;
  }
  .sm-share-banner-text > span:first-child {
    font-size: 0.95rem;
  }
}

/* Read-only mode: hide editing chrome on the SM tab */
body.sm-share-readonly #mainTabs,
body.sm-share-readonly #smTrackerActions,
body.sm-share-readonly #smToggleBtn,
body.sm-share-readonly #smMaxAllBtn,
body.sm-share-readonly #smShareBtn {
  display: none !important;
}

/* Hide the per-card overlay control row (unlock toggle, exclusion checkboxes) */
body.sm-share-readonly .sm-card-controls,
body.sm-share-readonly .sm-card-exclusions {
  display: none !important;
}

/* Render number inputs in cards as plain text */
body.sm-share-readonly .sm-card input[type='number'] {
  pointer-events: none;
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
  text-align: inherit;
  -moz-appearance: textfield;
  appearance: textfield;
}

body.sm-share-readonly .sm-card input[type='number']::-webkit-outer-spin-button,
body.sm-share-readonly .sm-card input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Read-only essence panel below the SM grid in share view */
.sm-share-essence-panel {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px solid rgba(245, 215, 122, 0.25);
  background: rgba(20, 20, 30, 0.4);
  border-radius: 8px;
  color: #ddd;
}

.sm-share-essence-panel h6 {
  font-size: 0.95rem;
  margin: 0 0 0.6rem 0;
  color: var(--accent-gold-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sm-share-essence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem 1rem;
}

.sm-share-essence-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.2rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
}

.sm-share-essence-row .label {
  text-transform: capitalize;
  opacity: 0.85;
}

.sm-share-essence-row .value {
  font-weight: 600;
  color: #fff;
}

.sm-share-essence-section + .sm-share-essence-section {
  margin-top: 0.75rem;
}

.sm-share-error {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(220, 53, 69, 0.5);
  background: rgba(220, 53, 69, 0.12);
  color: #ffb3b3;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* 404 / not-found state in share view */
.sm-share-not-found {
  text-align: center;
  padding: 3rem 1rem;
  color: #ddd;
}

.sm-share-not-found h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--accent-gold-light);
}

.sm-share-not-found p {
  opacity: 0.8;
  margin-bottom: 1.25rem;
}

.sm-share-not-found a {
  color: #1a1a1a;
  background: var(--accent-gold-light);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
}
