:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #5b6472;
  --line: #d7dde5;
  --surface: #f8fafc;
  --paper: #ffffff;
  --accent: #dc2626;
  --accent-dark: #b91c1c;
  --focus: rgba(220, 38, 38, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(960px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.login-panel,
.app-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(17, 24, 39, 0.08);
}

.login-panel {
  width: min(500px, 100%);
  margin: 0 auto;
  padding: 30px;
}

.app-panel {
  padding: 28px;
}

.version {
  margin: 0 0 14px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.intro,
.period,
.status {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.period {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.stack,
.grid-form,
.survey {
  display: grid;
  gap: 14px;
}

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

.wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  padding: 10px 11px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--focus);
}

.check {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.check input {
  width: 16px;
  height: 16px;
}

.actions,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

button,
.secondary {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 0 18px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 120ms ease;
}

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

.primary:hover,
.primary:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.16);
}

.secondary,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--ink);
}

.secondary:hover,
.secondary:focus-visible,
.ghost:hover,
.ghost:focus-visible {
  border-color: rgba(220, 38, 38, 0.48);
  background: rgba(220, 38, 38, 0.06);
  color: var(--accent-dark);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

button:active,
.secondary:active {
  transform: translateY(1px);
}

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

.result {
  overflow: auto;
  max-height: 420px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: #e5e7eb;
  font-size: 13px;
  line-height: 1.55;
}

.score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 20px, 960px);
    padding: 20px 0;
  }

  .login-panel,
  .app-panel {
    padding: 20px;
  }

  .grid-form,
  .score-row {
    grid-template-columns: 1fr;
  }

  .actions,
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  button,
  .secondary {
    width: 100%;
  }
}
