@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

#awsheet-app {
  --bg-body: #0d0d0d;
  --bg-sheet: rgba(23, 23, 23, 0.3);
  --border-color: #2e2e2e;
  --text-main: #e0e0e0;
  --text-muted: #888888;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-red: #ef4444;
  --font-main: 'Inter', sans-serif;
  
  --order-gold-color: #dac9a0;
  --order-gold-selection: rgba(218, 201, 160, 0.3);

  background-color: transparent;
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.5;
  min-height: 100vh;
}

/* Hide number input spinners globally for the sheet */
#awsheet-app input[type="number"]::-webkit-outer-spin-button,
#awsheet-app input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#awsheet-app input[type="number"] {
  -moz-appearance: textfield;
}

#awsheet-app .awsheet-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

#awsheet-app .awsheet {
  background: var(--bg-sheet);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 50px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Firefox performance fix: backdrop-filter is very slow in Mozilla */
@-moz-document url-prefix() {
  #awsheet-app .awsheet {
    backdrop-filter: none;
    background: rgba(23, 23, 23, 0.75);
  }
  #avatar-menu-modal {
    backdrop-filter: none !important;
  }
}

#awsheet-app .awsheet-header {
  text-align: center;
  margin-bottom: 20px;
}
#awsheet-app .awsheet-header h1 {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 0;
  
  background: linear-gradient(to right, #8b5cf6 0%, #e879f9 30%, #fdf3d1 70%, #a88143 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.3)); /* Soft atmospheric glow */
}

#awsheet-app .sheet-top {
  display: grid;
  grid-template-columns: 1fr 260px 1fr;
  align-items: stretch;
  gap: 20px;
  margin-bottom: 45px;
}
#awsheet-app .left-panel,
#awsheet-app .avatar-block,
#awsheet-app .right-panel {
  min-height: 0;
  height: 100%;
}
#awsheet-app .sheet-bottom {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin-bottom: 12px;
}

/* Notes row: three equal columns below everything */
#awsheet-app .sheet-notes-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin-bottom: 15px;
}
#awsheet-app .sheet-notes-panel {
  display: flex;
  flex-direction: column;
}
#awsheet-app .sheet-notes-panel textarea {
  min-height: 80px;
  height: 80px;
  resize: none;
  overflow: hidden;
}

/* In view mode, notes fields keep their background to look like content blocks */
#awsheet-app.view-mode .sheet-notes-panel textarea {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: none !important;
  pointer-events: none;
}
@media (max-width: 1100px) {
  #awsheet-app .sheet-top, #awsheet-app .sheet-bottom, #awsheet-app .sheet-notes-row { grid-template-columns: 1fr; }
  #awsheet-app .sheet-top { display: flex; flex-direction: column; gap: 15px; }
  #awsheet-app .left-panel,
  #awsheet-app .right-panel { display: contents; }
  
  #awsheet-app .mobile-order-1 { order: 1; }
  #awsheet-app .mobile-order-2 { order: 2; }
  #awsheet-app #species-age-row { order: 3; }
  #awsheet-app .mobile-order-4 { order: 4; }
  #awsheet-app .mobile-order-5 { order: 5; }
  #awsheet-app .mobile-order-6 { order: 6; }
  #awsheet-app .mobile-order-7 { order: 7; }
  #awsheet-app .avatar-block { order: 99; margin: 15px 0; min-height: auto; }
  #awsheet-app .avatar-block .avatar-frame {
    aspect-ratio: 1 / 1;
    width: 100%;
    height: auto !important;
    min-height: 0;
  }
  
  #awsheet-app .awsheet { padding: 20px; }
}

#awsheet-app .panel {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}
#awsheet-app .panel-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#awsheet-app .field { margin-bottom: 8px; }
#awsheet-app .field-row { display: flex; gap: 15px; margin-bottom: 8px; }

/* --- Mode Toggle --- */
.mode-toggle {
  display: flex;
  background: #111;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
}
.mode-option {
  padding: 8px 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: 0.2s;
}
.mode-option.active {
  color: #fff;
  background: var(--accent-blue);
}

#awsheet-app .field label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  font-weight: 500;
}

#awsheet-app .input-styled {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 0;
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
  border-radius: 0;
}
#awsheet-app .input-styled:focus {
  outline: none;
  border-bottom-color: #d1b5b8;
}

/* Mystic spell base points inline input */
#awsheet-app .spell-pts-direct-input {
  width: 38px;
  background: transparent;
  border: none;
  border-bottom: 2px solid #a89070;
  border-radius: 0;
  color: #dac9a0;
  font-weight: bold;
  font-family: var(--font-main);
  font-size: 0.95rem;
  text-align: center;
  padding: 0 2px 2px;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
#awsheet-app .spell-pts-direct-input:focus {
  outline: none;
  border-bottom-color: #d1b5b8;
}

#awsheet-app textarea.input-styled {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 8px;
  min-height: 80px;
  resize: none;
  overflow: hidden;
  line-height: 1.5;
}
#awsheet-app .restricted-ta {
  resize: vertical;
  overflow: auto;
  min-height: 96px;
  height: 96px;
  max-height: 400px;
}
#awsheet-app textarea#char-competences,
#awsheet-app textarea#char-info {
  min-height: 140px;
}
#awsheet-app textarea.restricted-ta {
  padding: 8px 8px 0 8px;
}
#awsheet-app textarea.single-line-ta {
  min-height: 0;
  padding: 4px 0;
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  resize: none;
  overflow: hidden;
}
#awsheet-app textarea.input-styled:focus {
  border-color: #d1b5b8;
}

/* Principle Checkboxes Block */
#awsheet-app .principle-checkboxes-block {
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
  margin-bottom: 5px;
}

#awsheet-app .avatar-frame {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}
#awsheet-app .avatar-frame:hover { border-color: var(--text-muted); }
#awsheet-app .avatar-frame img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  display: none;
}
#awsheet-app .avatar-placeholder {
  color: var(--text-muted);
  text-align: center;
  font-size: 0.85rem;
}

#awsheet-app .principle-group { margin-bottom: 12px; }
#awsheet-app .principle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}
#awsheet-app .principle-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: help;
  transition: all 0.2s ease;
}
#awsheet-app .principle-label:hover {
  color: #fff !important;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.4);
}

/* Competency rows */
#awsheet-app .competency-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
#awsheet-app .competency-row input[type="text"] { flex: 1; }
#awsheet-app .competency-row .btn-remove { flex-shrink: 0; }

/* Points bar */
#awsheet-app.view-mode #points-bar { display: none !important; }
#awsheet-app.view-mode #btn-add-competency { display: none !important; }
#awsheet-app.view-mode .competency-row .btn-remove { display: none !important; }
#awsheet-app .principle-boxes {
  display: flex;
  gap: 8px;
}
#awsheet-app .principle-cb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-color);
  background: transparent;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}
#awsheet-app .principle-cb:hover { border-color: var(--text-muted); }
#awsheet-app .principle-cb:checked::before {
  content: "";
  position: absolute;
  top: 3px; left: 3px; right: 3px; bottom: 3px;
  border-radius: 1px;
}
#awsheet-app .principle-row.evolution .principle-cb:nth-child(1):checked { border-color: #486a57; }
#awsheet-app .principle-row.evolution .principle-cb:nth-child(1):checked::before { background: #486a57; }
#awsheet-app .principle-row.evolution .principle-cb:nth-child(2):checked { border-color: #729382; }
#awsheet-app .principle-row.evolution .principle-cb:nth-child(2):checked::before { background: #729382; }
#awsheet-app .principle-row.evolution .principle-cb:nth-child(3):checked { border-color: #9dbcad; }
#awsheet-app .principle-row.evolution .principle-cb:nth-child(3):checked::before { background: #9dbcad; }
#awsheet-app .principle-row.evolution .principle-cb:nth-child(4):checked { border-color: #c8e6d8; }
#awsheet-app .principle-row.evolution .principle-cb:nth-child(4):checked::before { background: #c8e6d8; }

