/* ============================================
   Material Design 3 Expressive Theme
   Dynamic color, large radii, spring animations
   ============================================ */

:root {
  /* MD3 Expressive Color Tokens - Indigo/Blue primary */
  --md-sys-color-primary: #4355B9;
  --md-sys-color-on-primary: #FFFFFF;
  --md-sys-color-primary-container: #DEE0FF;
  --md-sys-color-on-primary-container: #00105C;

  --md-sys-color-secondary: #5B5D72;
  --md-sys-color-on-secondary: #FFFFFF;
  --md-sys-color-secondary-container: #E0E1F9;
  --md-sys-color-on-secondary-container: #181A2C;

  --md-sys-color-tertiary: #77536D;
  --md-sys-color-on-tertiary: #FFFFFF;
  --md-sys-color-tertiary-container: #FFD7F1;
  --md-sys-color-on-tertiary-container: #2D1228;

  --md-sys-color-error: #BA1A1A;
  --md-sys-color-on-error: #FFFFFF;
  --md-sys-color-error-container: #FFDAD6;
  --md-sys-color-on-error-container: #410002;

  --md-sys-color-background: #FAFDFC;
  --md-sys-color-on-background: #191C1C;
  --md-sys-color-surface: #FAFDFC;
  --md-sys-color-on-surface: #191C1C;

  --md-sys-color-surface-variant: #DAE5E4;
  --md-sys-color-on-surface-variant: #3F4948;
  --md-sys-color-outline: #6F7978;
  --md-sys-color-outline-variant: #BEC9C8;

  --md-sys-color-surface-container-lowest: #FFFFFF;
  --md-sys-color-surface-container-low: #F4F7F6;
  --md-sys-color-surface-container: #EEF1F0;
  --md-sys-color-surface-container-high: #E8EBEA;
  --md-sys-color-surface-container-highest: #E3E6E5;

  /* Success/Like colors */
  --md-sys-color-success: #006D3C;
  --md-sys-color-success-container: #98F7B5;
  --md-sys-color-on-success-container: #00210E;

  /* MD3 Expressive Shapes - Extra large for playful feel */
  --md-sys-shape-corner-none: 0px;
  --md-sys-shape-corner-extra-small: 4px;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 28px;
  --md-sys-shape-corner-full: 9999px;

  /* MD3 Expressive Typography - Google Sans style */
  --md-sys-typescale-display-large: 600 3.5rem/1.1 'Inter', system-ui, sans-serif;
  --md-sys-typescale-display-medium: 500 2.8rem/1.15 'Inter', system-ui, sans-serif;
  --md-sys-typescale-headline-large: 500 2rem/1.2 'Inter', system-ui, sans-serif;
  --md-sys-typescale-headline-medium: 500 1.75rem/1.25 'Inter', system-ui, sans-serif;
  --md-sys-typescale-title-large: 500 1.375rem/1.3 'Inter', system-ui, sans-serif;
  --md-sys-typescale-title-medium: 600 1rem/1.4 'Inter', system-ui, sans-serif;
  --md-sys-typescale-body-large: 400 1rem/1.5 'Inter', system-ui, sans-serif;
  --md-sys-typescale-body-medium: 400 0.875rem/1.45 'Inter', system-ui, sans-serif;
  --md-sys-typescale-label-large: 600 0.875rem/1.4 'Inter', system-ui, sans-serif;
  --md-sys-typescale-label-medium: 500 0.75rem/1.35 'Inter', system-ui, sans-serif;

  /* Elevation (tonal) */
  --md-sys-elevation-1: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --md-sys-elevation-2: 0 2px 6px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --md-sys-elevation-3: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);

  /* Spring animation easing */
  --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-duration-short: 150ms;
  --md-sys-motion-duration-medium: 300ms;
  --md-sys-motion-duration-long: 500ms;
}

