:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --text: #202124;
  --muted: #6b7280;
  --border: #e2e6ea;
  --input: #f9fafb;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --secondary: #374151;
  --status: #eff6f5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Noto Sans KR", sans-serif;
}

.app-shell {
  min-height: 100vh;
  padding: 22px;
}

.workspace {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1;
  letter-spacing: 0;
}

.header p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.download-link,
button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.download-link {
  display: inline-flex;
  align-items: center;
  background: var(--secondary);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 14px 34px rgba(31, 41, 55, 0.06);
}

.input-panel,
.key-panel {
  margin-bottom: 14px;
}

label {
  display: block;
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 800;
}

input[type="url"],
input[type="password"] {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  padding: 0 14px;
  font-size: 16px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

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

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

.secondary {
  background: var(--secondary);
  color: #fff;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: var(--status);
  color: var(--primary);
  padding: 0 16px;
  font-size: 15px;
  font-weight: 800;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(15, 118, 110, 0.22);
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

h2 {
  font-size: 20px;
  letter-spacing: 0;
}

.small {
  min-height: 36px;
  padding: 0 12px;
  background: var(--secondary);
  color: #fff;
  font-size: 13px;
}

.output {
  width: 100%;
  min-height: 360px;
  max-height: 64vh;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 14px/1.62 Arial, "Noto Sans KR", sans-serif;
}

.output.collapsed {
  max-height: 190px;
}

.summary h1 {
  margin: 0 0 14px;
  font-size: 24px;
}

.summary h2 {
  margin: 18px 0 10px;
  font-size: 19px;
}

.summary ul {
  margin: 0 0 14px;
  padding-left: 22px;
}

.summary li {
  margin: 6px 0;
}

@media (max-width: 780px) {
  .app-shell {
    padding: 16px;
  }

  .header,
  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .download-link,
  button {
    width: 100%;
  }

  .panel-title div {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}
