/* ===== Productivity upgrades ===== */

    .field-head{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
      min-height:32px;
    }

    .field-tools{
      display:flex;
      align-items:center;
      gap:7px;
    }

    .utility-btn{
      min-width:34px;
      height:32px;
      padding:0 10px;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      gap:6px;
      border:1px solid var(--border);
      border-radius:10px;
      background:var(--soft);
      color:var(--muted);
      font-size:11px;
      font-weight:600;
      box-shadow:none;
    }

    .utility-btn svg{
      width:14px;
      height:14px;
      flex:0 0 auto;
    }

    .utility-btn:hover{
      color:var(--primary);
      border-color:#abd8f8;
      background:var(--primary-soft);
      transform:translateY(-1px);
    }

    html[data-theme="dark"] .utility-btn:hover{
      border-color:#365f80;
    }

    .utility-btn.icon-only{
      width:34px;
      padding:0;
    }

    .textarea-wrap{
      position:relative;
    }

    .text-meta{
      display:flex;
      justify-content:flex-end;
      align-items:center;
      gap:7px;
      min-height:19px;
      padding-top:4px;
      color:var(--muted);
      font-size:10.5px;
      font-weight:500;
      user-select:none;
    }

    .meta-number{
      display:inline-block;
      min-width:1ch;
      color:color-mix(in srgb, var(--text) 76%, var(--muted));
      font-variant-numeric:tabular-nums;
    }

    .meta-dot{
      opacity:.42;
    }

    .actions{
      align-items:center;
    }

    .ghost{
      background:transparent;
      color:var(--muted);
      border:1px solid transparent;
      box-shadow:none;
    }

    .ghost:hover{
      color:var(--text);
      background:var(--soft);
      border-color:var(--border);
      transform:translateY(-1px);
    }

    .ghost svg,
    .secondary svg{
      width:15px;
      height:15px;
      vertical-align:-2px;
      margin-right:5px;
    }

    .recent-button.active{
      color:var(--primary);
      background:var(--primary-soft);
      border-color:var(--border);
    }

    .history-panel{
      display:grid;
      grid-template-rows:0fr;
      opacity:0;
      transform:translateY(-5px);
      margin-top:0;
      transition:
        grid-template-rows 320ms var(--ease),
        opacity 220ms var(--ease),
        transform 320ms var(--ease),
        margin-top 320ms var(--ease);
    }

    .history-panel.open{
      grid-template-rows:1fr;
      opacity:1;
      transform:translateY(0);
      margin-top:16px;
    }

    .history-panel-inner{
      overflow:hidden;
    }

    .history-shell{
      padding:12px;
      border:1px solid var(--border);
      border-radius:16px;
      background:color-mix(in srgb, var(--soft) 58%, transparent);
    }

    .history-head{
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:12px;
      margin-bottom:8px;
    }

    .history-title{
      display:flex;
      align-items:center;
      gap:8px;
      color:var(--label);
      font-size:12px;
      font-weight:700;
    }

    .history-title svg{
      width:15px;
      height:15px;
      color:var(--primary);
    }

    .clear-history{
      border:0;
      padding:5px 8px;
      border-radius:8px;
      background:transparent;
      color:var(--muted);
      font-size:10.5px;
      font-weight:600;
      box-shadow:none;
    }

    .clear-history:hover{
      background:var(--primary-soft);
      color:var(--primary);
    }

    .history-list{
      display:flex;
      flex-direction:column;
      gap:6px;
    }

    .history-item{
      width:100%;
      display:grid;
      grid-template-columns:38px minmax(0,1fr) auto;
      align-items:center;
      gap:10px;
      padding:9px;
      border:1px solid transparent;
      border-radius:12px;
      background:transparent;
      color:var(--text);
      text-align:left;
      box-shadow:none;
    }

    .history-item:hover{
      transform:translateX(2px);
      background:var(--field-bg);
      border-color:var(--border);
      box-shadow:0 6px 18px rgba(28,91,137,.05);
    }

    .history-type{
      width:38px;
      height:38px;
      display:grid;
      place-items:center;
      border-radius:10px;
      background:var(--primary-soft);
      color:var(--primary);
      font-size:10px;
      font-weight:700;
    }

    .history-copy{
      min-width:0;
    }

    .history-preview{
      display:block;
      overflow:hidden;
      white-space:nowrap;
      text-overflow:ellipsis;
      color:var(--text);
      font-size:11.5px;
      font-weight:600;
    }

    .history-sub{
      display:block;
      margin-top:2px;
      color:var(--muted);
      font-size:9.5px;
      font-weight:500;
    }

    .history-arrow{
      width:28px;
      height:28px;
      display:grid;
      place-items:center;
      border-radius:8px;
      color:var(--muted);
      background:var(--soft);
    }

    .history-arrow svg{
      width:13px;
      height:13px;
    }

    .history-empty{
      padding:15px 10px;
      color:var(--muted);
      text-align:center;
      font-size:11px;
    }

    .toast-stack{
      position:fixed;
      z-index:1000;
      right:18px;
      bottom:18px;
      width:min(360px, calc(100vw - 36px));
      display:flex;
      flex-direction:column;
      align-items:flex-end;
      gap:8px;
      pointer-events:none;
    }

    .toast{
      max-width:100%;
      display:flex;
      align-items:center;
      gap:10px;
      padding:11px 13px;
      border:1px solid var(--border);
      border-radius:13px;
      background:color-mix(in srgb, var(--field-bg) 94%, transparent);
      color:var(--text);
      box-shadow:
        0 16px 38px rgba(27,83,126,.16),
        inset 0 1px 0 rgba(255,255,255,.65);
      backdrop-filter:blur(18px);
      -webkit-backdrop-filter:blur(18px);
      font-size:11.5px;
      font-weight:600;
      pointer-events:auto;
      opacity:0;
      transform:translateY(12px) scale(.98);
      animation:toastIn 280ms var(--ease) forwards;
    }

    html[data-theme="dark"] .toast{
      box-shadow:0 18px 42px rgba(0,0,0,.34);
    }

    .toast.out{
      animation:toastOut 220ms var(--ease) forwards;
    }

    .toast-icon{
      width:24px;
      height:24px;
      display:grid;
      place-items:center;
      flex:0 0 24px;
      border-radius:8px;
      background:var(--primary-soft);
      color:var(--primary);
    }

    .toast.error .toast-icon{
      color:var(--danger);
      background:color-mix(in srgb, var(--danger) 10%, transparent);
    }

    .toast.success .toast-icon{
      color:var(--success);
      background:color-mix(in srgb, var(--success) 10%, transparent);
    }

    .status{
      position:absolute !important;
      width:1px !important;
      height:1px !important;
      padding:0 !important;
      margin:-1px !important;
      overflow:hidden !important;
      clip:rect(0,0,0,0) !important;
      white-space:nowrap !important;
      border:0 !important;
    }

    .result-fresh{
      animation:resultFresh 600ms var(--ease);
    }

    @keyframes resultFresh{
      0%{
        border-color:var(--border);
      }
      45%{
        border-color:var(--primary);
        box-shadow:0 0 0 4px rgba(21,147,255,.10);
      }
      100%{
        border-color:var(--border);
        box-shadow:none;
      }
    }

    @keyframes toastIn{
      to{
        opacity:1;
        transform:translateY(0) scale(1);
      }
    }

    @keyframes toastOut{
      to{
        opacity:0;
        transform:translateY(7px) scale(.98);
      }
    }

    @media (max-width:760px){
      .field-head{
        align-items:center;
      }

      .utility-btn .utility-label{
        display:none;
      }

      .utility-btn{
        width:34px;
        padding:0;
      }

      .actions{
        gap:8px;
      }

      .actions button{
        padding:11px 13px;
      }

      .toast-stack{
        right:12px;
        bottom:12px;
        width:calc(100vw - 24px);
      }
    }
