/* Look from the plan mockups: white cards on notebook grey, school-pen blue, red notebook margin on the right. */
:root {
  --ink: #1d2433; --mut: #5f6b7d; --line: #e2e5ee; --bg: #f4f6fb; --card: #fff;
  --pen: #2c4bb0; --pen-soft: #e8edfc; --ok: #1d7550; --ok-soft: #e4f3eb;
  --warn: #a4470a; --warn-soft: #fcefe3; --margin: #f0b6bc;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.5 "Assistant", "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.proto { background: #fff7d6; color: #6b5300; font-size: 13px; padding: 6px 14px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2px 8px; }
.proto button { background: none; border: 0; color: inherit; text-decoration: underline; font-size: 13px; padding: 0; }

.top { position: sticky; top: 0; z-index: 5; background: var(--card); padding: 12px 16px 10px; border-bottom: 1px solid var(--line); }
.who { font-size: 13px; color: var(--mut); }
.ttl { font-weight: 700; font-size: 19px; line-height: 1.3; }
.bar { display: flex; gap: 3px; margin-top: 10px; padding: 6px 0; background: none; border: 0; width: 100%; }
.bar i { flex: 1; height: 8px; border-radius: 4px; background: var(--line); position: relative; overflow: hidden; }
.bar i b { position: absolute; inset: 0 0 0 auto; background: var(--pen); }
.bar i.cur { outline: 2px solid var(--pen); outline-offset: 1px; }
.meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--mut); margin-top: 2px; }
.saved { color: var(--ok); font-weight: 600; white-space: nowrap; }

