:root {
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --background: 0 0% 96%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 3.9%;
  --primary: 240 9% 9%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 240 5.9% 10%;
  --radius: 0.5rem;
}

/* Font-face definitions */
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-sans);
}

body {
  line-height: 1.5;
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
  font-feature-settings: "rlig" 1, "calt" 1;
}

.container {
  max-width: 48rem;
  margin: 0 auto;
  padding: 4rem 1rem 8rem 1rem;
}

.header {
  text-align: left;
  margin-bottom: 3rem;
  padding: 0 1.5rem;
}

.title {
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: hsl(var(--foreground));
  margin-bottom: 0.8rem;
  letter-spacing: -0.025em;
}

.subtitle {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
  font-weight: 400;
}

.rules-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.rule-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 2px);
  padding: 1.5rem;
  transition: all 0.2s ease-in-out;
  position: relative;
}

.rule-card:hover {
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.1);
  border-color: hsl(var(--border));
}

.rule-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.rule-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  line-height: 1.3;
  margin: 0;
}

.copy-icon {
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 0.375rem;
  border-radius: var(--radius);
  transition: all 0.2s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.copy-icon:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--accent));
}

.copy-icon:focus {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.copy-icon.copied {
  color: hsl(120 100% 25%);
}

.rule-description {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.expression-container {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  background-color: hsl(var(--muted));
}

.expression-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background-color: hsl(var(--muted));
  border-bottom: 1px solid hsl(var(--border));
}

.expression-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rule-expression {
  display: block;
  padding: 1rem;
  font-family: monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: hsl(var(--foreground));
  background-color: hsl(var(--card));
  border: none;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
}

.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease-in-out;
  z-index: 50;
  max-width: 300px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success {
  background-color: hsl(120 100% 25%);
  color: white;
}

.toast.error {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding: 3rem 0.75rem 6rem 0.75rem;
  }
  
  .header {
    padding: 0 1rem;
  }
  
  .title {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }
  
  .rules-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .rule-card {
    padding: 1rem;
  }
  
  .rule-header {
    align-items: flex-start;
  }
  
  .rule-title {
    font-size: 1.125rem;
  }
  
  .toast {
    right: 0.75rem;
    left: 0.75rem;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .expression-container {
    margin: 0 -0.5rem;
  }
  
  .rule-expression {
    font-size: 0.8125rem;
    padding: 0.75rem;
  }
}

.rule-header-left {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.action-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.6rem;
  font-size: 0.70rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: calc(var(--radius) - 2px);
  width: fit-content;
}

.action-block {
  background-color: hsl(0 84.2% 60.2% / 0.1);
  color: hsl(0 84.2% 45%);
  border: 1px solid hsl(0 84.2% 60.2% / 0.2);
}

.action-skip {
  background-color: hsl(120 100% 25% / 0.1);
  color: hsl(120 100% 20%);
  border: 1px solid hsl(120 100% 25% / 0.2);
}

.action-managed-challenge {
  background-color: hsl(45 100% 50% / 0.2);
  color: hsl(45 100% 35%);
  border: 1px solid hsl(45 100% 50% / 0.5);
}

.action-js-challenge {
  background-color: hsl(220 100% 50% / 0.1);
  color: hsl(220 100% 35%);
  border: 1px solid hsl(220 100% 50% / 0.2);
}

.action-allow {
  background-color: hsl(150 100% 30% / 0.1);
  color: hsl(150 100% 25%);
  border: 1px solid hsl(150 100% 30% / 0.2);
}

.action-log {
  background-color: hsl(var(--muted-foreground) / 0.1);
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

.important-notice {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background-color: hsl(45 100% 50% / 0.05);
  border: 1px solid hsl(45 100% 50% / 0.2);
  border-left: 4px solid hsl(45 100% 50%);
  border-radius: var(--radius);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.notice-icon {
  color: hsl(45 100% 35%);
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.notice-content {
  flex: 1;
}

.notice-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(45 100% 25%);
  margin-bottom: 0.5rem;
}

.notice-text {
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.notice-steps {
  font-size: 0.875rem;
  color: hsl(var(--foreground));
}

.notice-steps p {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.notice-steps ol {
  margin-left: 1.25rem;
  line-height: 1.6;
}

.notice-steps li {
  margin-bottom: 0.25rem;
}

.notice-steps .action-badge {
  margin: 0 0.25rem;
}

@media (max-width: 768px) {
  .important-notice {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .notice-icon {
    align-self: flex-start;
  }
}