:root {
  --navy: #1b3a5c; --accent: #1b3a5c; --bg: #f5f7fa; --surface: #fff; --line: #d6dde6; --text: #14202e; --muted: #5b6878;
  --err: #b91c1c; --ok-bg: #dcfce7; --ok-text: #166534; --sel-bg: #1b3a5c; --sel-text: #fff;
  --early: #dbeafe; --early-text: #1e40af; --eday: #fef08a; --eday-text: #854d0e;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.wrap { max-width: 680px; margin: 0 auto; padding: 1rem 1rem 6rem; }
h1 { margin: 0.25rem 0 0.4rem; font-size: 26px; color: var(--navy); }
h2 { margin: 1.4rem 0 0.5rem; font-size: 20px; color: var(--navy); }
h3 { margin: 0; font-size: 17px; }
.lead { margin: 0 0 1rem; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; margin-bottom: 0.9rem; }
.muted { color: var(--muted); }
.err { color: var(--err); font-weight: 600; }
.small { font-size: 14px; }
label { display: block; font-weight: 600; margin: 0.75rem 0 0.25rem; }
label .opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=search] { width: 100%; font: inherit; padding: 0.65rem 0.7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
input:focus, button:focus-visible, a:focus-visible { outline: 3px solid #93c5fd; outline-offset: 1px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.row3 { display: grid; grid-template-columns: 2fr 1fr; gap: 0.6rem; }
button { font: inherit; cursor: pointer; }
.btn { display: inline-block; border: 0; border-radius: 8px; padding: 0.8rem 1.3rem; font-weight: 700; font-size: 17px; background: var(--navy); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn.block { width: 100%; }
.who { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.link { background: none; border: 0; color: var(--navy); text-decoration: underline; padding: 0; font-size: 15px; }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-weight: 700; color: var(--muted); font-size: 14px; }
.cal .cell { min-height: 58px; border: 3px solid transparent; border-radius: 8px; text-align: center; padding: 2px 0; background: transparent; color: var(--muted); }
.cal .cell .mon { display: block; font-size: 12px; font-weight: 700; min-height: 14px; line-height: 14px; }
.cal .cell .num { font-size: 20px; font-weight: 800; line-height: 1.1; }
.cal .cell.past { opacity: 0.4; background: #e8ecf1; cursor: not-allowed; }
.cal .cell.today { border-color: var(--line); }
.cal button.cell.early { background: var(--early); color: var(--early-text); }
.cal button.cell.eday { background: var(--eday); color: var(--eday-text); }
.cal button.cell.eday.upcoming { border: 3px dashed var(--eday-text); }
.cal button.cell.sel { border: 3px solid var(--navy); }
.legend { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.8rem; padding-top: 0.7rem; border-top: 1px solid var(--line); align-items: center; }
.pill { padding: 0.15rem 0.65rem; border-radius: 999px; font-size: 14px; font-weight: 700; }
.pill.early { background: var(--early); color: var(--early-text); }
.pill.eday { background: var(--eday); color: var(--eday-text); }

.dayhead { background: var(--navy); color: #fff; border-radius: 10px; padding: 0.8rem 1rem; margin: 1.2rem 0 0.8rem; }
.dayhead .d { font-size: 26px; font-weight: 800; line-height: 1.15; }
.dayhead .k { opacity: 0.9; }
.loc h3 { margin-bottom: 2px; }
.loc .addr { color: var(--muted); font-size: 15px; margin-bottom: 0.6rem; }
.loc .addr a { color: var(--navy); }
.shifts { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 8px; }
.shift { border: 2px solid var(--navy); background: #fff; color: var(--navy); border-radius: 8px; padding: 0.6rem 0.4rem; font-weight: 700; font-size: 15px; }
.shift.on { background: var(--sel-bg); color: var(--sel-text); }
.shift.full { border-color: var(--line); color: var(--muted); background: #eef1f5; cursor: not-allowed; font-weight: 600; }
.notice { background: #fef3c7; color: #78350f; border-radius: 8px; padding: 0.55rem 0.8rem; margin: 0.6rem 0; font-weight: 600; }

.bar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom, 0px)); display: flex; gap: 0.8rem; align-items: center; justify-content: space-between; z-index: 20; }
.bar .count { font-weight: 700; }
.mine { padding: 0.55rem 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 0.6rem; align-items: center; }
.mine:first-of-type { border-top: 0; }
.done { background: var(--ok-bg); color: var(--ok-text); border-radius: 10px; padding: 1rem; }
.done h2 { color: var(--ok-text); margin-top: 0; }
.foot { margin-top: 2rem; font-size: 13px; color: var(--muted); }

.lookup p { margin: 0.4rem 0 0; }
.mine-precinct { border-color: var(--navy); background: #eef4fb; }
.mine-precinct .k { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.mine-precinct .big { font-size: 24px; font-weight: 800; color: var(--navy); }
.loc.yours { border: 2px solid var(--navy); background: #eef4fb; }
.badge { display: inline-block; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; padding: 0.1rem 0.6rem; border-radius: 999px; margin-bottom: 0.4rem; }

.loc-search { margin: 0 0 0.9rem; }
