/* skui.css  skeuomorphic dark theme
   based on skeuocord aesthetic: charcoal, gold, blue-steel depth */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

/* =========================================================
   CSS CUSTOM PROPERTIES
   ========================================================= */

:root {
  /* backgrounds */
  --bg-void:        #111315;
  --bg-deep:        #1a1d1f;
  --bg-base:        #22262a;
  --bg-raised:      #2a2e33;
  --bg-float:       #32373d;
  --bg-hover:       #3a3f46;

  /* surfaces  gradient pairs (top, bottom) */
  --surf-t:         #3c4148;
  --surf-b:         #282c31;
  --surf-btn-t:     #444b54;
  --surf-btn-b:     #2e3339;

  /* text */
  --text-primary:   #dddfe2;
  --text-secondary: #9ea3a9;
  --text-muted:     #686d73;
  --text-inverse:   #ffffff;
  --text-link:      #6b95cc;

  /* accent  blue-steel */
  --blue-t:         #5b82be;
  --blue-b:         #3b5f96;
  --blue-lit:       #7aa0d4;
  --blue-dim:       #2d4a76;

  /* accent  secondary */
  --secondary-t:         #d4a840;
  --secondary-b:         #a07820;
  --secondary-lit:       #f0c84a;
  --secondary-glow:      rgba(200, 160, 40, 0.25);

  /* semantic */
  --danger-t:       #c94040;
  --danger-b:       #a02828;
  --success-t:      #3a9e6c;
  --success-b:      #2a7650;
  --warn-t:         #c8821a;
  --warn-b:         #9a5e10;

  /* borders */
  --border-hi:      rgba(255, 255, 255, 0.07);
  --border-lo:      rgba(0, 0, 0, 0.45);
  --border-mid:     rgba(0, 0, 0, 0.25);

  /* shadows */
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.4), 0 1px 0 rgba(0,0,0,0.3);
  --shadow-md:      0 3px 10px rgba(0,0,0,0.5), 0 1px 3px rgba(0,0,0,0.4);
  --shadow-lg:      0 8px 30px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.5);
  --shadow-inset:   inset 0 2px 6px rgba(0,0,0,0.5), inset 0 1px 0 rgba(0,0,0,0.3);

  /* bevel highlight / shadow lines */
  --bevel-hi:       inset 0 1px 0 rgba(255,255,255,0.08);
  --bevel-lo:       inset 0 -1px 0 rgba(0,0,0,0.35);

  /* geometry */
  --radius-sm:      3px;
  --radius-md:      5px;
  --radius-lg:      8px;
  --radius-xl:      12px;
  --radius-pill:    999px;

  /* type */
  --font-sans:      'Syne', system-ui, -apple-system, sans-serif;
  --font-mono:      'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --font-display:   'Syne', system-ui, sans-serif;

  --text-xs:        0.688rem;
  --text-sm:        0.813rem;
  --text-base:      0.938rem;
  --text-md:        1.063rem;
  --text-lg:        1.25rem;
  --text-xl:        1.5rem;
  --text-2xl:       2rem;

  /* transitions */
  --ease-out:       cubic-bezier(0.2, 0, 0, 1);
  --dur-fast:       80ms;
  --dur-base:       150ms;
  --dur-slow:       260ms;
}

/* =========================================================
   RESET & BASE
   ========================================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text-primary);
  background-color: var(--bg-void);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36'%3E%3Cline x1='0' y1='36' x2='36' y2='0' stroke='rgba(70,95,140,0.07)' stroke-width='1'/%3E%3Cline x1='0' y1='18' x2='18' y2='0' stroke='rgba(70,95,140,0.04)' stroke-width='0.8'/%3E%3Cline x1='18' y1='36' x2='36' y2='18' stroke='rgba(70,95,140,0.04)' stroke-width='0.8'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(60,70,90,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 80% 100%, rgba(40,55,80,0.12) 0%, transparent 70%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px;
}

/* =========================================================
   TYPOGRAPHY
   ========================================================= */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl);  }
h3 { font-size: var(--text-lg);  }
h4 { font-size: var(--text-md);  }
h5 { font-size: var(--text-base); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
h6 { font-size: var(--text-sm);  font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }

p { color: var(--text-secondary); line-height: 1.65; }

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--blue-lit); text-decoration: underline; }

