:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --card: #fff;
  --text: #202a35;
  --muted: #657383;
  --border: #d9e1e7;
  --primary: #2f6f9f;
  --primary-dark: #245b84;
  --primary-soft: #eaf3fa;
  --success: #26734d;
  --success-soft: #e8f6ee;
  --error: #a12d2d;
  --error-soft: #fdeaea;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; background: radial-gradient(circle at top left, #e7f1f8 0, transparent 38%), var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app-shell { width: min(100% - 28px, 1040px); margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom)); }
.brand-panel { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.brand-mark { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 17px; background: var(--primary); box-shadow: 0 10px 24px rgba(47, 111, 159, .22); color: #fff; font-size: 17px; font-weight: 850; letter-spacing: .04em; }
.eyebrow { margin: 0 0 5px; color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(27px, 5vw, 38px); }
h2 { margin-bottom: 7px; font-size: 24px; }
h3 { margin: 2px 0 0; font-size: 21px; }
.brand-copy, .card-head p, .home-header p, .privacy-copy { color: var(--muted); }
.brand-copy { margin: 0; }

.auth-card, .home-view { padding: clamp(22px, 5vw, 38px); border: 1px solid rgba(217, 225, 231, .9); border-radius: 20px; background: rgba(255, 255, 255, .94); box-shadow: 0 18px 55px rgba(28, 49, 67, .1); }
.auth-card { width: min(100%, 480px); margin: 6vh auto 0; }
.card-head { margin-bottom: 24px; }
.card-head p:last-child { margin-bottom: 0; line-height: 1.55; }
form { display: grid; gap: 9px; }
label { margin-top: 7px; color: #43515e; font-size: 13px; font-weight: 750; }
input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; outline: none; background: #fff; color: var(--text); }
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
select, textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; outline: none; background: #fff; color: var(--text); }
select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { resize: vertical; line-height: 1.45; }
.password-field { position: relative; }
.password-field input { padding-right: 88px; }
.password-field button { position: absolute; top: 5px; right: 5px; height: 38px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--primary); font-size: 12px; font-weight: 750; }
.primary-button, .secondary-button { min-height: 46px; border-radius: 10px; font-weight: 800; }
.primary-button { margin-top: 14px; border: 1px solid var(--primary); background: var(--primary); color: #fff; }
.primary-button:hover { background: var(--primary-dark); }
.primary-button:disabled, .secondary-button:disabled { cursor: wait; opacity: .6; }
.secondary-button { padding: 0 16px; border: 1px solid var(--border); background: #fff; color: var(--muted); }
.form-message { margin: 8px 0 0; padding: 11px 13px; border-radius: 8px; background: var(--error-soft); color: var(--error); font-size: 13px; }
.privacy-copy { margin: 18px 0 0; font-size: 11px; line-height: 1.5; text-align: center; }

.home-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.home-header p { margin-bottom: 0; }
.status-banner { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding: 14px 16px; border-radius: 11px; background: var(--success-soft); color: var(--success); }
.status-banner p { margin: 2px 0 0; font-size: 12px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); }
.assignments-section { margin-top: 26px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.section-head > span { color: var(--muted); font-size: 12px; }
.assignments-list { display: grid; gap: 10px; }
.assignment-card { display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #fafcfd; }
.assignment-card { cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.assignment-card:hover { border-color: #aac6da; box-shadow: 0 7px 20px rgba(38, 75, 102, .08); transform: translateY(-1px); }
.assignment-card:focus-visible { outline: 3px solid var(--primary-soft); border-color: var(--primary); }
.assignment-card time { display: grid; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: #fff; text-align: center; }
.assignment-card time span { padding: 4px 3px; background: var(--primary-soft); color: var(--primary-dark); font-size: 10px; font-weight: 850; }
.assignment-card time strong { padding: 4px; font-size: 22px; }
.assignment-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.duty-badge { display: inline-flex; align-items: center; justify-content: center; padding: 5px 9px; border-radius: 999px; background: #edf1f4; color: #4d5a65; font-size: 11px; font-weight: 850; }
.duty-badge.duty-19 { background: #e6f2fb; color: #23618f; }
.duty-badge.duty-20 { background: #eee9fb; color: #654da0; }
.duty-badge.duty-21 { background: #e6f5ed; color: #287050; }
.duty-badge.duty-22 { background: #fff1dc; color: #945e13; }
.duty-badge.duty-23 { background: #f8e8ef; color: #914561; }
.assignment-card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.assignment-timing { display: flex; flex-wrap: wrap; column-gap: 16px; margin-top: 5px; }
.assignment-timing p { display: flex; gap: 5px; }
.assignment-timing strong { color: #43515e; }
.assignment-start { margin-top: 7px !important; }
.assignment-start strong { color: var(--text); font-size: 13px; }
.empty-state { margin: 0; padding: 20px; border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); text-align: center; }
.empty-state.is-error { border-color: #efbbbb; background: var(--error-soft); color: var(--error); }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.feature-grid article { padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: #fafcfd; }
.feature-grid span { display: block; margin-bottom: 7px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.feature-grid p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.boot-message { margin-top: 20vh; color: var(--muted); text-align: center; }

.assignment-dialog { width: min(calc(100% - 28px), 620px); max-height: min(88vh, 780px); padding: 0; overflow: auto; border: 1px solid var(--border); border-radius: 18px; background: #fff; color: var(--text); box-shadow: 0 24px 70px rgba(23, 42, 57, .28); }
.assignment-dialog::backdrop { background: rgba(24, 38, 50, .48); backdrop-filter: blur(2px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 26px 20px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { margin-bottom: 5px; }
.dialog-head > div > p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.dialog-close { flex: 0 0 auto; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--muted); font-size: 25px; line-height: 1; }
.dialog-section { padding: 22px 26px; }
.dialog-section + .dialog-section { border-top: 1px solid var(--border); }
.dialog-section h3 { margin: 0 0 14px; font-size: 17px; }
.team-list { display: grid; gap: 8px; }
.team-member { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 13px; border-radius: 9px; background: #f5f8fa; }
.team-member .duty-badge { flex: 0 0 auto; }
.team-empty { margin: 0; color: var(--muted); font-size: 13px; }
.cancellation-section { background: #fffafa; }
.cancellation-section > p { margin: -4px 0 13px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.form-hint { margin: 0; color: var(--muted); font-size: 11px; }
.danger-button { min-height: 46px; margin-top: 10px; border: 1px solid #b73838; border-radius: 10px; background: #b73838; color: #fff; font-weight: 800; }
.danger-button:hover { background: #992d2d; }
.danger-button:disabled { cursor: wait; opacity: .6; }

@media (max-width: 600px) {
  .app-shell { width: min(100% - 20px, 1040px); }
  .brand-panel { align-items: flex-start; margin-bottom: 18px; }
  .brand-mark { width: 50px; height: 50px; border-radius: 14px; }
  .auth-card { margin-top: 3vh; border-radius: 16px; }
  .home-header { align-items: stretch; flex-direction: column; }
  .secondary-button { align-self: flex-start; }
  .assignment-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .feature-grid { grid-template-columns: 1fr; }
  .dialog-head, .dialog-section { padding-left: 19px; padding-right: 19px; }
}
