:root {
  color-scheme: light;
  --page: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #dbe3ee;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --green: #15803d;
  --green-bg: #ecfdf5;
  --green-border: #86efac;
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --amber-border: #fcd34d;
  --red: #b91c1c;
  --red-bg: #fef2f2;
  --red-border: #fecaca;
  --shadow: 0 24px 70px rgba(15, 23, 42, .16);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .11), transparent 42%),
    linear-gradient(315deg, rgba(21, 128, 61, .10), transparent 38%),
    var(--page);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select,
a {
  font: inherit;
}

.app-shell {
  width: min(100%, 480px);
  overflow: hidden;
  border: 1px solid rgba(219, 227, 238, .9);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

.site-logo {
  display: block;
  height: 26px;
  width: auto;
}

.lang-select {
  flex: 0 0 auto;
  min-width: 96px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  padding: 0 8px;
  cursor: pointer;
}

.lang-select:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .28);
  outline-offset: 2px;
}

.status-panel {
  padding: 32px 22px 20px;
  text-align: center;
}

.status-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #eff6ff;
  color: var(--blue);
}

.status-icon svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.status-icon[data-state="success"] {
  background: var(--green-bg);
  color: var(--green);
}

.status-icon[data-state="warn"] {
  background: var(--amber-bg);
  color: var(--amber);
}

.status-icon[data-state="bad"] {
  background: var(--red-bg);
  color: var(--red);
}

.is-loading {
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(.96);
    opacity: .72;
  }
}

h1 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.4;
}

.message {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.notice {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
  padding: 12px 14px;
  text-align: left;
  color: #334155;
  font-size: 13px;
  line-height: 1.7;
}

.notice-good {
  border-color: var(--green-border);
  background: var(--green-bg);
  color: #14532d;
}

.notice-warn {
  border-color: var(--amber-border);
  background: var(--amber-bg);
  color: #78350f;
}

.notice-bad {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: #7f1d1d;
}

.settings-box {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
  font-size: 13px;
  line-height: 1.7;
  text-align: left;
  color: #334155;
}

.settings-box summary {
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  user-select: none;
}

.settings-box summary::-webkit-details-marker {
  display: none;
}

.settings-box summary::before {
  content: "▶";
  font-size: 9px;
  opacity: .6;
  transition: transform .18s;
  flex-shrink: 0;
}

.settings-box[open] summary::before {
  transform: rotate(90deg);
}

.settings-box .steps {
  margin: 0;
  padding: 2px 14px 12px 28px;
}

.settings-box .steps li + li {
  margin-top: 5px;
}

.actions {
  display: grid;
  gap: 10px;
  padding: 0 22px 24px;
}

.button {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  padding: 15px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.2;
  cursor: pointer;
}

.button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .28);
  outline-offset: 2px;
}

.button-primary {
  background: var(--blue);
  color: #fff;
}

.button-primary:active {
  background: var(--blue-hover);
  transform: translateY(1px);
}

.button-success {
  background: var(--green);
  color: #fff;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 420px) {
  .page-header {
    padding: 16px 18px;
  }

  .status-panel {
    padding: 28px 18px 18px;
  }

  .actions {
    padding: 0 18px 20px;
  }

  h1 {
    font-size: 18px;
  }
}