strong { color: var(--text-primary); font-weight: 600; }
em     { color: var(--text-secondary); }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-deep);
  color: #c8d8f0;
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-lo);
  box-shadow: var(--shadow-inset);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--bg-deep);
  color: #c8d8f0;
  padding: 1.25em 1.5em;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-lo);
  box-shadow: var(--shadow-inset), var(--bevel-hi);
  overflow-x: auto;
  line-height: 1.7;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
  font-size: 1em;
}

kbd {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: linear-gradient(180deg, var(--surf-t) 0%, var(--surf-b) 100%);
  color: var(--text-secondary);
  padding: 0.15em 0.5em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-lo);
  box-shadow: var(--bevel-hi), var(--bevel-lo), 0 2px 0 var(--border-lo);
  vertical-align: middle;
}

blockquote {
  border-left: 3px solid var(--secondary-b);
  padding: 0.6em 1.2em;
  margin: 1em 0;
  background: linear-gradient(90deg, rgba(160,120,32,0.06) 0%, transparent 100%);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}

hr {
  border: none;
  border-top: 1px solid var(--border-lo);
  box-shadow: 0 1px 0 var(--border-hi);
  margin: 1.5em 0;
}

mark {
  background: rgba(200, 168, 40, 0.28);
  color: var(--secondary-lit);
  padding: 0.05em 0.3em;
  border-radius: 2px;
}

/* =========================================================
   PANEL / CARD SURFACE
   ========================================================= */

.panel {
  background: linear-gradient(180deg, var(--surf-t) 0%, var(--surf-b) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-lo);
  box-shadow:
    var(--bevel-hi),
    var(--bevel-lo),
    var(--shadow-md);
  padding: 1.25rem;
}

.panel--raised {
  background: linear-gradient(180deg, var(--bg-hover) 0%, var(--bg-float) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.09),
    inset 0 -1px 0 rgba(0,0,0,0.4),
    var(--shadow-lg);
}

.panel--inset {
  background: var(--bg-deep);
  box-shadow: var(--shadow-inset);
  border: 1px solid var(--border-lo);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.panel__header {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-lo);
  box-shadow: 0 1px 0 var(--border-hi);
}

.panel__footer {
  margin-top: 0.875rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-lo);
  box-shadow: inset 0 1px 0 var(--border-hi);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  padding: 0.55em 1.2em;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    filter var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
  user-select: none;
  -webkit-user-select: none;
}

.btn:active {
  transform: translateY(1px);
}

