:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: rgba(255, 255, 255, 0.85);
  --panel-strong: rgba(255, 255, 255, 0.95);
  --text: #101828;
  --muted: #667085;
  --line: rgba(15, 23, 42, 0.12);
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --danger: #b42318;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(20, 184, 166, 0.18), transparent 32%),
    radial-gradient(circle at 90% 12%, rgba(59, 130, 246, 0.15), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  display: flex;
  flex-direction: column;
}

button, input, select {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 16px 0 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  margin-bottom: 8px;
}

.brand-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--accent-strong);
  letter-spacing: -0.5px;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch-group {
  display: flex;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 999px;
  padding: 3px;
}

.lang-btn {
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: 0;
}

.lang-btn.active {
  color: var(--accent-strong);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: end;
  padding: 12px 0 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.5px;
}

h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.summary {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.status-card, .panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.status-card {
  border-radius: 20px;
  padding: 16px;
}

.status-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.panel {
  margin-top: 14px;
  border-radius: 20px;
  padding: 18px;
}

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

.login-panel {
  max-width: 760px;
}

summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 800;
  list-style: none;
}

summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 999px;
  color: white;
  background: var(--accent);
  font-size: 14px;
}

details[open] summary::before { content: "-"; }

.panel-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.grid {
  display: grid;
  gap: 12px;
}

.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-two { grid-column: span 2; }

label span {
  display: block;
  margin-bottom: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.form-note {
  align-self: end;
  min-height: 42px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 12px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 12px;
  line-height: 1.4;
}

input, select {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  outline: none;
}

input:focus, select:focus {
  border-color: rgba(15, 118, 110, 0.72);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.toggle {
  display: flex;
  align-items: center;
  min-height: 42px;
  gap: 8px;
}

.toggle input {
  width: 16px;
  height: 16px;
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease;
}

button:active {
  transform: scale(0.98);
}

.primary {
  min-height: 46px;
  padding: 0 24px;
  color: white;
  background: var(--accent);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.2);
  font-weight: 800;
}

.primary:hover { background: var(--accent-strong); }

.secondary {
  color: var(--accent-strong);
  background: rgba(15, 118, 110, 0.1);
  font-weight: 750;
}

.small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.action-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
}

.quick-action {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 14px;
}

.result {
  flex: 1;
  min-height: 46px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--muted);
  background: var(--panel-strong);
  font-size: 13px;
}

.result.success {
  color: var(--accent-strong);
  background: rgba(15, 118, 110, 0.1);
}

.result.error {
  color: var(--danger);
  background: rgba(180, 35, 24, 0.08);
}

pre {
  min-height: 140px;
  max-height: 220px;
  overflow: auto;
  margin: 0;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  padding: 12px;
  color: #d1fadf;
  background: #101828;
  font: 12px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 24, 40, 0.45);
  backdrop-filter: blur(6px);
  padding: 16px;
}

.modal-card {
  width: min(520px, 100%);
  background: #ffffff;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

.modal-card.wide {
  width: min(840px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}

.close-btn {
  background: transparent;
  border: 0;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
  min-height: auto;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.guide-content {
  max-height: 60vh;
  overflow-y: auto;
  font-size: 13px;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.guide-table th, .guide-table td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.guide-table th {
  background: var(--bg);
  font-weight: 700;
}

@media (max-width: 860px) {
  .hero, .two, .three { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .panel-head, .action-row, .quick-action { display: flex; flex-direction: column; align-items: stretch; }
  .primary, .secondary, .button-group button { width: 100%; }
}
