/* Tomo polish: Toss-like clarity on top of Tomo's identity (indigo accent, glass avatar,
   rounded shapes). Loaded last; it only refines tokens and presentation. */
:root{
  --a:#5B7CFF; --a-press:#4A69F2; --a-soft:#EEF2FF; --a-off:#C5D0FF;
  --ink:#191F28; --g4:#4E5968; --g3:#6B7684; --g2:#E5E8EB; --g1:#F2F4F6;
  --r-bub:20px; --r-card:20px;
  --t-fast:120ms; --t-med:200ms; --ease:cubic-bezier(.2,.8,.2,1);
}
body{color:var(--ink)}
:focus-visible{outline:2px solid var(--a);outline-offset:2px;border-radius:8px}

/* ---- press feedback (no layout shift) ---- */
button,.row.tap,.pick .r.tap,[role=button]{transition:transform var(--t-fast) var(--ease),background-color var(--t-fast) var(--ease),opacity var(--t-fast) var(--ease)}
button:not(:disabled):active,[role=button]:active{transform:scale(.97)}
.tabs button:not(:disabled):active{transform:scale(.92)}
button.ob-btn:not(:disabled):active,button.btn:not(:disabled):active{background:var(--a-press)}

/* ---- primary buttons ---- */
.ob-btn{height:56px;border-radius:16px;font-size:17px;font-weight:600;letter-spacing:-.2px}
.btn{border-radius:14px}
button.ob-btn:disabled,button.btn:disabled{opacity:1;background:var(--a-off)}

/* ---- header ---- */
.nav{height:56px;border-bottom:0;box-shadow:0 .5px 0 var(--g2)}
.nav .nm{font-size:17px;line-height:22px;font-weight:700;letter-spacing:-.2px}
.nav .cap{color:var(--g3)}

/* ---- bottom tabs: readable labels, 48px targets ---- */
.tabs{font-size:12px;line-height:16px;border-top:0;box-shadow:0 -.5px 0 var(--g2)}
.tabs button{min-height:48px;gap:3px}
.tabs button svg{width:24px;height:24px}