#awsheet-app .principle-row.metamorph .principle-cb:nth-child(1):checked { border-color: #6c4b4e; }
#awsheet-app .principle-row.metamorph .principle-cb:nth-child(1):checked::before { background: #6c4b4e; }
#awsheet-app .principle-row.metamorph .principle-cb:nth-child(2):checked { border-color: #957578; }
#awsheet-app .principle-row.metamorph .principle-cb:nth-child(2):checked::before { background: #957578; }
#awsheet-app .principle-row.metamorph .principle-cb:nth-child(3):checked { border-color: #bea0a3; }
#awsheet-app .principle-row.metamorph .principle-cb:nth-child(3):checked::before { background: #bea0a3; }
#awsheet-app .principle-row.metamorph .principle-cb:nth-child(4):checked { border-color: #e7cbce; }
#awsheet-app .principle-row.metamorph .principle-cb:nth-child(4):checked::before { background: #e7cbce; }

#awsheet-app .skill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 10px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  margin-bottom: 0;
}
#awsheet-app .skill-name {
  font-size: 0.95rem;
  color: var(--text-main);
}
#awsheet-app .skill-cost {
  color: var(--text-muted);
  font-size: 0.8rem;
}
#awsheet-app .skill-row.highlighted {
  border: 1px solid rgba(114, 147, 130, 0.4);
  border-radius: 4px;
  background: transparent;
  margin-bottom: 2px;
}
#awsheet-app .skill-row.highlighted .skill-name { color: var(--text-main); }
#awsheet-app .skill-row.error {
  border: 1px solid rgba(239, 68, 68, 0.9);
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.18);
  margin-bottom: 2px;
}
#awsheet-app .skill-row.error .skill-name { color: #ef4444; font-weight: bold; }

/* --- View Mode Overrides --- */
#awsheet-app.view-mode .help-icon,
#awsheet-app.view-mode .btn-add,
#awsheet-app.view-mode .btn-remove,
#awsheet-app.view-mode .image-placeholder,
#awsheet-app.view-mode button[id^="btn-add-"],
#awsheet-app.view-mode #skills-dropdown,
#awsheet-app.view-mode .panel-title input[type="number"],
#awsheet-app.view-mode .cost-item:has(input:placeholder-shown) {
  display: none !important;
}

/* View mode: hide ALL XP distribution elements and buttons */
#awsheet-app.view-mode #exp-point-box,
#awsheet-app.view-mode #btn-distribute-exp,
#awsheet-app.view-mode #xp-progression-banner,
#awsheet-app.view-mode .skill-xp-controls,
#awsheet-app.view-mode .btn-skill-xp-plus,
#awsheet-app.view-mode .btn-skill-xp-minus,
#awsheet-app.view-mode .gift-badge,
#awsheet-app.view-mode .btn-xp-small,
#awsheet-app.view-mode .btn-xp-remove,
#awsheet-app.view-mode .spell-xp-actions,
#awsheet-app.view-mode .spell-dice-btn,
#awsheet-app.view-mode .spell-balance-badge,
#awsheet-app.view-mode .spell-xp-badge,
#awsheet-app.view-mode .xp-acris-picker {
  display: none !important;
}

#awsheet-app.view-mode input[type="text"],
#awsheet-app.view-mode input[type="number"],
#awsheet-app.view-mode textarea,
#awsheet-app.view-mode select {
  border-color: transparent !important;
  background: transparent !important;
  pointer-events: none;
  box-shadow: none !important;
  color: var(--text-main);
  resize: none !important;
}
#awsheet-app.view-mode input::placeholder,
#awsheet-app.view-mode textarea::placeholder {
  color: transparent !important;
}

#awsheet-app.view-mode .avatar-frame {
  cursor: default !important;
  border-color: transparent !important;
}

#awsheet-app.view-mode .token {
  pointer-events: none;
}
#awsheet-app.view-mode .token:not(.active) {
  opacity: 0;
}

#awsheet-app .cost-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
#awsheet-app .cost-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  border-bottom: 1px solid var(--border-color);
  box-sizing: border-box;
  width: 100%;
}
#awsheet-app .cost-item input[type="text"]:not(.spell-pts-direct-input) {
  flex: 1;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
}
#awsheet-app .cost-item input[type="number"] {
  width: 40px;
  text-align: right;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
}
/* Spell base-points input: override cost-item reset to show underline */
#awsheet-app .cost-item .spell-pts-direct-input {
  flex: none !important;
  border: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.18) !important;
  padding: 0 2px 2px !important;
  transition: border-color 0.2s ease;
}
#awsheet-app .cost-item .spell-pts-direct-input:focus {
  outline: none !important;
  border-bottom-color: #d1b5b8 !important;
}
#awsheet-app .cost-item .cost-item-view-text {
  display: none;
}
#awsheet-app .cost-item .view-mode-value {
  display: none;
}

#awsheet-app.view-mode .cost-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 10px;
  border-bottom: 1px solid var(--border-color);
}
#awsheet-app.view-mode .cost-item input[type="text"],
#awsheet-app.view-mode .cost-item input[type="number"] {
  display: none !important;
}
#awsheet-app.view-mode .cost-item .cost-item-view-text {
  display: block;
  flex: 1;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.35;
}
#awsheet-app.view-mode .cost-item .view-mode-value {
  display: inline-block;
  color: #ffffff;
  font-weight: bold;
  font-size: 0.95rem;
  min-width: 18px;
  text-align: right;
  padding-top: 1px;
  flex-shrink: 0;
}
#awsheet-app .btn-remove {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 5px;
}
#awsheet-app .btn-remove:hover { color: var(--accent-red); }

/* Modal btn-remove: modals live outside #awsheet-app so need separate rule */
.modal-overlay .btn-remove {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(180, 175, 165, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 5px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}
.modal-overlay .btn-remove:hover {
  background: rgba(217, 83, 79, 0.15);
  color: #d9534f;
  border-color: rgba(217, 83, 79, 0.3);
}

#awsheet-app .tokens-grid-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
#awsheet-app .token-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#awsheet-app .token-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.5px;
}
#awsheet-app .token-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#awsheet-app .token-box {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-color);
  background: transparent;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  flex-shrink: 0;
}
#awsheet-app .token-box:hover { border-color: var(--text-muted); }
#awsheet-app .token-box.active::before {
  content: "";
  position: absolute;
  top: 3px; left: 3px; right: 3px; bottom: 3px;
  border-radius: 1px;
}
#awsheet-app #tokens-effort {
  display: grid;
  grid-template-columns: repeat(5, 18px);
  gap: 8px;
}
/* Effort tokens progressive left-to-right gold gradient (light to dark) */
#awsheet-app #tokens-effort .token-box:nth-child(1).active,
#awsheet-app #tokens-effort .token-box:nth-child(6).active { border-color: #f5cb9e; }
#awsheet-app #tokens-effort .token-box:nth-child(1).active::before,
#awsheet-app #tokens-effort .token-box:nth-child(6).active::before { background: #f5cb9e; }

#awsheet-app #tokens-effort .token-box:nth-child(2).active,
#awsheet-app #tokens-effort .token-box:nth-child(7).active { border-color: #e5b07c; }
#awsheet-app #tokens-effort .token-box:nth-child(2).active::before,
#awsheet-app #tokens-effort .token-box:nth-child(7).active::before { background: #e5b07c; }