/* Dark mode - class-based for manual toggle */
html.dark {
  --md-sys-color-primary: #BAC3FF;
  --md-sys-color-on-primary: #08218A;
  --md-sys-color-primary-container: #293CA0;
  --md-sys-color-on-primary-container: #DEE0FF;

  --md-sys-color-secondary: #C4C5DD;
  --md-sys-color-on-secondary: #2D2F42;
  --md-sys-color-secondary-container: #444559;
  --md-sys-color-on-secondary-container: #E0E1F9;

  --md-sys-color-tertiary: #E6BAD7;
  --md-sys-color-on-tertiary: #44263D;
  --md-sys-color-tertiary-container: #5D3C55;
  --md-sys-color-on-tertiary-container: #FFD7F1;

  --md-sys-color-error: #FFB4AB;
  --md-sys-color-on-error: #690005;
  --md-sys-color-error-container: #93000A;
  --md-sys-color-on-error-container: #FFDAD6;

  --md-sys-color-background: #0E1514;
  --md-sys-color-on-background: #E0E3E2;
  --md-sys-color-surface: #0E1514;
  --md-sys-color-on-surface: #E0E3E2;

  --md-sys-color-surface-variant: #3F4948;
  --md-sys-color-on-surface-variant: #BEC9C8;
  --md-sys-color-outline: #899392;
  --md-sys-color-outline-variant: #3F4948;

  --md-sys-color-surface-container-lowest: #090F0E;
  --md-sys-color-surface-container-low: #161D1C;
  --md-sys-color-surface-container: #1A2120;
  --md-sys-color-surface-container-high: #25292A;
  --md-sys-color-surface-container-highest: #2F3435;

  --md-sys-color-success: #7CDA9A;
  --md-sys-color-success-container: #005229;
  --md-sys-color-on-success-container: #98F7B5;

  --md-sys-elevation-1: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --md-sys-elevation-2: 0 2px 6px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.25);
  --md-sys-elevation-3: 0 4px 12px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Base Styles
   ============================================ */

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

/* SVG Icons - ensure they inherit color */
svg {
  fill: currentColor;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.icon svg {
  width: 100%;
  height: 100%;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font: var(--md-sys-typescale-body-large);
  background: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Layout
   ============================================ */

.app-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

@media (min-width: 600px) {
  .app-container {
    padding: 32px 24px;
  }
}

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

.app-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin-bottom: 32px;
}

.header-content {
  text-align: center;
}

.app-title {
  font: var(--md-sys-typescale-display-medium);
  color: var(--md-sys-color-primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.app-subtitle {
  font: var(--md-sys-typescale-body-large);
  color: var(--md-sys-color-on-surface-variant);
}

/* Theme Toggle */
.theme-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--md-sys-shape-corner-full);
  border: none;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.theme-toggle:hover {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.theme-toggle svg {
  width: 24px;
  height: 24px;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

html.dark .theme-toggle .icon-sun {
  display: block;
}

html.dark .theme-toggle .icon-moon {
  display: none;
}

/* ============================================
   Stats Bar
   ============================================ */

.stats-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 24px;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-full);
  font: var(--md-sys-typescale-label-large);
  color: var(--md-sys-color-on-surface-variant);
}

.stat-chip .value {
  color: var(--md-sys-color-on-surface);
  font-weight: 600;
}

/* ============================================
   Card System (MD3 Expressive)
   ============================================ */

.card {
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-sys-shape-corner-extra-large);
  padding: 24px;
  box-shadow: var(--md-sys-elevation-1);
  transition:
    transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized),
    box-shadow var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.card:hover {
  box-shadow: var(--md-sys-elevation-2);
}

.card-elevated {
  background: var(--md-sys-color-surface-container);
  box-shadow: var(--md-sys-elevation-2);
}

.card-filled {
  background: var(--md-sys-color-surface-container-highest);
  box-shadow: none;
}

/* ============================================
   Proxy Card
   ============================================ */

.proxy-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.proxy-card {
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-sys-shape-corner-extra-large);
  padding: 20px;
  box-shadow: var(--md-sys-elevation-1);
  transition:
    transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized),
    box-shadow var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.proxy-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--md-sys-elevation-3);
}

/* Fallback proxy card - TCP only (purple like Add Proxy button) */
.proxy-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.proxy-server {
  font: var(--md-sys-typescale-title-large);
  color: var(--md-sys-color-on-surface);
  word-break: break-all;
}

.proxy-port {
  color: var(--md-sys-color-outline);
  font-weight: 400;
}

