:root {
--bg: #F4F1EA;
--card: #FFFFFF;
--ink: #262420;
--ink-soft: #6B6660;
--line: #E4DFD3;
--az: #2B6CB0;
--az-bg: #E3EDF9;
--lexi: #B9483A;
--lexi-bg: #FAEAE6;
--accent: #3B7A57;
--accent-bg: #E7F1EA;
--warn: #B7791F;
--warn-bg: #FBF0DD;
--radius: 16px;
}
* { box-sizing: border-box; }
html, body {
margin: 0; padding: 0;
background: var(--bg);
color: var(--ink);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.device {
max-width: 1100px;
margin: 0 auto;
padding: 28px 32px 60px;
}

/* ---------- PIN SCREEN ---------- */
#pinScreen {
min-height: 640px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
gap: 18px;
}
#pinScreen .clock { font-size: 64px; font-weight: 600; letter-spacing: 1px; }
#pinScreen .date { font-size: 20px; color: var(--ink-soft); margin-bottom: 12px; }
.pin-welcome {
font-size: 20px;
font-weight: 600;
color: var(--accent);
margin: -4px 0 4px;
}
.pin-dots { display: flex; gap: 14px; margin: 8px 0 20px; }
.pin-dot {
width: 16px; height: 16px; border-radius: 50%;
border: 2px solid var(--line); background: transparent;
transition: background 0.15s, border-color 0.15s;
}
.pin-dot.filled { background: var(--ink); border-color: var(--ink); }
.pin-dots.shake {
animation: pin-shake 0.45s ease;
}
.pin-dots.shake .pin-dot.filled {
background: var(--lexi);
border-color: var(--lexi);
}
@keyframes pin-shake {
0%, 100% { transform: translateX(0); }
15% { transform: translateX(-10px); }
30% { transform: translateX(9px); }
45% { transform: translateX(-7px); }
60% { transform: translateX(5px); }
75% { transform: translateX(-3px); }
90% { transform: translateX(2px); }
}
.pin-error {
font-size: 13px;
color: var(--lexi);
margin-top: -12px;
}
.pin-pad {
display: grid;
grid-template-columns: repeat(3, 72px);
gap: 14px;
}
.pin-key {
width: 72px; height: 72px;
border-radius: 50%;
border: 1px solid var(--line);
background: var(--card);
font-size: 24px;
color: var(--ink);
cursor: pointer;
}
.pin-key:active { background: var(--line); }
.pin-forgot { margin-top: 18px; font-size: 14px; color: var(--ink-soft); text-decoration: underline; cursor: pointer; background:none; border:none; }

/* ---------- SHELL ---------- */
#shell { display: none; }
header.topbar {
display: flex;
align-items: baseline;
justify-content: space-between;
margin-bottom: 22px;
}
.brand { font-size: 22px; font-weight: 600; }
.brand span { color: var(--ink-soft); font-weight: 400; }
nav.tabs {
display: flex;
gap: 6px;
background: var(--card);
border: 1px solid var(--line);
border-radius: 999px;
padding: 4px;
}
nav.tabs button {
border: none; background: transparent; cursor: pointer;
padding: 10px 22px; font-size: 15px; border-radius: 999px; color: var(--ink-soft);
font-family: inherit;
}
nav.tabs button.active { background: var(--ink); color: #fff; }
.lock-btn { font-size: 13px; color: var(--ink-soft); background:none; border:1px solid var(--line); border-radius:20px; padding:8px 16px; cursor:pointer; }
.topbar-right { display:flex; align-items:center; gap:14px; }

section.view { display: none; }
section.view.active { display: block; }

/* ---------- TODAY / BRIEFING ---------- */
.briefing-head { margin-bottom: 22px; }
.briefing-head .big-date { font-size: 34px; font-weight: 600; margin: 0 0 4px; }
.daily-text { font-size: 15px; font-style: italic; color: var(--ink-soft); margin: 0 0 10px; line-height: 1.5; }
.daily-text[hidden] { display: none; }
.daily-text a { color: var(--ink-soft); text-decoration: underline; font-style: italic; }
.briefing-head .sub { font-size: 16px; color: var(--ink-soft); margin: 0; }

.heads-up {
display: flex; align-items: center; gap: 12px;
background: var(--warn-bg); border: 1px solid #EEDCB4;
color: #6B4E14;
padding: 14px 18px; border-radius: var(--radius);
font-size: 15px; margin-bottom: 22px;
}
.heads-up[hidden] { display: none; }
.heads-up .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex-shrink:0; }

