/* ==========================================================================
   AppetiteCheck - Soft Colorful Brutalist Theme
   Professional research platform with engaging, bold aesthetic
   ========================================================================== */

:root {
  /* Primary - Vibrant Purple */
  --primary-50: #faf5ff;
  --primary-100: #f3e8ff;
  --primary-200: #e9d5ff;
  --primary-300: #d8b4fe;
  --primary-400: #c084fc;
  --primary-500: #a855f7;
  --primary-600: #9333ea;
  --primary-700: #7e22ce;

  /* Secondary - Warm Coral */
  --coral-50: #fff5f5;
  --coral-100: #ffe4e6;
  --coral-200: #fecdd3;
  --coral-300: #fda4af;
  --coral-400: #fb7185;
  --coral-500: #f43f5e;

  /* Accent - Fresh Teal */
  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-200: #99f6e4;
  --teal-300: #5eead4;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;

  /* Accent 2 - Sunny Yellow */
  --yellow-50: #fefce8;
  --yellow-100: #fef9c3;
  --yellow-200: #fef08a;
  --yellow-300: #fde047;
  --yellow-400: #facc15;

  /* Accent 3 - Sky Blue */
  --sky-50: #f0f9ff;
  --sky-100: #e0f2fe;
  --sky-200: #bae6fd;
  --sky-300: #7dd3fc;
  --sky-400: #38bdf8;
  --sky-500: #0ea5e9;

  /* Neutrals */
  --ink: #1a1a2e;
  --ink-soft: #4a4a68;
  --ink-muted: #7a7a96;
  --surface: #fffbfe;
  --card: #ffffff;
  --line: #e8e4f0;
  --line-strong: #d4cfe3;

  /* Brutalist Design Tokens */
  --border-width: 2.5px;
  --shadow-offset: 4px;
  --radius: 8px;
  --radius-sm: 6px;
}

/* ==========================================================================
   Base Reset
   ========================================================================== */

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: 'IBM Plex Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  
  /* Soft colorful gradient background */
  background: 
    radial-gradient(ellipse at 0% 0%, var(--primary-100) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 0%, var(--teal-100) 0%, transparent 40%),
    radial-gradient(ellipse at 100% 100%, var(--coral-100) 0%, transparent 50%),
    radial-gradient(ellipse at 0% 100%, var(--yellow-100) 0%, transparent 40%),
    var(--surface);
  background-attachment: fixed;
}

/* ==========================================================================
   Decorative Glow Elements
   ========================================================================== */

.glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.6;
}

.glow-1 {
  width: 300px;
  height: 300px;
  background: var(--primary-300);
  top: -80px;
  left: -80px;
}

.glow-2 {
  width: 250px;
  height: 250px;
  background: var(--teal-300);
  right: -60px;
  bottom: -60px;
}

/* ==========================================================================
   App Shell Layout
   ========================================================================== */

.app-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Cards - Brutalist with colorful accents
   ========================================================================== */

.card {
  background: var(--card);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--ink);
  margin-bottom: 1rem;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 6px;
  background: linear-gradient(90deg, var(--primary-400), var(--teal-400), var(--coral-400));
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 1;
}

.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: calc(var(--shadow-offset) + 2px) calc(var(--shadow-offset) + 2px) 0 var(--ink);
}

.topbar,
.hero,
.auth-card,
.workspace-head,
.wearable-card,
.slider-shell,
.history-card,
#admin-panel {
  padding: 1.25rem;
  padding-top: 1.5rem;
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--card);
  background: var(--primary-500);
  padding: 0.3rem 0.6rem;
  border: var(--border-width) solid var(--ink);
  border-radius: 4px;
  display: inline-block;
  box-shadow: 2px 2px 0 var(--ink);
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1 {
  margin: 0.5rem 0 0;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h2, h3, h4, p {
  margin-top: 0;
}

h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-700);
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 0.25rem;
}

/* Hero Section */
.hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-700);
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--ink-soft);
  line-height: 1.65;
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* Auth Section */
.auth-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  font-size: 0.92rem;
  color: var(--ink-muted);
  margin-bottom: 1.25rem;
}

/* Admin Section */
.admin-subtitle {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin: 0;
}

