:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #232923;
  background: #f7f8f5;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  --muted: #7c837a;
  --green: #385d48;
  --line: #e4e7e0;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 56px 24px 40px;
}
.auth-shell { width: 100%; max-width: 420px; }
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  margin: 0 auto 28px;
  text-decoration: none;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -.6px;
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--green);
  border: 1px solid #dce4d9;
  border-radius: 12px;
  background: #edf2e9;
}
.card {
  padding: 36px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 8px 32px rgb(40 54 34 / 3%);
}
.card-header { margin-bottom: 28px; }
.eyebrow { margin: 0 0 12px; color: var(--muted); font-size: 12px; letter-spacing: 1px; }
h1 { margin: 0; font-size: 30px; line-height: 1.25; font-weight: 600; letter-spacing: -1px; }
.subtitle { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.auth-form { display: grid; gap: 20px; }
.field { display: grid; gap: 9px; }
.field > label { font-size: 13px; font-weight: 550; }
.optional { color: var(--muted); font-weight: 400; }
.field input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: #232923;
  background: #fcfcfb;
  border: 1px solid #dfe3db;
  border-radius: 9px;
  outline: none;
  font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: #8fa78e; box-shadow: 0 0 0 3px rgb(103 137 103 / 12%); background: #fff; }
.field input:autofill { box-shadow: 0 0 0 100px #f7faf4 inset; }
.password-control { position: relative; }
.password-control:has(.password-toggle:not([hidden])) input { padding-right: 64px; }
.password-toggle {
  position: absolute;
  right: 5px;
  top: 5px;
  min-width: 50px;
  height: 38px;
  padding: 0 8px;
  color: #63735f;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
}
.password-toggle:hover { background: #f0f3ed; }
.field-help { margin: -1px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.checkbox-label { display: flex; align-items: center; gap: 9px; width: fit-content; font-size: 12px; cursor: pointer; }
.checkbox-label input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); cursor: pointer; }
.muted { color: var(--muted); margin-left: 4px; }
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 550;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.button-primary { color: #fff; background: var(--green); }
.button-primary:hover { background: #2c4c3a; }
.button-secondary { color: #596354; background: #f7f8f5; border-color: var(--line); margin-top: 12px; }
.button-secondary:hover { background: #eef1ea; }
.button:disabled, .text-button:disabled { cursor: wait; opacity: .65; }
.switch-mode { margin: 26px 0 0; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.7; }
.switch-mode a { margin-left: 6px; color: var(--green); text-underline-offset: 4px; text-decoration-color: #bcccbc; }
.switch-mode a:hover { text-decoration-color: currentColor; }
.footer-note { margin: 24px 0 0; color: #969c92; text-align: center; font-size: 11px; letter-spacing: .5px; }
.message { margin: -4px 0 22px; padding: 12px 14px; border: 1px solid; border-radius: 9px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.message-error { color: #98463d; background: #fdf5f3; border-color: #f1ded8; }
.message-notice { color: #47613f; background: #f2f7ee; border-color: #dee9d7; }
.empty-state { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 0; }
.compact-form { gap: 0; }
.account-detail { display: flex; justify-content: space-between; gap: 20px; margin: 0 0 28px; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; }
.account-detail span { color: var(--muted); flex-shrink: 0; }
.account-detail strong { font-weight: 550; overflow-wrap: anywhere; text-align: right; }
.invite-section { margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--line); }
.invite-section h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.2px; }
.invite-description { margin: 9px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.invite-form .button-secondary { margin-top: 0; }
.invite-result { margin-top: 16px; padding: 16px; background: #f6f8f3; border: 1px solid #e3e9dd; border-radius: 10px; }
.invite-code-row { display: flex; align-items: center; gap: 8px; }
.invite-code-row input { min-width: 0; height: 44px; padding: 0 10px; background: #fff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 14px; }
.button-copy { flex-shrink: 0; width: auto; min-height: 44px; padding: 10px; color: var(--green); background: #e7eee1; font-size: 12px; white-space: nowrap; }
.button-copy:hover { background: #dfe8d8; }
.invite-expiry, .invite-save-note { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.invite-save-note { margin-top: 5px; }
.copy-status { margin: 8px 0 0; color: var(--green); font-size: 11px; line-height: 1.65; }
.copy-status:empty { margin: 0; }
.register-link { display: inline-block; margin-top: 14px; color: var(--green); font-size: 12px; text-decoration-color: #bcccbc; text-underline-offset: 4px; }
.register-link:hover { text-decoration-color: currentColor; }
.logout-form { margin-top: 22px; text-align: center; }
.text-button { padding: 5px 10px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; text-decoration: underline; text-decoration-color: #c8cec3; text-underline-offset: 4px; }
.text-button:hover { color: #343c31; }
:focus-visible { outline: 2px solid #7f9a7c; outline-offset: 4px; }
[hidden] { display: none !important; }
@media (max-width: 480px) {
  .page { padding: 40px 20px 28px; }
  .brand { margin-bottom: 24px; }
  .card { padding: 30px 25px; border-radius: 18px; }
  h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
