/* Bobber v1.0.0 | bob.css  Look: a summer lake at the dock. Warm sky, teal water, a red and white bobber on a line, slab-serif answers like a bait shop sign.
   Signature: the answer comes up from the water. ASCII only. */
:root{
  --sky:#f8e9c8; --sky2:#f3d7a6; --sand:#efdcb4; --ink:#1d2a33; --ink2:#4a5866; --bob:#d8342b; --lake:#1c6470; --lake2:#2b8a8c; --paper:#fffaf0; --go:#2f7d6d;
  --r:16px; --ui:'Atkinson Hyperlegible Next', system-ui, sans-serif; --slab:'Alfa Slab One', Georgia, serif;
  color-scheme: light;
}
*{ box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent; }
html{ background:var(--sky); height:100%; }
body{ min-height:100%; font-family:var(--ui); color:var(--ink); background:linear-gradient(180deg, var(--sky) 0%, var(--sky2) 70%); overscroll-behavior:none; }
button, a.row{ font:inherit; color:inherit; background:none; border:0; cursor:pointer; text-decoration:none; }
.app{ height:100vh; height:100dvh; display:flex; flex-direction:column; max-width:560px; margin:0 auto; padding: max(10px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom)); }
.bar{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.brand{ line-height:0; } .mark{ height:52px; width:auto; display:block; }
.gear{ width:46px; height:46px; border-radius:50%; display:grid; place-items:center; background:var(--paper); box-shadow:0 2px 0 var(--sand), 0 0 0 2px var(--ink) inset; }
.gear svg{ width:24px; height:24px; fill:var(--ink); }
.modes{ display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-top:8px; padding:5px; border-radius:16px; background:rgba(29,42,51,.08); }
.mode{ min-height:46px; border-radius:12px; font-weight:700; font-size:1.05rem; color:var(--ink2); }
.mode.on{ background:var(--ink); color:var(--paper); box-shadow:0 2px 0 rgba(0,0,0,.2); }
.pill{ align-self:center; margin-top:8px; display:inline-flex; align-items:center; gap:8px; padding:7px 14px; border-radius:999px; background:var(--paper); box-shadow:0 0 0 2px var(--ink) inset; font-weight:700; }
.pill[hidden]{ display:none; }
.pill__k{ font-weight:400; color:var(--ink2); font-size:.88rem; } .pill__v{ color:var(--ink2); font-size:.8rem; }

.stage{ flex:1; position:relative; min-height:0; display:flex; flex-direction:column; justify-content:flex-end; margin:8px -14px 0; }
.ans{ position:absolute; left:18px; right:18px; top:6px; min-height:112px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:8px 44px;
  opacity:0; transform:translateY(40px) scale(.96); transition:opacity .35s, transform .5s cubic-bezier(.2,1.3,.4,1); z-index:2; pointer-events:none; }
.ans.on{ opacity:1; transform:none; pointer-events:auto; }
.ans__k{ font-weight:700; font-size:.82rem; letter-spacing:.14em; text-transform:uppercase; color:var(--lake); }
.ans__txt{ font-family:var(--slab); font-size:2rem; line-height:1.12; color:var(--ink); margin-top:4px; text-wrap:balance; }
.ans__txt.s2{ font-size:1.6rem; } .ans__txt.s3{ font-size:1.3rem; }
.keep{ position:absolute; right:0; top:50%; transform:translateY(-50%); width:44px; height:44px; display:grid; place-items:center; border-radius:50%; }
.keep svg{ width:28px; height:28px; fill:none; stroke:var(--ink2); stroke-width:1.8; stroke-linejoin:round; transition:transform .2s; }
.keep.on svg{ fill:#f2b33d; stroke:#9a5a1f; transform:scale(1.12); }
.lake{ position:relative; width:100%; height:min(62%, 420px); min-height:220px; cursor:pointer; outline:none; }
.lake:focus-visible{ box-shadow:0 0 0 3px var(--ink) inset; }
.lk{ width:100%; height:100%; display:block; }
.lk-bob{ animation:float 3.2s ease-in-out infinite; transform-origin:200px 276px; transform-box:view-box; }
@keyframes float{ 0%,100%{ transform:translateY(0) rotate(-3deg); } 50%{ transform:translateY(5px) rotate(3deg); } }
.lk-glints{ animation:glint 4s ease-in-out infinite; } @keyframes glint{ 50%{ opacity:.25; } }
.lk--nibble .lk-bob-in{ animation:nib .3s ease-in-out 2; } @keyframes nib{ 50%{ transform:translateY(9px); } }
.lk--plunge .lk-bob-in{ transform:translateY(110px); transition:transform .45s cubic-bezier(.5,0,.8,.4); }
.lk--up .lk-bob-in{ animation:pop .38s cubic-bezier(.2,1.5,.4,1); } @keyframes pop{ from{ transform:translateY(110px); } to{ transform:none; } }
.lk--plunge .lk-line{ transform:scaleY(1.35); transform-origin:200px 0; transform-box:view-box; transition:transform .45s; }
.lk-rings ellipse{ opacity:0; animation:ring 1.3s ease-out forwards; transform-origin:200px 292px; transform-box:view-box; }
@keyframes ring{ from{ opacity:.9; transform:scale(.5); } to{ opacity:0; transform:scale(3); } }
.hint{ position:absolute; bottom:8px; left:0; right:0; text-align:center; font-size:.95rem; color:#dff1ec; padding:0 16px; z-index:2; }

/* ---- dock ---- */
.dock{ display:flex; flex-direction:column; gap:10px; padding-top:10px; }
.tools{ display:grid; grid-template-columns:repeat(4, 1fr); gap:8px; }
.tool{ display:flex; flex-direction:column; align-items:center; gap:3px; padding:8px 2px 7px; border-radius:14px; background:rgba(255,253,246,.72); box-shadow:0 0 0 1.5px rgba(31,42,68,.18) inset; font-size:.86rem; font-weight:700; min-height:60px; }
.tool svg{ width:24px; height:24px; fill:none; stroke:var(--ink); stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.tool b{ color:var(--bob); }
.tool:active{ background:var(--paper); }
.main{ width:100%; min-height:62px; border-radius:var(--r); background:var(--bob); color:#fff; font-weight:700; font-size:1.3rem; letter-spacing:.02em; box-shadow:0 4px 0 #9c1f1a; }
.main:active{ transform:translateY(3px); box-shadow:0 1px 0 #9c1f1a; }

/* ---- sheet ---- */
.sheet{ position:fixed; inset:0; background:rgba(31,42,68,.42); display:flex; align-items:flex-end; justify-content:center; opacity:0; pointer-events:none; transition:opacity .2s; z-index:20; }
.sheet.on{ opacity:1; pointer-events:auto; }
.sheet__box{ width:100%; max-width:560px; max-height:88dvh; overflow:auto; background:var(--paper); border-radius:22px 22px 0 0; padding:16px 16px max(18px, env(safe-area-inset-bottom));
  transform:translateY(30px); transition:transform .25s; }
.sheet.on .sheet__box{ transform:none; }
.still .sheet__box, .still .ans{ transition:none !important; }
.still .lk-bob, .still .lk-glints{ animation:none !important; }
.sh-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.sh-head h2{ font-size:1.3rem; }
.x{ width:44px; height:44px; border-radius:50%; background:var(--sand); font-weight:700; }
.x--s{ width:36px; height:36px; flex:none; }
.rows{ display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
.row{ display:grid; grid-template-columns:1fr auto; grid-template-rows:auto auto; text-align:left; padding:12px 14px; border-radius:14px; background:#fff; box-shadow:0 0 0 1.5px rgba(31,42,68,.14) inset; min-height:58px; }
.row b{ font-size:1.06rem; } .row span{ grid-column:1; font-size:.9rem; color:var(--ink2); }
.row em{ grid-column:2; grid-row:1/3; align-self:center; font-style:normal; font-weight:700; color:var(--ink2); padding-left:10px; font-size:1.1rem; }
.row--on{ box-shadow:0 0 0 2.5px var(--ink) inset; background:#fff7e4; }
.row--add em{ color:var(--bob); font-size:1.4rem; }
.rows--gear{ margin-top:14px; }
.sw{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 2px; border-bottom:1px solid rgba(31,42,68,.1); }
.sw b{ display:block; font-size:1.05rem; } .sw small{ color:var(--ink2); font-size:.86rem; }
.sw input{ position:absolute; opacity:0; width:1px; height:1px; }
.sw i{ flex:none; width:54px; height:32px; border-radius:20px; background:#cfc6b2; position:relative; transition:background .2s; }
.sw i::after{ content:''; position:absolute; top:3px; left:3px; width:26px; height:26px; border-radius:50%; background:#fff; transition:transform .2s; box-shadow:0 1px 2px rgba(0,0,0,.2); }
.sw input:checked + i{ background:var(--go); } .sw input:checked + i::after{ transform:translateX(22px); }
.sw input:focus-visible + i{ outline:3px solid var(--ink); outline-offset:2px; }
.ver{ text-align:center; color:var(--ink2); font-size:.8rem; }
.lab{ display:block; font-weight:700; margin:12px 0 6px; } .lab small{ font-weight:400; color:var(--ink2); }
.field{ width:100%; border:2px solid rgba(31,42,68,.22); border-radius:12px; padding:11px 12px; font:inherit; font-size:1rem; background:#fff; color:var(--ink); }
.field:focus{ outline:none; border-color:var(--ink); }
.field--big{ font-family:var(--slab); font-size:1rem; line-height:1.45; }
textarea.field{ resize:vertical; }
.chips{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.chip{ padding:7px 11px; border-radius:999px; background:var(--sand); font-size:.88rem; font-family:var(--slab); }
.two{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:14px; }
.two.stick{ position:sticky; bottom:calc(-1 * max(18px, env(safe-area-inset-bottom))); background:var(--paper); padding:10px 0 max(18px, env(safe-area-inset-bottom)); margin-bottom:calc(-1 * max(18px, env(safe-area-inset-bottom))); }
.btn{ min-height:52px; border-radius:14px; background:var(--sand); font-weight:700; font-size:1.05rem; padding:0 12px; width:100%; }
.btn--go{ background:var(--go); color:#fff; }
.soft{ color:var(--ink2); margin:6px 0 14px; line-height:1.45; }
.jar{ list-style:none; display:flex; flex-direction:column; gap:6px; }
.jar li{ display:flex; align-items:center; gap:10px; padding:10px 8px 10px 12px; background:#fff; border-radius:12px; box-shadow:0 0 0 1.5px rgba(31,42,68,.12) inset; font-family:var(--slab); color:var(--ink); }
.jar li span{ flex:1; }
.how{ padding-left:22px; display:flex; flex-direction:column; gap:8px; line-height:1.4; margin-bottom:8px; }
.src{ padding-left:20px; display:flex; flex-direction:column; gap:6px; font-size:.9rem; color:var(--ink2); margin:8px 0 14px; word-break:break-word; }
#sheet-box p{ line-height:1.45; margin-bottom:8px; }

/* ---- modal + toast ---- */
.modal{ position:fixed; inset:0; background:rgba(31,42,68,.5); display:grid; place-items:center; z-index:40; padding:20px; }
.modal__box{ width:100%; max-width:380px; background:var(--paper); border-radius:18px; padding:18px; }
.modal__box h3{ font-size:1.2rem; margin-bottom:8px; } .modal__box p{ color:var(--ink2); line-height:1.45; margin-bottom:12px; }
.modal__box > .btn{ margin-top:4px; }
.toast{ position:fixed; left:50%; top:calc(150px + env(safe-area-inset-top)); transform:translate(-50%, 20px); background:var(--ink); color:#fff; padding:10px 16px; border-radius:999px; font-weight:700; opacity:0; transition:.2s; pointer-events:none; z-index:30; white-space:nowrap; }
.toast.on{ opacity:1; transform:translate(-50%, 0); }

@media (max-height:640px){ .mark{ height:36px; } .gear{ width:42px; height:42px; } .pill{ margin-top:6px; padding:7px 14px; } .tool{ min-height:52px; padding:6px 2px; } .main{ min-height:54px; } .ans{ min-height:96px; } }
@media (min-width:700px){ .mark{ height:56px; } }

.mode:focus-visible, .main:focus-visible, .tool:focus-visible, .pill:focus-visible{ outline:3px solid var(--ink); outline-offset:2px; }
@media (max-height:640px){ .mark{ height:40px; } .mode{ min-height:40px; } .ans__txt{ font-size:1.6rem; } .hint{ font-size:.82rem; bottom:2px; } }
@media (max-height:700px) and (min-width:500px){ .hint{ display:none; } }
.dock{ background:#103d4a; margin:0 -14px calc(-1 * max(12px, env(safe-area-inset-bottom))); padding:10px 14px max(12px, env(safe-area-inset-bottom)); }
.tool{ background:rgba(255,250,240,.92); }
.main{ box-shadow:0 4px 0 #6e1712; }