/* primary  blue steel */
.btn--primary {
  background: linear-gradient(180deg, var(--blue-t) 0%, var(--blue-b) 100%);
  color: #fff;
  border-color: rgba(0,0,0,0.4);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 2px 6px rgba(0,0,0,0.5),
    0 1px 2px rgba(0,0,0,0.4);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.btn--primary:hover {
  filter: brightness(1.12);
}
.btn--primary:active {
  background: linear-gradient(180deg, var(--blue-b) 0%, var(--blue-dim) 100%);
  box-shadow:
    inset 0 2px 5px rgba(0,0,0,0.5),
    0 1px 0 rgba(255,255,255,0.04);
}

/* secondary */
.btn--secondary {
  background: linear-gradient(180deg, var(--secondary-t) 0%, var(--secondary-b) 100%);
  color: #1a1200;
  border-color: rgba(0,0,0,0.4);
  box-shadow:
    inset 0 1px 0 rgba(255,220,80,0.3),
    inset 0 -1px 0 rgba(0,0,0,0.35),
    0 2px 6px rgba(0,0,0,0.5),
    0 0 8px var(--secondary-glow);
  text-shadow: 0 1px 1px rgba(255,200,60,0.4);
}
.btn--secondary:hover { filter: brightness(1.1); }
.btn--secondary:active {
  background: linear-gradient(180deg, var(--secondary-b) 0%, #805e14 100%);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

/* danger */
.btn--danger {
  background: linear-gradient(180deg, var(--danger-t) 0%, var(--danger-b) 100%);
  color: #fff;
  border-color: rgba(0,0,0,0.4);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 2px 6px rgba(0,0,0,0.5);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.btn--danger:hover { filter: brightness(1.12); }
.btn--danger:active {
  background: linear-gradient(180deg, var(--danger-b) 0%, #7a1e1e 100%);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

/* ghost */
.btn--ghost {
  background: linear-gradient(180deg, var(--surf-btn-t) 0%, var(--surf-btn-b) 100%);
  color: var(--text-secondary);
  border-color: var(--border-lo);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 2px 4px rgba(0,0,0,0.35);
}
.btn--ghost:hover {
  color: var(--text-primary);
  filter: brightness(1.08);
}
.btn--ghost:active {
  background: linear-gradient(180deg, var(--surf-b) 0%, var(--bg-raised) 100%);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

/* success */
.btn--success {
  background: linear-gradient(180deg, var(--success-t) 0%, var(--success-b) 100%);
  color: #fff;
  border-color: rgba(0,0,0,0.4);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 2px 6px rgba(0,0,0,0.5);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.btn--success:hover { filter: brightness(1.12); }

/* sizes */
.btn--sm {
  font-size: var(--text-xs);
  padding: 0.4em 0.9em;
  border-radius: var(--radius-sm);
}
.btn--lg {
  font-size: var(--text-md);
  padding: 0.65em 1.6em;
  border-radius: var(--radius-lg);
}
.btn--pill {
  border-radius: var(--radius-pill);
}

/* icon-only */
.btn--icon {
  width: 2.2em;
  height: 2.2em;
  padding: 0;
  border-radius: var(--radius-md);
}

/* disabled */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* =========================================================
   FORM ELEMENTS
   ========================================================= */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-label--required::after {
  content: ' *';
  color: var(--danger-t);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

.form-error {
  font-size: var(--text-xs);
  color: var(--danger-t);
  display: flex;
  align-items: center;
  gap: 0.3em;
}

/* text inputs */
.input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-deep);
  border: 1px solid var(--border-lo);
  border-radius: var(--radius-md);
  padding: 0.55em 0.8em;
  outline: none;
  transition:
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
  box-shadow:
    var(--shadow-inset),
    inset 0 0 0 1px rgba(0,0,0,0.1),
    0 1px 0 var(--border-hi);
  -webkit-appearance: none;
}

.input::placeholder { color: var(--text-muted); }

.input:focus {
  border-color: var(--blue-b);
  box-shadow:
    var(--shadow-inset),
    0 0 0 2px rgba(74, 112, 185, 0.3),
    0 1px 0 var(--border-hi);
}

.input--error {
  border-color: var(--danger-b);
}
.input--error:focus {
  box-shadow:
    var(--shadow-inset),
    0 0 0 2px rgba(200, 64, 64, 0.3);
}

.input--success {
  border-color: var(--success-b);
}

textarea.input {
  resize: vertical;
  min-height: 6em;
  line-height: 1.55;
}

/* select */
.select {
  width: 100%;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background:
    linear-gradient(180deg, var(--surf-t) 0%, var(--surf-b) 100%)
    no-repeat right 0.7em center / 1em;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239ea3a9' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--surf-t) 0%, var(--surf-b) 100%);
  background-repeat: no-repeat, no-repeat;
  background-position: right 0.75em center, 0 0;
  background-size: 0.75em, 100%;
  border: 1px solid var(--border-lo);
  border-radius: var(--radius-md);
  padding: 0.55em 2.2em 0.55em 0.8em;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  box-shadow:
    var(--bevel-hi),
    var(--bevel-lo),
    var(--shadow-sm);
  transition: filter var(--dur-fast) var(--ease-out);
}

.select:focus {
  border-color: var(--blue-b);
  box-shadow:
    var(--bevel-hi),
    var(--bevel-lo),
    0 0 0 2px rgba(74, 112, 185, 0.3),
    var(--shadow-sm);
}

.select:hover { filter: brightness(1.06); }

/* checkbox */
.checkbox-wrap,
.radio-wrap {
  display: flex;
  align-items: center;
  gap: 0.6em;
  cursor: pointer;
  user-select: none;
}

.checkbox-wrap input[type="checkbox"],
.radio-wrap input[type="radio"] {
  display: none;
}

.checkbox-box {
  width: 1.1em;
  height: 1.1em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-lo);
  background: linear-gradient(180deg, var(--bg-raised) 0%, var(--bg-deep) 100%);
  box-shadow:
    var(--shadow-inset),
    inset 0 1px 0 rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}

input[type="checkbox"]:checked + .checkbox-box {
  background: linear-gradient(180deg, var(--blue-t) 0%, var(--blue-b) 100%);
  border-color: rgba(0,0,0,0.4);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 1px 3px rgba(0,0,0,0.4);
}

.checkbox-box::after {
  content: '';
  display: none;
  width: 0.35em;
  height: 0.62em;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(40deg) translateY(-0.05em);
}

input[type="checkbox"]:checked + .checkbox-box::after { display: block; }

/* radio */
.radio-dot {
  width: 1.1em;
  height: 1.1em;
  border-radius: 50%;
  border: 1px solid var(--border-lo);
  background: linear-gradient(180deg, var(--bg-raised) 0%, var(--bg-deep) 100%);
  box-shadow: var(--shadow-inset);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--dur-base) var(--ease-out);
}

.radio-dot::after {
  content: '';
  width: 0.4em;
  height: 0.4em;
  border-radius: 50%;
  background: var(--blue-t);
  box-shadow: 0 0 4px rgba(91, 130, 190, 0.6);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}

input[type="radio"]:checked + .radio-dot {
  border-color: var(--blue-b);
  box-shadow:
    var(--shadow-inset),
    0 0 0 2px rgba(74, 112, 185, 0.25);
}

input[type="radio"]:checked + .radio-dot::after { opacity: 1; }

.checkbox-wrap span,
.radio-wrap span {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* toggle switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.7em;
  cursor: pointer;
}

.toggle-wrap input { display: none; }

.toggle-track {
  width: 2.6em;
  height: 1.4em;
  border-radius: var(--radius-pill);
  background: var(--bg-deep);
  border: 1px solid var(--border-lo);
  box-shadow: var(--shadow-inset);
  position: relative;
  flex-shrink: 0;
  transition: background var(--dur-base) var(--ease-out);
}

.toggle-thumb {
  position: absolute;
  top: 0.15em;
  left: 0.15em;
  width: 0.95em;
  height: 0.95em;
  border-radius: 50%;
  background: linear-gradient(180deg, #7a8088 0%, #5a5f66 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 1px 3px rgba(0,0,0,0.5),
    0 1px 1px rgba(0,0,0,0.4);
  transition: transform var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}

input:checked ~ .toggle-track {
  background: linear-gradient(180deg, var(--blue-dim) 0%, #1e3455 100%);
  border-color: var(--blue-b);
}

input:checked ~ .toggle-track .toggle-thumb {
  transform: translateX(1.2em);
  background: linear-gradient(180deg, var(--blue-t) 0%, var(--blue-b) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 1px 3px rgba(0,0,0,0.5),
    0 0 6px rgba(91,130,190,0.4);
}

.toggle-wrap span {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* range slider */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 0.35em;
  border-radius: var(--radius-pill);
  background: var(--bg-deep);
  border: 1px solid var(--border-lo);
  box-shadow: var(--shadow-inset);
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.1em;
  height: 1.1em;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--blue-t) 0%, var(--blue-b) 100%);
  border: 1px solid rgba(0,0,0,0.4);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 2px 5px rgba(0,0,0,0.5),
    0 0 6px rgba(91,130,190,0.3);
  cursor: pointer;
  transition: filter var(--dur-fast);
}

.slider::-moz-range-thumb {
  width: 1.1em;
  height: 1.1em;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--blue-t) 0%, var(--blue-b) 100%);
  border: 1px solid rgba(0,0,0,0.4);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 2px 5px rgba(0,0,0,0.5);
  cursor: pointer;
}

.slider::-webkit-slider-thumb:hover { filter: brightness(1.15); }

/* =========================================================
   BADGES & TAGS
   ========================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 0.2em 0.55em;
  border-radius: var(--radius-pill);
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}

.badge--blue {
  background: linear-gradient(180deg, var(--blue-t) 0%, var(--blue-b) 100%);
  color: #fff;
  border-color: rgba(0,0,0,0.3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 1px 3px rgba(0,0,0,0.4);
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.badge--gold {
  background: linear-gradient(180deg, var(--secondary-t) 0%, var(--secondary-b) 100%);
  color: #1a1200;
  border-color: rgba(0,0,0,0.3);
  box-shadow: inset 0 1px 0 rgba(255,220,80,0.25), 0 1px 3px rgba(0,0,0,0.4);
}

.badge--danger {
  background: linear-gradient(180deg, var(--danger-t) 0%, var(--danger-b) 100%);
  color: #fff;
  border-color: rgba(0,0,0,0.3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 1px 3px rgba(0,0,0,0.4);
}

.badge--ghost {
  background: linear-gradient(180deg, var(--surf-t) 0%, var(--surf-b) 100%);
  color: var(--text-secondary);
  border-color: var(--border-lo);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 1px 2px rgba(0,0,0,0.3);
}

.badge--success {
  background: linear-gradient(180deg, var(--success-t) 0%, var(--success-b) 100%);
  color: #fff;
  border-color: rgba(0,0,0,0.3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 1px 3px rgba(0,0,0,0.4);
}

/* count dot */
.badge--dot {
  min-width: 1.35em;
  height: 1.35em;
  border-radius: var(--radius-pill);
  padding: 0 0.3em;
  font-size: 0.6rem;
  justify-content: center;
}

/* tag chip */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.25em 0.65em;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--surf-t) 0%, var(--surf-b) 100%);
  color: var(--text-secondary);
  border: 1px solid var(--border-lo);
  box-shadow: var(--bevel-hi), var(--bevel-lo), var(--shadow-sm);
  cursor: default;
}

.tag--blue  { color: var(--blue-lit);  background: linear-gradient(180deg, rgba(91,130,190,0.2) 0%, rgba(59,95,150,0.15) 100%); border-color: rgba(74,112,185,0.3); }
.tag--secondary  { color: var(--secondary-lit);  background: linear-gradient(180deg, rgba(212,168,64,0.2) 0%, rgba(160,120,32,0.15) 100%); border-color: rgba(160,120,32,0.3); }
.tag--red   { color: #e07070; background: linear-gradient(180deg, rgba(200,64,64,0.2) 0%, rgba(160,40,40,0.15) 100%); border-color: rgba(160,40,40,0.3); }
.tag--green { color: #68c89a; background: linear-gradient(180deg, rgba(58,158,108,0.2) 0%, rgba(42,118,80,0.15) 100%); border-color: rgba(42,118,80,0.3); }

/* =========================================================
   AVATAR
   ========================================================= */

.avatar {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-b) 0%, #2a3a5a 100%);
  border: 2px solid var(--border-lo);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 2px 6px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: rgba(255,255,255,0.7);
  font-weight: 700;
  flex-shrink: 0;
}

.avatar--sm  { width: 1.8rem; height: 1.8rem; font-size: 0.65rem; }
.avatar--md  { width: 2.5rem; height: 2.5rem; font-size: 0.85rem; }
.avatar--lg  { width: 3.5rem; height: 3.5rem; font-size: 1.2rem; }
.avatar--xl  { width: 5rem;   height: 5rem;   font-size: 1.8rem; border-width: 3px; }

.avatar--square { border-radius: var(--radius-md); }

/* status indicator */
.avatar-wrap {
  position: relative;
  display: inline-flex;
}

.avatar-status {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 0.75em;
  height: 0.75em;
  border-radius: 50%;
  border: 2px solid var(--bg-base);
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.avatar-status--online  { background: var(--success-t); }
.avatar-status--idle    { background: var(--warn-t); }
.avatar-status--dnd     { background: var(--danger-t); }
.avatar-status--offline { background: var(--text-muted); }

/* =========================================================
   LIST / CHANNEL LIST ITEM
   ========================================================= */

.list-item {
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.4em 0.65em;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
  user-select: none;
}

.list-item:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.02) 100%);
  color: var(--text-primary);
}