.brief-card { margin-bottom: 22px; }
.brief-text { font-size: 15px; line-height: 1.55; color: var(--ink); white-space: pre-wrap; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 22px; }
.card {
background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
padding: 20px 22px;
}
.card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; display:flex; align-items:center; gap:8px; }
.who-dot { width: 10px; height: 10px; border-radius: 50%; }
.who-dot.az { background: var(--az); }
.who-dot.lexi { background: var(--lexi); }

.event-row { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.event-row:first-of-type { border-top: none; }
.event-time { width: 76px; flex-shrink: 0; font-size: 13px; color: var(--ink-soft); padding-top:1px; }
.event-title { font-size: 15px; }
.event-title .loc { color: var(--ink-soft); font-size: 13px; }
.empty-note { font-size: 14px; color: var(--ink-soft); padding: 6px 0; }

.today-chores-divider {
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.04em;
color: var(--ink-soft);
margin: 16px 0 2px;
padding-top: 12px;
border-top: 1px solid var(--line);
}
.chore-row { display:flex; align-items:center; gap:12px; padding:9px 0; border-top:1px solid var(--line); }
.chore-row:first-of-type { border-top:none; }
.chk { width: 20px; height:20px; border-radius:6px; border:2px solid var(--line); flex-shrink:0; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:13px; color:#fff; }
.chk.done { background: var(--accent); border-color: var(--accent); }
.chore-name { font-size: 15px; }
.chore-name.done { text-decoration: line-through; color: var(--ink-soft); }
.who-chip { font-size: 11px; padding: 3px 9px; border-radius: 999px; margin-left:auto; flex-shrink:0; }
.who-chip.az { background: var(--az-bg); color: var(--az); }
.who-chip.lexi { background: var(--lexi-bg); color: var(--lexi); }
.spiritual-chip {
font-size: 11px;
padding: 3px 9px;
border-radius: 999px;
background: var(--accent-bg);
color: var(--accent);
font-weight: 600;
white-space: nowrap;
}

.mini-cal-card { margin-top: 0; }
.mini-cal-head { display:flex; align-items:center; justify-content:space-between; margin-bottom: 14px; }
.mini-cal-head h3 { margin:0; font-size:15px; font-weight:600; }
.calendar-embed.mini { padding: 6px; }
.calendar-embed.mini iframe { border-radius: 8px; }

/* ---------- CALENDAR ---------- */
.cal-toolbar { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.cal-toolbar .week-label { font-size: 20px; font-weight: 600; }
.btn { border:1px solid var(--line); background:var(--card); border-radius:10px; padding:9px 16px; font-size:14px; cursor:pointer; color: var(--ink); font-family: inherit; }
.btn.primary { background: var(--ink); color:#fff; border-color: var(--ink); }
.legend { display:flex; gap:16px; font-size:13px; color: var(--ink-soft); margin-bottom:14px; }
.legend span { display:flex; align-items:center; gap:6px; }
.btn { text-decoration: none; display: inline-block; color: var(--ink); }
.calendar-embed { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; overflow: hidden; }
.calendar-embed iframe { display: block; border-radius: 10px; }

.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.day-col { background: var(--card); border:1px solid var(--line); border-radius: 14px; padding: 12px 10px; min-height: 260px; }
.day-col.today { border: 2px solid var(--ink); }
.day-col .d-label { font-size: 12px; color: var(--ink-soft); text-align:center; margin-bottom:2px; }
.day-col .d-num { font-size: 18px; font-weight:600; text-align:center; margin-bottom:10px; }
.evt-block { border-radius: 8px; padding: 6px 8px; font-size: 12px; margin-bottom: 6px; line-height:1.3; }
.evt-block.az { background: var(--az-bg); color: var(--az); }
.evt-block.lexi { background: var(--lexi-bg); color: var(--lexi); }
.evt-block .t { display:block; font-size:10.5px; opacity:0.8; }
.evt-block .s-dot { display:inline-block; width:6px; height:6px; border-radius:50%; background: var(--accent); margin-right:4px; vertical-align:middle; }
.evt-block .w-dot, .m-evt .w-dot { display:inline-block; width:6px; height:6px; border-radius:50%; background: var(--warn); margin-right:4px; vertical-align:middle; }
.work-chip {
font-size: 11px;
padding: 3px 9px;
border-radius: 999px;
background: var(--warn-bg);
color: #6B4E14;
font-weight: 600;
white-space: nowrap;
}

/* Month grid (Calendar tab) -- up to 6 rows x 7 cols, more compact per-day
   cells than the week view since it needs to fit far more days on screen. */
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.month-grid .m-weekday { font-size: 12px; font-weight: 600; color: var(--ink-soft); text-align:center; padding-bottom: 4px; }
.month-day { background: var(--card); border:1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 108px; }
.month-day.today { border: 2px solid var(--ink); }
.month-day.out-of-month { background: transparent; border-color: transparent; }
.month-day.out-of-month .m-num { color: var(--ink-soft); opacity: 0.4; }
.month-day .m-num { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.month-day .m-evt { border-radius: 6px; padding: 2px 6px; font-size: 11px; margin-bottom: 3px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-day .m-evt.az { background: var(--az-bg); color: var(--az); }
.month-day .m-evt.lexi { background: var(--lexi-bg); color: var(--lexi); }
.month-day .m-more { font-size: 11px; color: var(--ink-soft); }

/* ---------- ADD EVENT MODAL ---------- */
.modal-overlay {
position: fixed; inset: 0; background: rgba(38, 36, 32, 0.45);
display: flex; align-items: center; justify-content: center;
z-index: 50; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
background: var(--card); border-radius: var(--radius);
padding: 24px; width: 100%; max-width: 420px;
max-height: 90vh; overflow-y: auto;
}
.modal h3 { margin: 0 0 16px; font-size: 18px; }
.modal form { display: flex; flex-direction: column; gap: 14px; }
.modal label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.modal input[type="text"], .modal input[type="date"], .modal input[type="time"], .modal select {
border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px;
font-size: 14px; font-family: inherit; color: var(--ink); background: var(--card);
}
.modal-row { display: flex; gap: 14px; align-items: flex-end; }
.modal-row label { flex: 1; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px !important; font-size: 14px; color: var(--ink); }
.modal-note { font-size: 12px; color: #6B4E14; background: var(--warn-bg); border-radius: 8px; padding: 8px 10px; line-height: 1.4; }
.modal-note[hidden] { display: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ---------- EVENT DETAIL ---------- */
.evt-block, .m-evt, .event-row { cursor: pointer; }
.evt-block:hover, .m-evt:hover { filter: brightness(0.97); }
.ed-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.ed-head h3 { margin: 0; }
.ed-rows { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.ed-row { display: flex; flex-direction: column; gap: 3px; }
.ed-label { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.ed-value { font-size: 15px; color: var(--ink); }

/* Completed jobs (trailing check mark in the title) read as done: grayed. */
.evt-block.completed, .m-evt.completed, .event-row.completed { opacity: 0.5; }

/* Multi-day events: one event spanning days. Square the joined edges so the
   day segments read as a single continuous bar rather than separate copies. */
.m-evt.mday-start, .evt-block.mday-start { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.m-evt.mday-end, .evt-block.mday-end { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.m-evt.mday-mid, .evt-block.mday-mid { border-radius: 0; }

/* Editable fields in the event detail popup. */
.ed-edit { display: flex; gap: 14px; margin-bottom: 16px; }
.ed-edit label { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.ed-edit select { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font-size: 14px; font-family: inherit; color: var(--ink); background: var(--card); }
.ed-saved { font-size: 13px; color: var(--accent); margin-bottom: 10px; }
.ed-saved[hidden] { display: none; }

/* ---------- CHORES ---------- */
.chores-toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.chores-toolbar .filters { display:flex; gap:8px; }
.filter-chip { border:1px solid var(--line); background:var(--card); border-radius:999px; padding:8px 16px; font-size:13px; cursor:pointer; color: var(--ink-soft); }
.filter-chip.active { background: var(--ink); color:#fff; border-color: var(--ink); }
.chore-list-card { background: var(--card); border:1px solid var(--line); border-radius: var(--radius); }
.chore-list-card .row { display:flex; align-items:center; gap:14px; padding:16px 20px; border-top:1px solid var(--line); }
.chore-list-card .row:first-child { border-top:none; }
.chore-meta { font-size: 12px; color: var(--ink-soft); }
.recur-tag { font-size: 11px; background: var(--accent-bg); color: var(--accent); padding:3px 9px; border-radius:999px; }
.recur-tag.one-off { background: var(--warn-bg); color: #6B4E14; }

footer.hint { text-align:center; font-size:12px; color: var(--ink-soft); margin-top:28px; }

@media (max-width: 720px) {
.grid-2 { grid-template-columns: 1fr; }
.week-grid { grid-template-columns: repeat(7, minmax(90px, 1fr)); overflow-x: auto; }
.month-grid { grid-template-columns: repeat(7, minmax(70px, 1fr)); overflow-x: auto; }
}