/* Modal */
.modal-subtitle {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

/* ==========================================================================
   Chips / Tags - Colorful Brutalist pills
   ========================================================================== */

.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chip-wrap-compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.chip-wrap span {
  border: var(--border-width) solid var(--ink);
  border-radius: 50px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--yellow-100);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.chip-wrap span:nth-child(2n) {
  background: var(--teal-100);
}

.chip-wrap span:nth-child(3n) {
  background: var(--primary-100);
}

.chip-wrap span:nth-child(4n) {
  background: var(--coral-100);
}

.chip-wrap span:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

/* ==========================================================================
   Mode Toggle - Tab-style buttons
   ========================================================================== */

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 1.25rem;
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 3px 3px 0 var(--ink);
}

.mode-btn {
  font: inherit;
  border: none;
  border-radius: 0;
  background: var(--card);
  color: var(--ink-soft);
  font-weight: 600;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mode-btn:first-child {
  border-right: var(--border-width) solid var(--ink);
}

.mode-btn.active {
  background: var(--primary-500);
  color: white;
}

.mode-btn:hover:not(.active) {
  background: var(--primary-50);
}

/* ==========================================================================
   Forms
   ========================================================================== */

.auth-form,
label {
  display: grid;
  gap: 0.35rem;
}

.auth-form {
  gap: 1rem;
}

label {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 600;
}

input,
textarea,
output {
  font: inherit;
}

input,
textarea {
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  background: var(--card);
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-200);
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-muted);
  font-weight: 400;
}

input[type='range'] {
  --range-progress: 50%;
  padding: 0;
  border: none;
  box-shadow: none;
  width: 100%;
  height: 28px;
  margin: 0.8rem 0 0.35rem;
  background:
    linear-gradient(90deg, var(--primary-500) 0 var(--range-progress), var(--line-strong) var(--range-progress) 100%)
      center / 100% 10px no-repeat,
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc((100% / 6) - 1px),
      rgba(26, 26, 46, 0.55) calc((100% / 6) - 1px),
      rgba(26, 26, 46, 0.55) calc(100% / 6)
    )
      center / 100% 22px no-repeat;
  border-radius: 999px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

input[type='range']::-webkit-slider-runnable-track {
  background: transparent;
  border-radius: 999px;
  height: 10px;
  border: 1px solid var(--ink);
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  background: var(--primary-500);
  border: var(--border-width) solid var(--ink);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  margin-top: -9px;
}

input[type='range']::-webkit-slider-thumb:hover {
  background: var(--primary-400);
}

input[type='range']::-moz-range-track {
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 999px;
  height: 10px;
}

input[type='range']::-moz-range-progress {
  background: transparent;
  border-radius: 999px;
  height: 10px;
}

input[type='range']::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--primary-500);
  border: var(--border-width) solid var(--ink);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}

/* ==========================================================================
   Buttons - Bold Brutalist style
   ========================================================================== */