.list-item--active {
  background: linear-gradient(180deg, var(--bg-hover) 0%, var(--bg-float) 100%);
  color: var(--text-primary);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.2),
    0 1px 3px rgba(0,0,0,0.3);
}

.list-item--active-blue {
  background: linear-gradient(180deg, rgba(74,112,185,0.25) 0%, rgba(59,95,150,0.18) 100%);
  color: #b0c8e8;
  border-left: 2px solid var(--blue-t);
  box-shadow: inset 0 1px 0 rgba(91,130,190,0.08);
}

.list-item .icon {
  flex-shrink: 0;
  opacity: 0.6;
}
.list-item:hover .icon,
.list-item--active .icon,
.list-item--active-blue .icon { opacity: 1; }

/* section label */
.list-section {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.8em 0.5em 0.3em;
  display: flex;
  align-items: center;
  gap: 0.4em;
}

/* =========================================================
   TABS
   ========================================================= */

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-lo);
  box-shadow: 0 1px 0 var(--border-hi);
  gap: 0.2rem;
}

.tab {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.55em 1em;
  cursor: pointer;
  border: none;
  background: none;
  position: relative;
  transition: color var(--dur-fast) var(--ease-out);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  user-select: none;
}

.tab:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.03);
}

.tab--active {
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 100%);
}

