.toggle-divider {
  width: 1px;
  align-self: stretch;
  background: var(--ui-border-strong);
  margin: 0 4px;
}
.dashboard-toggle:hover {
  background: var(--ui-bg-alt);
}
.dashboard-toggle input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}
.dashboard-toggle-label {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: var(--ui-fg);
}
.dashboard-toggle-warning {
  font-family: 'MedievalSharp', serif;
  font-size: 0.65rem;
  color: var(--ui-danger);
  font-weight: 600;
  visibility: hidden;
}
.dashboard-toggle input[type="checkbox"]:checked ~ .dashboard-toggle-warning {
  visibility: visible;
}
.dashboard-weapons {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--ui-border);
}
.dashboard-weapons-label {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ui-fg-strong);
  margin-bottom: 6px;
}
.dashboard-weapons-table {
  width: 100%;
  border-collapse: collapse;
}
.dashboard-weapons-table th {
  background: var(--ui-bg-alt);
  color: var(--ui-fg);
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid var(--ui-border);
}
.dashboard-weapons-table td {
  color: var(--ui-fg);
  font-family: 'MedievalSharp', serif;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-bottom: 1px solid var(--ui-border);
}
.dashboard-weapons-table tbody tr:hover td {
  background: var(--ui-bg-alt);
}
.sheet-container {
  display: grid;
  grid-template-columns: minmax(320px, 620px) 1fr;
  align-items: start;
  gap: 20px;
}
.sheet-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.stats-section-header,
.skills-section-header,
.equipment-section-header {
  margin-top: 0;
  margin-bottom: 0;
}
.sheet-column-right .skills-section-header {
  margin-top: -8px;
}
.equipment-section-header,
.coin-purse-panel,
.equipment-grid,
#weaponsCatalogDetails {
  grid-column: 1 / -1;
}
.panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 40%),
    var(--ui-bg);
  border: 1px solid var(--ui-border-strong);
  border-top: 3px solid var(--ui-border-strong);
  border-radius: 2px;
  padding: 20px;
  box-shadow:
    0 1px 3px rgba(0,0,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.4);
  position: relative;
}
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap table {
  min-width: 0;
  width: 100%;
}
.sheet-container table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  border: none;
}
.sheet-container th,
.sheet-container td {
  border: none;
  border-bottom: 1px solid var(--rule-color);
  padding: 9px 10px;
  vertical-align: middle;
}
.sheet-container td + td,
.sheet-container th + th {
  border-left: 1px solid rgba(92, 64, 48, 0.1);
}
.sheet-container th {
  background: var(--ink);
  color: var(--parchment-dark);
  font-family: 'Uncial Antiqua', 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  border-bottom: 2px solid var(--ink);
  position: relative;
}
.sheet-container th + th {
  border-left: 1px solid rgba(244, 228, 193, 0.15);
}
.sheet-container td {
  background: transparent;
}
.sheet-container tr:nth-child(even) td {
  background: rgba(232, 212, 168, 0.18);
}
.sheet-container tr:hover td {
  background: rgba(201, 162, 39, 0.12);
}
.sheet-container tbody tr:last-child td {
  border-bottom: 2px solid var(--rule-heavy);
}
.skills-category-table td:nth-child(1),
.skills-category-table th:nth-child(1) {
  max-width: 20ch;
  white-space: normal;
  text-align: right;
}
.skills-category-table td:nth-child(2) {
  width: 1px;
  white-space: nowrap;
  text-align: center;
  padding: 4px 2px;
}
.skills-category-table td:nth-child(2) .input-stat {
  font-size: 0.75rem;
  text-align: center;
  color: var(--ink-faint);
  min-width: 0;
  width: 5ch;
  padding: 4px 2px;
}
.skills-category-table td:nth-child(3),
.skills-category-table td:nth-child(4),
.skills-category-table td:nth-child(6) {
  white-space: nowrap;
  text-align: center;
  width: 1px;
}
.skills-category-table th:nth-child(2),
.skills-category-table th:nth-child(3),
.skills-category-table th:nth-child(4),
.skills-category-table th:nth-child(5),
.skills-category-table th:nth-child(6) {
  white-space: nowrap;
  text-align: center;
  width: 1px;
  padding: 9px 2px;
}
.skills-category-table td:nth-child(4) strong {
  font-family: 'MedievalSharp', serif;
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 700;
}
@keyframes arcane-shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.skills-category-table td:nth-child(4) strong.spell-energy-total {
  font-size: 1.3rem;
}
.skills-category-table td:nth-child(4) strong.spell-energy-total,
#current-spell-points,
#derived-spell-points-table {
  background: linear-gradient(270deg, #bfa7ff, #8d73f1, #6c4cfd, #624ec9, #9072e2);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: arcane-shimmer 6s ease infinite;
  text-shadow:
    0 1px 1px rgba(0, 0, 0, 0.25),
    0 -1px 0 rgba(255, 255, 255, 0.2);
}
#current-spell-points {
  font-family: 'MedievalSharp', serif;
  font-size: 1.5rem;
  font-weight: 700;
  width: 3em;
  text-align: right;
  padding-right: 4px;
  min-width: 0;
  padding-left: 0;
}
.skills-category-table td:nth-child(5) {
  white-space: nowrap;
  text-align: center;
  width: 1px;
  padding: 4px 2px;
}
.skills-category-table td:nth-child(5) .cost-input {
  width: 2.2em;
  min-width: 2.2em;
  font-size: 0.8rem;
  padding: 0;
}
#statsTable {
  table-layout: fixed;
}
#statsTable td:nth-child(1),
#statsTable th:nth-child(1) {
  width: 14ch;
  text-align: right;
}
#statsTable td:nth-child(2),
#statsTable td:nth-child(3),
#statsTable td:nth-child(4),
#statsTable td:nth-child(5) {
  white-space: nowrap;
  text-align: center;
  width: 3ch;
}
#statsTable th:nth-child(2),
#statsTable th:nth-child(3),
#statsTable th:nth-child(4),
#statsTable th:nth-child(5) {
  white-space: nowrap;
  text-align: center;
  width: 3ch;
}
#statsTable th:nth-child(5),
#statsTable td:nth-child(5),
.skills-category-table th:nth-child(6),
.skills-category-table td:nth-child(6) {
  width: 1px;
  padding: 2px 2px;
  max-width: 30px;
}
#derivedStatsTable,
#modifiersTable {
  table-layout: fixed;
}
#modifiersTable td:nth-child(3),
#modifiersTable th:nth-child(3) {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
#statsTable input[data-field="value"] {
  font-style: normal;
}
#statsTable input[data-field="mod"] {
  color: var(--ink);
}
.stat-total {
  font-family: 'MedievalSharp', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  position: relative;
}
.danger-zone-panel {
  border-color: rgba(198, 21, 21, 0.35);
  border-top-color: var(--ui-danger);
  background:
    linear-gradient(180deg, rgba(239, 68, 68, 0.08) 0%, transparent 40%),
    var(--ui-bg);
}
.danger-zone-panel .collapsible-summary h2 {
  color: var(--ui-danger);
}
.danger-zone-body {
  padding-top: 12px;
}
.danger-zone-note {
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  color: var(--ui-fg-muted);
  margin: 0 0 12px 0;
}
.danger-zone-actions {
  display: flex;
  justify-content: flex-start;
}
.cost-input {
  font-family: 'MedievalSharp', serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: #8a7565;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  box-shadow: none;
  display: inline-block;
}
.stat-total::before {
  content: '·';
  color: var(--gold-dark);
  margin-right: 4px;
  font-size: 0.8em;
  opacity: 0.5;
}
.stat-total::after {
  content: '·';
  color: var(--gold-dark);
  margin-left: 4px;
  font-size: 0.8em;
  opacity: 0.5;
}
@media (max-width: 1180px) {
  .sheet-container {
    grid-template-columns: 1fr;
  }
  .sheet-column-right .skills-section-header {
    margin-top: 0;
  }
}
@media (max-width: 760px) {
  .sheet-container th,
  .sheet-container td {
    padding: 6px 6px;
  }
  #statsTable td:nth-child(1),
  #statsTable th:nth-child(1) {
    width: 11ch;
  }
  #statsTable td:nth-child(2),
  #statsTable td:nth-child(3),
  #statsTable td:nth-child(4),
  #statsTable td:nth-child(5),
  #statsTable th:nth-child(2),
  #statsTable th:nth-child(3),
  #statsTable th:nth-child(4),
  #statsTable th:nth-child(5) {
    width: 2.5ch;
  }
}
