* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f3f4f6; color: #111827;
}
nav {
  display: flex; gap: 16px; padding: 12px 16px;
  background: #fff; border-bottom: 1px solid #e5e7eb;
}
nav a { color: #374151; text-decoration: none; font-weight: 600; }
nav a:hover { color: #2563eb; }
.page {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 16px; min-height: 0;
}
.card {
  width: 100%; max-width: 560px; background: #fff; padding: 24px;
  border-radius: 12px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
h1 { margin: 0 0 16px; font-size: clamp(1.25rem, 5vw, 1.75rem); }
p { margin: 0 0 16px; color: #374151; }
form { display: flex; flex-direction: column; gap: 12px; }
input[type="text"], input[type="password"], input[type="datetime-local"], button {
  width: 100%; padding: 12px 14px; font-size: 1rem; border-radius: 8px;
}
input[type="text"], input[type="password"], input[type="datetime-local"] { border: 1px solid #d1d5db; }
input:focus { outline: 2px solid #2563eb; border-color: transparent; }
label { font-size: 0.9rem; color: #374151; margin-bottom: -6px; }
label.check { display: flex; align-items: center; gap: 8px; margin-bottom: 0; }
button, a.button {
  border: none; background: #2563eb; color: #fff; font-weight: 600; cursor: pointer;
}
button:hover, a.button:hover { background: #1d4ed8; }
a.button {
  display: inline-block; padding: 12px 14px; border-radius: 8px; text-decoration: none;
}
#result { word-break: break-all; }
#result a { color: #2563eb; }
.error { color: #b91c1c; margin: 0; }
@media (min-width: 480px) {
  button { width: auto; white-space: nowrap; }
}

/* Home */
.profile { display: flex; align-items: center; gap: 32px; max-width: 700px; }
.profile img {
  width: 200px; height: 200px; border-radius: 50%; object-fit: cover;
  border: 4px solid #e5e7eb; flex-shrink: 0;
}
.profile p { margin: 0; font-size: 1.1rem; line-height: 1.6; }
@media (max-width: 600px) { .profile { flex-direction: column; text-align: center; } }

/* JSON formatter */
.json-tool { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.json-tool header { padding: 12px 16px; display: flex; align-items: center; gap: 16px; }
.json-tool h1 { margin: 0; flex: 1; font-size: 1.1rem; }
.json-tool main { flex: 1; display: flex; gap: 12px; padding: 0 12px 12px; min-height: 0; }
.pane { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pane label { font-weight: 600; margin-bottom: 4px; color: #555; }
.json-tool textarea, .json-tool pre {
  flex: 1; margin: 0; padding: 10px; border: 1px solid #ccc; border-radius: 6px;
  background: #fff; font: 13px/1.5 ui-monospace, Consolas, monospace; overflow: auto; resize: none;
}
.json-tool pre { white-space: pre-wrap; word-break: break-word; }
#json-error {
  display: none; margin: 0 12px 12px; padding: 10px 12px; border-radius: 6px;
  background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; font-size: 0.9rem;
}
@media (max-width: 700px) { .json-tool main { flex-direction: column; } }

/* Home tools table */
.page.home { flex-direction: column; gap: 16px; }
.tools { max-width: 700px; }
.tools h2 { margin: 0 0 12px; font-size: 1.15rem; }
.tools table { width: 100%; border-collapse: collapse; }
.tools th, .tools td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e5e7eb; }
.tools a { color: #2563eb; }