.tab--active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue-t), var(--blue-lit));
  box-shadow: 0 0 6px rgba(91,130,190,0.5);
}

.tab--active-secondary::after {
  background: linear-gradient(90deg, var(--secondary-b), var(--secondary-t));
  box-shadow: 0 0 6px var(--secondary-glow);
}

/* =========================================================
   TABLE
   ========================================================= */

.table-wrap {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-lo);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

thead {
  background: linear-gradient(180deg, var(--bg-hover) 0%, var(--bg-float) 100%);
  box-shadow: 0 1px 0 var(--border-hi);
}

thead th {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.7em 1em;
  text-align: left;
  border-bottom: 1px solid var(--border-lo);
}

tbody tr {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-lo);
  transition: background var(--dur-fast) var(--ease-out);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover {
  background: var(--bg-hover);
}

tbody tr:nth-child(even) {
  background: var(--bg-float);
}

tbody tr:nth-child(even):hover {
  background: var(--bg-hover);
}

tbody td {
  padding: 0.65em 1em;
  color: var(--text-secondary);
  vertical-align: middle;
}

tbody td:first-child { color: var(--text-primary); }

/* =========================================================
   MODAL / DIALOG
   ========================================================= */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal {
  background: linear-gradient(180deg, var(--surf-t) 0%, var(--surf-b) 100%);
  border: 1px solid var(--border-lo);
  border-radius: var(--radius-xl);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    var(--shadow-lg),
    0 0 0 1px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}