.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-link,
.choice,
.scale-btn {
  font: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  border: var(--border-width) solid var(--ink);
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.btn-primary {
  color: white;
  background: var(--primary-500);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn-primary:hover {
  background: var(--primary-600);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.btn-primary:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn-secondary {
  color: var(--teal-600);
  background: var(--teal-100);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn-secondary:hover {
  background: var(--teal-200);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.btn-ghost {
  color: var(--ink-soft);
  background: var(--card);
  box-shadow: 2px 2px 0 var(--line-strong);
}

.btn-ghost:hover {
  background: var(--primary-50);
  color: var(--primary-700);
  box-shadow: 3px 3px 0 var(--line-strong);
  transform: translate(-1px, -1px);
}

.btn-link {
  border: none;
  background: transparent;
  color: var(--primary-600);
  font-weight: 700;
  padding: 0.4rem 0.6rem;
  text-decoration: none;
  border-radius: 4px;
}

.btn-link:hover {
  background: var(--primary-100);
  color: var(--primary-700);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled,
.btn-link:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   Feedback Messages - Colorful status indicators
   ========================================================================== */

.feedback {
  margin-top: 0.75rem;
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  background: var(--sky-100);
  color: var(--ink-soft);
  box-shadow: 2px 2px 0 var(--ink);
}

.feedback:empty {
  display: none;
}

.feedback.success {
  background: var(--teal-100);
  color: var(--teal-600);
}

.feedback.error {
  background: var(--coral-100);
  color: var(--coral-500);
}

.hidden {
  display: none !important;
}

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

.workspace-head {
  display: grid;
  gap: 0.75rem;
}

.workspace-actions,
.row-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Sensor / Wearable Section
   ========================================================================== */

.sensor-metrics {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 1rem;
}

.sensor-metrics article {
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  background: linear-gradient(135deg, var(--sky-50) 0%, var(--card) 100%);
  box-shadow: 2px 2px 0 var(--ink);
}

.sensor-metrics h4 {
  margin: 0 0 0.2rem 0;
}

.sensor-metrics p {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-600);
  font-family: 'IBM Plex Mono', monospace;
}

.sensor-log-card {
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  background: var(--card);
  margin: 1rem 0;
  box-shadow: 2px 2px 0 var(--ink);
}

.sensor-log-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px dashed var(--line);
}

.sensor-log-head h4,
.sensor-log-head p {
  margin: 0;
}

.sensor-log-head p {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-family: 'IBM Plex Mono', monospace;
}

.sensor-event-log {
  display: grid;
  gap: 0.4rem;
}

.sensor-event {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: start;
  border: 2px solid var(--line);
  border-left: 4px solid var(--sky-400);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  background: var(--card);
}

.sensor-event time {
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
}

.sensor-event p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink);
}

.sensor-event-ok {
  border-left-color: var(--teal-500);
  background: var(--teal-50);
}

.sensor-event-info {
  border-left-color: var(--sky-500);
  background: var(--sky-50);
}

.sensor-event-error {
  border-left-color: var(--coral-500);
  background: var(--coral-50);
}

.sensor-event-empty {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin: 0;
  padding: 0.5rem 0;
}

/* ==========================================================================
   Slide Progress Dots
   ========================================================================== */

.slide-progress {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.progress-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--line);
  border: var(--border-width) solid var(--ink);
  transition: background 0.2s ease, transform 0.2s ease;
}

.progress-dot.active {
  background: var(--primary-500);
  transform: scale(1.15);
  box-shadow: 2px 2px 0 var(--ink);
}

.slide {
  display: none;
}

.slide.active {
  display: block;
  animation: slideIn 0.25s ease;
}

.slide-text {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

/* ==========================================================================
   Range Slider Meta
   ========================================================================== */

.range-meta {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 500;
  margin-top: 0.4rem;
}

.slider-shell label {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.slider-shell label > input[type='range'] + .range-meta {
  margin-top: 0;
}

.range-meta span:last-child {
  text-align: right;
}

.range-meta output {
  min-width: 2.5rem;
  text-align: center;
  border: var(--border-width) solid var(--primary-500);
  border-radius: 50px;
  padding: 0.2rem 0.6rem;
  background: var(--primary-100);
  color: var(--primary-700);
  font-weight: 800;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  box-shadow: 2px 2px 0 var(--primary-300);
}

.inline-line {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr auto;
}

/* ==========================================================================
   Likert Scales & Choice Buttons
   ========================================================================== */

.likert-block,
.likert-grid {
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  margin-bottom: 0.9rem;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--line-strong);
}

.likert-block p,
.likert-grid p {
  margin: 0 0 0.6rem;
  color: var(--ink);
  font-weight: 500;
}

.choice-row,
.scale-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.choice {
  border: var(--border-width) solid var(--line-strong);
  background: var(--card);
  color: var(--ink-soft);
  padding: 0.7rem;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 2px 2px 0 var(--line);
}

.choice.active {
  background: var(--teal-100);
  border-color: var(--teal-500);
  color: var(--teal-600);
  box-shadow: 2px 2px 0 var(--teal-300);
}

.choice:hover:not(.active) {
  background: var(--primary-50);
  border-color: var(--primary-300);
  transform: translate(-1px, -1px);
}

.scale-row {
  grid-template-columns: repeat(4, 1fr);
}

.scale-btn {
  border: var(--border-width) solid var(--line-strong);
  background: var(--card);
  color: var(--ink-soft);
  padding: 0.6rem 0.4rem;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 2px 2px 0 var(--line);
}

.scale-btn.active {
  border-color: var(--primary-600);
  color: white;
  background: var(--primary-500);
  box-shadow: 2px 2px 0 var(--primary-700);
}

.scale-btn:hover:not(.active) {
  background: var(--primary-50);
  transform: translate(-1px, -1px);
}

.slide-nav {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 2px dashed var(--line);
}

/* ==========================================================================
   Consent Checkbox
   ========================================================================== */

.consent-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
}

.consent-row input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--primary-500);
  cursor: pointer;
}

