/**
 * iOS Universal Links Validator Styles
 * ChottuLink - Free Tools Suite
 */

/* ===============================
   Score Card (mirrors deep-link-tester)
   =============================== */
.aasa-score-card {
  padding: 1.25rem;
  max-width: 600px;
  margin: 1rem auto 2rem;
  position: relative;
  z-index: 1;
  border: 0;
  box-shadow: none;
}

.aasa-score-circle-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 1rem;
}

.aasa-score-circle {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.aasa-score-bg {
  fill: none;
  stroke: var(--border-subtle, #e5e7eb);
  stroke-width: 8;
}

.aasa-score-progress {
  fill: none;
  stroke: #22c55e;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-out, stroke 0.3s ease;
}

.aasa-score-progress--critical {
  stroke: #ef4444;
}

.aasa-score-progress--warn {
  stroke: #f59e0b;
}

.aasa-score-value {
  position: absolute;
  height: 82%;
  width: 82%;
  background: var(--app-bg-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  font-weight: 700;
  color: var(--app-text-primary, #1f2937);
}

.aasa-score-label {
  margin-top: 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--app-text-primary, #1f2937);
  margin-bottom: 0.25rem;
}

.aasa-score-summary {
  font-size: 0.95rem;
  color: var(--text-secondary, #6b7280);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.aasa-verdict-badge {
  display: inline-block;
  padding: 0.2rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.aasa-verdict-badge.pass  { background: rgba(34,197,94,0.12); color: #16a34a; }
.aasa-verdict-badge.warn  { background: rgba(245,158,11,0.12); color: #d97706; }
.aasa-verdict-badge.fail  { background: rgba(239,68,68,0.12); color: #dc2626; }

.aasa-counters {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

.aasa-counter-pass  { color: #16a34a; font-weight: 600; }
.aasa-counter-warn  { color: #d97706; font-weight: 600; }
.aasa-counter-fail  { color: #dc2626; font-weight: 600; }

.aasa-summary-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.aasa-action-btn {
  padding: 0.4rem 1rem;
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: transparent;
  color: var(--app-text-secondary, #374151);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.aasa-action-btn:hover {
  border-color: #FF5733;
  color: #FF5733;
}

.aasa-monitoring-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #16a34a;
  background: rgba(34,197,94,0.1);
  padding: 0.2rem 0.7rem;
  border-radius: 9999px;
  margin-top: 0.75rem;
}

/* ===============================
   Input Mode Tabs
   =============================== */
.aasa-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle, #e5e7eb);
  margin-bottom: 1rem;
  gap: 0;
}

.aasa-tab {
  flex: 1;
  padding: 0.65rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  text-align: center;
}

.aasa-tab:hover {
  color: var(--app-text-primary, #1f2937);
}

.aasa-tab.active {
  color: #FF5733;
  border-bottom-color: #FF5733;
}

.aasa-tab-panel {
  display: none;
}

.aasa-tab-panel.active {
  display: block;
}

/* ===============================
   Domain Input with Prefix
   =============================== */
.aasa-input-row {
  display: flex;
  align-items: stretch;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.aasa-input-row:focus-within {
  box-shadow: 0 0 0 2px rgba(255,87,51,0.3);
  border-color: #FF5733;
}

.aasa-input-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.6rem 0 0.75rem;
  background: var(--card-bg-secondary, #f9fafb);
  color: var(--text-secondary, #9ca3af);
  font-size: 0.85rem;
  font-family: ui-monospace, monospace;
  user-select: none;
  border-right: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.aasa-domain-input {
  flex: 1;
  padding: 0.75rem;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  font-family: ui-monospace, monospace;
  color: var(--app-text-primary, #1f2937);
  outline: none;
  min-width: 0;
}

.aasa-validation-line {
  min-height: 1.25rem;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.35rem;
  color: var(--text-secondary, #6b7280);
}

.aasa-validation-line.valid  { color: #16a34a; }
.aasa-validation-line.invalid { color: #dc2626; }

.example-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  background: transparent;
}

.example-chip:hover {
  border-color: #FF5733;
  color: #FF5733;
}

/* ===============================
   Progress Bar (thin coral)
   =============================== */
.aasa-progress-bar-wrap {
  width: 100%;
  height: 3px;
  background: var(--border-subtle, #e5e7eb);
  border-radius: 9999px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.aasa-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #FF5733, #FF8C00);
  border-radius: 9999px;
  width: 0%;
  transition: width 0.4s ease;
}

/* ===============================
   5-Phase Stepper
   =============================== */
.aasa-stepper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 540px;
  margin: 0 auto 1.5rem;
}

.aasa-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.aasa-step__dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle, #d1d5db);
  background: transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  transition: all 0.2s ease;
}

.aasa-step__dot.running {
  border-color: #FF5733;
  animation: aasa-spin 0.8s linear infinite;
}

.aasa-step__dot.done {
  border-color: #22c55e;
  background: #22c55e;
}

.aasa-step__dot.fail {
  border-color: #ef4444;
  background: #ef4444;
}

@keyframes aasa-spin {
  to { transform: rotate(360deg); }
}

.aasa-step__label {
  font-size: 0.85rem;
  color: var(--text-secondary, #6b7280);
  font-weight: 500;
  transition: color 0.2s;
}

.aasa-step__label.running {
  color: var(--app-text-primary, #1f2937);
  font-weight: 600;
}

.aasa-step__label.done {
  color: #16a34a;
}

.aasa-step__label.fail {
  color: #dc2626;
}

/* ===============================
   Collapsible Group Cards
   =============================== */
.aasa-group-card {
  padding: 0;
  overflow: hidden;
}

.aasa-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.875rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.aasa-group-header:hover {
  background: var(--card-bg-secondary, #f9fafb);
}

.aasa-group-header-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary, #6b7280);
  min-width: 0;
}

.aasa-group-icon {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
  color: var(--text-secondary, #9ca3af);
}

.aasa-group-header-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.aasa-group-summary {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
}

.aasa-gsumm {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
}

.aasa-gsumm--pass { background: rgba(34,197,94,0.15);  color: #16a34a; }
.aasa-gsumm--fail { background: rgba(239,68,68,0.15);  color: #dc2626; }
.aasa-gsumm--warn { background: rgba(245,158,11,0.15); color: #d97706; }
.aasa-gsumm--info { background: rgba(59,130,246,0.12); color: #2563eb; }

.aasa-group-chevron {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--text-secondary, #9ca3af);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.aasa-group-card--open .aasa-group-chevron {
  transform: rotate(180deg);
}

/* ===============================
   Check Items List (collapsible)
   =============================== */
.aasa-checks-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0 0.75rem 0.75rem;
  overflow: hidden;
}

.aasa-checks-list--collapsed {
  display: none;
}

/* ===============================
   Check Items — color-coded
   =============================== */
.aasa-check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  border-radius: 0.4rem;
  border-left: 3px solid transparent;
  background: var(--card-bg-secondary, #f9fafb);
}

.aasa-check-item--pass { background: rgba(34,197,94,0.07);  border-left-color: #22c55e; }
.aasa-check-item--fail { background: rgba(239,68,68,0.07);  border-left-color: #ef4444; }
.aasa-check-item--warn { background: rgba(245,158,11,0.07); border-left-color: #f59e0b; }
.aasa-check-item--info { background: rgba(59,130,246,0.07); border-left-color: #60a5fa; }
.aasa-check-item--skip { background: var(--card-bg-secondary, #f9fafb); opacity: 0.55; border-left-color: transparent; }

.aasa-check-icon {
  flex-shrink: 0;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.05rem;
}

.aasa-check-item--pass .aasa-check-icon { background: rgba(34,197,94,0.2);  color: #16a34a; }
.aasa-check-item--fail .aasa-check-icon { background: rgba(239,68,68,0.2);  color: #dc2626; }
.aasa-check-item--warn .aasa-check-icon { background: rgba(245,158,11,0.2); color: #d97706; }
.aasa-check-item--info .aasa-check-icon { background: rgba(59,130,246,0.2); color: #2563eb; }
.aasa-check-item--skip .aasa-check-icon { background: rgba(156,163,175,0.15); color: #9ca3af; }

.aasa-check-body {
  flex: 1;
  min-width: 0;
}

.aasa-check-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--app-text-primary, #1f2937);
  line-height: 1.3;
  display: block;
}

.aasa-check-pts {
  font-weight: 600;
  font-size: 0.7rem;
  color: #16a34a;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.aasa-check-message {
  font-size: 0.73rem;
  color: var(--text-secondary, #6b7280);
  margin-top: 0.1rem;
  overflow-wrap: anywhere;
  display: block;
}

.aasa-check-hint {
  font-size: 0.7rem;
  color: var(--text-secondary, #6b7280);
  margin-top: 0.2rem;
  display: block;
  font-style: italic;
}

.aasa-check-hint a {
  color: #FF5733;
  text-decoration: underline;
}

/* legacy alias kept for any stray references */
.aasa-fix-hint { font-size: 0.75rem; color: var(--text-secondary, #6b7280); margin-top: 0.25rem; }
.aasa-fix-hint a { color: #FF5733; text-decoration: underline; }

/* ===============================
   "Fix These First" Card
   =============================== */
.aasa-critical-card {
  border: 1px solid rgba(239,68,68,0.25) !important;
  background: rgba(239,68,68,0.04);
}

.aasa-critical-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #dc2626;
  margin-bottom: 0.75rem;
}

.aasa-critical-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.aasa-critical-list li a {
  font-size: 0.85rem;
  font-weight: 600;
  color: #dc2626;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.aasa-critical-list li a:hover {
  text-decoration: underline;
}

/* ===============================
   Apple CDN Bonus Row
   =============================== */
.aasa-cdn-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.aasa-cdn-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(245,158,11,0.1);
  color: #d97706;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.aasa-cdn-unscored {
  font-size: 0.72rem;
  color: var(--text-secondary, #9ca3af);
}

/* ===============================
   AASA JSON Viewer
   =============================== */
.aasa-json-viewer {
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 0.625rem;
  overflow: hidden;
  margin-top: 0.75rem;
}

.aasa-json-viewer__tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle, #e5e7eb);
  background: var(--card-bg-secondary, #f9fafb);
}

.aasa-json-tab {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.aasa-json-tab.active {
  color: #FF5733;
  border-bottom-color: #FF5733;
}

.aasa-json-viewer__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-right: 0.75rem;
}

.aasa-json-action-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 0.3rem;
  background: transparent;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.aasa-json-action-btn:hover {
  border-color: #FF5733;
  color: #FF5733;
}

.aasa-json-body {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  max-height: 480px;
  overflow-y: auto;
}

.aasa-json-gutter {
  background: var(--card-bg-secondary, #f9fafb);
  padding: 0.75rem 0.4rem;
  text-align: right;
  border-right: 1px solid var(--border-subtle, #e5e7eb);
  font-size: 0.72rem;
  font-family: ui-monospace, monospace;
  color: var(--text-secondary, #9ca3af);
  user-select: none;
  line-height: 1.6;
}

.aasa-json-gutter span {
  display: block;
}

.aasa-json-code {
  padding: 0.75rem;
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
  color: var(--app-text-primary, #1f2937);
  margin: 0;
  tab-size: 2;
}

.aasa-json-preview-meta {
  font-size: 0.72rem;
  color: var(--text-secondary, #9ca3af);
  padding: 0.35rem 0.75rem;
  border-top: 1px solid var(--border-subtle, #e5e7eb);
  background: var(--card-bg-secondary, #f9fafb);
}

/* JSON token colors */
.aasa-tok-key    { color: #FF5733; font-weight: 600; }
.aasa-tok-str    { color: #16a34a; }
.aasa-tok-num    { color: #2563eb; }
.aasa-tok-bool   { color: #d97706; }
.aasa-tok-null   { color: #9ca3af; }

/* Rules table */
.aasa-rules-body {
  padding: 0.75rem;
}

.aasa-rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.aasa-rules-table th {
  text-align: left;
  padding: 0.4rem 0.6rem;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #9ca3af);
  border-bottom: 1px solid var(--border-subtle, #e5e7eb);
}

.aasa-rules-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border-subtle, #e5e7eb);
  vertical-align: top;
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.aasa-rules-table tr:last-child td {
  border-bottom: none;
}

/* ===============================
   Path Tester
   =============================== */
.aasa-path-input-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.aasa-path-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.5rem 0 0.75rem;
  background: var(--card-bg-secondary, #f9fafb);
  border: 1px solid #e5e7eb;
  border-right: none;
  border-radius: 0.5rem 0 0 0.5rem;
  color: var(--text-secondary, #9ca3af);
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.aasa-path-input {
  flex: 1;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-left: none;
  border-radius: 0 0.5rem 0.5rem 0;
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
  background: transparent;
  color: var(--app-text-primary, #1f2937);
  outline: none;
  transition: box-shadow 0.15s;
}

.aasa-path-input:focus {
  box-shadow: 0 0 0 2px rgba(255,87,51,0.25);
  border-color: #FF5733;
}

.aasa-path-result {
  min-height: 1.5rem;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.4rem;
  display: none;
}

.aasa-path-result.visible { display: block; }
.aasa-path-result.pass { background: rgba(34,197,94,0.08); color: #16a34a; font-weight: 600; }
.aasa-path-result.fail { background: rgba(239,68,68,0.08); color: #dc2626; font-weight: 600; }

/* ===============================
   Explainer Section
   =============================== */
.aasa-explainer-grid {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.aasa-explainer-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 200px;
}

.aasa-explainer-num {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(255,87,51,0.1);
  color: #FF5733;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.aasa-explainer-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--app-text-primary, #1f2937);
}

.aasa-explainer-desc {
  font-size: 0.8rem;
  color: var(--text-secondary, #6b7280);
  line-height: 1.5;
}

.aasa-explainer-connector {
  flex: 1;
  height: 2px;
  background: var(--border-subtle, #e5e7eb);
  min-width: 2rem;
  align-self: center;
  margin-bottom: 2.5rem;
}

@media (max-width: 640px) {
  .aasa-explainer-connector { display: none; }
}

/* ===============================
   Email Gate Bottom-Sheet
   =============================== */
.aasa-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 199;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.aasa-gate-overlay.open {
  opacity: 1;
  visibility: visible;
}

.aasa-gate-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--app-bg-primary, #ffffff);
  border-top: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 1rem 1rem 0 0;
  padding: 1.25rem 1.5rem 2rem;
  box-shadow: 0 -4px 32px rgba(0,0,0,0.12);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  z-index: 200;
  max-width: 540px;
  margin: 0 auto;
}

.aasa-gate-sheet.open {
  transform: translateY(0);
}

.aasa-gate-drag {
  width: 2.5rem;
  height: 0.25rem;
  background: var(--border-subtle, #d1d5db);
  border-radius: 9999px;
  margin: 0 auto 1.25rem;
}

.aasa-gate-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--app-text-primary, #1f2937);
  margin-bottom: 0.25rem;
}

.aasa-gate-sub {
  font-size: 0.85rem;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 1rem;
}

.aasa-gate-email-row {
  display: flex;
  gap: 0.5rem;
}

.aasa-gate-email-input {
  flex: 1;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: transparent;
  color: var(--app-text-primary, #1f2937);
  outline: none;
  transition: border-color 0.15s;
}

.aasa-gate-email-input:focus {
  border-color: #FF5733;
  box-shadow: 0 0 0 2px rgba(255,87,51,0.2);
}

.aasa-gate-otp-inputs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 0.75rem 0;
}

.aasa-gate-otp-input {
  width: 2.5rem;
  height: 3rem;
  border: 1.5px solid var(--border-subtle, #e5e7eb);
  border-radius: 0.5rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--app-text-primary, #1f2937);
  background: transparent;
  outline: none;
  transition: border-color 0.15s;
}

.aasa-gate-otp-input:focus {
  border-color: #FF5733;
  box-shadow: 0 0 0 2px rgba(255,87,51,0.2);
}

.aasa-gate-otp-input.error {
  border-color: #ef4444;
  animation: aasa-shake 0.3s ease;
}

@keyframes aasa-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.aasa-gate-fine-print {
  font-size: 0.72rem;
  color: var(--text-secondary, #9ca3af);
  margin-top: 0.5rem;
}

.aasa-gate-fine-print a {
  color: var(--text-secondary, #9ca3af);
  text-decoration: underline;
}

.aasa-gate-skip {
  display: block;
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary, #9ca3af);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
}

.aasa-gate-skip:hover {
  color: var(--app-text-primary, #374151);
}

.aasa-gate-error {
  font-size: 0.8rem;
  color: #dc2626;
  margin-top: 0.35rem;
  min-height: 1.2rem;
}

.aasa-gate-resend {
  font-size: 0.78rem;
  color: var(--text-secondary, #9ca3af);
  text-align: center;
  margin-top: 0.5rem;
}

.aasa-gate-resend button {
  color: #FF5733;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.78rem;
}

.aasa-gate-resend button:disabled {
  color: var(--text-secondary, #9ca3af);
  cursor: default;
}

.aasa-gate-success-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* ===============================
   Error Card
   =============================== */
.aasa-error-card {
  max-width: 500px;
  margin: 2rem auto;
  text-align: center;
}

/* ===============================
   Related Tools Strip
   =============================== */
.aasa-related-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.aasa-related-link {
  display: inline-block;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.aasa-related-link:hover {
  border-color: #FF5733;
  color: #FF5733;
}

/* ===============================
   Loading State
   =============================== */
.aasa-loading-card {
  text-align: center;
  padding: 2.5rem 1.5rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ===============================
   Responsive
   =============================== */
@media (max-width: 480px) {
  .aasa-score-circle-wrapper {
    width: 120px;
    height: 120px;
  }
  .aasa-score-value {
    font-size: 2.25rem;
  }
  .aasa-gate-otp-input {
    width: 2.25rem;
    height: 2.75rem;
    font-size: 1rem;
  }
  .aasa-gate-sheet {
    padding: 1rem 1rem 1.5rem;
  }
}

/* ===============================
   Dark Mode
   =============================== */
html[data-theme="dark"] .aasa-score-bg {
  stroke: #374151;
}

html[data-theme="dark"] .aasa-check-item {
  background: rgba(255,255,255,0.04);
}

html[data-theme="dark"] .aasa-check-item--pass { background: rgba(34,197,94,0.1);  border-left-color: #22c55e; }
html[data-theme="dark"] .aasa-check-item--fail { background: rgba(239,68,68,0.1);  border-left-color: #ef4444; }
html[data-theme="dark"] .aasa-check-item--warn { background: rgba(245,158,11,0.1); border-left-color: #f59e0b; }
html[data-theme="dark"] .aasa-check-item--info { background: rgba(59,130,246,0.1); border-left-color: #60a5fa; }

html[data-theme="dark"] .aasa-group-header:hover {
  background: rgba(255,255,255,0.04);
}

html[data-theme="dark"] .aasa-critical-card {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.3) !important;
}

html[data-theme="dark"] .aasa-input-prefix,
html[data-theme="dark"] .aasa-path-prefix {
  background: rgba(255,255,255,0.06);
  border-color: #374151;
  color: #9ca3af;
}

html[data-theme="dark"] .aasa-input-row {
  border-color: #374151;
}

html[data-theme="dark"] .aasa-domain-input,
html[data-theme="dark"] .aasa-path-input {
  color: #e5e7eb;
}

html[data-theme="dark"] .aasa-json-viewer {
  border-color: #374151;
}

html[data-theme="dark"] .aasa-json-gutter,
html[data-theme="dark"] .aasa-json-viewer__tabs {
  background: rgba(255,255,255,0.05);
  border-color: #374151;
}

html[data-theme="dark"] .aasa-json-code {
  color: #e5e7eb;
}

html[data-theme="dark"] .aasa-json-preview-meta {
  background: rgba(255,255,255,0.03);
  border-color: #374151;
  color: #6b7280;
}

html[data-theme="dark"] .aasa-rules-table th,
html[data-theme="dark"] .aasa-rules-table td {
  border-color: #374151;
}

html[data-theme="dark"] .aasa-gate-sheet {
  background: var(--app-bg-primary, #0f172a);
  border-color: #374151;
}

html[data-theme="dark"] .aasa-gate-email-input,
html[data-theme="dark"] .aasa-gate-otp-input {
  border-color: #374151;
  color: #e5e7eb;
  background: rgba(255,255,255,0.04);
}

html[data-theme="dark"] .aasa-tabs {
  border-color: #374151;
}

html[data-theme="dark"] .aasa-progress-bar-wrap {
  background: #374151;
}

html[data-theme="dark"] .aasa-json-viewer__tabs {
  border-color: #374151;
}

html[data-theme="dark"] .example-chip {
  border-color: #374151;
  color: #9ca3af;
}

html[data-theme="dark"] .example-chip:hover {
  border-color: #FF5733;
  color: #FF5733;
}

/* ===============================
   Reduced Motion
   =============================== */
@media (prefers-reduced-motion: reduce) {
  .aasa-gate-sheet { transition: none; }
  .aasa-step__dot.running { animation: none; }
  .aasa-score-progress { transition: none; }
  .aasa-progress-bar { transition: none; }
}
