/* ============================================================
   Unknown Armies 2nd Edition — System Stylesheet
   Aesthetic: Gritty urban occult, typewriter & cracked concrete
   ============================================================ */

/* ---- Variables ---- */
:root {
  --ua2e-bg:          #1a1a1a;
  --ua2e-surface:     #242424;
  --ua2e-surface2:    #2f2f2f;
  --ua2e-border:      #444444;
  --ua2e-text:        #d4cfc9;
  --ua2e-text-muted:  #888888;
  --ua2e-accent:      #c0392b;  /* blood red */
  --ua2e-accent2:     #e67e22;  /* burnt orange */
  --ua2e-crit:        #f1c40f;  /* gold */
  --ua2e-success:     #27ae60;
  --ua2e-fail:        #c0392b;
  --ua2e-match:       #8e44ad;
  --ua2e-font:        'Georgia', serif;
  --ua2e-font-mono:   'Courier New', monospace;
}

/* =====================================================================
   Sheet Base
   ===================================================================== */

.ua2e.sheet {
  font-family: var(--ua2e-font);
  color: var(--ua2e-text);
  background: var(--ua2e-bg);
  overflow: visible;
  isolation: isolate;
}

.ua2e.sheet .window-content {
  background: var(--ua2e-bg);
  padding: 0;
  overflow: visible;
  position: relative;
}

.ua2e.sheet form {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: visible;
  position: relative;
}

.ua2e.sheet .sheet-header,
.ua2e.sheet .sheet-body {
  position: relative;
  z-index: 2;
}

/* =====================================================================
   Header
   ===================================================================== */

.ua2e.sheet .sheet-header {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: var(--ua2e-surface);
  border-bottom: 2px solid var(--ua2e-accent);
  min-height: 230px;
  align-items: stretch;
}

.ua2e.sheet .profile-img {
  flex: 0 0 240px;
  width: 240px;
  height: auto;
  max-height: none;
  max-width: none;
  object-fit: cover;
  object-position: center;
  border: none;
  cursor: pointer;
  border-radius: 0;
  align-self: stretch;
  background: transparent;
  display: block;
}

.ua2e.sheet .header-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.ua2e.sheet .charname {
  margin: 0;
  padding: 0;
  line-height: 1;
}

.ua2e.sheet .charname input {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ua2e-border);
  color: var(--ua2e-text);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1.05;
  font-family: var(--ua2e-font);
  padding: 0 0 4px;
  height: auto;
}

.ua2e.sheet .header-details {
  display: flex;
  gap: 10px;
}

.ua2e.sheet .header-obsession {
  margin-top: 2px;
}

.ua2e.sheet .wound-type-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ua2e.sheet .wound-type-row .wound-points-area {
  flex: 0 1 68%;
}

.ua2e.sheet .type-checks {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
}