#awsheet-app #tokens-effort .token-box:nth-child(3).active,
#awsheet-app #tokens-effort .token-box:nth-child(8).active { border-color: #d19665; }
#awsheet-app #tokens-effort .token-box:nth-child(3).active::before,
#awsheet-app #tokens-effort .token-box:nth-child(8).active::before { background: #d19665; }

#awsheet-app #tokens-effort .token-box:nth-child(4).active,
#awsheet-app #tokens-effort .token-box:nth-child(9).active { border-color: #b87e53; }
#awsheet-app #tokens-effort .token-box:nth-child(4).active::before,
#awsheet-app #tokens-effort .token-box:nth-child(9).active::before { background: #b87e53; }

#awsheet-app #tokens-effort .token-box:nth-child(5).active,
#awsheet-app #tokens-effort .token-box:nth-child(10).active { border-color: #9a6845; }
#awsheet-app #tokens-effort .token-box:nth-child(5).active::before,
#awsheet-app #tokens-effort .token-box:nth-child(10).active::before { background: #9a6845; }

#awsheet-app .gold-gradient-label {
  background: linear-gradient(to right, #9a6845 0%, #e0b4a4 50%, #fcead9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: 0.5px;
}

/* Sanity (Blue) tokens progressive left-to-right gradient (light to dark) */
#awsheet-app #tokens-sanity .token-box:nth-child(1).active { border-color: #aecdff; }
#awsheet-app #tokens-sanity .token-box:nth-child(1).active::before { background: #aecdff; }
#awsheet-app #tokens-sanity .token-box:nth-child(2).active { border-color: #94bcff; }
#awsheet-app #tokens-sanity .token-box:nth-child(2).active::before { background: #94bcff; }
#awsheet-app #tokens-sanity .token-box:nth-child(3).active { border-color: #7caeff; }
#awsheet-app #tokens-sanity .token-box:nth-child(3).active::before { background: #7caeff; }
#awsheet-app #tokens-sanity .token-box:nth-child(4).active { border-color: #5a99ff; }
#awsheet-app #tokens-sanity .token-box:nth-child(4).active::before { background: #5a99ff; }

#awsheet-app .blue-gradient-label {
  background: linear-gradient(to right, #5a99ff 0%, #7caeff 50%, #aecdff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: 0.5px;
}

/* Flesh (Pink) tokens progressive left-to-right gradient (light to dark) */
#awsheet-app #tokens-luck .token-box:nth-child(1).active { border-color: #ffb6c2; }
#awsheet-app #tokens-luck .token-box:nth-child(1).active::before { background: #ffb6c2; }
#awsheet-app #tokens-luck .token-box:nth-child(2).active { border-color: #ffa0af; }
#awsheet-app #tokens-luck .token-box:nth-child(2).active::before { background: #ffa0af; }
#awsheet-app #tokens-luck .token-box:nth-child(3).active { border-color: #ff7e93; }
#awsheet-app #tokens-luck .token-box:nth-child(3).active::before { background: #ff7e93; }
#awsheet-app #tokens-luck .token-box:nth-child(4).active { border-color: #ff5a75; }
#awsheet-app #tokens-luck .token-box:nth-child(4).active::before { background: #ff5a75; }

#awsheet-app .pink-gradient-label {
  background: linear-gradient(to right, #ff5a75 0%, #ff7e93 50%, #ffb6c2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: 0.5px;
}

/* Stress (Red) tokens progressive left-to-right gradient */
#awsheet-app #tokens-stress .token-box:nth-child(1).active { border-color: #ff736c; }
#awsheet-app #tokens-stress .token-box:nth-child(1).active::before { background: #ff736c; }
#awsheet-app #tokens-stress .token-box:nth-child(2).active { border-color: #fd564d; }
#awsheet-app #tokens-stress .token-box:nth-child(2).active::before { background: #fd564d; }
#awsheet-app #tokens-stress .token-box:nth-child(3).active { border-color: #ff3f36; }
#awsheet-app #tokens-stress .token-box:nth-child(3).active::before { background: #ff3f36; }
#awsheet-app #tokens-stress .token-box:nth-child(4).active { border-color: #ff2116; }
#awsheet-app #tokens-stress .token-box:nth-child(4).active::before { background: #ff2116; }

#awsheet-app .red-gradient-label {
  background: linear-gradient(to right, #ff2116 0%, #fd564d 50%, #ff736c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: 0.5px;
}

#awsheet-app .token-box.active { background: transparent; }

#awsheet-app .exp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 15px;
  text-align: center;
}
#awsheet-app .exp-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 5px;
}
#awsheet-app .exp-grid input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: #fff;
  font-size: 1.1rem;
  text-align: center;
  font-family: var(--font-main);
  padding: 2px 0;
}

#awsheet-app .btn-primary,
.modal-overlay .btn-primary {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 15px;
  border-radius: 4px;
  font-family: var(--font-main);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
}
#awsheet-app .btn-primary:hover,
.modal-overlay .btn-primary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-muted);
}
#awsheet-app .controls {
  display: flex;
  gap: 15px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto 30px;
  justify-content: center;
  padding-top: 20px;
}
#awsheet-app .controls .btn-primary { margin-top: 0; flex: 1; padding: 10px 10px; }

#awsheet-app #context-menu {
  position: absolute;
  display: none;
  background: var(--bg-sheet);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 8px 15px;
  font-size: 0.85rem;
  color: var(--text-main);
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
#awsheet-app #context-menu:hover { background: rgba(255, 255, 255, 0.05); }

/* --- View Mode Overrides --- */
#awsheet-app.view-mode .help-icon,
#awsheet-app.view-mode .btn-add,
#awsheet-app.view-mode .btn-remove,
#awsheet-app.view-mode .image-placeholder,
#awsheet-app.view-mode button[id^="btn-add-"],
#awsheet-app.view-mode #skills-dropdown,
#awsheet-app.view-mode .panel-title input[type="number"],
#awsheet-app.view-mode .cost-item:has(input:placeholder-shown) {
  display: none !important;
}

#awsheet-app.view-mode input[type="text"],
#awsheet-app.view-mode input[type="number"],
#awsheet-app.view-mode textarea,
#awsheet-app.view-mode select {
  border-color: transparent !important;
  background: transparent !important;
  pointer-events: none;
  box-shadow: none !important;
  color: var(--text-main);
  resize: none !important;
}
#awsheet-app.view-mode input::placeholder,
#awsheet-app.view-mode textarea::placeholder {
  color: transparent !important;
}

#awsheet-app.view-mode .left-panel,
#awsheet-app.view-mode .right-panel {
  justify-content: flex-start !important;
}

#awsheet-app.view-mode .avatar-frame {
  cursor: default !important;
  border-color: transparent !important;
}

#awsheet-app.view-mode .token {
  pointer-events: none;
}
#awsheet-app.view-mode .token:not(.active) {
  opacity: 0;
}

#tooltip-modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
#tooltip-modal .modal-content {
  background: #171717;
  border: 1px solid #2e2e2e;
  padding: 30px;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
#tooltip-modal .modal-content h2 {
  font-size: 1.2rem;
  color: #fff;
  margin-top: 0;
  margin-bottom: 15px;
  font-weight: 900;
}
#tooltip-modal .modal-content p {
  color: #e0e0e0;
  font-size: 0.95rem;
  margin-bottom: 25px;
}

@media (min-width: 1101px) {
  #awsheet-app .left-panel {
    text-align: right;
  }
  #awsheet-app .left-panel .input-styled {
    text-align: right;
  }
}