.body { padding: 14px; display: grid; gap: 12px; flex: 1; align-content: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.q { font-weight: 600; margin-bottom: 8px; }
.q small, .sub { font-weight: 400; color: var(--mut); }
.hint { font-size: 13px; color: var(--mut); }
.note-card { position: relative; padding-right: 32px; }
.note-card::after { content: ""; position: absolute; top: 0; bottom: 0; right: 18px; width: 1px; background: var(--margin); }

textarea, input[type=text], input[type=tel] {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff;
  font-size: 16px; /* 16px stops iPhone zooming in */
}
textarea { min-height: 76px; resize: vertical; display: block; }
textarea.short { min-height: 44px; }
textarea:focus, input:focus { outline: none; border-color: var(--pen); box-shadow: 0 0 0 2px var(--pen-soft); }
::placeholder { color: #8e98aa; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips + .chips { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.chip { border: 1px solid #cfd5e3; border-radius: 999px; padding: 7px 14px; background: #fff; font-size: 15px; text-align: right; line-height: 1.3; }
.chip.on { background: var(--pen); border-color: var(--pen); color: #fff; }
.add { background: none; border: 0; padding: 4px 0; margin-top: 8px; font-size: 14px; color: var(--pen); font-weight: 600; }
.notebox { margin-top: 10px; }

.asp { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.q + .asp, .sub + .asp { border-top: 0; }
.two { display: flex; gap: 5px; flex: none; }
.two button { border: 1px solid #cfd5e3; border-radius: 8px; padding: 6px 12px; font-size: 14px; background: #fff; }
.two button.ok { background: var(--ok-soft); border-color: #a9d8bf; color: var(--ok); font-weight: 700; }
.two button.no { background: var(--warn-soft); border-color: #f1c39c; color: var(--warn); font-weight: 700; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lbl { font-size: 13px; color: var(--mut); margin-bottom: 3px; display: block; }
.more { margin-top: 12px; display: grid; gap: 12px; }

/* Conners 3: one row per screen */
.c3q { font-size: 20px; font-weight: 700; line-height: 1.35; margin: 6px 0 14px; }
.c3opts { display: grid; gap: 8px; }
.c3opts button { display: flex; align-items: center; gap: 12px; text-align: right; border: 1px solid #cfd5e3; border-radius: 12px; padding: 12px 14px; background: #fff; font-size: 16px; font-weight: 600; }
.c3opts button b { font-size: 22px; width: 22px; text-align: center; color: var(--pen); }
.c3opts button small { display: block; font-weight: 400; font-size: 13px; color: var(--mut); }
.c3opts button.on { background: var(--pen); border-color: var(--pen); color: #fff; }
.c3opts button.on b, .c3opts button.on small { color: #fff; }
.dots { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.dots button { border: 1px solid #cfd5e3; border-radius: 8px; padding: 7px 0; background: #fff; font-size: 14px; font-variant-numeric: tabular-nums; }
.dots button.on { background: var(--pen-soft); border-color: #b9c6f3; color: var(--pen); font-weight: 700; }
.c3nav { display: flex; justify-content: space-between; margin-top: 8px; }
.c3nav .add { margin-top: 0; }
/* .fit: the row screen is exactly one phone screen; heights and fonts follow the screen height (vh) */
.app.fit { height: 100vh; height: 100dvh; min-height: 0; }
.app.fit .body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 1.2vh; padding: 1.6vh 14px; }
.app.fit .c3card { flex: 1; display: flex; flex-direction: column; padding: 1.8vh 14px 1vh; }
.app.fit .c3q { font-size: clamp(16px, 2.7vh, 24px); margin: 0.8vh 0 1.6vh; }
.app.fit .c3opts { flex: 1; grid-template-rows: repeat(4, 1fr); gap: 1.1vh; }
.app.fit .c3opts button { padding: 0.6vh 14px; font-size: clamp(15px, 2.2vh, 19px); line-height: 1.3; }
.app.fit .c3opts button b { font-size: clamp(19px, 3vh, 26px); }
.app.fit .c3opts button small { font-size: clamp(12px, 1.7vh, 15px); }
.app.fit .c3nav { margin-top: 0.8vh; }
.app.fit .foot { padding-top: 1.2vh; padding-bottom: calc(1.2vh + env(safe-area-inset-bottom)); }
/* short phones: drop the header lines the card screen repeats anyway */
@media (max-height: 700px) { .app.fit .top .who, .app.fit .top .meta { display: none; } .app.fit .top .bar { margin-top: 4px; } }

.photos { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.photo { position: relative; width: 86px; height: 104px; border-radius: 8px; border: 1px solid var(--line); overflow: hidden; background: #fff; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo button { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 15px; line-height: 26px; padding: 0; }
.addphoto { width: 86px; height: 104px; border: 1.5px dashed #b9c6f3; border-radius: 8px; background: var(--pen-soft); color: var(--pen); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; }
.addphoto input { display: none; }

.banner { background: var(--pen-soft); border-radius: 12px; padding: 12px 14px; display: grid; gap: 10px; }

.foot { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.btn { border: 1px solid #cfd5e3; border-radius: 10px; padding: 12px 14px; font-weight: 600; background: #fff; text-align: center; font-size: 16px; }
.btn.pri { background: var(--pen); color: #fff; border-color: var(--pen); flex: 1; }
.btn.sm { padding: 7px 11px; font-size: 14px; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }

.list { display: grid; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 16px; border: 0; border-top: 1px solid var(--line); background: var(--card); width: 100%; text-align: right; font-size: 16px; }
.row small { color: var(--mut); }
.pill { font-size: 13px; border-radius: 999px; padding: 2px 10px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.run { background: var(--pen-soft); color: var(--pen); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.new { background: #eceef3; color: var(--mut); }

.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(20,25,40,.4); display: flex; align-items: flex-end; justify-content: center; }
.sheet > div { background: var(--card); width: 100%; max-width: 560px; max-height: 85vh; overflow: auto; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); }
.sheet .hd { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; font-weight: 700; }

.center { text-align: center; padding: 40px 18px; display: grid; gap: 10px; }
.big { font-size: 26px; font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
pre.summary { font: 15px/1.65 "Assistant", "Segoe UI", Arial, sans-serif; white-space: pre-wrap; margin: 0; }
.ltr { direction: ltr; text-align: left; }