.ua2e.sheet .type-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78em;
  color: var(--ua2e-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.ua2e.sheet .type-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

.ua2e.sheet .header-details select {
  background: var(--ua2e-surface2);
  border: 1px solid var(--ua2e-border);
  color: var(--ua2e-text);
  font-size: 0.85em;
  padding: 2px 4px;
}

/* Wound points bar */
.ua2e.sheet .wound-points-area {
  margin-top: 4px;
}

.ua2e.sheet .wound-points-area label {
  font-size: 0.75em;
  text-transform: uppercase;
  color: var(--ua2e-text-muted);
  letter-spacing: 1px;
}

.ua2e.sheet .wound-bar-wrap {
  background: var(--ua2e-surface2);
  border: 1px solid var(--ua2e-border);
  height: 8px;
  border-radius: 2px;
  margin: 3px 0;
  overflow: hidden;
  max-width: 380px;
}

.ua2e.sheet .wound-bar {
  height: 100%;
  background: linear-gradient(to right, var(--ua2e-accent), var(--ua2e-accent2));
  transition: width 0.3s ease;
}

.ua2e.sheet .wound-bar.healthy { background: #2f9e44; }
.ua2e.sheet .wound-bar.hurt { background: #e9c46a; }
.ua2e.sheet .wound-bar.bad { background: #f4a261; }
.ua2e.sheet .wound-bar.critical { background: #e76f51; }
.ua2e.sheet .wound-bar.dead { background: #8d99ae; }

.ua2e.sheet .wound-values {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85em;
}

.ua2e.sheet .wound-values input {
  width: 40px;
  background: transparent;
  border: 1px solid var(--ua2e-border);
  color: var(--ua2e-text);
  text-align: center;
  padding: 1px;
}

.ua2e.sheet .wound-status {
  font-size: 0.8em;
  font-weight: bold;
  padding: 1px 6px;
  border-radius: 2px;
}

.ua2e.sheet .wound-status.dead {
  background: var(--ua2e-accent);
  color: #fff;
}

.ua2e.sheet .wound-status.unconscious {
  background: var(--ua2e-accent2);
  color: #fff;
}

.ua2e.sheet .wound-status.healthy { background: #2f9e44; color: #fff; }
.ua2e.sheet .wound-status.hurt { background: #e9c46a; color: #000; }
.ua2e.sheet .wound-status.bad { background: #f4a261; color: #000; }
.ua2e.sheet .wound-status.critical { background: #e76f51; color: #fff; }

.ua2e.sheet .header-passions {
  border-top: 1px solid var(--ua2e-border);
  margin-top: 6px;
  padding-top: 6px;
}

.ua2e.sheet .header-passions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ua2e.sheet .header-passions-grid .form-group {
  margin-bottom: 4px;
}

.ua2e.sheet .header-passions-grid .form-group label,
.ua2e.sheet .obsession-inline label {
  min-width: 86px;
  font-size: 0.72em;
}

.ua2e.sheet .obsession-inline {
  margin-top: 4px;
}

/* =====================================================================
   Tab Navigation
   ===================================================================== */

.ua2e.sheet .tabs {
  display: flex;
  background: var(--ua2e-surface);
  border-bottom: 1px solid var(--ua2e-border);
  padding: 0 8px;
}

.ua2e.sheet .tabs .item {
  padding: 6px 14px;
  cursor: pointer;
  color: var(--ua2e-text-muted);
  border-bottom: 2px solid transparent;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.2s, border-color 0.2s;
}

.ua2e.sheet .tabs .item:hover,
.ua2e.sheet .tabs .item.active {
  color: var(--ua2e-text);
  border-bottom-color: var(--ua2e-accent);
}

.ua2e.sheet.vertical-tabs .side-tabs {
  --ua2e-tab-width: 98px;
  position: absolute;
  top: 50px;
  left: calc(100% + 8px);
  width: var(--ua2e-tab-width);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  background: transparent;
  border: none;
  overflow: visible;
}

.ua2e.sheet.vertical-tabs .side-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: var(--ua2e-tab-width);
  min-height: 88px;
  margin: 0 0 8px -12px;
  padding: 12px 10px 14px 10px;
  border: 1px solid rgba(24, 18, 11, 0.44);
  border-left: none;
  border-radius: 0;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.28);
  color: #2d2418;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transform-origin: left center;
  transition: box-shadow 0.18s ease, filter 0.18s ease, margin-left 0.18s ease;
  clip-path: none;
}

.ua2e.sheet.vertical-tabs .side-tab::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(45, 36, 24, 0.52);
  pointer-events: none;
}

.ua2e.sheet.vertical-tabs .side-tab,
.ua2e.sheet.vertical-tabs .side-tab:hover,
.ua2e.sheet.vertical-tabs .side-tab.active {
  color: #2d2418;
  border-bottom-color: transparent;
}

.ua2e.sheet.vertical-tabs .side-tab:hover {
  margin-left: -10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);
  filter: brightness(1.02);
}

.ua2e.sheet.vertical-tabs .side-tab.active {
  margin-left: -12px;
  box-shadow: inset 0 0 0 2px rgba(45, 36, 24, 0.72), 0 12px 24px rgba(0, 0, 0, 0.34);
  filter: saturate(1.06) brightness(1.04);
}

.ua2e.sheet.vertical-tabs .side-tab:nth-child(odd) {
  transform: rotate(-1.9deg);
}

.ua2e.sheet.vertical-tabs .side-tab:nth-child(even) {
  transform: rotate(1.55deg);
}

.ua2e.sheet.vertical-tabs .side-tab.active {
  transform: rotate(-1.2deg);
}

.ua2e.sheet.vertical-tabs .side-tab-pin {
  position: absolute;
  top: 4px;
  left: 8px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: rgba(121, 57, 43, 0.9);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.ua2e.sheet.vertical-tabs .side-tab.active .side-tab-pin {
  opacity: 1;
}

.ua2e.sheet.vertical-tabs .side-tab-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-top: 10px;
}

.ua2e.sheet.vertical-tabs .side-tab-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.18));
}

.ua2e.sheet.vertical-tabs .side-tab-icon.fa-solid,
.ua2e.sheet.vertical-tabs .side-tab-icon.fas {
  width: auto;
  height: auto;
  font-size: 1.4rem;
  line-height: 1;
  color: inherit;
  filter: none;
}

.ua2e.sheet.vertical-tabs .side-tab-label {
  font-size: 0.7em;
  line-height: 1.15;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.ua2e.sheet .postit-sand {
  background: linear-gradient(180deg, #f3e3b2 0%, #e5cf90 100%);
}

.ua2e.sheet .postit-amber {
  background: linear-gradient(180deg, #c39ad6 0%, #8e44ad 100%);
}

.ua2e.sheet .postit-rose {
  background: linear-gradient(180deg, #f0c17f 0%, #e67e22 100%);
}

.ua2e.sheet .postit-blue {
  background: linear-gradient(180deg, #a9cad3 0%, #7aa8b8 100%);
}

.ua2e.sheet .postit-sage {
  background: linear-gradient(180deg, #b8c6a2 0%, #90a47a 100%);
}

.ua2e.sheet .postit-olive {
  background: linear-gradient(180deg, #b8c78e 0%, #7d9250 100%);
}

/* =====================================================================
   Scrollable Tab Body
   ===================================================================== */

.ua2e.sheet .sheet-body,
.ua2e.sheet .tab {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.ua2e.sheet .tab {
  display: none;
}

.ua2e.sheet .tab.active {
  display: block;
}

@media (max-width: 900px) {
  .ua2e.sheet.vertical-tabs .side-tabs {
    position: static;
    left: auto;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
    background: var(--ua2e-surface);
    border-bottom: 1px solid var(--ua2e-border);
  }

  .ua2e.sheet.vertical-tabs .side-tab,
  .ua2e.sheet.vertical-tabs .side-tab.active,
  .ua2e.sheet.vertical-tabs .side-tab:hover {
    flex-direction: row;
    justify-content: flex-start;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 8px 12px;
    border-left: 1px solid rgba(24, 18, 11, 0.28);
    border-radius: 0;
    transform: none;
    clip-path: none;
  }

  .ua2e.sheet.vertical-tabs .side-tab-pin {
    top: 4px;
    left: 6px;
  }

  .ua2e.sheet.vertical-tabs .side-tab-icon-wrap {
    width: 28px;
    height: 28px;
    margin-top: 0;
    margin-left: 8px;
  }

  .ua2e.sheet .sheet-body,
  .ua2e.sheet .tab {
    padding: 12px;
  }
}

/* =====================================================================
   Form Groups
   ===================================================================== */

.ua2e.sheet .form-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ua2e.sheet .form-group label {
  min-width: 130px;
  color: var(--ua2e-text-muted);
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ua2e.sheet .form-group input[type="text"],
.ua2e.sheet .form-group input[type="number"],
.ua2e.sheet .form-group textarea,
.ua2e.sheet .form-group select {
  flex: 1;
  background: var(--ua2e-surface2);
  border: 1px solid var(--ua2e-border);
  color: var(--ua2e-text);
  padding: 4px 6px;
  font-family: var(--ua2e-font);
}

.ua2e.sheet .form-group textarea {
  resize: vertical;
}

.ua2e.sheet .form-group.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.ua2e.sheet .hint {
  font-size: 0.78em;
  color: var(--ua2e-text-muted);
}

/* =====================================================================
   Stats Tab
   ===================================================================== */

.ua2e.sheet .stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.ua2e.sheet .stats-skills-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.ua2e.sheet .stats-skills-columns > .stat-skill-column {
  position: relative;
  transform-origin: 50% 0%;
}

.ua2e.sheet .stats-skills-columns > .stat-skill-column:nth-child(odd) {
  transform: rotate(-1.5deg);
}

.ua2e.sheet .stats-skills-columns > .stat-skill-column:nth-child(even) {
  transform: rotate(1.7deg);
}

.ua2e.sheet .stats-skills-columns > .stat-skill-column:nth-child(3n) {
  transform: rotate(-2.2deg);
}

.ua2e.sheet .tab.stats .stats-skills-columns {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
  align-items: start;
}

.ua2e.sheet .tab.stats .stats-skills-columns > .stat-skill-column {
  min-width: 0;
  width: 100%;
}

.ua2e.sheet .stat-skill-column {
  --ua2e-note-tint: var(--ua2e-accent2);
  background:
    linear-gradient(
      173deg,
      color-mix(in srgb, var(--ua2e-note-tint) 18%, var(--ua2e-surface)) 0%,
      color-mix(in srgb, var(--ua2e-note-tint) 7%, var(--ua2e-surface2)) 100%
    );
  border: 1px solid var(--ua2e-border);
  border-radius: 4px 2px 5px 3px;
  padding: 8px;
  z-index: 1;
}

.ua2e.sheet .stat-skill-column[data-stat="body"] {
  --ua2e-note-tint: var(--ua2e-accent);
}

.ua2e.sheet .stat-skill-column[data-stat="speed"] {
  --ua2e-note-tint: var(--ua2e-accent2);
}

.ua2e.sheet .stat-skill-column[data-stat="mind"] {
  --ua2e-note-tint: var(--ua2e-match);
}

.ua2e.sheet .stat-skill-column[data-stat="soul"] {
  --ua2e-note-tint: var(--ua2e-crit);
}

.ua2e.sheet .stat-skill-column::before {
  content: "";
  position: absolute;
  inset: -2px 0 0 -1px;
  border: 1px dashed color-mix(in srgb, var(--ua2e-text-muted) 55%, transparent);
  border-radius: 2px 5px 3px 4px;
  pointer-events: none;
}

.ua2e.sheet .stat-skill-column .stat-block {
  background:
    linear-gradient(
      176deg,
      color-mix(in srgb, var(--ua2e-note-tint) 11%, var(--ua2e-surface)) 0%,
      color-mix(in srgb, var(--ua2e-note-tint) 5%, var(--ua2e-surface2)) 100%
    );
  border-color: color-mix(in srgb, var(--ua2e-note-tint) 22%, var(--ua2e-border));
  border-left-color: color-mix(in srgb, var(--ua2e-note-tint) 64%, var(--ua2e-border));
  border-left-width: 2px;
  padding: 6px 8px;
  margin-bottom: 8px;
}

.ua2e.sheet .skill-table.compact th,
.ua2e.sheet .skill-table.compact td {
  font-size: 0.8em;
  padding: 2px 3px;
}

.ua2e.sheet .skill-table.compact .skill-value-col {
  width: 78px;
}

.ua2e.sheet .column-add-skill {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
}

.ua2e.sheet .compact-create-btn {
  padding: 2px 8px;
  font-size: 0.75em;
}

.ua2e.sheet .stat-block {
  background: var(--ua2e-surface);
  border: 1px solid var(--ua2e-border);
  border-left: 3px solid var(--ua2e-accent);
  padding: 10px 12px;
  border-radius: 2px;
}

.ua2e.sheet .stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.ua2e.sheet .stat-label {
  margin: 0;
  font-size: 0.95em;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ua2e-accent2);
}

.ua2e.sheet .stat-roll-btn {
  background: transparent;
  border: 1px solid var(--ua2e-border);
  color: var(--ua2e-text-muted);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.85em;
  transition: color 0.2s, border-color 0.2s;
}

.ua2e.sheet .stat-roll-btn:hover {
  color: var(--ua2e-accent2);
  border-color: var(--ua2e-accent2);
}

.ua2e.sheet .stat-value-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ua2e.sheet .stat-input {
  width: 60px;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--ua2e-accent);
  color: var(--ua2e-text);
  font-size: 1.6em;
  font-family: var(--ua2e-font-mono);
  text-align: center;
  padding: 2px;
}

.ua2e.sheet .stat-pct {
  font-size: 1.2em;
  color: var(--ua2e-text-muted);
}

.ua2e.sheet .stat-descriptor input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--ua2e-border);
  color: var(--ua2e-text-muted);
  font-size: 0.85em;
  font-style: italic;
  padding: 2px 0;
  margin-top: 4px;
}

/* Passions & Obsession */
.ua2e.sheet .passions-section,
.ua2e.sheet .obsession-section {
  border-top: 1px solid var(--ua2e-border);
  padding-top: 10px;
  margin-bottom: 10px;
}

.ua2e.sheet .passions-section h3,
.ua2e.sheet .obsession-section h3 {
  color: var(--ua2e-accent2);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.85em;
  margin-bottom: 8px;
}

/* =====================================================================
   Skills Tab
   ===================================================================== */

.ua2e.sheet .skills-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ua2e.sheet .create-btn {
  background: var(--ua2e-surface2);
  border: 1px solid var(--ua2e-border);
  color: var(--ua2e-text);
  cursor: pointer;
  padding: 4px 10px;
  font-size: 0.85em;
  transition: background 0.2s;
}

.ua2e.sheet .create-btn:hover {
  background: var(--ua2e-accent);
  border-color: var(--ua2e-accent);
}

.ua2e.sheet .skill-group {
  --ua2e-note-tint: var(--ua2e-accent2);
  position: relative;
  background:
    linear-gradient(
      168deg,
      color-mix(in srgb, var(--ua2e-note-tint) 16%, var(--ua2e-surface)) 0%,
      color-mix(in srgb, var(--ua2e-note-tint) 8%, var(--ua2e-surface2)) 100%
    );
  border: 1px solid color-mix(in srgb, var(--ua2e-note-tint) 28%, var(--ua2e-border));
  border-radius: 4px 2px 6px 3px;
  padding: 9px 10px 8px;
  margin-bottom: 14px;
  transform-origin: 50% 0%;
}

.ua2e.sheet .tab.skills .skill-group:nth-of-type(odd) {
  transform: rotate(-1.8deg);
}

.ua2e.sheet .tab.skills .skill-group:nth-of-type(even) {
  transform: rotate(1.4deg);
}

.ua2e.sheet .tab.skills .skill-group:nth-of-type(3n) {
  transform: rotate(-2.6deg);
}

.ua2e.sheet .tab.skills .skill-group + .skill-group {
  margin-top: -6px;
}

.ua2e.sheet .skill-group::before {
  content: "";
  position: absolute;
  inset: -2px 1px 0 -1px;
  border: 1px dashed color-mix(in srgb, var(--ua2e-note-tint) 36%, var(--ua2e-border));
  border-radius: 3px 6px 2px 5px;
  pointer-events: none;
}

.ua2e.sheet .skill-group[data-stat="body"] {
  --ua2e-note-tint: var(--ua2e-accent);
}

.ua2e.sheet .skill-group[data-stat="speed"] {
  --ua2e-note-tint: var(--ua2e-accent2);
}

.ua2e.sheet .skill-group[data-stat="mind"] {
  --ua2e-note-tint: var(--ua2e-match);
}

.ua2e.sheet .skill-group[data-stat="soul"] {
  --ua2e-note-tint: var(--ua2e-crit);
}

.ua2e.sheet .skill-group-header {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.8em;
  color: var(--ua2e-accent2);
  margin-bottom: 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--ua2e-border);
}

.ua2e.sheet .skill-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

.ua2e.sheet .skill-table th {
  color: var(--ua2e-text-muted);
  font-size: 0.78em;
  text-align: left;
  padding: 2px 4px;
  font-weight: normal;
  text-transform: uppercase;
}

.ua2e.sheet .skill-row {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
}

.ua2e.sheet .skill-row:hover {
  background: rgba(255,255,255,0.03);
}

.ua2e.sheet .skill-row.obsession {
  background: rgba(192, 57, 43, 0.08);
}

.ua2e.sheet .skill-row.free-skill {
  opacity: 0.8;
}

.ua2e.sheet .obsession-col {
  width: 24px;
  text-align: center;
}

.ua2e.sheet .obsession-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ua2e-border);
  font-size: 1em;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.ua2e.sheet .obsession-toggle:hover,
.ua2e.sheet .obsession-toggle.active {
  color: var(--ua2e-crit);
}

.ua2e.sheet .obsession-icon.active {
  color: var(--ua2e-crit);
}

.ua2e.sheet .skill-name-col {
  padding: 4px;
}

.ua2e.sheet .tag {
  display: inline-block;
  font-size: 0.7em;
  padding: 0 4px;
  border-radius: 2px;
  margin-left: 4px;
  vertical-align: middle;
}

.ua2e.sheet .free-tag {
  background: var(--ua2e-surface2);
  border: 1px solid var(--ua2e-border);
  color: var(--ua2e-text-muted);
}

.ua2e.sheet .skill-value-col {
  width: 50px;
  text-align: center;
  font-family: var(--ua2e-font-mono);
  color: var(--ua2e-accent2);
  font-weight: bold;
}

.ua2e.sheet .skill-controls-col {
  width: 80px;
  text-align: right;
  white-space: nowrap;
}

.ua2e.sheet .skill-controls-col button {
  background: transparent;
  border: none;
  color: var(--ua2e-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 2px 3px;
  font-size: 0.8em;
  transition: color 0.2s;
}

.ua2e.sheet .skill-controls-col button:hover {
  color: var(--ua2e-text);
}

.ua2e.sheet .strangeness-group .skill-group-header {
  color: var(--ua2e-match);
}

/* =====================================================================
   Madness Tab
   ===================================================================== */

.ua2e.sheet .madness-intro {
  font-size: 0.85em;
  color: var(--ua2e-text-muted);
  font-style: italic;
  margin-bottom: 10px;
}

.ua2e.sheet .madness-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
}

.ua2e.sheet .stress-meters-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.ua2e.sheet .stress-meter-card {
  --ua2e-note-tint: var(--ua2e-accent2);
  position: relative;
  background:
    linear-gradient(
      164deg,
      color-mix(in srgb, var(--ua2e-note-tint) 22%, var(--ua2e-surface)) 0%,
      color-mix(in srgb, var(--ua2e-note-tint) 9%, var(--ua2e-surface2)) 100%
    );
  border: 1px solid color-mix(in srgb, var(--ua2e-note-tint) 30%, var(--ua2e-border));
  border-radius: 4px 2px 5px 3px;
  padding: 6px;
  transform-origin: 50% 0%;
}

.ua2e.sheet .stress-meter-card::before {
  content: "";
  position: absolute;
  inset: -2px 1px 0 -1px;
  border: 1px dashed color-mix(in srgb, var(--ua2e-note-tint) 38%, var(--ua2e-border));
  border-radius: 2px 5px 3px 4px;
  pointer-events: none;
}

.ua2e.sheet .stress-meter-card[data-meter="violence"] {
  --ua2e-note-tint: var(--ua2e-accent);
  transform: rotate(-2.1deg);
}

.ua2e.sheet .stress-meter-card[data-meter="unnatural"] {
  --ua2e-note-tint: var(--ua2e-match);
  transform: rotate(1.5deg) translateY(2px);
}

.ua2e.sheet .stress-meter-card[data-meter="helplessness"] {
  --ua2e-note-tint: var(--ua2e-crit);
  transform: rotate(-1.6deg) translateY(-1px);
}

.ua2e.sheet .stress-meter-card[data-meter="isolation"] {
  --ua2e-note-tint: color-mix(in srgb, var(--ua2e-bg) 78%, var(--ua2e-border));
  transform: rotate(2.4deg) translateY(1px);
}

.ua2e.sheet .stress-meter-card[data-meter="self"] {
  --ua2e-note-tint: var(--ua2e-success);
  transform: rotate(-1.2deg) translateY(3px);
}

.ua2e.sheet .stress-meter-card .meter-name {
  padding: 0;
  min-width: 0;
  margin: 0 0 6px 0;
  font-size: 0.78em;
}

.ua2e.sheet .stress-meter-card .meter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ua2e.sheet .stress-meter-card .stress-roll-btn {
  flex: 0 0 auto;
}

.ua2e.sheet .stress-meter-card .meter-track {
  margin-bottom: 6px;
}

.ua2e.sheet .stress-meter-card .meter-track-label {
  font-size: 0.68em;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ua2e-text-muted);
  margin-bottom: 2px;
}

.ua2e.sheet .stress-meter-card .notch-row {
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.ua2e.sheet .stress-meter-card .notch {
  font-size: 0.95em;
}

.ua2e.sheet .stress-meter-card .notch-btn {
  width: 16px;
  height: 16px;
  font-size: 0.78em;
}

.ua2e.sheet .stress-meter-card .notch-count {
  font-size: 0.78em;
}

.ua2e.sheet .madness-table th {
  color: var(--ua2e-text-muted);
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 8px;
  text-align: left;
  border-bottom: 1px solid var(--ua2e-border);
}

.ua2e.sheet .madness-table .notch-hint {
  font-weight: normal;
  font-style: italic;
  font-size: 0.9em;
}

.ua2e.sheet .madness-row {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.ua2e.sheet .meter-name {
  padding: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.88em;
  min-width: 110px;
}

.ua2e.sheet .notch-row {
  display: flex;
  gap: 2px;
  margin-bottom: 4px;
}

.ua2e.sheet .notch {
  font-size: 1.1em;
  cursor: default;
  transition: color 0.2s;
}

.ua2e.sheet .notch.hardened {
  color: var(--ua2e-border);
}

.ua2e.sheet .notch.hardened.filled {
  color: var(--ua2e-accent2);
}

.ua2e.sheet .notch.failed {
  color: var(--ua2e-border);
}

.ua2e.sheet .notch.failed.filled {
  color: var(--ua2e-accent);
}

.ua2e.sheet .notch-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ua2e.sheet .notch-btn {
  background: var(--ua2e-surface2);
  border: 1px solid var(--ua2e-border);
  color: var(--ua2e-text);
  cursor: pointer;
  width: 20px;
  height: 20px;
  font-size: 0.9em;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.ua2e.sheet .notch-btn:hover {
  background: var(--ua2e-accent);
}

.ua2e.sheet .notch-count {
  font-family: var(--ua2e-font-mono);
  font-size: 0.85em;
  color: var(--ua2e-text-muted);
  min-width: 18px;
  text-align: center;
}

.ua2e.sheet .madness-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ua2e-border);
}

.ua2e.sheet .madness-input-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82em;
}

.ua2e.sheet .madness-num-input {
  width: 38px;
  background: var(--ua2e-surface2);
  border: 1px solid var(--ua2e-border);
  color: var(--ua2e-text);
  text-align: center;
  padding: 2px;
  font-family: var(--ua2e-font-mono);
}

.ua2e.sheet .stress-afflictions-section {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--ua2e-border);
}

/* =====================================================================
   Biography / Item Sheet body
   ===================================================================== */

.ua2e.sheet .bio-section {
  margin-bottom: 16px;
}

.ua2e.sheet .bio-section h3 {
  color: var(--ua2e-accent2);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.82em;
  margin-bottom: 6px;
}

.ua2e.sheet .bio-textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  background: var(--ua2e-surface2);
  border: 1px solid var(--ua2e-border);
  color: var(--ua2e-text);
  padding: 8px;
  font-family: var(--ua2e-font);
  line-height: 1.4;
}

/* =====================================================================
   Item Sheets
   ===================================================================== */

.ua2e-item-sheet {
  font-family: var(--ua2e-font);
  color: var(--ua2e-text);
  background: var(--ua2e-bg);
}

.ua2e-item-sheet .item-sheet-header {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: var(--ua2e-surface);
  border-bottom: 2px solid var(--ua2e-accent);
  align-items: center;
}

.ua2e-item-sheet .item-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 1px solid var(--ua2e-border);
  cursor: pointer;
}

.ua2e-item-sheet .item-name {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ua2e-border);
  color: var(--ua2e-text);
  font-size: 1.2em;
  font-family: var(--ua2e-font);
}

.ua2e-item-sheet .sheet-body {
  padding: 12px;
}

.ua2e-item-sheet .form-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ua2e-item-sheet .form-group label {
  min-width: 140px;
  font-size: 0.85em;
  color: var(--ua2e-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ua2e-item-sheet .form-group input[type="text"],
.ua2e-item-sheet .form-group input[type="number"],
.ua2e-item-sheet .form-group textarea,
.ua2e-item-sheet .form-group select {
  flex: 1;
  background: var(--ua2e-surface2);
  border: 1px solid var(--ua2e-border);
  color: var(--ua2e-text);
  padding: 4px 6px;
  font-family: var(--ua2e-font);
}

.ua2e-item-sheet .pct-label {
  color: var(--ua2e-text-muted);
  font-size: 1.1em;
}

/* =====================================================================
   Chat Roll Card
   ===================================================================== */

.ua2e-roll-card {
  font-family: var(--ua2e-font-mono);
  background: var(--ua2e-surface);
  border: 1px solid var(--ua2e-border);
  border-left: 4px solid var(--ua2e-text-muted);
  padding: 8px 10px;
  font-size: 0.9em;
}

.ua2e-roll-card.crit     { border-left-color: var(--ua2e-crit);    }
.ua2e-roll-card.fumble   { border-left-color: var(--ua2e-accent);  }
.ua2e-roll-card.strong   { border-left-color: var(--ua2e-success); }
.ua2e-roll-card.success  { border-left-color: var(--ua2e-success); }
.ua2e-roll-card.hailmary { border-left-color: var(--ua2e-match);   }
.ua2e-roll-card.weak     { border-left-color: var(--ua2e-accent2); }
.ua2e-roll-card.fail     { border-left-color: var(--ua2e-accent);  }

.ua2e-roll-card .roll-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.ua2e-roll-card .roll-label {
  font-weight: bold;
  font-size: 1em;
  color: #eee;
}

.ua2e-roll-card .check-type-badge {
  font-size: 0.78em;
  text-transform: uppercase;
  color: var(--ua2e-text-muted);
  align-self: center;
}

.ua2e-roll-card .roll-numbers {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.ua2e-roll-card .roll-total {
  font-size: 2em;
  font-weight: bold;
  color: #fff;
  font-family: var(--ua2e-font-mono);
}

.ua2e-roll-card .roll-vs {
  color: var(--ua2e-text-muted);
  font-size: 0.85em;
}

.ua2e-roll-card .roll-target {
  font-size: 1.1em;
  color: var(--ua2e-accent2);
}

.ua2e-roll-card .target-type {
  font-size: 0.75em;
  color: var(--ua2e-text-muted);
}

.ua2e-roll-card .roll-shift {
  font-size: 0.8em;
  color: var(--ua2e-text-muted);
}

.ua2e-roll-card .roll-indicators {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.ua2e-roll-card .indicator {
  font-size: 0.78em;
  padding: 1px 6px;
  border-radius: 2px;
  font-weight: bold;
}

.ua2e-roll-card .indicator.crit   { background: var(--ua2e-crit);   color: #000; }
.ua2e-roll-card .indicator.fumble { background: var(--ua2e-accent); color: #fff; }
.ua2e-roll-card .indicator.match  { background: var(--ua2e-match);  color: #fff; }

.ua2e-roll-card .roll-outcome {
  font-size: 1em;
  font-weight: bold;
  padding: 2px 0;
}

.ua2e-roll-card .outcome-crit     { color: var(--ua2e-crit);    }
.ua2e-roll-card .outcome-fumble   { color: var(--ua2e-accent);  }
.ua2e-roll-card .outcome-strong   { color: var(--ua2e-success); }
.ua2e-roll-card .outcome-success  { color: var(--ua2e-success); }
.ua2e-roll-card .outcome-hailmary { color: var(--ua2e-match);   }
.ua2e-roll-card .outcome-weak     { color: var(--ua2e-accent2); }
.ua2e-roll-card .outcome-fail     { color: var(--ua2e-accent);  }

.ua2e-roll-card .roll-warning {
  font-size: 0.8em;
  color: var(--ua2e-accent2);
  margin-top: 4px;
}

.ua2e-roll-card .flip-option {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--ua2e-border);
  font-size: 0.88em;
  color: var(--ua2e-crit);
}

.ua2e-roll-card .flip-label {
  margin-right: 4px;
  font-weight: bold;
}

.ua2e-roll-card .flip-total {
  font-family: var(--ua2e-font-mono);
  font-weight: bold;
}

/* =====================================================================
   Roll Dialog
   ===================================================================== */

.ua2e-roll-dialog .form-group {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ua2e-roll-dialog label {
  min-width: 140px;
  font-size: 0.9em;
}

.ua2e-roll-dialog .checktype-checkboxes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.ua2e-roll-dialog .checktype-checkboxes label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
}

.ua2e-roll-dialog .hint {
  font-size: 0.85em;
  color: #888;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #333;
}

/* =====================================================================
   Strangeness tags in stats soul column
   ===================================================================== */

.ua2e.sheet .strangeness-tag {
  padding: 0 4px;
  border-radius: 2px;
  font-size: 0.68em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ua2e.sheet .strangeness-tag.magick {
  background: rgba(142, 68, 173, 0.25);
  border: 1px solid var(--ua2e-match);
  color: var(--ua2e-match);
}

.ua2e.sheet .strangeness-tag.avatar {
  background: rgba(230, 126, 34, 0.2);
  border: 1px solid var(--ua2e-accent2);
  color: var(--ua2e-accent2);
}

.ua2e.sheet .skill-row.strangeness-skill {
  background: rgba(142, 68, 173, 0.06);
}

/* =====================================================================
   Adept / Avatar Tab Shared
   ===================================================================== */

.ua2e.sheet .adept-obsession-banner {
  --ua2e-note-tint: var(--ua2e-match);
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background:
    linear-gradient(
      164deg,
      color-mix(in srgb, var(--ua2e-note-tint) 22%, var(--ua2e-surface)) 0%,
      color-mix(in srgb, var(--ua2e-note-tint) 10%, var(--ua2e-surface2)) 100%
    );
  border: 1px solid color-mix(in srgb, var(--ua2e-note-tint) 34%, var(--ua2e-border));
  border-left: 4px solid color-mix(in srgb, var(--ua2e-note-tint) 72%, var(--ua2e-border));
  border-radius: 4px 2px 6px 3px;
  padding: 8px 14px;
  margin-bottom: 12px;
  transform: rotate(-1.3deg);
}

.ua2e.sheet .adept-obsession-banner::before {
  content: "";
  position: absolute;
  inset: -2px 1px 0 -1px;
  border: 1px dashed color-mix(in srgb, var(--ua2e-note-tint) 40%, var(--ua2e-border));
  border-radius: 2px 6px 3px 5px;
  pointer-events: none;
}

.ua2e.sheet .adept-obsession-banner.avatar-banner {
  --ua2e-note-tint: var(--ua2e-accent2);
  transform: rotate(1.1deg);
}

.ua2e.sheet .adept-obsession-label {
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ua2e-text-muted);
  min-width: 120px;
}

.ua2e.sheet .adept-obsession-name {
  flex: 1;
  font-size: 1em;
  font-weight: bold;
  color: var(--ua2e-text);
}

.ua2e.sheet .adept-obsession-value {
  font-size: 1.6em;
  font-family: var(--ua2e-font-mono);
  font-weight: bold;
  color: var(--ua2e-match);
}

.ua2e.sheet .adept-obsession-banner.avatar-banner .adept-obsession-value {
  color: var(--ua2e-accent2);
}

.ua2e.sheet .adept-hint {
  border: 1px dashed var(--ua2e-border);
  padding: 8px 12px;
  margin-bottom: 12px;
  color: var(--ua2e-text-muted);
  font-style: italic;
}

.ua2e.sheet .adept-section {
  --ua2e-note-tint: var(--ua2e-accent2);
  position: relative;
  background:
    linear-gradient(
      168deg,
      color-mix(in srgb, var(--ua2e-note-tint) 16%, var(--ua2e-surface)) 0%,
      color-mix(in srgb, var(--ua2e-note-tint) 8%, var(--ua2e-surface2)) 100%
    );
  border: 1px solid color-mix(in srgb, var(--ua2e-note-tint) 28%, var(--ua2e-border));
  border-radius: 4px 2px 6px 3px;
  padding: 9px 10px 8px;
  margin-bottom: 14px;
  transform-origin: 50% 0%;
}

.ua2e.sheet .tab.adept .adept-section {
  --ua2e-note-tint: var(--ua2e-match);
}

.ua2e.sheet .tab.avatar .adept-section {
  --ua2e-note-tint: var(--ua2e-accent2);
}

.ua2e.sheet .adept-section::before {
  content: "";
  position: absolute;
  inset: -2px 1px 0 -1px;
  border: 1px dashed color-mix(in srgb, var(--ua2e-note-tint) 34%, var(--ua2e-border));
  border-radius: 3px 6px 2px 5px;
  pointer-events: none;
}

.ua2e.sheet .tab.adept .adept-section:nth-of-type(odd),
.ua2e.sheet .tab.avatar .adept-section:nth-of-type(odd) {
  transform: rotate(-1.7deg);
}

.ua2e.sheet .tab.adept .adept-section:nth-of-type(even),
.ua2e.sheet .tab.avatar .adept-section:nth-of-type(even) {
  transform: rotate(1.4deg);
}

.ua2e.sheet .tab.adept .adept-section:nth-of-type(3n),
.ua2e.sheet .tab.avatar .adept-section:nth-of-type(3n) {
  transform: rotate(-2.3deg);
}

.ua2e.sheet .adept-section + .adept-section {
  margin-top: -4px;
}

.ua2e.sheet .adept-section-title {
  font-size: 0.82em;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ua2e-accent2);
  border-bottom: 1px solid var(--ua2e-border);
  padding-bottom: 3px;
  margin: 0 0 8px 0;
}

.ua2e.sheet .adept-taboo-input,
.ua2e.sheet .adept-section textarea {
  width: 100%;
  background: var(--ua2e-surface2);
  border: 1px solid var(--ua2e-border);
  color: var(--ua2e-text);
  font-family: var(--ua2e-font);
  font-size: 0.9em;
  padding: 6px 8px;
  resize: vertical;
}

/* =====================================================================
   Charge Counters
   ===================================================================== */

.ua2e.sheet .charge-counters {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.ua2e.sheet .charge-counter {
  --ua2e-note-tint: var(--ua2e-border);
  position: relative;
  flex: 1;
  background:
    linear-gradient(
      172deg,
      color-mix(in srgb, var(--ua2e-note-tint) 14%, var(--ua2e-surface)) 0%,
      color-mix(in srgb, var(--ua2e-note-tint) 7%, var(--ua2e-surface2)) 100%
    );
  border: 1px solid color-mix(in srgb, var(--ua2e-note-tint) 35%, var(--ua2e-border));
  border-radius: 4px 2px 5px 3px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform-origin: 50% 0%;
}

.ua2e.sheet .charge-counter::before {
  content: "";
  position: absolute;
  inset: -2px 1px 0 -1px;
  border: 1px dashed color-mix(in srgb, var(--ua2e-note-tint) 30%, var(--ua2e-border));
  border-radius: 3px 5px 2px 4px;
  pointer-events: none;
}

.ua2e.sheet .charge-counter.minor {
  --ua2e-note-tint: var(--ua2e-text-muted);
  transform: rotate(-1.6deg);
}

.ua2e.sheet .charge-counter.significant {
  --ua2e-note-tint: var(--ua2e-accent2);
  transform: rotate(1.2deg);
}

.ua2e.sheet .charge-counter.major {
  --ua2e-note-tint: var(--ua2e-crit);
  transform: rotate(-2.1deg);
}

.ua2e.sheet .charge-label {
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  min-width: 0;
  text-align: center;
}

.ua2e.sheet .charge-label.minor       { color: var(--ua2e-text-muted); }
.ua2e.sheet .charge-label.significant { color: var(--ua2e-accent2);    }
.ua2e.sheet .charge-label.major       { color: var(--ua2e-crit);       }

.ua2e.sheet .charge-input {
  width: 48px;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--ua2e-border);
  color: var(--ua2e-text);
  font-size: 1.8em;
  font-family: var(--ua2e-font-mono);
  text-align: center;
  padding: 2px 0;
}

.ua2e.sheet .charge-counter.minor .charge-input     { border-bottom-color: var(--ua2e-border);  }
.ua2e.sheet .charge-counter.significant .charge-input { border-bottom-color: var(--ua2e-accent2); }
.ua2e.sheet .charge-counter.major .charge-input     { border-bottom-color: var(--ua2e-crit);    }

.ua2e.sheet .charge-howto-group {
  align-items: flex-start;
}

.ua2e.sheet .charge-howto-group label {
  min-width: 130px;
}

.ua2e.sheet .charge-howto-group textarea {
  flex: 1;
}

/* =====================================================================
   Spell Table
   ===================================================================== */

.ua2e.sheet .spell-cost-col {
  width: 120px;
}

.ua2e.sheet .charge-badge {
  display: inline-block;
  font-size: 0.75em;
  font-family: var(--ua2e-font-mono);
  padding: 1px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ua2e.sheet .charge-badge.minor {
  background: rgba(68,68,68,0.6);
  border: 1px solid var(--ua2e-border);
  color: var(--ua2e-text-muted);
}

.ua2e.sheet .charge-badge.significant {
  background: rgba(230,126,34,0.2);
  border: 1px solid var(--ua2e-accent2);
  color: var(--ua2e-accent2);
}

.ua2e.sheet .charge-badge.major {
  background: rgba(241,196,15,0.2);
  border: 1px solid var(--ua2e-crit);
  color: var(--ua2e-crit);
}

/* =====================================================================
   Channel Timeline
   ===================================================================== */

.ua2e.sheet .channel-timeline {
  position: relative;
  padding-left: 48px;
}

.ua2e.sheet .channel-node {
  position: relative;
  margin-bottom: 0;
  display: flex;
  align-items: flex-start;
  gap: 0;
  min-height: 48px;
}

/* Vertical line connecting nodes */
.ua2e.sheet .channel-node:not(:last-child) .channel-spine {
  position: absolute;
  left: -28px;
  top: 24px;
  width: 2px;
  bottom: 0;
  background: var(--ua2e-border);
}

.ua2e.sheet .channel-node.unlocked:not(:last-child) .channel-spine {
  background: var(--ua2e-accent2);
}

/* Node dot */
.ua2e.sheet .channel-node::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ua2e-border);
  border: 2px solid var(--ua2e-surface);
  z-index: 1;
}

.ua2e.sheet .channel-node.unlocked::before {
  background: var(--ua2e-accent2);
  box-shadow: 0 0 6px rgba(230,126,34,0.5);
}

.ua2e.sheet .channel-threshold {
  position: absolute;
  left: -60px;
  top: 12px;
  text-align: right;
  width: 44px;
}

.ua2e.sheet .channel-threshold-value {
  font-size: 0.68em;
  font-family: var(--ua2e-font-mono);
  color: var(--ua2e-text-muted);
}

.ua2e.sheet .channel-node.unlocked .channel-threshold-value {
  color: var(--ua2e-accent2);
  font-weight: bold;
}

.ua2e.sheet .channel-content {
  position: relative;
  flex: 1;
  background:
    linear-gradient(
      168deg,
      color-mix(in srgb, var(--ua2e-accent2) 12%, var(--ua2e-surface)) 0%,
      color-mix(in srgb, var(--ua2e-accent2) 6%, var(--ua2e-surface2)) 100%
    );
  border: 1px solid color-mix(in srgb, var(--ua2e-accent2) 24%, var(--ua2e-border));
  border-radius: 4px 2px 5px 3px;
  padding: 8px 10px;
  margin-bottom: 8px;
  transition: border-color 0.2s, background 0.2s;
  transform-origin: 50% 0%;
}

.ua2e.sheet .channel-content::before {
  content: "";
  position: absolute;
  inset: -2px 1px 0 -1px;
  border: 1px dashed color-mix(in srgb, var(--ua2e-accent2) 36%, var(--ua2e-border));
  border-radius: 3px 5px 2px 4px;
  pointer-events: none;
}

.ua2e.sheet .channel-node:nth-child(odd) .channel-content {
  transform: rotate(-1.4deg);
}

.ua2e.sheet .channel-node:nth-child(even) .channel-content {
  transform: rotate(1.2deg);
}

.ua2e.sheet .channel-node.unlocked .channel-content {
  border-color: rgba(230,126,34,0.4);
  background: rgba(230,126,34,0.05);
}

.ua2e.sheet .channel-node.locked .channel-content {
  opacity: 0.55;
}

.ua2e.sheet .channel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ua2e.sheet .channel-name {
  font-size: 0.9em;
  font-weight: bold;
  color: var(--ua2e-text);
}

.ua2e.sheet .channel-node.locked .channel-name {
  color: var(--ua2e-text-muted);
}

.ua2e.sheet .channel-controls {
  width: auto;
  display: flex;
  gap: 2px;
}

}

/* =====================================================================
   Scrollbar Styling
   ===================================================================== */

.ua2e.sheet ::-webkit-scrollbar {
  width: 5px;
}

.ua2e.sheet ::-webkit-scrollbar-track {
  background: var(--ua2e-bg);
}

.ua2e.sheet ::-webkit-scrollbar-thumb {
  background: var(--ua2e-border);
  border-radius: 3px;
}

.ua2e.sheet ::-webkit-scrollbar-thumb:hover {
  background: var(--ua2e-accent);
}