.modal__header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border-lo);
  box-shadow: 0 1px 0 var(--border-hi);
}

.modal__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.modal__body {
  padding: 1.25rem 1.5rem;
}

.modal__body p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.modal__footer {
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border-lo);
  box-shadow: inset 0 1px 0 var(--border-hi);
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

/* =========================================================
   CONTEXT MENU / DROPDOWN
   ========================================================= */

.menu {
  background: linear-gradient(180deg, var(--bg-hover) 0%, var(--bg-float) 100%);
  border: 1px solid var(--border-lo);
  border-radius: var(--radius-lg);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),
    var(--shadow-lg);
  padding: 0.35rem;
  min-width: 180px;
  overflow: hidden;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.5em 0.75em;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  user-select: none;
}

.menu-item:hover {
  background: linear-gradient(180deg, rgba(91,130,190,0.2) 0%, rgba(59,95,150,0.15) 100%);
  color: #c0d4f0;
}

.menu-item--danger:hover {
  background: linear-gradient(180deg, rgba(200,64,64,0.2) 0%, rgba(160,40,40,0.15) 100%);
  color: #e08080;
}

.menu-sep {
  height: 1px;
  background: var(--border-lo);
  margin: 0.3rem 0;
  box-shadow: 0 1px 0 var(--border-hi);
}

/* =========================================================
   TOOLTIP
   ========================================================= */

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--bg-hover) 0%, var(--bg-float) 100%);
  color: var(--text-primary);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.35em 0.7em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-lo);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),
    var(--shadow-md);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
  z-index: 100;
}

[data-tooltip]:hover::after { opacity: 1; }

/* =========================================================
   PROGRESS BAR
   ========================================================= */