@media (min-width: 1101px) {
  #awsheet-app .left-panel .field label {
    background: linear-gradient(to left, rgba(255, 255, 255, 0.08) 0%, transparent 100%);
    padding: 2px 10px 2px 0;
  }
  
  #awsheet-app .right-panel .field label {
    background: linear-gradient(to right, rgba(255, 255, 255, 0.08) 0%, transparent 100%);
    padding: 2px 0 2px 10px;
    display: block;
  }
  
  #awsheet-app .right-panel .evolution .principle-label {
    background: linear-gradient(to right, #c8e6d8 0%, #486a57 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  #awsheet-app .right-panel .metamorph .principle-label {
    background: linear-gradient(to right, #e7cbce 0%, #6c4b4e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
}

#awsheet-app.view-mode .restricted-ta {
  min-height: 44px !important;
  resize: none !important;
  overflow: hidden !important;
}

/* --- Hint Icons --- */
#awsheet-app .hint-icon {
  display: inline-block;
  margin-left: 6px;
  width: 16px;
  height: 16px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 50%;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  font-style: normal;
  font-family: monospace;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
  vertical-align: middle;
}

#awsheet-app .field:hover .hint-icon,
#awsheet-app .panel:hover .hint-icon,
#awsheet-app .principle-row:hover .hint-icon,
#awsheet-app .xp-box:hover .hint-icon,
#awsheet-app .panel-title:hover .hint-icon,
#awsheet-app .token-label:hover .hint-icon {
  opacity: 1;
}

#awsheet-app .hint-icon:hover {
  background: var(--accent-purple);
  color: #fff;
}



/* HINT HIGHLIGHTING */
#awsheet-app .hint-clickable {
  cursor: help;
  transition: all 0.2s ease;
}

#awsheet-app .hint-clickable:hover {
  color: #fff !important;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

@media (min-width: 1101px) {
  #awsheet-app .left-panel .field label.hint-clickable:hover {
    background: linear-gradient(to left, rgba(255, 255, 255, 0.15) 0%, transparent 100%);
  }
  #awsheet-app .right-panel .field label.hint-clickable:hover {
    background: linear-gradient(to right, rgba(255, 255, 255, 0.15) 0%, transparent 100%);
  }
}

/* SECTION TITLES */
#awsheet-app .section-title {
  cursor: help;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.8rem;
  line-height: 0.8;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding-left: 0.4em;
  
  opacity: 0.6;
}

#awsheet-app .section-title::before,
#awsheet-app .section-title::after {
  display: none;
  flex: 1;
  height: 1px;
  margin: 0 15px;
}

#awsheet-app .chaos-title { 
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.7), rgba(232, 121, 249, 0.7), rgba(139, 92, 246, 0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #a855f7;
  margin-top: 12px !important;
  margin-bottom: 8px !important;
  cursor: help;
  transition: all 0.3s ease;
}
#awsheet-app .chaos-title:hover {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #ffffff !important;
  color: #ffffff !important;
  opacity: 1 !important;
  text-shadow: 0 0 8px #a855f7, 0 0 18px #e879f9, 0 0 30px #a855f7 !important;
}

#awsheet-app .order-title { 
  background: linear-gradient(135deg, rgba(185, 100, 60, 0.8), rgba(250, 220, 170, 0.9), rgba(155, 80, 45, 0.8));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #b8643c;
  margin-top: 12px !important;
  margin-bottom: 8px !important;
  cursor: help;
  transition: all 0.3s ease;
}
#awsheet-app .order-title:hover {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #ffffff !important;
  color: #ffffff !important;
  opacity: 1 !important;
  text-shadow: 0 0 8px #fadeaa, 0 0 18px #b8643c, 0 0 30px #fadeaa !important;
}

/* THEMED FRAMES (JS POSITIONED) */
#awsheet-app .left-panel,
#awsheet-app .right-panel {
  position: relative;
  padding-bottom: 0;
}
#awsheet-app .themed-frame {
  position: absolute;
  left: -15px;
  right: -15px;
  border-radius: 8px 8px 0 0;
  background: rgba(0, 0, 0, 0.15);
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, black 100px, transparent 220px);
  mask-image: linear-gradient(to bottom, black 100px, transparent 220px);
}
#awsheet-app .themed-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px 8px 0 0;
  padding: 2px 2px 0 2px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  /* Opacity removed! Alpha is baked into colors to fix the mask anti-aliasing bug */
}
#awsheet-app .chaos-frame::before {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.7), rgba(232, 121, 249, 0.7), rgba(139, 92, 246, 0.7));
}
#awsheet-app .order-frame::before {
  background: linear-gradient(135deg, rgba(185, 100, 60, 0.8), rgba(250, 220, 170, 0.9), rgba(155, 80, 45, 0.8));
}
#awsheet-app .left-panel .field,
#awsheet-app .right-panel .field {
  position: relative;
  z-index: 1; /* Sit above the frame */
}

/* Fix Avatar picture length to align with frames */
#awsheet-app .avatar-block {
  padding-bottom: 0 !important;
}
#awsheet-app .avatar-block .avatar-frame {
  height: 100% !important;
}

/* CUSTOM FOCUS COLORS */
#awsheet-app .input-styled:focus {
  outline: none !important;
  border-bottom-color: #a1a1aa !important;
}
#awsheet-app textarea.input-styled:focus {
  border-color: #a1a1aa !important;
}
#awsheet-app #char-brand:focus,
#awsheet-app #char-temptations:focus,
#awsheet-app #char-vulnerabilities:focus {
  border-color: #9c7fc2 !important;
  border-bottom-color: #9c7fc2 !important;
}
#awsheet-app .principle-group .input-styled:focus,
#awsheet-app #char-aspirations:focus {
  border-color: var(--order-gold-color) !important;
  border-bottom-color: var(--order-gold-color) !important;
}

#awsheet-app .principle-group .input-styled::selection,
#awsheet-app .principle-group textarea::selection,
#awsheet-app #char-aspirations::selection {
  background-color: var(--order-gold-selection) !important;
  color: #ffffff !important;
}

/* Styles for reset checkboxes to match the 4th checkboxes */
#awsheet-app .principle-row.evolution .principle-reset-cb:checked { border-color: #c8e6d8 !important; }
#awsheet-app .principle-row.evolution .principle-reset-cb:checked::before {
  content: ""; position: absolute; top: 3px; left: 3px; right: 3px; bottom: 3px; background: #c8e6d8 !important; border-radius: 1px;
}
#awsheet-app .principle-row.metamorph .principle-reset-cb:checked { border-color: #e7cbce !important; }
#awsheet-app .principle-row.metamorph .principle-reset-cb:checked::before {
  content: ""; position: absolute; top: 3px; left: 3px; right: 3px; bottom: 3px; background: #e7cbce !important; border-radius: 1px;
}
/* Skills Modal Styles */
.skill-modal-item {
  padding: 10px;
  border: 1px solid transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.2s ease;
  border-radius: 4px;
}
.skill-modal-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.skill-modal-item.selected {
  background: rgba(218, 201, 160, 0.15);
  border: 1px solid #dac9a0 !important;
  color: #dac9a0 !important;
  font-weight: bold;
}
.skill-modal-item.trait-adv {
  color: #8cba76;
}
.skill-modal-item.trait-dis {
  color: #d9534f;
}
.skill-modal-item.trait-adv.selected {
  background: rgba(140, 186, 118, 0.15);
  border: 1px solid #8cba76 !important;
  color: #8cba76 !important;
}
.skill-modal-item.trait-dis.selected {
  background: rgba(217, 83, 79, 0.15);
  border: 1px solid #d9534f !important;
  color: #d9534f !important;
}

