:root {
  /* KRODIA palette matches the main system krod_theme.css. */
  --brand-primary: #187344;
  --brand-hover: #145f3c;
  --brand-dark: #0d4f32;
  --brand-accent: #198754;
  --brand-soft: #edf8f1;
  --brand-bg: #f4f7f5;
  --brand-surface: #fff;
  --brand-text: #15251d;
  --brand-muted: #637169;
  --brand-border: #dce5e0;
  --brand-border-strong: #c6d5cd;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-synthesis: none;
  color: var(--brand-text);
  background: var(--brand-bg);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.page-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 36px 24px 22px;
  background: radial-gradient(ellipse at 50% 0%, var(--brand-soft) 0, var(--brand-bg) 65%);
}
.brand-header { display: flex; align-items: center; justify-content: center; gap: 11px; }
.brand-mark { width: 39px; height: 39px; border-radius: 11px; background: var(--brand-primary); color: #fff; display: grid; place-items: center; font-size: 25px; font-weight: 750; line-height: 1; }
.brand-name { display: block; font-size: 23px; line-height: 1.1; font-weight: 750; letter-spacing: .09em; }
.brand-caption { display: block; color: var(--brand-muted); font-size: 11px; margin-top: 4px; letter-spacing: .06em; }
.main-content { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 0; width: 100%; }
.auth-card { width: 100%; max-width: 448px; padding: 38px 36px 30px; border: 1px solid var(--brand-border); border-radius: 20px; background: #fff; box-shadow: 0 14px 46px rgba(7, 56, 33, .08); }
.eyebrow { margin: 0 0 10px; color: var(--brand-hover); font-size: 10px; line-height: 1.5; letter-spacing: .17em; font-weight: 750; }
h1 { font-size: 26px; margin: 0; line-height: 1.5; letter-spacing: .03em; font-weight: 700; }
.intro { margin: 11px 0 0; color: var(--brand-muted); font-size: 13px; line-height: 1.8; }
.login-form { margin-top: 30px; }
.field-group + .field-group { margin-top: 23px; }
label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
input[type="text"], input[type="password"] { width: 100%; min-width: 0; height: 48px; border: 1px solid var(--brand-border-strong); border-radius: 8px; background: #fff; color: var(--brand-text); padding: 10px 13px; font-size: 16px; line-height: 1.5; transition: border-color .15s; }
input:hover { border-color: #93ad9f; }
.field-hint { margin: 7px 0 0; color: var(--brand-muted); font-size: 11px; line-height: 1.6; }
.password-field { position: relative; }
.password-field:has(.reveal-button:not([hidden])) input { padding-right: 52px; }
.reveal-button { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; color: var(--brand-muted); border: 0; border-radius: 6px; background: transparent; touch-action: none; user-select: none; -webkit-user-select: none; }
.reveal-button:hover, .reveal-button[aria-pressed="true"] { color: var(--brand-primary); background: var(--brand-soft); }
.primary-button, .secondary-button { display: flex; align-items: center; justify-content: center; text-decoration: none; min-height: 46px; border-radius: 8px; padding: 11px 20px; font-size: 14px; line-height: 1.5; font-weight: 700; }
.primary-button { width: 100%; margin-top: 28px; color: #fff; background: var(--brand-primary); border: 1px solid var(--brand-primary); box-shadow: 0 3px 8px rgba(7, 56, 33, .10); }
.primary-button:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.primary-button:active { background: var(--brand-dark); }
.support-note { margin: 26px 0 0; padding-top: 21px; border-top: 1px solid var(--brand-border); color: var(--brand-muted); font-size: 11px; line-height: 1.8; text-align: center; }
.login-trouble-link { display: flex; justify-content: center; align-items: center; min-height: 44px; margin-top: 8px; color: var(--brand-hover); font-size: 12px; line-height: 1.6; }
.limited-body .main-content { align-items: flex-start; padding: 24px 0; }
.limited-card { overflow-wrap: anywhere; }
.limited-card h1 { font-size: 20px; }
.limited-message { margin: 16px 0 0; color: var(--brand-muted); font-size: 14px; line-height: 1.8; }
.limited-actions { display: grid; gap: 10px; margin-top: 22px; }
.limited-actions .primary-button { margin-top: 0; }
.limited-emergency-title { margin: 24px 0 9px; color: var(--brand-muted); font-size: 12px; }
.limited-emergency { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.limited-emergency a { display: flex; flex-direction: column; justify-content: center; align-items: center; min-width: 0; min-height: 52px; padding: 7px 4px; border: 1px solid #c65d65; border-radius: 8px; color: #962b34; text-decoration: none; }
.limited-emergency strong { font-size: 17px; line-height: 1.3; }
.limited-emergency span { font-size: 10px; line-height: 1.6; }
.page-footer { color: var(--brand-muted); font-size: 11px; text-align: center; }
.app-install { width: 100%; max-width: 448px; margin: 0 auto 5px; font-size: 12px; text-align: left; }
.app-install summary { display: list-item; width: fit-content; min-height: 44px; margin: 0 auto; padding: 12px 4px; color: var(--brand-hover); line-height: 20px; cursor: pointer; }
.app-install summary:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; border-radius: 4px; }
.app-install-content { padding: 0 10px 12px; overflow-wrap: anywhere; }
.app-install-content p { margin: 9px 0 0; font-size: 12px; line-height: 1.75; }
.app-install-content strong { font-weight: 650; }
.app-install-button { width: 100%; min-height: 44px; margin: 0 0 12px; padding: 10px 16px; border: 1px solid var(--brand-border-strong); border-radius: 8px; color: var(--brand-hover); background: #fff; font-size: 14px; font-weight: 700; }
.app-install-button:disabled { opacity: .6; cursor: default; }
.form-message { margin-top: 23px; padding: 12px 14px; border: 1px solid #efb8bf; border-radius: 8px; background: #fff1f2; color: #9d2533; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.form-message:not([hidden]) + .login-form { margin-top: 24px; }
.welcome-card { text-align: center; padding-top: 40px; padding-bottom: 38px; }
.welcome-symbol { display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-hover); }
.welcome-title { font-size: 22px; }
.employee-name { display: block; margin-top: 5px; font-size: 27px; overflow-wrap: anywhere; }
.welcome-card .intro { margin-top: 18px; }
.today-message time { display: block; color: var(--brand-text); font-weight: 650; }
.today-message time span { margin-left: .4em; white-space: nowrap; }
.welcome-actions { display: grid; gap: 12px; margin-top: 28px; }
.welcome-actions .primary-button { margin-top: 0; }
.trouble-card { text-align: center; }
.trouble-card .secondary-button { margin-top: 28px; }
.logout-form { margin-top: 32px; }
.secondary-button { width: 100%; color: var(--brand-hover); border: 1px solid var(--brand-border-strong); background: #fff; }
.secondary-button:hover { background: var(--brand-bg); }

/* Keep the staff home compact without changing login or dispatch screens. */
.welcome-body .page-shell { padding: 18px 16px 16px; }
.welcome-body .main-content { align-items: flex-start; padding: 20px 0; }
.welcome-body .welcome-card { padding: 24px 20px 20px; }
.welcome-body .welcome-title { font-size: 19px; }
.welcome-body .employee-name { margin-top: 2px; font-size: 23px; }
.welcome-body .today-message { margin-top: 12px; }
.welcome-body .today-message time { display: inline; }
.welcome-today { margin-top: 18px; padding: 16px 0; border-top: 1px solid var(--brand-border); border-bottom: 1px solid var(--brand-border); text-align: left; overflow-wrap: anywhere; }
.welcome-today h2 { margin: 0 0 10px; color: var(--brand-dark); font-size: 15px; line-height: 1.6; }
.welcome-assignment p, .welcome-today-message { margin: 3px 0 0; font-size: 14px; line-height: 1.75; }
.welcome-assignment .welcome-business { margin-top: 0; font-weight: 700; }
.welcome-assignment + .welcome-assignment { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--brand-border); }
.welcome-body .welcome-actions { gap: 10px; margin-top: 18px; }
.welcome-body .logout-form { margin-top: 18px; }

@media (max-width: 480px) {
  .page-shell { padding: 28px 18px 20px; }
  .main-content { padding: 30px 0; }
  .auth-card { padding: 30px 24px 25px; border-radius: 16px; }
  h1 { font-size: 24px; }
  .welcome-card { padding-top: 34px; padding-bottom: 30px; }
  .employee-name { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  input[type="text"], input[type="password"] { transition: none; }
}