/* ==========================================================================
   History Section
   ========================================================================== */

.history-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 2px dashed var(--line);
}

canvas {
  width: 100%;
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--card);
  margin-bottom: 1rem;
  box-shadow: 2px 2px 0 var(--ink);
}

.admin-history-panel {
  margin-bottom: 1rem;
}

.admin-history-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 0.6rem;
}

.admin-history-head h3 {
  margin: 0 0 0.25rem 0;
}

.admin-history-filter {
  display: grid;
  gap: 0.3rem;
  min-width: 220px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.admin-history-filter select {
  min-height: 42px;
}

/* ==========================================================================
   Tables - Clean Brutalist data display
   ========================================================================== */

.table-wrap {
  overflow-x: auto;
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--card);
  box-shadow: 3px 3px 0 var(--ink);
  margin-top: 1rem;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 2px solid var(--line);
  font-size: 0.82rem;
}

.session-export-cell {
  min-width: 190px;
}

.table-action-link {
  display: inline-block;
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
  padding: 0.35rem 0.5rem;
  border: var(--border-width) solid var(--ink);
  border-radius: 6px;
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 2px 2px 0 var(--ink);
}

.table-action-link:hover {
  transform: translate(-1px, -1px);
}

.table-action-link:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

th {
  background: linear-gradient(135deg, var(--primary-100) 0%, var(--teal-100) 100%);
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  border-bottom: var(--border-width) solid var(--ink);
}

tr:hover td {
  background: var(--yellow-50);
}

/* ==========================================================================
   Admin Metrics Grid
   ========================================================================== */

.admin-metrics {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 1rem;
}

.admin-metrics article {
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
  position: relative;
  overflow: hidden;
}

.admin-metrics article::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
}

.admin-metrics article:nth-child(1)::before { background: var(--primary-500); }
.admin-metrics article:nth-child(2)::before { background: var(--teal-500); }
.admin-metrics article:nth-child(3)::before { background: var(--coral-400); }
.admin-metrics article:nth-child(4)::before { background: var(--sky-500); }
.admin-metrics article:nth-child(5)::before { background: var(--yellow-400); }
.admin-metrics article:nth-child(6)::before { background: var(--primary-400); }

.admin-metrics h4 {
  margin: 0 0 0.25rem 0;
}

.admin-metrics p {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
}

/* ==========================================================================
   Modal - Brutalist dialog
   ========================================================================== */

.modal {
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius);
  width: min(92vw, 440px);
  padding: 0;
  box-shadow: 8px 8px 0 var(--ink);
  background: var(--card);
  position: relative;
}

.modal::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 6px;
  background: linear-gradient(90deg, var(--primary-400), var(--teal-400));
  border-radius: var(--radius) var(--radius) 0 0;
}

.modal::backdrop {
  background: rgba(26, 26, 46, 0.6);
  backdrop-filter: blur(4px);
}

.modal-body {
  padding: 1.5rem;
  padding-top: 1.75rem;
}

.modal-body h3 {
  margin-bottom: 0.25rem;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (min-width: 640px) {
  .app-shell {
    padding: 1.25rem;
  }

  .topbar,
  .hero,
  .auth-card,
  .workspace-head,
  .wearable-card,
  .slider-shell,
  .history-card,
  #admin-panel {
    padding: 1.5rem;
    padding-top: 1.75rem;
  }

  .sensor-metrics {
    grid-template-columns: repeat(4, 1fr);
  }

  .admin-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .scale-row {
    grid-template-columns: repeat(7, 1fr);
  }

  .workspace-head {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .history-head {
    align-items: center;
  }
}

@media (min-width: 768px) {
  .chip-wrap {
    gap: 0.6rem;
  }
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Button press animation */
@keyframes buttonPress {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(1px, 1px); }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-mono {
  font-family: 'IBM Plex Mono', monospace;
}

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

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  .glow, .glow-1, .glow-2 {
    display: none;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .card::before {
    display: none;
  }
  
  body {
    background: white;
  }
}
