:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --line: #d6dde5;
  --text: #17202a;
  --muted: #5b6675;
  --blue: #1f6284;
  --blue-dark: #15465e;
  --green: #2f7d57;
  --amber: #af7b1d;
  --shadow: 0 18px 36px rgba(17, 24, 39, 0.12);
  font-family: "Segoe UI", "Meiryo", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(140deg, rgba(31, 98, 132, 0.08), rgba(47, 125, 87, 0.05)), var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 24px);
}

.login-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(560px, 100%);
  padding: clamp(20px, 4vw, 32px);
}

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.18;
  text-wrap: balance;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  line-height: 1.25;
  text-wrap: balance;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.lead {
  margin: 12px 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.field span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.message {
  min-height: 24px;
  margin: 14px 0;
  color: #b44753;
  font-weight: 700;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 700;
}

.primary-button {
  background: var(--blue);
  color: white;
}

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

.secondary-button {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}

.app-shell {
  padding: clamp(16px, 4vw, 24px);
  display: grid;
  gap: 16px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.panel {
  padding: clamp(16px, 3vw, 18px);
}

.panel span,
.panel strong {
  display: block;
}

.panel span {
  color: var(--muted);
  font-size: 0.85rem;
}

.panel strong {
  margin-top: 8px;
  font-size: clamp(1.3rem, 2.8vw, 1.6rem);
}

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

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e7f0f5;
  color: var(--blue-dark);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.code-block {
  margin: 0;
  min-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafb;
  font-size: 0.84rem;
  line-height: 1.55;
}

@media (max-width: 860px) {
  .status-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }
}

@media (max-width: 640px) {
  .login-card {
    width: 100%;
  }

  h1 {
    font-size: clamp(1.8rem, 9vw, 2.4rem);
  }

  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions button {
    flex: 1 1 140px;
  }
}
