:root { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: #f4f5f7;
  color: #1f2328;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.card {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  padding: 32px 28px;
}
h1 {
  font-size: 18px;
  color: #6b7280;
  font-weight: 500;
  margin: 0 0 4px;
  text-align: center;
}
.cp {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  word-break: break-all;
  margin-bottom: 24px;
  text-align: center;
}
.divider {
  border: 0;
  height: 1px;
  background: #e5e7eb;
  margin: 0 16px 24px;
}
.logo {
  display: block;
  margin: 0 auto 20px;
  max-width: 180px;
  width: 100%;
  height: auto;
}
.intro {
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.5;
}
.intro-title {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.intro-block {
  margin: 0;
}
.intro-block + .intro-block {
  margin-top: 12px;
}
.row {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.row button { min-width: 200px; }
button {
  appearance: none;
  border: 0;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  transition: transform 0.05s ease, opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: progress; }
.start { background: #16a34a; }
.start:hover:not(:disabled) { background: #15803d; }
.stop { background: #dc2626; }
.stop:hover:not(:disabled) { background: #b91c1c; }
button.charging { background: #1d4ed8; }
button.offline  { background: #6b7280; }
button.charging:disabled,
button.offline:disabled { opacity: 1; cursor: not-allowed; }
button.charging .btn-label { animation: btnBlink 1s ease-in-out infinite; }
@keyframes btnBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.status {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  display: none;
}
.status.ok { display: block; background: #ecfdf5; color: #065f46; }
.status.err { display: block; background: #fef2f2; color: #991b1b; }
.status.info { display: block; background: #eff6ff; color: #1e3a8a; }
footer {
  margin-top: 18px;
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
}
.op-by {
  margin-top: 24px;
}
.op-by-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.op-by-line {
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}
.op-by-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.3;
  color: #4b5563;
  font-size: 14px;
}
.op-by-vi { font-weight: 600; }
.op-by-en {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}
.op-by-logos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 8px 18px;
}
.op-logo {
  width: 50%;
  max-height: 56px;
  height: auto;
  object-fit: contain;
}
.op-logo-pvp {
  width: 50%;
  max-height: 80px;
  height: auto;
  object-fit: contain;
}
.op-by-bottom {
  border: 0;
  height: 1px;
  background: #e5e7eb;
  margin: 0;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
  flex-shrink: 0;
}
button.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.lang-switch,
.theme-switch {
  position: fixed;
  top: 16px;
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.92);
  padding: 4px;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  backdrop-filter: blur(6px);
  z-index: 10;
}
.lang-switch { right: 16px; }
.theme-switch { left: 16px; }
.lang-switch button,
.theme-switch button {
  all: unset;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  color: #6b7280;
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-switch button:hover:not(.active),
.theme-switch button:hover:not(.active) { color: #1f2328; }
.lang-switch button.active,
.theme-switch button.active {
  background: #1f2328;
  color: #fff;
}

[data-theme="dark"] body { background: #0f1115; color: #e5e7eb; }
[data-theme="dark"] .card { background: #171a21; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
[data-theme="dark"] h1 { color: #9ca3af; }
[data-theme="dark"] .divider,
[data-theme="dark"] .op-by-line,
[data-theme="dark"] .op-by-bottom { background: #2a2f3a; }
[data-theme="dark"] .op-by-text { color: #d1d5db; }
[data-theme="dark"] .op-by-en { color: #9ca3af; }
[data-theme="dark"] .op-logo {
  background: #fff;
  border-radius: 6px;
  padding: 6px;
}
[data-theme="dark"] .status.ok { background: #022c22; color: #a7f3d0; }
[data-theme="dark"] .status.err { background: #450a0a; color: #fecaca; }
[data-theme="dark"] .status.info { background: #0b1e3a; color: #bfdbfe; }
[data-theme="dark"] .lang-switch,
[data-theme="dark"] .theme-switch {
  background: rgba(23,26,33,0.92);
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
[data-theme="dark"] .lang-switch button,
[data-theme="dark"] .theme-switch button { color: #9ca3af; }
[data-theme="dark"] .lang-switch button:hover:not(.active),
[data-theme="dark"] .theme-switch button:hover:not(.active) { color: #e5e7eb; }
[data-theme="dark"] .lang-switch button.active,
[data-theme="dark"] .theme-switch button.active { background: #e5e7eb; color: #0f1115; }
