/*
 * Amplify — App · Textarea UI
 *
 * Purpose: Styles the shared enhanced textarea behavior.
 * Contract: Pure presentation for textareas enhanced by core/textarea.js.
 * Dependencies: foundation.css.
 * Invariants: Must not change native textarea semantics or form values.
 * Maintenance: Comments describe current intent, not release history. Remove obsolete rules instead of stacking versioned patches.
 */

/* Textareas editoriais: Training, Knowledge e Follow-up */
  .app-textarea-shell{
    position:relative;
    width:100%;
    display:grid;
    grid-template-rows:minmax(0,1fr) 19px;
    overflow:hidden;
    border:1px solid var(--border);
    border-radius:13px;
    background:rgba(8,8,8,.7);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.012);
    transition:border-color 160ms ease,background 160ms ease,box-shadow 160ms ease
  }

  .app-textarea-shell:focus-within{
    border-color:rgba(254,233,147,.5);
    background:rgba(11,11,11,.94);
    box-shadow:0 0 0 3px rgba(254,233,147,.055)
  }

  .app-textarea-shell > textarea{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    border:0!important;
    border-radius:0!important;
    outline:0!important;
    background:transparent!important;
    box-shadow:none!important;
    resize:none!important;
    overflow-y:auto!important;
    scrollbar-width:thin;
    scrollbar-color:rgba(254,233,147,.30) rgba(255,255,255,.018)
  }

  .app-textarea-shell > textarea::-webkit-scrollbar{
    width:8px;
    height:8px
  }

  .app-textarea-shell > textarea::-webkit-scrollbar-track{
    background:rgba(255,255,255,.018);
    border-left:1px solid rgba(255,255,255,.025)
  }

  .app-textarea-shell > textarea::-webkit-scrollbar-thumb{
    min-height:34px;
    border:2px solid rgba(8,8,8,.72);
    border-radius:999px;
    background:rgba(254,233,147,.34)
  }

  .app-textarea-shell > textarea::-webkit-scrollbar-thumb:hover{
    background:rgba(254,233,147,.52)
  }

  .app-textarea-shell > textarea::-webkit-scrollbar-corner{
    background:transparent
  }

  .app-textarea-footer{
    position:relative;
    height:19px;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    border-top:1px solid rgba(255,255,255,.045);
    background:
      linear-gradient(180deg,rgba(255,255,255,.012),rgba(0,0,0,.11));
    user-select:none
  }

  .app-textarea-footer::before{
    content:"";
    position:absolute;
    left:10px;right:34px;top:50%;
    height:1px;
    background:linear-gradient(90deg,transparent,rgba(254,233,147,.055),transparent)
  }

  .app-textarea-resize-grip{
    position:relative;
    z-index:2;
    width:28px;
    height:19px;
    display:grid;
    place-items:center;
    padding:0;
    border:0;
    background:transparent;
    color:rgba(254,233,147,.42);
    cursor:ns-resize
  }

  .app-textarea-resize-grip:hover,
  .app-textarea-resize-grip:focus-visible{
    outline:none;
    color:rgba(254,233,147,.72);
    background:rgba(254,233,147,.035)
  }

  .app-textarea-resize-grip svg{
    width:12px;
    height:12px;
    overflow:visible;
    fill:none;
    stroke:currentColor;
    stroke-width:1.7;
    stroke-linecap:round
  }

  .app-textarea-resize-grip.is-dragging{
    color:var(--gold);
    background:rgba(254,233,147,.055)
  }

  body.app-textarea-resizing,
  body.app-textarea-resizing *{
    cursor:ns-resize!important;
    user-select:none!important
  }

  /* O Follow-up passa a usar exatamente a mesma linguagem de contorno. */
  #followupToolPage .app-textarea-shell{
    border-color:var(--border);
    border-radius:13px;
    background:rgba(8,8,8,.7)
  }

  #followupToolPage .app-textarea-shell:focus-within{
    border-color:rgba(254,233,147,.5);
    background:rgba(11,11,11,.94)
  }

  @media(max-width:640px){
    .app-textarea-shell > textarea::-webkit-scrollbar{width:6px}
    .app-textarea-footer{height:18px}
    .app-textarea-shell{grid-template-rows:minmax(0,1fr) 18px}
  }
