:root {
  color-scheme: light;
  --paper: #f4f5f0;
  --surface: #fff;
  --ink: #202923;
  --muted: #69736c;
  --line: #d8ded8;
  --green: #315d49;
  --green-dark: #244b38;
  --error: #93473e;
  font-family: "Yu Gothic UI", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
}

button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid #829a89;
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px max(16px, calc((100vw - 760px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}

.brand-symbol {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--green);
  border-radius: 4px;
  color: var(--green);
  font-size: 16px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.25;
}

.brand strong {
  font-size: 13px;
}

.brand small,
.access-label {
  color: var(--muted);
  font-size: 10px;
}

.access-label {
  white-space: nowrap;
}

.page {
  width: min(100% - 28px, 440px);
  margin: clamp(28px, 8vh, 72px) auto 48px;
}

.surface {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(20px, 6vw, 30px);
  background: var(--surface);
}

.loading-view {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.loading-view p {
  margin: 0;
}

.loading-dot {
  width: 11px;
  height: 11px;
  border: 2px solid #cdd8d0;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.intro {
  margin: 9px 0 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.auth-block {
  display: grid;
  gap: 12px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.auth-block + .auth-block {
  margin-top: 19px;
}

.auth-block h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 750;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 45px;
  border: 1px solid #bfc9c1;
  border-radius: 5px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
}

.button {
  width: 100%;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 11px 15px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.button.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.button.primary:hover:not(:disabled) {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.button.secondary {
  border-color: #bfc9c1;
  background: #fff;
  color: var(--green-dark);
}

.button.secondary:hover:not(:disabled) {
  border-color: var(--green);
  background: #f7faf7;
}

.tracker-copy {
  margin: -12px 0 15px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.tracker-button {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3px 0 16px;
  text-decoration: none;
}

.feedback,
.secure-notice {
  margin: 13px 0 0;
  border-left: 3px solid #b18a49;
  padding: 9px 11px;
  background: #f8f3e8;
  color: #614e2e;
  font-size: 11px;
  line-height: 1.55;
}

.feedback[data-tone="error"] {
  border-left-color: var(--error);
  background: #fcf1ef;
  color: var(--error);
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
  color: var(--muted);
  font-size: 11px;
}

.text-button {
  min-height: 34px;
  border: 0;
  padding: 5px 0 5px 8px;
  background: transparent;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.text-button:hover {
  text-decoration: underline;
}

@media (min-width: 700px) {
  .topbar {
    padding-inline: max(24px, calc((100vw - 760px) / 2));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