/* Custom Number Input Controls */
.number-control {
  display: flex;
  align-items: center;
  gap: 5px;
}
.number-control button {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
}
.number-control button:hover {
  background: var(--accent-purple);
  color: white;
  border-color: var(--accent-purple);
}
.number-control .val-display {
  font-family: var(--font-main);
  font-size: 0.95rem;
  min-width: 20px;
  text-align: center;
}



/* Modal Desktop Specific Layout */
@media (min-width: 480px) {
  #skills-modal-left {
    flex: 0 0 240px !important;
  }
  #skills-modal-right {
    flex: 1 !important;
  }
}
/* View mode custom value spans */
.view-mode-value {
    display: none;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: bold;
    margin-left: 5px;
    margin-right: 5px;
}

#awsheet-app.view-mode .cost-item input[type="number"],
#awsheet-app.view-mode .skill-row input[type="number"] {
    display: none !important;
}

#awsheet-app.view-mode .view-mode-value {
    display: inline-block;
}

/* Skill row styling (Edit mode vs View mode) */
#awsheet-app .skill-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

/* Single highlighted skill >= 7 (when count <= 4): soft evolution sage green border (#729382) with subtle matching green tint background */
#awsheet-app:not(.view-mode) .skill-row.highlighted {
    border: 1px solid rgba(114, 147, 130, 0.5) !important;
    background: rgba(114, 147, 130, 0.12) !important;
}
#awsheet-app:not(.view-mode) .skill-row.highlighted .skill-name {
    color: var(--text-main) !important;
}

/* Thin divider lines for skills in EDIT mode */
#awsheet-app:not(.view-mode) #skills-list .skill-row:not(.highlighted):not(.error) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Error state (>4 skills >= 7): clear transparent-red border outline in edit mode */
#awsheet-app:not(.view-mode) .skill-row.error {
    border: 1px solid rgba(239, 68, 68, 0.7) !important;
    background: rgba(239, 68, 68, 0.1) !important;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.25);
}

/* Warning banners for limits (skills, wounds) */
#skills-limit-warning,
#wounds-limit-warning,
.panel-limit-warning {
    display: none;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 4px;
    color: #f87171;
    font-size: 0.78rem;
    line-height: 1.35;
    text-align: left;
}

#awsheet-app:not(.view-mode) #skills-limit-warning.active,
#awsheet-app:not(.view-mode) #wounds-limit-warning.active,
#awsheet-app:not(.view-mode) .panel-limit-warning.active {
    display: block;
}

#awsheet-app.view-mode .skill-row {
    border-color: transparent !important;
    background: transparent !important;
    padding: 4px 0 !important;
}

/* Thin divider lines between skills in view mode */
#awsheet-app.view-mode #skills-list .skill-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Fully hide highlighted/error borders in view mode */
#awsheet-app.view-mode .skill-row.highlighted,
#awsheet-app.view-mode .skill-row.error {
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: transparent !important;
    margin-bottom: 0 !important;
    box-shadow: none !important;
}

/* Hide cost-item & competency-row elements in view mode if text input is empty */
#awsheet-app.view-mode .cost-item.empty-in-view,
#awsheet-app.view-mode .competency-row.empty-in-view {
    display: none !important;
}

#skills-modal-points::-webkit-inner-spin-button, #skills-modal-points::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Modal Controls Styling (Grey Box Style) */
#skills-modal-btn-minus,
#skills-modal-btn-plus,
#btn-modal-add-skill {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 4px !important;
  color: var(--text-main) !important;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-main);
  text-transform: uppercase;
}

#skills-modal-btn-minus:hover,
#skills-modal-btn-plus:hover,
#btn-modal-add-skill:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

#btn-modal-add-skill:disabled {
  opacity: 0.3 !important;
  cursor: not-allowed !important;
}

#skills-modal-points {
  background: transparent !important;
  border: none !important;
  color: var(--text-main) !important;
  font-family: var(--font-main);
  font-size: 1.4rem !important;
  transition: all 0.2s ease;
}

#skills-modal-points:focus {
  outline: none !important;
}

/* Reset text color in view mode */
#awsheet-app.view-mode .skill-row.highlighted .skill-name,
#awsheet-app.view-mode .skill-row.error .skill-name {
    color: var(--text-main) !important;
}

/* Override height for Brand box */
#awsheet-app textarea#char-brand {
    min-height: 0;
    resize: none;
}

/* Match font size of skills-points counter to panel title */
#awsheet-app #skills-points {
    font-size: 1rem;
    font-family: var(--font-main);
    display: none; /* Hidden: duplicates the points bar above */
}

/* Points bar labels: override global section-title opacity so they're clearly readable */
#awsheet-app #points-bar .section-title {
    opacity: 1;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    margin-bottom: 0;
    white-space: nowrap;
}

/* Keep Distribute XP button compact */
#awsheet-app #btn-distribute-exp {
    flex-shrink: 0;
    width: auto !important;
    white-space: nowrap;
    padding: 6px 12px !important;
    font-size: 0.7rem !important;
    align-self: center;
    margin-top: 0;
}


/* Modal detail & note input styling matching site dark theme */
#bodymind-modal-detail-input,
#psychosis-modal-comment,
#mystic-mod-note-input,
#mystic-spell-name,
#mystic-spell-comment,
.modal-content input[type="text"],
.modal-content input[type="number"],
.modal-content textarea {
  background: rgba(0, 0, 0, 0.5) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 4px !important;
  color: var(--text-main) !important;
  padding: 8px 12px !important;
  font-family: var(--font-main) !important;
  font-size: 0.9rem !important;
  box-sizing: border-box !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

#skills-modal-points,
#mystic-base-points-input,
.modal-counter-input {
  background: rgba(0, 0, 0, 0.6) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 4px !important;
  color: #ffffff !important;
  text-align: center !important;
  font-size: 1.25rem !important;
  font-weight: bold !important;
  width: 65px !important;
  height: 42px !important;
  padding: 0 !important;
  line-height: 42px !important;
  -moz-appearance: textfield !important;
}

#skills-modal-points::-webkit-outer-spin-button,
#skills-modal-points::-webkit-inner-spin-button,
#mystic-base-points-input::-webkit-outer-spin-button,
#mystic-base-points-input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

#skills-modal-btn-minus,
#skills-modal-btn-plus,
#mystic-base-btn-minus,
#mystic-base-btn-plus {
  margin: 0 !important;
  padding: 8px 18px !important;
  font-size: 1.2rem !important;
  min-width: 48px !important;
  height: 42px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#bodymind-modal-detail-input:focus,
#psychosis-modal-comment:focus,
#mystic-mod-note-input:focus,
#mystic-spell-name:focus,
#mystic-spell-comment:focus,
.modal-content input[type="text"]:focus,
.modal-content input[type="number"]:focus,
.modal-content textarea:focus {
  outline: none !important;
  border-color: rgba(218, 201, 160, 0.6) !important;
  box-shadow: 0 0 8px rgba(218, 201, 160, 0.15) !important;
}

#bodymind-modal-detail-input::placeholder,
#psychosis-modal-comment::placeholder,
#mystic-mod-note-input::placeholder,
#mystic-spell-name::placeholder,
#mystic-spell-comment::placeholder,
.modal-content input[type="text"]::placeholder,
.modal-content textarea::placeholder {
  color: var(--text-muted) !important;
  opacity: 0.7 !important;
}

/* Mystic Base Effect Trait Styling (Matches Skills style) */
#awsheet-app .trait-base span:first-child {
  color: #dac9a0 !important;
  font-weight: bold !important;
}