/* ---- chat: grouped runs, Tomo's avatar once per run (CSS only; the DOM is untouched) ---- */
.col{gap:4px;padding:16px 16px 20px}
.bub{padding:10px 14px;border-radius:var(--r-bub);font-size:16px;line-height:24px;max-width:min(280px,calc(100% - 48px))}
.them{background:var(--g1);color:var(--ink)}
.me{background:var(--a);color:#fff}
/* Tomo's side: replies, cards, candidate lists, and the typing bubble */
.col>:is(.them,.att,.pick,.oshi-confirm,.suggestion-closed,#chat-submit-status:not([hidden])){position:relative;margin-left:40px;max-width:calc(100% - 40px)}
/* first of a run = not directly after another item from the same side */
.col>:is(.them,.att,.pick,.oshi-confirm,.suggestion-closed,#chat-submit-status:not([hidden])):not(:is(.them,.att,.pick,.oshi-confirm,.suggestion-closed)+*){margin-top:14px}
.col>:is(.them,.att,.pick,.oshi-confirm,.suggestion-closed,#chat-submit-status:not([hidden])):not(:is(.them,.att,.pick,.oshi-confirm,.suggestion-closed)+*)::before{content:'';position:absolute;left:-40px;top:0;width:32px;height:32px;border-radius:11px;background:var(--tomo-av) center/cover no-repeat}
.col>.them:not(:is(.them,.att,.pick,.oshi-confirm,.suggestion-closed)+*){border-top-left-radius:6px}
.col>.me:not(.me+*){margin-top:14px;border-top-right-radius:6px}
.col>#chat-submit-status:not([hidden]):not(:is(.them,.att,.pick,.oshi-confirm,.suggestion-closed)+*){border-top-left-radius:6px}
.col>:first-child{margin-top:0!important}
.col>.sys+*{margin-top:6px!important}
.att,.pick{border-radius:var(--r-card)}
.col>.sys{font-size:12px;line-height:16px;color:var(--g3);padding:6px 0 2px}

/* waiting for Tomo: a typing bubble (the status text stays for screen readers) */
#chat-submit-status:not([hidden]){align-self:flex-start;display:inline-flex;align-items:center;height:40px;padding:0 14px;border-radius:var(--r-bub);background:var(--g1);color:transparent;font-size:0;line-height:0}
#chat-submit-status:not([hidden])::after{content:'';width:6px;height:6px;margin-right:20px;border-radius:50%;background:var(--g3);box-shadow:10px 0 0 var(--g3),20px 0 0 var(--g3);animation:tomo-typing 1.1s var(--ease) infinite}
@keyframes tomo-typing{0%,100%{opacity:.35}50%{opacity:1}}

/* ---- composer: filled field, round send ---- */
.chat-layout>.input.chat-composer{height:auto;min-height:48px;margin:4px 16px 10px;padding:4px 4px 4px 18px;border:0;border-radius:24px;background:var(--g1)}
.chat-composer textarea::placeholder{color:#8B95A1}
.input .send{width:40px;height:40px;border-radius:20px;margin-right:0}
.chat-composer .send:disabled{opacity:1;background:var(--a-off)}
.chat-layout>.chat-composer-status{color:var(--g4)}

/* ---- cards and lists ---- */
.card{border-radius:var(--r-card)}
.row .s,.cap,.sec,.why,.grd,.empty{color:var(--g3)}
.toast{left:16px;right:16px;bottom:112px;border-radius:14px;background:rgba(25,31,40,.92);padding:14px 16px;font-size:15px;line-height:20px;box-shadow:0 8px 24px rgba(0,0,0,.12)}

/* ---- start (Google only) ---- */
.onb{padding:0 24px}
.onb-hero{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding-top:40px}
.onb-brand{font-size:40px;line-height:48px;font-weight:700;letter-spacing:-.6px;margin-top:24px}
.onb-intro{font-size:17px;line-height:26px;color:var(--g3);margin-top:8px;max-width:300px}
.onb-foot{padding-bottom:max(32px,env(safe-area-inset-bottom))}
.onb-foot .langs{justify-content:center;flex-wrap:wrap;margin-bottom:20px}
.langs button{height:36px;padding:0 14px;border-radius:18px}
.onb-phone .field:first-child{margin-top:0}
.onb-phone .ob-btn{margin-top:12px}
.onb-note{font-size:13px;line-height:20px;color:var(--g3);text-align:center;margin-top:12px;padding:0 8px}

/* ---- step screens (phone verification) ---- */
.step{display:flex;flex-direction:column;padding:4px 24px 0}
.step-top{display:flex;align-items:center;justify-content:space-between;min-height:48px}
.step-count{font-size:13px;font-weight:600;color:var(--g3)}
.step-skip{min-height:44px;padding:0 4px;font-size:15px;color:var(--g3)}
.step-title{font-size:26px;line-height:34px;font-weight:700;letter-spacing:-.5px;margin-top:20px}
.step-sub{font-size:16px;line-height:24px;color:var(--g3);margin-top:8px}
.field{display:block;margin-top:28px}
.field+.field{margin-top:16px}
.field[hidden]{display:none}
.field span{display:block;margin-bottom:8px;font-size:13px;line-height:18px;font-weight:600;color:var(--g4)}
.field input{width:100%;height:56px;padding:0 16px;border:0;border-radius:14px;background:var(--g1);font:inherit;font-size:18px;color:var(--ink);outline:0;transition:box-shadow var(--t-fast) var(--ease),background-color var(--t-fast) var(--ease)}
.field input:focus{background:#fff;box-shadow:inset 0 0 0 2px var(--a)}
.field input[readonly]{color:var(--g3)}
.field input::placeholder{color:#8B95A1}
.step-msg{min-height:20px;margin-top:12px;font-size:14px;line-height:20px;color:var(--g4)}
.step-foot{display:flex;flex-direction:column;gap:4px;margin-top:auto;padding:16px 0 max(24px,env(safe-area-inset-bottom))}
.step-link{min-height:44px;font-size:15px;font-weight:600;color:var(--a)}
.step-link[hidden]{display:none}

/* ---- live view: the person's own view of their server-side browser ---- */
.lv{position:fixed;inset:0;z-index:1000;display:flex;flex-direction:column;background:#fff;color:var(--ink)}
.lv-top{display:flex;align-items:center;gap:8px;padding:max(8px,env(safe-area-inset-top)) 12px 8px;box-shadow:0 .5px 0 var(--g2)}
.lv-close{flex:none;width:44px;height:44px;border-radius:22px;font-size:26px;line-height:44px;color:var(--g4)}
.lv-where{flex:1;min-width:0}
.lv-host{font-size:16px;line-height:22px;font-weight:700;letter-spacing:-.2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lv-note{font-size:12px;line-height:16px;color:var(--g3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lv-done{flex:none;height:44px;padding:0 16px;border-radius:14px;background:var(--a);color:#fff;font-size:15px;font-weight:600}
.lv-done:disabled{background:var(--a-off)}
.lv-stage{position:relative;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden;background:var(--g1);outline:0}
.lv-img{display:block;max-width:100%;max-height:100%;background:#fff;user-select:none;-webkit-user-select:none;-webkit-user-drag:none;touch-action:none;cursor:default}
.lv-img[hidden]{display:none}
.lv-state{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:24px;text-align:center;background:rgba(242,244,246,.92)}
.lv-state[hidden]{display:none}
.lv-state-text{margin:0;max-width:320px;font-size:15px;line-height:22px;color:var(--g4)}
.lv-retry{height:44px;padding:0 20px;border-radius:14px;background:var(--a-soft);color:var(--a);font-size:15px;font-weight:600}
.lv-retry[hidden]{display:none}
.lv-phone{display:flex;flex-direction:column;gap:8px;width:100%;max-width:320px}
.lv-phone .lv-text{flex:none;background:#fff}
.lv-phone .lv-text[hidden]{display:none}
.lv-phone .lv-send{height:48px}
.lv-bar[hidden]{display:none}
.lv-bar{display:flex;flex-direction:column;gap:8px;padding:8px 12px max(10px,env(safe-area-inset-bottom));box-shadow:0 -.5px 0 var(--g2)}
.lv-type{display:flex;align-items:center;gap:6px}
.lv-text{flex:1;min-width:0;height:44px;padding:0 14px;border:0;border-radius:12px;background:var(--g1);font:inherit;font-size:16px;color:var(--ink);outline:0}
.lv-text:focus{background:#fff;box-shadow:inset 0 0 0 2px var(--a)}
.lv-eye{flex:none;height:44px;padding:0 8px;font-size:14px;color:var(--g3)}
.lv-send{flex:none;height:44px;padding:0 16px;border-radius:12px;background:var(--a-soft);color:var(--a);font-size:15px;font-weight:600}
.lv-keys{display:flex;gap:6px}
.lv-key{flex:1;min-width:0;height:44px;border-radius:12px;background:var(--g1);font-size:14px;font-weight:600;color:var(--g4)}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation:none!important;transition:none!important}
  button:not(:disabled):active,[role=button]:active,.tabs button:not(:disabled):active{transform:none}
}
