:root {
  --bg: #f7f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e5e7eb;
  --shadow: 0 6px 24px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.04);
  --radius: 14px;
  --pad: 20px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  padding: 24px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", sans-serif;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

.card {
  max-width: 920px;
  margin: 0 auto 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: var(--shadow);
}

h1 {
  font-size: 1.25rem;
  margin: 0 0 12px;
}

h2 {
  font-size: 1.05rem;
  margin: 18px 0 10px;
}

label {
  display: block;
  font-weight: 700;
  margin: 10px 0 6px;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d7dbe2;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 10px 36px 10px 12px;
  border: 1px solid #d7dbe2;
  border-radius: 10px;
  background: #fff
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path fill="%238191a5" d="M5.5 7.5l4.5 5 4.5-5z"/></svg>')
    no-repeat right 10px center/16px 16px;
  font-size: 14px;
  color: inherit;
  min-width: 160px;
}

.select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 720px) {
  .row {
    grid-template-columns: 1fr;
  }

  body {
    padding: 16px;
  }
}

.inline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
}

.inline input[type="checkbox"] {
  margin-top: 3px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid #111827;
  background: #111827;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.06s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.muted {
  color: var(--muted);
  font-size: 0.86rem;
}

.err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 0 0 12px;
  white-space: pre-wrap;
}

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  white-space: nowrap;
  color: #0f172a;
}

pre {
  background: #0b1020;
  color: #e5e7eb;
  padding: 12px;
  border-radius: 10px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 10px 0 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9rem;
}

code {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  align-items: flex-end;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --card: #0f172a;
    --text: #e5e7eb;
    --muted: #9aa5b1;
    --border: #1f2937;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
  }

  input[type="text"],
  input[type="password"] {
    background: #0b1220;
    border-color: #273449;
    color: #e5e7eb;
  }

  .select {
    background: #0b1220
      url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path fill="%239aa5b1" d="M5.5 7.5l4.5 5 4.5-5z"/></svg>')
      no-repeat right 10px center/16px 16px;
    border-color: #273449;
    color: #e5e7eb;
  }

  input[type="text"]::placeholder,
  input[type="password"]::placeholder {
    color: #7b8794;
  }

  .btn {
    border-color: #e5e7eb;
  }

  pre {
    background: #0a0f1b;
  }

  code {
    background: #121827;
    border-color: #22314a;
    color: #cbd5e1;
  }
}