/* Mystic Modal Dark Input & Counter Theme */
#mystic-modal input[type="text"],
#mystic-modal textarea {
  background: rgba(0, 0, 0, 0.4) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 4px !important;
  color: var(--text-main) !important;
  padding: 8px 12px !important;
  font-family: var(--font-main) !important;
  box-sizing: border-box !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

#mystic-modal input[type="text"]:focus,
#mystic-modal textarea:focus {
  outline: none !important;
  border-color: rgba(218, 201, 160, 0.6) !important;
  box-shadow: 0 0 8px rgba(218, 201, 160, 0.15) !important;
}

#mystic-modal textarea {
  resize: none !important;
  height: 54px !important;
  min-height: 54px !important;
  line-height: 1.35 !important;
  overflow-y: auto !important;
}

#mystic-modal input[type="text"]::placeholder,
#mystic-modal textarea::placeholder {
  color: var(--text-muted) !important;
  opacity: 0.7 !important;
}

/* Remove default browser spinner on number input */
#mystic-base-points-input::-webkit-outer-spin-button,
#mystic-base-points-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#mystic-base-points-input[type=number] {
  -moz-appearance: textfield;
}

.btn-save-mystic {
  background: rgba(46, 125, 50, 0.35) !important;
  border: 1px solid #8cba76 !important;
  color: #8cba76 !important;
  box-shadow: 0 0 10px rgba(140, 186, 118, 0.2) !important;
  transition: all 0.2s ease !important;
}

.btn-save-mystic:hover {
  background: rgba(140, 186, 118, 0.35) !important;
  color: #ffffff !important;
  border-color: #a3e635 !important;
  box-shadow: 0 0 14px rgba(140, 186, 118, 0.45) !important;
}

/* ==========================================================================
   Clean Structured Layout Classes (Refactored from inline styles)
   ========================================================================== */

#awsheet-app .controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 15px auto 10px auto;
  max-width: 1000px;
  padding: 0 20px;
}
#awsheet-app .controls .btn-primary {
  flex: 1;
  margin: 0;
  padding: 6px 4px;
  font-size: 0.75rem;
  height: auto;
  min-height: 32px;
  letter-spacing: 0.5px;
}
#awsheet-app .controls label.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
}

#awsheet-app .mode-toggle-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

#awsheet-app .sheet-top {
  position: relative;
}

#awsheet-app .left-panel,
#awsheet-app .right-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  min-height: 0;
}

#awsheet-app #char-brand {
  min-height: 0;
}

#awsheet-app .field.mobile-order-5,
#awsheet-app .field.mobile-order-6 {
  display: flex;
  flex-direction: column;
}
#awsheet-app .field.mobile-order-5 #char-temptations,
#awsheet-app .field.mobile-order-6 #char-vulnerabilities {
  min-height: 80px;
  height: 80px;
  resize: none;
  overflow: hidden;
}
#awsheet-app .field.mobile-order-6 {
  margin-bottom: 0;
}

#awsheet-app .avatar-block {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 0;
  gap: 15px;
}

#awsheet-app .avatar-frame {
  cursor: pointer;
  width: 100%;
  flex: 1;
  min-height: 180px;
}
#awsheet-app .avatar-placeholder {
  padding: 20px;
  line-height: 1.4;
}

#awsheet-app .tokens-grid-container {
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  padding: 10px 12px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}
#awsheet-app .tokens-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#awsheet-app .token-group {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
#awsheet-app .token-group label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
}
#awsheet-app .token-group-effort {
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  margin-top: 2px;
}

#awsheet-app #species-age-row .field:first-child {
  flex: 3;
}
#awsheet-app #species-age-row .field:last-child {
  flex: 1;
}

#awsheet-app .principle-group {
  margin-bottom: 10px;
}
#awsheet-app .principle-group:last-child {
  margin-bottom: 0;
}
#awsheet-app .principle-group .input-styled {
  margin-bottom: 5px;
}
#awsheet-app .principle-row-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

#awsheet-app .aspirations-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
#awsheet-app #char-aspirations {
  min-height: 80px;
  padding: 8px;
  resize: none;
  overflow: hidden;
}

#awsheet-app #points-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 20px;
  margin: 24px 0;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
#awsheet-app #points-bar .point-item {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
#awsheet-app #points-bar .point-fraction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
#awsheet-app #points-bar .pts-remain-val {
  color: #dac9a0;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}
#awsheet-app #points-bar .pts-divider {
  color: var(--text-muted);
  font-size: 0.9rem;
  opacity: 0.7;
}
#awsheet-app #points-bar .pts-total-input,
#awsheet-app #points-bar input[type="number"] {
  width: 38px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: #fff;
  text-align: center;
  font-family: var(--font-main);
  font-size: 0.95rem;
}
#awsheet-app #points-bar .pts-total-input:focus,
#awsheet-app #points-bar input[type="number"]:focus {
  outline: none;
  border-bottom-color: #d1b5b8;
}
#awsheet-app #points-bar .exp-point-item {
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  padding: 0 14px;
}

#awsheet-app .skills-header-counter {
  display: flex;
  align-items: center;
  gap: 10px;
}
#awsheet-app .add-skill-field {
  margin-bottom: 10px;
}

#awsheet-app .col-flex-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}
#awsheet-app .col-flex-container-full {
  height: 100%;
}
#awsheet-app .panel-info-flex {
  display: flex;
  flex-direction: column;
}
#awsheet-app #char-info {
  min-height: 140px;
  height: 140px;
  resize: none;
  overflow: hidden;
}

#awsheet-app .panel-psych-wounds {
  padding: 0;
}
#awsheet-app .psych-wounds-wrapper {
  display: flex;
  gap: 15px;
  width: 100%;
}
#awsheet-app .psych-wounds-item {
  flex: 1 1 0;
  min-width: 0;
}
#awsheet-app.view-mode .panel-psych-wounds.empty-in-view,
#awsheet-app.view-mode .psych-wounds-item.empty-in-view {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
#awsheet-app.view-mode .psych-wounds-item.full-width-in-view {
  flex: 1 1 100% !important;
  width: 100% !important;
}
#awsheet-app .btn-add-sub {
  margin-top: 5px;
}

#awsheet-app .exp-grid {
  padding: 15px;
}
#global-skill-tooltip {
  position: absolute;
  display: none;
  background: rgba(15, 15, 15, 0.95);
  color: var(--text-main);
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  max-width: 300px;
  font-size: 0.85rem;
  line-height: 1.4;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* Fully collapse empty fields and textareas in view mode without leaving margin space */
#awsheet-app.view-mode .empty-in-view {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Maintain consistent panel layout in view mode */
#awsheet-app.view-mode .left-panel,
#awsheet-app.view-mode .right-panel {
  justify-content: flex-start !important;
  gap: 0 !important;
  height: 100% !important;
}
#awsheet-app.view-mode .left-panel .field,
#awsheet-app.view-mode .right-panel .field:not(#species-age-row .field) {
  margin-bottom: 8px !important;
}
#awsheet-app.view-mode .field.mobile-order-6,
#awsheet-app.view-mode .aspirations-field {
  margin-bottom: 0 !important;
}

/* Modal text highlight classes */
.highlight-gold { color: var(--order-gold-color, #dac9a0); font-weight: bold; }
.highlight-purple { color: #9c7fc2; font-weight: bold; }
.highlight-pink { color: #e879f9; font-weight: bold; }
.highlight-green { color: #8cba76; font-weight: bold; }

/* PNG export clean capture rules */
#awsheet-app.exporting-capture {
  background: #0d0d0d !important;
}

#awsheet-app.exporting-capture #awsheet-export-area {
  background: #141414 !important;
  box-shadow: none !important;
}

#awsheet-app.exporting-capture .awsheet-header h1 {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #fdf3d1 !important;
  color: #fdf3d1 !important;
  text-shadow: 0 0 15px rgba(218, 201, 160, 0.4) !important;
}

#awsheet-app.exporting-capture .chaos-title {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #d8b4fe !important;
  color: #d8b4fe !important;
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.4) !important;
}