.ping-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--md-sys-shape-corner-full);
  font: var(--md-sys-typescale-label-large);
  white-space: nowrap;
}

.ping-badge.ok {
  background: var(--md-sys-color-success-container);
  color: var(--md-sys-color-on-success-container);
}

.ping-badge.warning {
  background: #FFF3E0;
  color: #E65100;
}

html.dark .ping-badge.warning {
  background: #4A2800;
  color: #FFB74D;
}

.ping-badge.failed {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

.ping-badge.pending {
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface-variant);
}

/* Fallback badge - TCP only (match Add Proxy primary button) */
.ping-badge.fallback {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

html.dark .ping-badge.fallback {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.proxy-secret {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--md-sys-color-outline);
  background: var(--md-sys-color-surface-container);
  padding: 8px 12px;
  border-radius: var(--md-sys-shape-corner-medium);
  word-break: break-all;
  margin-bottom: 16px;
}

.proxy-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.vote-buttons {
  display: flex;
  gap: 8px;
}

.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font: var(--md-sys-typescale-label-large);
  cursor: pointer;
  transition:
    transform var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-emphasized),
    background var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.vote-btn:active {
  transform: scale(0.95);
}

.vote-btn.like {
  background: var(--md-sys-color-success-container);
  color: var(--md-sys-color-on-success-container);
}

.vote-btn.like:hover {
  filter: brightness(0.95);
}

.vote-btn.like.active {
  background: var(--md-sys-color-success);
  color: white;
}

.vote-btn.dislike {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

.vote-btn.dislike:hover {
  filter: brightness(0.95);
}

.vote-btn.dislike.active {
  background: var(--md-sys-color-error);
  color: white;
}

.link-buttons {
  display: flex;
  gap: 8px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-full);
  background: transparent;
  color: var(--md-sys-color-primary);
  font: var(--md-sys-typescale-label-large);
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-emphasized);
}

.link-btn:hover {
  background: var(--md-sys-color-surface-container);
}

.link-btn:active {
  transform: scale(0.97);
}

/* ============================================
   Buttons (MD3 Filled/Tonal/Outlined)
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font: var(--md-sys-typescale-label-large);
  cursor: pointer;
  transition:
    transform var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-emphasized),
    box-shadow var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    background var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.btn:active {
  transform: scale(0.97);
}

.btn-filled {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-sys-elevation-1);
}

.btn-filled:hover {
  box-shadow: var(--md-sys-elevation-2);
}

.btn-tonal {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.btn-tonal:hover {
  filter: brightness(0.96);
}

.btn-outlined {
  background: transparent;
  color: var(--md-sys-color-primary);
  border: 1px solid var(--md-sys-color-outline);
}

.btn-outlined:hover {
  background: var(--md-sys-color-surface-container);
}

.btn-text {
  background: transparent;
  color: var(--md-sys-color-primary);
}

.btn-text:hover {
  background: var(--md-sys-color-surface-container);
}

/* ============================================
   Form Elements
   ============================================ */

.form-section {
  margin-bottom: 24px;
}

.form-title {
  font: var(--md-sys-typescale-title-medium);
  color: var(--md-sys-color-on-surface);
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form-field {
  flex: 1;
  min-width: 200px;
}

.form-field.full {
  flex: 100%;
  min-width: 100%;
}

.text-field {
  position: relative;
  width: 100%;
}

.text-field input,
.text-field textarea {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container-lowest);
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-body-large);
  transition:
    border-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    box-shadow var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.text-field input:focus,
.text-field textarea:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px rgba(0, 106, 106, 0.1);
}

.text-field input::placeholder,
.text-field textarea::placeholder {
  color: var(--md-sys-color-outline);
}

.text-field textarea {
  resize: vertical;
  min-height: 120px;
}

.text-field label {
  position: absolute;
  top: -8px;
  left: 12px;
  padding: 2px 8px;
  background: var(--md-sys-color-surface-container-high);
  font: var(--md-sys-typescale-label-medium);
  color: var(--md-sys-color-on-surface-variant);
  z-index: 1;
  border-radius: 4px;
}

/* Form Panels for tab switching */
.form-panel {
  display: block;
}