.progress {
  height: 0.5em;
  border-radius: var(--radius-pill);
  background: var(--bg-deep);
  border: 1px solid var(--border-lo);
  box-shadow: var(--shadow-inset);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--blue-b), var(--blue-t));
  box-shadow: 0 0 6px rgba(91,130,190,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: width var(--dur-slow) var(--ease-out);
}

.progress__fill--gold {
  background: linear-gradient(90deg, var(--secondary-b), var(--secondary-t));
  box-shadow: 0 0 6px var(--secondary-glow), inset 0 1px 0 rgba(255,220,80,0.3);
}

.progress__fill--success {
  background: linear-gradient(90deg, var(--success-b), var(--success-t));
  box-shadow: 0 0 6px rgba(58,158,108,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* =========================================================
   ALERT / CALLOUT
   ========================================================= */

.alert {
  display: flex;
  gap: 0.75em;
  padding: 0.9em 1.1em;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
}

.alert--info {
  background: linear-gradient(90deg, rgba(74,112,185,0.12) 0%, rgba(74,112,185,0.06) 100%);
  border-color: rgba(74,112,185,0.25);
  color: #a0c0e8;
  border-left: 3px solid var(--blue-t);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.alert--warn {
  background: linear-gradient(90deg, rgba(200,130,26,0.12) 0%, rgba(200,130,26,0.06) 100%);
  border-color: rgba(200,130,26,0.25);
  color: #d4a060;
  border-left: 3px solid var(--warn-t);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.alert--danger {
  background: linear-gradient(90deg, rgba(200,64,64,0.12) 0%, rgba(200,64,64,0.06) 100%);
  border-color: rgba(200,64,64,0.25);
  color: #e09090;
  border-left: 3px solid var(--danger-t);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.alert--success {
  background: linear-gradient(90deg, rgba(58,158,108,0.12) 0%, rgba(58,158,108,0.06) 100%);
  border-color: rgba(58,158,108,0.25);
  color: #80d0a8;
  border-left: 3px solid var(--success-t);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.alert--secondary {
  background: linear-gradient(90deg, rgba(200,168,40,0.12) 0%, rgba(200,168,40,0.06) 100%);
  border-color: rgba(200,168,40,0.25);
  color: var(--secondary-lit);
  border-left: 3px solid var(--secondary-t);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* =========================================================
   MESSAGE BUBBLE (chat)
   ========================================================= */

.message {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  transition: background var(--dur-fast) var(--ease-out);
}

.message:hover {
  background: rgba(255,255,255,0.02);
}

.message--mention {
  background: linear-gradient(90deg, rgba(200,168,40,0.08) 0%, rgba(200,168,40,0.02) 100%);
  border-left: 2px solid var(--secondary-b);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.message__content { flex: 1; min-width: 0; }

.message__author {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.1em;
}

.message__author--secondary { color: var(--secondary-lit); }
.message__author--blue { color: var(--blue-lit); }

.message__time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-left: 0.5em;
  font-weight: 400;
}

.message__text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.mention-pill {
  display: inline;
  background: rgba(74,112,185,0.25);
  color: var(--blue-lit);
  padding: 0.05em 0.3em;
  border-radius: 3px;
  font-weight: 600;
  cursor: pointer;
}

.mention-pill:hover {
  background: var(--blue-b);
  color: #fff;
}

/* =========================================================
   SCROLLBAR
   ========================================================= */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--surf-t) 0%, var(--surf-b) 100%);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-lo);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--bg-hover) 0%, var(--bg-float) 100%);
}

/* =========================================================
   SEPARATOR LABEL
   ========================================================= */

.divider {
  display: flex;
  align-items: center;
  gap: 0.75em;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0.5em 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-lo);
  box-shadow: 0 1px 0 var(--border-hi);
}

/* =========================================================
   UTILITY
   ========================================================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.flex   { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1  { gap: 0.25rem; }
.gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; }
.gap-4  { gap: 1rem; }
.gap-6  { gap: 1.5rem; }
.mt-1   { margin-top: 0.25rem; }
.mt-2   { margin-top: 0.5rem; }
.mt-3   { margin-top: 0.75rem; }
.mt-4   { margin-top: 1rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