#awsheet-app.exporting-capture .order-title {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #dac9a0 !important;
  color: #dac9a0 !important;
  text-shadow: 0 0 10px rgba(218, 201, 160, 0.4) !important;
}

#awsheet-app.exporting-capture .gold-gradient-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #e0b4a4 !important;
  color: #e0b4a4 !important;
}

#awsheet-app.exporting-capture .blue-gradient-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #93c5fd !important;
  color: #93c5fd !important;
}

#awsheet-app.exporting-capture .pink-gradient-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #f472b6 !important;
  color: #f472b6 !important;
}

#awsheet-app.exporting-capture .red-gradient-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #f87171 !important;
  color: #f87171 !important;
}

#awsheet-app.exporting-capture .right-panel .evolution .principle-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #86efac !important;
  color: #86efac !important;
}

#awsheet-app.exporting-capture .right-panel .metamorph .principle-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #fca5a5 !important;
  color: #fca5a5 !important;
}

#awsheet-app.exporting-capture .hint-icon,
#awsheet-app.exporting-capture .btn-remove,
#awsheet-app.exporting-capture .btn-primary,
#awsheet-app.exporting-capture .panel-limit-warning,
#awsheet-app.exporting-capture #points-bar,
#awsheet-app.exporting-capture #xp-progression-banner {
  display: none !important;
}

/* --- XP Progression Mode Styling --- */
#awsheet-app .xp-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  margin: -10px 0 24px 0;
  background: linear-gradient(135deg, rgba(218, 201, 160, 0.12) 0%, rgba(140, 186, 118, 0.08) 50%, rgba(218, 201, 160, 0.05) 100%);
  border: 1px solid rgba(218, 201, 160, 0.35);
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  animation: xpBannerFadeIn 0.3s ease;
}

@keyframes xpBannerFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

#awsheet-app .xp-banner-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

#awsheet-app .xp-banner-desc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

#awsheet-app .xp-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  color: #dac9a0;
  letter-spacing: 0.5px;
}

#awsheet-app .xp-badge-icon {
  color: #ffd700;
  font-size: 1.1rem;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.5));
}

#awsheet-app .xp-banner-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

#awsheet-app .xp-banner-center {
  display: flex;
  align-items: center;
}

#awsheet-app .gift-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  user-select: none;
}

#awsheet-app .gift-toggle-label:hover {
  border-color: #8cba76;
  background: rgba(140, 186, 118, 0.1);
}

#awsheet-app .gift-toggle-checkbox {
  display: none;
}

#awsheet-app .gift-toggle-custom {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--border-color);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#awsheet-app .gift-toggle-checkbox:checked + .gift-toggle-custom {
  background: #8cba76;
  border-color: #8cba76;
}

#awsheet-app .gift-toggle-checkbox:checked + .gift-toggle-custom::after {
  content: "✓";
  color: #000;
  font-size: 10px;
  font-weight: bold;
}

#awsheet-app .gift-toggle-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  transition: color 0.2s ease;
}

#awsheet-app .gift-toggle-checkbox:checked ~ .gift-toggle-text {
  color: #8cba76;
}

#awsheet-app .xp-banner-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#awsheet-app .xp-cancel-btn {
  margin: 0 !important;
  padding: 6px 14px !important;
  font-size: 0.8rem !important;
  white-space: nowrap !important;
  background: rgba(180, 60, 60, 0.18) !important;
  border-color: rgba(200, 80, 80, 0.5) !important;
  color: #e89090 !important;
  transition: all 0.2s ease;
}

#awsheet-app .xp-cancel-btn:hover {
  background: rgba(200, 80, 80, 0.28) !important;
  border-color: #e08080 !important;
  color: #ffaaaa !important;
}


#awsheet-app .xp-rules-btn {
  margin: 0 !important;
  padding: 6px 14px !important;
  font-size: 0.8rem !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: var(--border-color) !important;
}

/* Active Distribute XP Button state in points-bar */
#awsheet-app #btn-distribute-exp.xp-mode-active {
  background: rgba(156, 127, 194, 0.25) !important;
  border-color: #9c7fc2 !important;
  color: #c8aef0 !important;
  box-shadow: 0 0 16px rgba(156, 127, 194, 0.45) !important;
  font-weight: bold !important;
}

/* Approve button: XP mode open but no changes made yet - grey/idle */
#awsheet-app #btn-distribute-exp.xp-mode-active.xp-approve-idle {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--text-muted) !important;
  box-shadow: none !important;
  cursor: default !important;
  font-weight: normal !important;
}
#awsheet-app #btn-distribute-exp.xp-mode-active.xp-approve-idle:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}


#awsheet-app.xp-mode-active #exp-point-box {
  background: rgba(218, 201, 160, 0.1);
  border-radius: 4px;
}

/* Skill row XP action buttons */
#awsheet-app .skill-xp-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
}

#awsheet-app .btn-skill-xp-plus,
#awsheet-app .btn-skill-xp-minus {
  background: rgba(218, 201, 160, 0.15);
  border: 1px solid rgba(218, 201, 160, 0.4);
  color: #dac9a0;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

#awsheet-app .btn-skill-xp-plus:hover {
  background: rgba(140, 186, 118, 0.3);
  border-color: #8cba76;
  color: #8cba76;
}

#awsheet-app .btn-skill-xp-minus:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ef4444;
}

/* XP button: not enough experience to afford */
#awsheet-app .btn-xp-disabled,
#awsheet-app .btn-xp-disabled:hover {
  background: rgba(239, 68, 68, 0.08) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: rgba(239, 68, 68, 0.5) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

#awsheet-app .gift-badge {
  display: inline-block;
  background: rgba(140, 186, 118, 0.2);
  color: #8cba76;
  border: 1px solid rgba(140, 186, 118, 0.5);
  font-size: 0.68rem;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

#awsheet-app .btn-cure-flaw {
  background: rgba(140, 186, 118, 0.2);
  border: 1px solid rgba(140, 186, 118, 0.5);
  color: #8cba76;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

#awsheet-app .btn-cure-flaw:hover {
  background: rgba(140, 186, 118, 0.4);
  color: #fff;
}

/* ── XP Mystic Upgrades ──────────────────────────────── */
#awsheet-app .spell-xp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 5px 0 2px 10px;
  margin-top: 3px;
}

#awsheet-app .btn-xp-small {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(92, 160, 220, 0.45);
  background: rgba(92, 160, 220, 0.1);
  color: #7ab8e8;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
#awsheet-app .btn-xp-small:hover:not(.btn-xp-disabled) {
  background: rgba(92, 160, 220, 0.25);
  border-color: rgba(92, 160, 220, 0.7);
  color: #b8d8f8;
}
#awsheet-app .btn-xp-small.btn-xp-remove {
  border: 1px solid rgba(218, 201, 160, 0.4);
  background: rgba(218, 201, 160, 0.15);
  color: #dac9a0;
}
#awsheet-app .btn-xp-small.btn-xp-remove:hover:not(.btn-xp-disabled) {
  background: rgba(140, 186, 118, 0.3);
  border-color: #8cba76;
  color: #8cba76;
}

#awsheet-app .spell-xp-badge {
  font-size: 0.7rem;
  font-weight: bold;
  background: rgba(218, 201, 160, 0.15);
  color: #dac9a0;
  border: 1px solid rgba(218, 201, 160, 0.3);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: auto;
}