.form-panel.hidden {
  display: none;
}

/* Helper text below form fields */
.form-helper {
  font: var(--md-sys-typescale-body-medium);
  color: var(--md-sys-color-outline);
  margin-top: 8px;
}

/* MD3 Dialog Tab Buttons */
.dialog-tabs {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-full);
  margin-bottom: 20px;
}

.dialog-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-large);
  border-radius: var(--md-sys-shape-corner-full);
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.dialog-tab:hover {
  background: var(--md-sys-color-surface-container-high);
}

.dialog-tab.active {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-sys-elevation-1);
}

/* Port field narrower */
.form-field.port-field {
  max-width: 100px;
  min-width: 80px;
  flex: 0 0 100px;
}

/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

/* ============================================
   Tabs / Segmented Button (Sort)
   ============================================ */

.segmented-buttons {
  display: inline-flex;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-full);
  overflow: hidden;
}

.segment-btn {
  padding: 10px 24px;
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-label-large);
  cursor: pointer;
  transition:
    background var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.segment-btn:not(:last-child) {
  border-right: 1px solid var(--md-sys-color-outline-variant);
}

.segment-btn:hover {
  background: var(--md-sys-color-surface-container);
}

.segment-btn.active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

/* ============================================
   Controls Bar
   ============================================ */

.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.controls-label {
  font: var(--md-sys-typescale-label-large);
  color: var(--md-sys-color-on-surface-variant);
}

/* ============================================
   Dialog/Modal (MD3 Expressive)
   ============================================ */

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard),
    visibility var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
  z-index: 1000;
}

.dialog-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.dialog {
  background: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-sys-shape-corner-extra-large);
  padding: 24px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.dialog-backdrop.open .dialog {
  transform: scale(1) translateY(0);
}

.dialog-title {
  font: var(--md-sys-typescale-headline-medium);
  color: var(--md-sys-color-on-surface);
  margin-bottom: 16px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

/* ============================================
   QR Code Dialog
   ============================================ */

.qr-dialog {
  text-align: center;
}

.qr-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}

#qr-code-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background: var(--md-sys-color-surface);
  border-radius: var(--md-sys-shape-corner-large);
}

.qr-hint {
  font: var(--md-sys-typescale-body-medium);
  color: var(--md-sys-color-on-surface-variant);
  margin: 0;
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--md-sys-color-on-surface-variant);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font: var(--md-sys-typescale-headline-medium);
  margin-bottom: 8px;
}

.empty-state-text {
  font: var(--md-sys-typescale-body-large);
}

/* ============================================
   Toast / Snackbar
   ============================================ */

.snackbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
  padding: 14px 24px;
  border-radius: var(--md-sys-shape-corner-extra-large);
  box-shadow: var(--md-sys-elevation-3);
  font: var(--md-sys-typescale-body-medium);
  z-index: 1001;
  opacity: 0;
  transition:
    transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized),
    opacity var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
}

.snackbar.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============================================
   Icons (Material Symbols style)
   ============================================ */

.icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

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

@media (max-width: 600px) {
  .app-title {
    font-size: 2rem;
  }

  .proxy-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .vote-buttons,
  .link-buttons {
    justify-content: center;
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .segmented-buttons {
    width: 100%;
    display: flex;
  }

  .segment-btn {
    flex: 1;
    text-align: center;
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.proxy-card {
  animation: fadeIn var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
  animation-fill-mode: both;
}

.proxy-card:nth-child(1) {
  animation-delay: 0ms;
}

.proxy-card:nth-child(2) {
  animation-delay: 50ms;
}

.proxy-card:nth-child(3) {
  animation-delay: 100ms;
}

.proxy-card:nth-child(4) {
  animation-delay: 150ms;
}

.proxy-card:nth-child(5) {
  animation-delay: 200ms;
}

.proxy-card:nth-child(n+6) {
  animation-delay: 250ms;
}

/* Loading state */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--md-sys-color-surface-container);
  border-radius: inherit;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.4;
  }

  50% {
    opacity: 0.7;
  }
}

/* Copy feedback */
.copy-success {
  animation: copyPulse 0.3s ease-out;
}

@keyframes copyPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}