
.swadt-app,
.swadt-lock {
  --swadt-accent: #635bff;
  --swadt-accent-dark: #4f46e5;
  --swadt-bg: #f5f7fb;
  --swadt-card: #ffffff;
  --swadt-text: #151821;
  --swadt-muted: #6b7280;
  --swadt-border: #e5e7eb;
  --swadt-success: #0f9f6e;
}

.swadt-app,
.swadt-app * { box-sizing: border-box; }

.swadt-app {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--swadt-text);
  background: var(--swadt-bg);
  padding: 24px;
  border-radius: 22px;
}

.swadt-shell { max-width: 1220px; margin: 0 auto; }

.swadt-hero {
  background: linear-gradient(135deg, #111827, #1f2937);
  color: white;
  padding: 30px;
  border-radius: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 18px 50px rgba(17,24,39,.16);
}
.swadt-eyebrow { font-size: 12px; letter-spacing: .18em; font-weight: 800; opacity: .72; }
.swadt-hero h1 { margin: 7px 0 8px; font-size: clamp(28px, 4vw, 44px); line-height: 1.05; color: #fff; }
.swadt-hero p { margin: 0; max-width: 700px; color: rgba(255,255,255,.76); font-size: 16px; }
.swadt-local-badge {
  white-space: nowrap; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08);
  color: #d1fae5; border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 800;
}

.swadt-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.swadt-tab {
  border: 1px solid var(--swadt-border); background: white; color: var(--swadt-muted);
  border-radius: 999px; padding: 10px 14px; cursor: pointer; font-weight: 750;
}
.swadt-tab.is-active { background: var(--swadt-accent); color: white; border-color: var(--swadt-accent); }

.swadt-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px;
}
.swadt-stats div {
  background: white; border: 1px solid var(--swadt-border); border-radius: 15px; padding: 16px 18px;
}
.swadt-stats strong { display: block; font-size: 24px; line-height: 1; }
.swadt-stats span { display: block; margin-top: 6px; color: var(--swadt-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

.swadt-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 18px; }
.swadt-panel {
  background: var(--swadt-card); border: 1px solid var(--swadt-border); border-radius: 18px; padding: 18px;
  box-shadow: 0 10px 30px rgba(17,24,39,.04);
}
.swadt-output-panel, .swadt-duplicates-panel { grid-column: 1 / -1; }

.swadt-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.swadt-panel-head > div { display: flex; align-items: center; gap: 10px; }
.swadt-panel-head h2 { font-size: 17px; margin: 0; }
.swadt-step {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px;
  background: #eef2ff; color: var(--swadt-accent-dark); font-weight: 900; font-size: 12px;
}
.swadt-ghost { background: transparent; border: 0; color: var(--swadt-muted); cursor: pointer; font-weight: 750; }

#swadt-input, #swadt-output {
  width: 100%; min-height: 310px; resize: vertical; border: 1px solid var(--swadt-border);
  border-radius: 14px; padding: 15px; font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #fbfcfe; color: #111827; outline: none;
}
#swadt-input:focus { border-color: var(--swadt-accent); box-shadow: 0 0 0 3px rgba(99,91,255,.1); }
#swadt-output { min-height: 220px; }

.swadt-help, .swadt-note, .swadt-status { color: var(--swadt-muted); font-size: 12px; }
.swadt-help { margin-top: 9px; }

.swadt-controls { align-self: start; }
.swadt-control-group { padding: 14px 0; border-top: 1px solid var(--swadt-border); }
.swadt-control-group:first-of-type { border-top: 0; padding-top: 0; }
.swadt-control-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--swadt-muted); margin: 0 0 10px; }

.swadt-check { display: flex; gap: 9px; align-items: center; margin: 9px 0; font-size: 14px; cursor: pointer; }
.swadt-check input { width: 16px; height: 16px; }

.swadt-button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.swadt-mini, .swadt-action, .swadt-secondary, .swadt-primary {
  border-radius: 10px; border: 1px solid var(--swadt-border); padding: 9px 11px; background: white;
  cursor: pointer; font-weight: 750; font-size: 13px;
}
.swadt-mini.is-selected { border-color: var(--swadt-accent); background: #eef2ff; color: var(--swadt-accent-dark); }
.swadt-action { width: 100%; margin: 4px 0; text-align: left; }
.swadt-action:hover, .swadt-mini:hover, .swadt-secondary:hover { border-color: #c7c9d1; background: #f9fafb; }

.swadt-control-group label:not(.swadt-check) { display: block; font-size: 12px; font-weight: 750; color: var(--swadt-muted); margin: 10px 0 6px; }
.swadt-control-group select, .swadt-control-group input[type="text"] {
  width: 100%; margin-top: 6px; border: 1px solid var(--swadt-border); border-radius: 10px;
  padding: 10px 11px; background: white; color: var(--swadt-text);
}

.swadt-footer-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 12px; }
.swadt-primary { background: var(--swadt-accent); border-color: var(--swadt-accent); color: white; padding-inline: 16px; }
.swadt-primary:hover { background: var(--swadt-accent-dark); }
.swadt-secondary { background: white; }
.swadt-status { min-height: 18px; margin-top: 9px; color: var(--swadt-success); font-weight: 700; }

.swadt-count-pill {
  border-radius: 999px; padding: 6px 10px; background: #f3f4f6; color: var(--swadt-muted); font-size: 12px; font-weight: 800;
}

.swadt-duplicate-list { display: grid; gap: 8px; }
.swadt-dup-row {
  display: flex; justify-content: space-between; gap: 20px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--swadt-border); border-radius: 10px;
}
.swadt-dup-row code { overflow-wrap: anywhere; }
.swadt-dup-row span { font-weight: 900; color: var(--swadt-accent-dark); }

.swadt-note { padding: 16px 4px 0; }
.swadt-app .is-hidden { display: none !important; }

.swadt-lock {
  padding: 40px 20px; background: #f5f7fb; border-radius: 18px;
}
.swadt-lock-card {
  max-width: 520px; margin: 0 auto; padding: 38px; background: white; border: 1px solid #e5e7eb;
  border-radius: 18px; text-align: center; box-shadow: 0 12px 40px rgba(17,24,39,.07);
}
.swadt-lock-icon { font-size: 34px; }
.swadt-lock-card h2 { margin: 12px 0 8px; }
.swadt-lock-card p { color: #6b7280; }
.swadt-login-btn {
  display: inline-block; margin-top: 10px; padding: 11px 18px; border-radius: 10px; background: var(--swadt-accent);
  color: white !important; text-decoration: none; font-weight: 800;
}

@media (max-width: 900px) {
  .swadt-grid { grid-template-columns: 1fr; }
  .swadt-output-panel, .swadt-duplicates-panel { grid-column: auto; }
}
@media (max-width: 640px) {
  .swadt-app { padding: 12px; border-radius: 14px; }
  .swadt-hero { padding: 22px; flex-direction: column; }
  .swadt-stats { grid-template-columns: repeat(2, 1fr); }
  #swadt-input { min-height: 250px; }
}
