/* Promesa maintenance: light, one column, phone first (the build instructions' LOOK) */
:root {
  --page: #f5f7fa; --card: #ffffff; --fill: #eaf0f8; --text: #1c2430; --muted: #5d6a7a; --line: #e1e6ee;
  --blue: #2f86c9; --navy: #0e2e52; --danger: #b3261e; --on-navy: #ffffff;
  --shadow: 0 6px 24px rgba(14, 46, 82, 0.10), 0 1px 3px rgba(14, 46, 82, 0.08);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--text); font: 16px/1.4 var(--sans); -webkit-text-size-adjust: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app { max-width: 32rem; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 16px 0; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 14px; }
.who { min-width: 0; }
.eyebrow { margin: 0 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--blue); }
h1 { margin: 0; font: 600 28px/1.15 var(--serif); color: var(--navy); overflow-wrap: anywhere; }

/* the crew: up to three overlapping navy circles, then +N */
.crew-dots { display: flex; align-items: center; padding: 4px; border: 0; background: none; flex: 0 0 auto; }
.dot { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: var(--on-navy); display: inline-flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 600; letter-spacing: .02em; border: 2px solid var(--page); box-shadow: var(--shadow); }
.crew-dots .dot + .dot { margin-left: -10px; }
.dot.more { background: var(--fill); color: var(--navy); }

/* Maintenance | Chat */
.switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--fill); margin-bottom: 14px; }
.switch button { border: 0; background: none; border-radius: 999px; min-height: 38px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.switch button[aria-selected="true"] { background: var(--navy); color: var(--on-navy); box-shadow: var(--shadow); }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--navy); color: var(--on-navy); font-size: 12px; line-height: 20px; text-align: center; }
.switch button[aria-selected="true"] .count { background: var(--on-navy); color: var(--navy); }

#main, #maint, #chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* the properties, sideways */
.bubbles { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -16px 4px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.bubbles::-webkit-scrollbar { display: none; }
.bubble { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); border-radius: 999px; min-height: 36px; padding: 0 14px; font-size: 14px; font-weight: 600;
  color: var(--navy); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.bubble b { font-weight: 600; color: var(--muted); }
.bubble[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.bubble[aria-pressed="true"] b { color: rgba(255,255,255,.75); }
.bubble.edit { color: var(--blue); border-style: dashed; }

/* the jobs */
.list { flex: 1; padding-bottom: 92px; }
.group { margin: 0 0 14px; }
.group h2 { margin: 0 0 6px 4px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rows { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.job { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 6px; min-height: 52px; border-top: 1px solid var(--line); }
.job:first-child { border-top: 0; }
.tick { flex: 0 0 auto; width: 40px; height: 40px; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.tick i, .ring { display: block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--blue); }
.job.done .tick i { background: var(--blue); box-shadow: inset 0 0 0 3px var(--card); }
.jt { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 12px 0; font-size: 16px; color: var(--text); overflow-wrap: anywhere; }
.job.done .jt { text-decoration: line-through; color: var(--muted); }
.who-btn { flex: 0 0 auto; border: 0; background: none; color: var(--blue); font-size: 14px; font-weight: 600; padding: 8px 2px; }
.who-btn:disabled { cursor: default; }
.empty { margin: 18px 4px; color: var(--muted); }

/* the field pinned at the foot, clear of the iPhone's home indicator */
.bar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; margin: 0 -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--page) 78%, rgba(245,247,250,0)); }
.bar .ring { flex: 0 0 auto; margin-left: 15px; border-color: var(--line); }
.bar input { flex: 1; min-width: 0; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); outline: none; }
.bar input:focus { border-color: var(--blue); }

/* the chat */
.thread { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 4px 0 84px; overflow-y: auto; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 16px; font-size: 15.5px; line-height: 1.38; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.mine { align-self: flex-end; background: var(--navy); color: var(--on-navy); border-bottom-right-radius: 5px; }
.msg.theirs { align-self: flex-start; background: var(--card); box-shadow: var(--shadow); border-bottom-left-radius: 5px; }
.msg.grok { background: #e3f1fb; border: 1px solid #c4e0f5; box-shadow: none; }
.msg.grok .nm { color: var(--blue); }
.msg .nm { display: block; font-size: 12.5px; font-weight: 700; color: var(--navy); margin-bottom: 2px; }
.send { flex: 0 0 auto; min-height: 46px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--navy); color: var(--on-navy); font-weight: 600; }
.send:disabled { opacity: .4; cursor: default; }

/* sign-in */
.signin { display: grid; gap: 12px; margin-top: 18px; }
.lede { margin: 0 0 4px; color: var(--muted); }
.refused { margin: 0; padding: 12px 14px; border-radius: 12px; background: #fdecea; color: var(--danger); font-weight: 600; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border-radius: 12px; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.btn.navy { background: var(--navy); color: var(--on-navy); }
.btn.ghost { background: var(--card); color: var(--navy); border-color: var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }
.link { border: 0; background: none; color: var(--blue); font-weight: 600; padding: 6px 0; }
.link.danger { color: var(--danger); }

/* the white card over the page (crew, invite, grok, edit properties, pickers) */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(14, 46, 82, 0.28); display: flex; align-items: flex-end; justify-content: center; }
.card { width: 100%; max-width: 32rem; max-height: 88vh; max-height: 88dvh; overflow-y: auto; background: var(--card); border-radius: 18px 18px 0 0; box-shadow: var(--shadow);
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); }
.card h3 { margin: 6px 0 12px; font: 600 22px/1.2 var(--serif); color: var(--navy); }
.card .row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.card .row:first-of-type { border-top: 0; }
.card .row .grow { flex: 1; min-width: 0; }
.card .line { font-size: 13px; color: var(--muted); }
.card .name { font-weight: 600; }
.card label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.card input[type=text], .card input[type=email] { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none; }
.card input:focus { border-color: var(--blue); }
.card .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 10px 44px; }
.chip { border: 1px solid var(--navy); background: #fff; color: var(--navy); border-radius: 999px; min-height: 32px; padding: 0 12px; font-size: 13.5px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--navy); color: var(--on-navy); }
.opt { display: block; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); background: none; min-height: 48px; padding: 0 4px; font-size: 16px; }
.opt:first-of-type { border-top: 0; }
.opt[aria-current="true"] { color: var(--blue); font-weight: 600; }
.secret { display: block; padding: 10px 12px; border-radius: 10px; background: var(--fill); font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
.note { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.err { color: var(--danger); font-size: 14px; margin: 8px 0 0; }
/* on a computer (2026-10-22, Nathan: "A wider column on computers"): still one column, about 800 px, the cards with it;
   a phone or a tablet is as above */
@media (min-width: 900px) {
  .app, .card { max-width: 50rem; }
  .msg { max-width: 70%; }
}
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; max-width: calc(100% - 32px);
  padding: 10px 14px; border-radius: 12px; background: var(--navy); color: var(--on-navy); font-size: 14px; box-shadow: var(--shadow); }
