/* MindSpring — shared tutor chat styling.

   Used by the three tutor pages (tutor.html = Sage, coach.html = Coach,
   scholar.html = Scholar), which are thin shells over assets/tutor-chat.js.
   Lives here rather than inline on each page so the three can't drift.
*/

  html,body{height:100%;}
  body{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;background:var(--paper);}
  .nav{flex:none;}

  .tt-wrap{flex:1;display:flex;flex-direction:column;min-height:0;}
  .tt-col{flex:1;display:flex;flex-direction:column;min-height:0;width:100%;max-width:760px;margin:0 auto;padding:0 20px;}

  /* boot / gate */
  .tt-boot{flex:1;display:flex;align-items:center;justify-content:center;color:var(--ink-soft);font-size:15px;}
  .tt-gate{margin:auto;max-width:420px;text-align:center;padding:40px 0;}
  .tt-gate h2{font-family:"Bricolage Grotesque",sans-serif;font-size:1.4rem;color:var(--ink);letter-spacing:-.01em;}
  .tt-gate p{margin-top:10px;color:var(--ink-soft);font-size:15px;line-height:1.6;}
  .tt-gate .acts{margin-top:24px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;}

  /* persona header */
  .tt-eyebrow{font-family:"IBM Plex Mono",monospace;font-size:12.5px;letter-spacing:.16em;text-transform:uppercase;color:var(--spring-deep);display:flex;align-items:center;gap:10px;padding-top:22px;}
  .tt-eyebrow::before{content:"";width:22px;height:1px;background:var(--spring-deep);opacity:.6;}
  .tt-head{flex:none;padding:14px 0 16px;display:flex;align-items:center;gap:13px;border-bottom:1px solid var(--line);}
  .tt-avatar{flex:none;width:46px;height:46px;border-radius:14px;background:var(--evergreen);color:var(--honey);display:grid;place-items:center;}
  .tt-avatar svg{width:24px;height:24px;}
  .tt-head-ttl{flex:1;min-width:0;}
  .tt-head-ttl h1{font-family:"Bricolage Grotesque",sans-serif;font-size:1.3rem;font-weight:700;color:var(--ink);letter-spacing:-.01em;line-height:1.15;}
  .tt-head-sub{margin-top:2px;font-size:13px;color:var(--ink-soft);display:flex;align-items:center;gap:6px;}
  .tt-head-sub .dot{width:7px;height:7px;border-radius:50%;background:var(--spring);flex:none;}
  .tt-newchat{flex:none;display:inline-flex;align-items:center;gap:7px;padding:8px 14px;border-radius:100px;
    border:1.5px solid var(--line-strong);background:var(--card);color:var(--ink-soft);
    font-size:13px;font-weight:600;cursor:pointer;transition:transform .16s ease,border-color .16s ease,color .16s ease;}
  .tt-newchat svg{width:15px;height:15px;}
  .tt-newchat:hover{transform:translateY(-1px);border-color:var(--spring);color:var(--ink);}
  .tt-newchat:active{transform:scale(.96);}
  @media(max-width:520px){.tt-newchat span{display:none;}.tt-newchat{padding:8px;}}

  /* persona picker */
  /* Tutor switcher. Each tutor is its own page, so these are links to the
     siblings; the current one renders as a non-navigating <span>.active. */
  .tt-personas{flex:none;display:flex;gap:8px;padding:12px 0;flex-wrap:wrap;}
  .tt-persona-btn{display:flex;flex-direction:column;align-items:flex-start;gap:1px;padding:8px 13px;border-radius:12px;border:1.5px solid var(--line-strong);background:var(--card);cursor:pointer;font-family:inherit;text-decoration:none;transition:border-color .16s ease,background .16s ease,transform .12s ease;}
  a.tt-persona-btn:hover{border-color:var(--spring);transform:translateY(-1px);}
  .tt-persona-btn.active{border-color:var(--spring);background:var(--sage);cursor:default;}
  .tt-persona-name{font-size:13.5px;font-weight:700;color:var(--ink);}
  .tt-persona-tag{font-size:11px;color:var(--ink-soft);}
  @media(prefers-reduced-motion:reduce){ a.tt-persona-btn:hover{transform:none;} }

  /* log */
  .tt-log{flex:1;overflow-y:auto;padding:22px 0;display:flex;flex-direction:column;gap:16px;min-height:0;}

  .tt-intro{margin:auto;text-align:center;max-width:400px;padding:20px;}
  .tt-intro .tt-avatar{margin:0 auto 16px;width:54px;height:54px;border-radius:16px;}
  .tt-intro .tt-avatar svg{width:28px;height:28px;}
  .tt-intro h2{font-family:"Bricolage Grotesque",sans-serif;font-size:1.25rem;color:var(--ink);letter-spacing:-.01em;}
  .tt-intro p{margin-top:9px;color:var(--ink-soft);font-size:14.5px;line-height:1.6;}
  .tt-intro .cost{margin-top:14px;font-family:"IBM Plex Mono",monospace;font-size:11.5px;color:var(--ink-soft);}

  /* starter prompts (empty state) + quick-reply chips (after each answer) */
  .tt-starters{margin-top:16px;display:flex;flex-direction:column;align-items:center;gap:8px;}
  .tt-starters-lbl{font-family:"IBM Plex Mono",monospace;font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-soft);opacity:.8;}
  .tt-chip{font-family:inherit;font-size:13.5px;font-weight:600;color:var(--spring-deep);background:var(--card);
    border:1.5px solid var(--line-strong);border-radius:100px;padding:8px 15px;cursor:pointer;line-height:1.3;
    transition:border-color .14s ease,background .14s ease,transform .1s ease;}
  .tt-chip:hover{border-color:var(--spring);background:var(--sage);transform:translateY(-1px);}
  .tt-chip:active{transform:scale(.97);}

  /* suggestion row under the latest tutor answer */
  .tt-suggest{display:flex;flex-direction:column;gap:12px;margin:-4px 0 2px 38px;}
  .tt-quicks{display:flex;flex-wrap:wrap;gap:8px;}
  .tt-actions{display:flex;flex-wrap:wrap;gap:8px;}
  .tt-act{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:600;text-decoration:none;
    color:var(--ink);background:var(--sage);border:1px solid transparent;border-radius:10px;padding:8px 13px;
    transition:border-color .14s ease,transform .1s ease;}
  .tt-act svg{width:15px;height:15px;color:var(--spring-deep);flex:none;}
  .tt-act:hover{border-color:var(--spring);transform:translateY(-1px);}
  @media(max-width:560px){.tt-suggest{margin-left:0;}}

  .tt-row{display:flex;gap:10px;align-items:flex-end;max-width:100%;}
  .tt-row.me{justify-content:flex-end;}
  .tt-row .tt-avatar{width:28px;height:28px;border-radius:9px;margin-bottom:2px;}
  .tt-row .tt-avatar svg{width:15px;height:15px;}
  .tt-msg{max-width:78%;font-size:15.5px;line-height:1.6;}
  .tt-msg.me{background:var(--evergreen);color:#f2f0e6;border-radius:16px 16px 4px 16px;padding:11px 15px;}
  .tt-msg.me img{display:block;max-width:220px;border-radius:10px;margin:0 0 8px;}
  .tt-msg.bot{background:var(--card);border:1px solid var(--line);color:var(--ink);border-radius:16px 16px 16px 4px;padding:12px 16px;box-shadow:var(--shadow-sm);}
  .tt-msg.bot p{margin:0 0 8px;}
  .tt-msg.bot p:last-child{margin-bottom:0;}
  .tt-msg.bot ul{margin:6px 0;padding-left:18px;}
  .tt-msg.bot li{margin:3px 0;}
  .tt-msg.bot strong{font-weight:700;color:var(--ink);}
  .tt-msg.bot h4,.tt-msg.bot h5{font-family:"Bricolage Grotesque",sans-serif;color:var(--ink);line-height:1.3;margin:10px 0 4px;}
  .tt-msg.bot h4:first-child,.tt-msg.bot h5:first-child{margin-top:0;}
  .tt-msg.bot h4{font-size:16.5px;font-weight:700;}
  .tt-msg.bot h5{font-size:14.5px;font-weight:700;color:var(--spring-deep);}
  .tt-msg.bot code,.tt-msg.me code{font-family:"IBM Plex Mono",monospace;font-size:13.5px;background:var(--sage);padding:1px 5px;border-radius:5px;}
  .tt-sys{align-self:center;text-align:center;font-size:13.5px;color:var(--ink-soft);background:var(--sage);border-radius:100px;padding:6px 15px;max-width:88%;}
  .tt-sys a{color:var(--spring-deep);font-weight:600;}

  .tt-typing-row{display:flex;gap:10px;align-items:center;}
  .tt-typing{display:inline-flex;align-items:center;gap:7px;padding:12px 15px;background:var(--card);border:1px solid var(--line);border-radius:16px 16px 16px 4px;box-shadow:var(--shadow-sm);}
  .tt-typing .lbl{font-size:12.5px;color:var(--ink-soft);}
  .tt-typing .dots{display:inline-flex;gap:4px;}
  .tt-typing .dots span{width:6px;height:6px;border-radius:50%;background:var(--spring-deep);opacity:.5;animation:tt-bounce 1s infinite;}
  .tt-typing .dots span:nth-child(2){animation-delay:.15s;}
  .tt-typing .dots span:nth-child(3){animation-delay:.3s;}
  @keyframes tt-bounce{0%,60%,100%{transform:translateY(0);opacity:.4;}30%{transform:translateY(-4px);opacity:.9;}}

  /* resource-context chip */
  .tt-ctx{flex:none;margin-bottom:10px;display:none;align-items:center;gap:10px;background:var(--sage);border:1px solid var(--line);border-radius:12px;padding:10px 12px;font-size:13px;color:var(--ink);}
  .tt-ctx.show{display:flex;}
  .tt-ctx-ic{flex:none;width:26px;height:26px;border-radius:8px;background:var(--card);display:grid;place-items:center;color:var(--spring-deep);}
  .tt-ctx-ic svg{width:14px;height:14px;}
  .tt-ctx-text{flex:1;min-width:0;line-height:1.4;}
  .tt-ctx-text b{color:var(--ink);}
  .tt-ctx-x{flex:none;border:none;background:none;color:var(--ink-soft);cursor:pointer;font-size:18px;line-height:1;padding:2px 4px;}
  .tt-ctx-x:hover{color:var(--ink);}

  /* composer */
  .tt-compose{flex:none;border-top:1px solid var(--line);padding:14px 0 calc(14px + env(safe-area-inset-bottom,0px));}
  .tt-attach-row{display:flex;align-items:center;gap:10px;margin-bottom:9px;}
  .tt-attach{display:inline-flex;align-items:center;gap:7px;font-size:13px;font-weight:600;color:var(--spring-deep);background:var(--sage);border:1px dashed var(--spring);border-radius:10px;padding:8px 12px;cursor:pointer;position:relative;}
  .tt-attach svg{width:16px;height:16px;}
  .tt-attach input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none;}
  .tt-thumb{display:none;align-items:center;gap:8px;font-size:12px;color:var(--ink-soft);}
  .tt-thumb.show{display:inline-flex;}
  .tt-thumb img{width:34px;height:34px;object-fit:cover;border-radius:7px;border:1px solid var(--line);}
  .tt-thumb button{border:none;background:none;color:var(--ink-soft);cursor:pointer;font-size:16px;line-height:1;padding:2px;}
  .tt-cost{margin-left:auto;font-size:11.5px;color:var(--ink-soft);font-family:"IBM Plex Mono",monospace;text-align:right;}

  .tt-input-row{display:flex;align-items:flex-end;gap:9px;}
  .tt-input{flex:1;resize:none;max-height:130px;min-height:46px;padding:13px 15px;border:1px solid var(--line);border-radius:13px;background:var(--card);color:var(--ink);font-family:inherit;font-size:15.5px;line-height:1.45;box-shadow:var(--shadow-sm);}
  .tt-input:focus{outline:none;border-color:var(--spring);box-shadow:0 0 0 3px rgba(62,156,108,.15);}
  .tt-send{flex:none;width:46px;height:46px;border-radius:13px;border:none;background:var(--evergreen);color:#f4f2e8;cursor:pointer;display:grid;place-items:center;transition:transform .12s ease;}
  .tt-send:hover:not(:disabled){transform:translateY(-1px);}
  .tt-send:disabled{opacity:.45;cursor:not-allowed;}
  .tt-send svg{width:19px;height:19px;}

  @media(max-width:560px){
    .tt-col{padding:0 14px;}
    .tt-msg{max-width:86%;}
    .tt-cost{display:none;}
  }
  @media(prefers-reduced-motion:reduce){
    .tt-typing .dots span{animation:none;opacity:.6;}
    .tt-send{transition:none;}
  }