/* Acris XP picker dropdown */
.xp-acris-picker {
  position: absolute;
  z-index: 9999;
  background: #1e1a14;
  border: 1px solid rgba(168, 144, 112, 0.5);
  border-radius: 6px;
  min-width: 220px;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 6px 24px rgba(0,0,0,0.6);
  padding: 4px 0;
}
.xp-acris-picker-row {
  padding: 6px 12px;
  font-size: 0.8rem;
  color: #c8b490;
  cursor: pointer;
  transition: background 0.12s;
}
.xp-acris-picker-row:hover:not(.xp-picker-unaffordable) {
  background: rgba(168, 144, 112, 0.15);
  color: #dac9a0;
}
.xp-acris-picker-row.xp-picker-unaffordable {
  color: rgba(217, 83, 79, 0.5);
  cursor: not-allowed;
}



/* --- Forced Desktop Layout for PNG Export (Desktop & Mobile) --- */
#awsheet-app.desktop-export-force,
#awsheet-app.desktop-export-force .awsheet-container,
#awsheet-app.desktop-export-force #awsheet-export-area,
#awsheet-app.desktop-export-force .awsheet {
  width: 1200px !important;
  max-width: 1200px !important;
  min-width: 1200px !important;
  box-sizing: border-box !important;
}

#awsheet-app.desktop-export-force .awsheet {
  padding: 50px !important;
}

#awsheet-app.desktop-export-force .sheet-top {
  display: grid !important;
  grid-template-columns: 1fr 260px 1fr !important;
  gap: 20px !important;
  margin-bottom: 45px !important;
}

#awsheet-app.desktop-export-force .left-panel,
#awsheet-app.desktop-export-force .right-panel {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

#awsheet-app.desktop-export-force .left-panel {
  text-align: right !important;
}

#awsheet-app.desktop-export-force .left-panel .input-styled {
  text-align: right !important;
}

#awsheet-app.desktop-export-force .left-panel .field label {
  background: linear-gradient(to left, rgba(255, 255, 255, 0.08) 0%, transparent 100%) !important;
  padding: 2px 10px 2px 0 !important;
}

#awsheet-app.desktop-export-force .right-panel .field label {
  background: linear-gradient(to right, rgba(255, 255, 255, 0.08) 0%, transparent 100%) !important;
  padding: 2px 0 2px 10px !important;
  display: block !important;
}

#awsheet-app.desktop-export-force .avatar-block {
  order: unset !important;
  margin: 0 !important;
  grid-column: unset !important;
  height: 100% !important;
  min-height: 0 !important;
}

#awsheet-app.desktop-export-force .avatar-block .avatar-frame {
  aspect-ratio: unset !important;
  width: 100% !important;
  height: 100% !important;
}

#awsheet-app.desktop-export-force .sheet-bottom {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 25px !important;
  margin-bottom: 10px !important;
}

#awsheet-app.desktop-export-force .sheet-notes-row {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 25px !important;
  margin-bottom: 10px !important;
}


/* --- Fix text-clip, mask-image & gradient blocks in HTML2Canvas Export --- */
#awsheet-app.desktop-export-force .themed-frame::before,
#awsheet-app.exporting-capture .themed-frame::before {
  display: none !important;
  content: none !important;
}

#awsheet-app.desktop-export-force .themed-frame,
#awsheet-app.exporting-capture .themed-frame {
  mask-image: none !important;
  -webkit-mask-image: none !important;
  background: transparent !important;
}

#awsheet-app.desktop-export-force .chaos-frame,
#awsheet-app.exporting-capture .chaos-frame {
  border: 2px solid rgba(168, 85, 247, 0.45) !important;
  border-bottom: none !important;
  background: transparent !important;
}

#awsheet-app.desktop-export-force .order-frame,
#awsheet-app.exporting-capture .order-frame {
  border: 2px solid rgba(218, 201, 160, 0.45) !important;
  border-bottom: none !important;
  background: transparent !important;
}

#awsheet-app.desktop-export-force .awsheet-header h1,
#awsheet-app.exporting-capture .awsheet-header h1 {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #fdf3d1 !important;
  color: #fdf3d1 !important;
  text-shadow: 0 0 16px rgba(139, 92, 246, 0.4) !important;
}

#awsheet-app.desktop-export-force .chaos-title,
#awsheet-app.exporting-capture .chaos-title {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #c084fc !important;
  color: #c084fc !important;
}

#awsheet-app.desktop-export-force .order-title,
#awsheet-app.exporting-capture .order-title {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #f6d89b !important;
  color: #f6d89b !important;
}

#awsheet-app.desktop-export-force .blue-gradient-label,
#awsheet-app.exporting-capture .blue-gradient-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #7caeff !important;
  color: #7caeff !important;
}

#awsheet-app.desktop-export-force .pink-gradient-label,
#awsheet-app.exporting-capture .pink-gradient-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #ff7e93 !important;
  color: #ff7e93 !important;
}

#awsheet-app.desktop-export-force .red-gradient-label,
#awsheet-app.exporting-capture .red-gradient-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #ff3f36 !important;
  color: #ff3f36 !important;
}

#awsheet-app.desktop-export-force .gold-gradient-label,
#awsheet-app.exporting-capture .gold-gradient-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #d19665 !important;
  color: #d19665 !important;
}

#awsheet-app.desktop-export-force .evolution .principle-label,
#awsheet-app.exporting-capture .evolution .principle-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #8cba76 !important;
  color: #8cba76 !important;
}

#awsheet-app.desktop-export-force .metamorph .principle-label,
#awsheet-app.exporting-capture .metamorph .principle-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #e7cbce !important;
  color: #e7cbce !important;
}

#awsheet-app.desktop-export-force .chaos-title,
#awsheet-app.exporting-capture .chaos-title {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #c084fc !important;
  color: #c084fc !important;
}

#awsheet-app.desktop-export-force .order-title,
#awsheet-app.exporting-capture .order-title {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #f6d89b !important;
  color: #f6d89b !important;
}

#awsheet-app.desktop-export-force .blue-gradient-label,
#awsheet-app.exporting-capture .blue-gradient-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #7caeff !important;
  color: #7caeff !important;
}

#awsheet-app.desktop-export-force .pink-gradient-label,
#awsheet-app.exporting-capture .pink-gradient-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #ff7e93 !important;
  color: #ff7e93 !important;
}

#awsheet-app.desktop-export-force .red-gradient-label,
#awsheet-app.exporting-capture .red-gradient-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #ff3f36 !important;
  color: #ff3f36 !important;
}

#awsheet-app.desktop-export-force .gold-gradient-label,
#awsheet-app.exporting-capture .gold-gradient-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #d19665 !important;
  color: #d19665 !important;
}

#awsheet-app.desktop-export-force .evolution .principle-label,
#awsheet-app.exporting-capture .evolution .principle-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #8cba76 !important;
  color: #8cba76 !important;
}

#awsheet-app.desktop-export-force .metamorph .principle-label,
#awsheet-app.exporting-capture .metamorph .principle-label {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #e7cbce !important;
  color: #e7cbce !important;
}


/* Tighten layout in view mode so notes sit right below content */
#awsheet-app.view-mode .sheet-bottom {
  margin-bottom: 10px !important;
}
#awsheet-app.view-mode .sheet-notes-row {
  margin-bottom: 10px !important;
}
#awsheet-app.view-mode .col-flex-container {
  gap: 16px !important;
}
#awsheet-app.view-mode #char-info {
  min-height: 0 !important;
  height: auto !important;
}
