:root {
  color-scheme: light;
  --page: #f6f5f1;
  --surface: #ffffff;
  --ink: #172f40;
  --muted: #536273;
  --line: #d6ddd9;
  --teal: #116b64;
  --teal-dark: #0b514c;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  overflow-wrap: break-word;
}

a {
  color: var(--teal);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--teal-dark);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid #0d766e;
  outline-offset: 4px;
}

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

h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  max-width: 900px;
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4.6vw, 3.375rem);
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.1rem;
}

p:last-child {
  margin-bottom: 0;
}

.shell {
  width: min(1100px, calc(100% - 3rem));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.site-header > .shell,
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 88px;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 750;
  line-height: 1.3;
  text-decoration: none;
}

.site-header nav,
.site-header form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}

.hero {
  padding-block: clamp(2.5rem, 5vw, 4.5rem) 2rem;
}

.intro {
  max-width: 800px;
  color: var(--muted);
  font-size: 1.125rem;
}

.login-panel {
  width: min(100%, 560px);
  margin-block: 0 2rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 5px 18px rgb(23 47 64 / 3%);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

label,
legend {
  font-size: 1rem;
  font-weight: 650;
}

input,
textarea,
select,
button {
  font: inherit;
  font-size: 1rem;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.75rem 0.85rem;
  border: 1px solid #aab8b3;
  border-radius: 9px;
  background: #ffffff;
  color: var(--ink);
}

input[type="checkbox"],
input[type="radio"] {
  appearance: auto;
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  accent-color: var(--teal);
}

label:has(input[type="checkbox"]),
label:has(input[type="radio"]) {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #67747d;
  opacity: 1;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border: 2px solid #a43232;
}

.help {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.75rem 1.1rem;
  border: 1px solid #aab8b3;
  border-radius: 9px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
button:hover {
  border-color: var(--teal);
  background: #edf5f3;
  color: var(--teal-dark);
}

.button-primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.button-primary:hover {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
  color: #ffffff;
}

.button-secondary {
  border-color: #aab8b3;
  background: #ffffff;
  color: var(--ink);
}

.button-secondary:hover {
  border-color: var(--teal);
  background: #edf5f3;
  color: var(--teal-dark);
}

button:disabled,
.button[aria-disabled="true"] {
  border-color: #cbd3cf;
  background: #e6ebe8;
  color: #5c6861;
  cursor: not-allowed;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.status,
.notice {
  margin-block: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid #b9cec9;
  border-left-width: 4px;
  border-radius: 9px;
  background: #edf5f3;
  color: #254e49;
  font-size: 1rem;
}

.status:empty {
  display: none;
}

.status[data-state="error"] {
  border-color: #d69b9b;
  background: #fff1f0;
  color: #852929;
}

.notice-warning {
  border-color: #d2b16d;
  background: #fff7e5;
  color: #785013;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-block: 1.5rem 2.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 5px 18px rgb(23 47 64 / 3%);
}

.project-card h2 {
  font-size: 1.5rem;
  overflow-wrap: anywhere;
}

.project-id {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 0.75rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid #b9cec9;
  border-radius: 6px;
  background: #edf5f3;
  color: var(--teal-dark);
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.project-meta {
  margin-block: 0 1rem;
  color: var(--muted);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.project-meta dt {
  font-weight: 650;
}

.project-meta dd {
  margin: 0 0 0.5rem;
}

.config-list {
  margin-block: 0.5rem 1.25rem;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 1rem;
}

.config-list li + li {
  margin-top: 0.5rem;
}

.project-card .actions {
  margin-top: auto;
  padding-top: 1.25rem;
}

.project-card .actions .button {
  flex: 1 1 130px;
}

code,
pre,
.guide {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

code {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.guide {
  max-width: 100%;
  max-height: 75vh;
  overflow: auto;
  margin-block: 1rem 2rem;
  padding: clamp(1rem, 3vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}

.footer {
  margin-top: 2.5rem;
  padding-block: 1.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.skip-link {
  position: absolute;
  z-index: 100;
  top: 0.75rem;
  left: 1rem;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  transform: translateY(-180%);
}

.skip-link:focus {
  color: #ffffff;
  transform: translateY(0);
}

@media (max-width: 760px) {
  .shell {
    width: min(1100px, calc(100% - 2rem));
  }

  .project-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .hero {
    padding-block: 2.5rem 1.5rem;
  }

  .login-panel,
  .project-card {
    border-radius: 12px;
  }
}

@media (max-width: 440px) {
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .project-card .actions .button {
    flex: 0 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

@media print {
  body,
  .site-header,
  .login-panel,
  .project-card,
  .guide {
    background: #ffffff;
    box-shadow: none;
  }

  .shell {
    width: 100%;
  }

  .actions,
  .site-header nav,
  .site-header form,
  .skip-link {
    display: none;
  }

  .guide {
    max-height: none;
    overflow: visible;
  }
}

.offer { margin-block: 1.25rem; padding: 1rem; border-left: 3px solid #14746f; background: #eef5f3; border-radius: .25rem; }
.offer h3 { margin-block: .5rem; font-size: 1.25rem; line-height: 1.4; overflow-wrap: anywhere; }
