:root {
  font-family: Pretendard, "Malgun Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2328;
  background: #f7f6f1;
  --navy: #1a2744;
  --gold: #a87c3f;
  --purple: #667eea;
  --purple-dark: #764ba2;
  --surface: #ffffff;
  --line: #dedbd2;
  --muted: #74766f;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: #f7f6f1; }
button, input, textarea { font: inherit; }

.login-screen {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
  overflow-y: auto;
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.login-screen .card {
  width: 100%;
  max-width: 400px;
  padding: 40px 32px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(0,0,0,.2);
}
.login-screen h1 { margin: 0 0 4px; color: #333; font-size: 28px; }
.login-screen .subtitle { margin-bottom: 28px; color: #888; font-size: 13px; }
.login-screen label { display: block; margin: 16px 0 6px; color: #555; font-size: 13px; font-weight: 600; }
.login-screen input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border .15s;
}
.login-screen input:focus { outline: none; border-color: #667eea; }
.login-screen #btn {
  width: 100%;
  margin-top: 22px;
  padding: 13px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #667eea;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.login-screen #btn:hover { background: #5568d3; }
.login-screen button:disabled { cursor: not-allowed; opacity: .6; }
.login-screen .error { display: none; margin-top: 14px; padding: 10px 12px; border-radius: 8px; color: #b71c1c; background: #fdeded; font-size: 13px; }
.login-type-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 14px 0 4px; }
.login-type { margin: 0; padding: 10px 4px; border: 1px solid #ddd; border-radius: 8px; color: #333; background: #fff; font-size: 12px; font-weight: 800; }
.login-type.active { border-color: #1a2744; color: #fff; background: #1a2744; }
.login-type:hover { border-color: #667eea; color: #5568d3; background: #eef0ff; }
.login-type.active:hover { color: #fff; background: #1a2744; }
.local-dev-credentials { margin: 14px 0 4px; padding: 12px; border: 1px solid #b9c5ff; border-radius: 10px; background: #f2f4ff; }
.local-dev-head { margin-bottom: 8px; color: #1a2744; font-size: 12px; font-weight: 800; }
.local-dev-row { display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: 8px; margin-top: 5px; font-size: 12px; }
.local-dev-row span { color: #777; }
.local-dev-row code { padding: 5px 7px; border-radius: 5px; color: #1a2744; background: #fff; font-family: Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; user-select: all; }
.local-dev-credentials button { width: 100%; margin-top: 10px; padding: 9px; border: 1px solid #667eea; border-radius: 7px; color: #fff; background: #667eea; font-size: 12px; font-weight: 700; }
.preset-box { margin: 18px 0 4px; padding: 12px; border: 1px solid #eee; border-radius: 10px; background: #fafafa; }
.preset-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.preset-title { color: #555; font-size: 12px; font-weight: 700; }
.preset-help { color: #999; font-size: 11px; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-grid.three-columns { grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
.preset { margin: 0; padding: 9px 8px; border: 1px solid #ddd; border-radius: 7px; color: #333; background: #fff; font-size: 12px; font-weight: 700; }
.preset:hover { border-color: #667eea; color: #5568d3; background: #f2f4ff; }
.preset.selected { border-color: #667eea; color: #5568d3; background: #eef0ff; }
.preset.saved::after { content: " 저장됨"; color: #2e7d32; font-size: 10px; font-weight: 700; }
.preset.test-account { padding: 8px 4px; color: #fff; font-size: 11px; line-height: 1.3; }
.preset.test-account:hover { color: #fff; filter: brightness(.94); }
.preset small { font-size: 9px; opacity: .75; }
.preset-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
.preset-actions button { margin: 0; padding: 9px; border: 1px solid #ddd; border-radius: 7px; color: #444; background: #eef0f6; font-size: 12px; }
.preset-actions button.danger { color: #b71c1c; background: #fff0f0; }
.preset-status { margin-top: 8px; color: #777; font-size: 11px; line-height: 1.4; }
.safe-password-note { color: #1a2744; font-weight: 800; }
.hidden { display: none !important; }
.footer { margin-top: 22px; color: #999; text-align: center; font-size: 12px; }
.footer + .footer { margin-top: 12px; }
.footer a { color: #667eea; font-weight: 700; text-decoration: none; }

.app-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
body.auth-pending .app-shell { display: none; }
aside { padding: 24px; color: #fff; background: #263b43; }
.app-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 24px; }
.app-brand span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; color: #fff; background: var(--gold); font-weight: 900; }
nav { display: grid; gap: 8px; }
button { padding: 9px 12px; border: 1px solid #7c9b9b; border-radius: 5px; color: #234; background: #fff; cursor: pointer; }
aside button { border-color: #53727a; color: #fff; background: #304a53; text-align: left; }
main { width: 100%; max-width: 1200px; padding: 24px; }
header, .context { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
main section { margin-top: 18px; padding: 18px; border: 1px solid #ccd8d6; border-radius: 8px; background: #fff; }
input, textarea { padding: 8px; border: 1px solid #aebfbd; border-radius: 4px; }
#steps { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 10px; padding: 0; list-style: none; }
#steps button { width: 100%; }
pre { min-height: 120px; padding: 14px; color: #dceceb; background: #17252a; white-space: pre-wrap; }

@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  aside { padding: 12px; }
  nav { grid-template-columns: repeat(3, 1fr); }
  main { padding: 16px; }
  header, .context { align-items: flex-start; flex-direction: column; }
  #steps { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 380px) {
  .login-screen .card { padding: 32px 22px; }
}
