/* Prompter tab (prompter-tab.js): the recording queue, plus the Home quick-start card. */
.pt-head{margin:18px 0 12px}
/* Out-specifies the board's generic `.tab h2` label style. */
#t-prompter .pt-title{margin:0;font-size:30px;line-height:1.1;font-weight:700;letter-spacing:-.4px;text-transform:none;color:var(--ink)}
.pt-sub{margin:6px 0 0;color:var(--muted);font-size:15px}
.pt-chips{display:flex;gap:8px;margin:0 0 14px;overflow-x:auto;scrollbar-width:none}
.pt-chips::-webkit-scrollbar{display:none}
.pt-chips button{flex:0 0 auto;min-height:40px;padding:0 16px;border:1px solid var(--line);border-radius:999px;background:transparent;color:var(--ink);font:inherit;font-size:14px;cursor:pointer;transition:background .16s ease,color .16s ease,border-color .16s ease}
.pt-chips button[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:var(--bg);font-weight:700}
.pt-chips button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

.pt-list{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.pt-group{margin:12px 0 0;padding:0 4px;color:var(--muted);font-size:13px;font-weight:600;letter-spacing:.2px}
.pt-row{position:relative;border-radius:16px;overflow:hidden;--pt-progress:0}
.pt-row-bg{position:absolute;inset:0;display:flex;align-items:center;padding-left:20px;border-radius:16px;background:var(--green);color:#fff;font-weight:700;font-size:15px;opacity:calc(.35 + var(--pt-progress) * .65)}
.pt-row-bg{justify-content:space-between;padding-right:20px}
.pt-row[data-dir="left"] .pt-row-bg{background:var(--red)}
.pt-row[data-dir="left"] .pt-bg-done,.pt-row:not([data-dir="left"]) .pt-bg-trash{visibility:hidden}
.pt-card{position:relative;display:flex;flex-wrap:wrap;align-items:stretch;background:var(--panel);border:1px solid var(--line);border-radius:16px;touch-action:pan-y;user-select:none;-webkit-user-select:none;transition:transform .22s cubic-bezier(.2,.8,.3,1)}
/* A dragged card follows the finger exactly; any transition turns it to rubber. */
.pt-dragging .pt-card{transition:none}
.pt-gone{animation:pt-out .26s ease forwards}
@keyframes pt-out{to{opacity:0;transform:scale(.96)}}
.pt-open{flex:1;min-width:0;display:grid;gap:6px;min-height:72px;padding:14px 4px 14px 16px;border:0;background:transparent;color:var(--ink);font:inherit;text-align:left;cursor:pointer}
.pt-open:focus-visible,.pt-done:focus-visible{outline:2px solid var(--accent);outline-offset:-3px;border-radius:16px}
.pt-row-title{font-size:17px;font-weight:700;line-height:1.3}
.pt-meta{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:13px}
.pt-pill{padding:2px 8px;border-radius:999px;background:rgba(224,138,95,.14);color:var(--accent);font-size:12px;font-weight:700}
.pt-hook{color:var(--muted);font-size:14px;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pt-done{flex:0 0 56px;display:flex;align-items:center;justify-content:center;border:0;border-left:1px solid var(--line);background:transparent;color:var(--green);font-size:22px;font-weight:700;cursor:pointer;border-radius:0 16px 16px 0}
.pt-done:hover{background:var(--line)}
/* Expanded row: read the whole script, then record it. */
.pt-body{flex:0 0 100%;padding:0 16px 16px;border-top:1px solid var(--line)}
.pt-script{margin:14px 0 16px;max-height:50dvh;overflow-y:auto;white-space:pre-wrap;font-size:16px;line-height:1.55;color:var(--ink);user-select:text;-webkit-user-select:text}
.pt-record{display:block;width:100%;min-height:52px;border:0;border-radius:14px;background:var(--accent);color:#0a0b0c;font:inherit;font-size:17px;font-weight:700;cursor:pointer}
.pt-record:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
/* Record stays the one filled action; Rewrite and Edit sit beside each other as outlines. */
.pt-row-actions{display:flex;gap:8px;align-items:stretch;max-width:520px}.pt-row-actions .pt-record{flex:1 1 auto;width:auto;min-height:48px}.pt-row-actions .pt-secondary{flex:0 0 auto;padding:0 18px;font-size:15px;background:transparent;color:var(--ink);border:1px solid var(--line)}
.pt-body>.nt-chips{margin:14px 0 -2px}
.pt-edit{flex:0 0 48px;min-height:48px;display:grid;place-items:center;padding:0;border:1px solid var(--line);border-radius:14px;background:transparent;color:var(--ink);cursor:pointer}.pt-edit:focus-visible{outline:2px solid var(--ink);outline-offset:2px}.pt-edit svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.pt-trash{flex:0 0 48px;display:flex;align-items:center;justify-content:center;border:0;border-left:1px solid var(--line);background:transparent;color:var(--muted);font-size:18px;cursor:pointer}
.pt-trash:hover{background:var(--line)}
.pt-trash:focus-visible{outline:2px solid var(--accent);outline-offset:-3px}
.pt-tip{margin:14px 0 0;text-align:center;color:var(--muted);font-size:13px}
.pt-empty{margin:28px 0;padding:28px 20px;text-align:center;border:1px dashed var(--line);border-radius:16px}
.pt-empty-title{margin:0 0 6px;font-size:20px;font-weight:700;color:var(--ink)}
.pt-empty p{margin:0 0 14px;color:var(--muted)}
.pt-empty button{min-height:44px;padding:0 20px;border:0;border-radius:12px;background:var(--accent);color:#0a0b0c;font:inherit;font-weight:700;cursor:pointer}

.pt-undo{position:fixed;left:12px;right:12px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:72;display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:440px;margin:0 auto;padding:10px 10px 10px 16px;border-radius:14px;background:var(--ink);color:var(--bg);font-size:15px;box-shadow:0 14px 40px rgba(0,0,0,.4)}
.pt-undo[hidden]{display:none}
.pt-undo button{min-height:40px;padding:0 14px;border:0;border-radius:10px;background:transparent;color:var(--accent);font:inherit;font-weight:700;cursor:pointer}

.home-prompter-card{display:flex;align-items:center;gap:12px;width:100%;margin:18px 0 6px;padding:18px 18px 18px 20px;border:1px solid rgba(224,138,95,.35);border-radius:18px;background:linear-gradient(135deg,rgba(224,138,95,.16),rgba(224,138,95,.04));color:var(--ink);font:inherit;text-align:left;cursor:pointer}
.home-prompter-card:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.hpc-copy{flex:1;display:grid;gap:3px}
.hpc-eyebrow{font:11px "SF Mono",Menlo,monospace;letter-spacing:1.6px;text-transform:uppercase;color:var(--accent)}
.hpc-title{font-size:19px;font-weight:700;line-height:1.25}
.hpc-sub{color:var(--muted);font-size:14px}
.hpc-arrow{font-size:30px;line-height:1;color:var(--accent)}

@media(max-width:767px){
  /* Above the bottom tab bar, not under it. */
  .pt-undo{bottom:calc(76px + env(safe-area-inset-bottom))}
  #t-prompter .pt-title{font-size:32px}
}
@media(prefers-reduced-motion:reduce){
  .pt-card,.pt-chips button,.pt-filter-toggle{transition:none}
  .pt-filter-panel{animation:none}
  .pt-gone{animation:none;opacity:0}
}
.pt-pill-review{background:rgba(200,98,74,.16);color:var(--red)}
.pt-pill-new{background:rgba(126,167,139,.18);color:var(--green)}
.pt-hold{margin:14px 0 0;padding:10px 12px;border-radius:10px;background:rgba(200,98,74,.1);color:var(--ink);font-size:14px;line-height:1.45}
.pt-meta{flex-wrap:wrap;row-gap:4px}
.pt-pill{white-space:nowrap}

.pt-actions{display:flex;gap:8px;margin:0 0 16px}
.pt-actions .pt-record{flex:2 1 0;min-height:52px}
.pt-actions .pt-add{flex:1 1 0;padding:0 12px;background:transparent;color:var(--ink);border:1px solid var(--line)}
.pt-paste-dialog{box-sizing:border-box;width:min(560px,calc(100% - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:20px;border:1px solid var(--line);border-radius:18px;background:var(--panel);color:var(--ink)}
.pt-paste-dialog::backdrop{background:rgba(0,0,0,.5)}
.pt-paste-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
/* A sheet title, not the board's tracked-caps section label. Close is a plain text button, as on iOS sheets. */
.pt-paste-heading h2{margin:0;font-size:19px;font-weight:700;line-height:1.25;letter-spacing:-.2px;text-transform:none;color:var(--ink);overflow-wrap:anywhere}
.pt-paste-heading button{flex:0 0 auto;min-height:44px;padding:0 4px;background:transparent;border:0;color:var(--ink);font:inherit;font-size:17px;font-weight:600;cursor:pointer}
.pt-paste-dialog p{font-size:15px;line-height:1.45;color:var(--muted)}
.pt-paste-dialog textarea{box-sizing:border-box;width:100%;min-height:140px;max-height:40dvh;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--bg);color:var(--ink);font-family:inherit;font-size:16px;line-height:1.5;resize:vertical}
.pt-paste-dialog textarea:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.pt-paste-dialog .sm-error{color:var(--red)}
.pt-paste-dialog button:disabled{opacity:.45;cursor:default}
/* The Add a script sheet: header, box, then one row of actions, all kept on screen. The box gives up height first. */
#pt-paste-dialog[open]{display:flex;flex-direction:column;overflow:hidden;padding-top:10px}
#pt-paste-dialog:focus-visible{outline:none}
/* The 6px of room keeps focus rings from being clipped by the scroll box. */
#pt-paste-dialog form{display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:0;overflow-y:auto;margin:-6px;padding:6px}
#pt-paste-dialog p{margin:0;text-wrap:pretty}
#pt-paste-dialog p:empty{display:none}
#pt-paste-dialog textarea{flex:1 1 auto;min-height:96px;max-height:none}
.pt-paste-actions{display:flex;gap:10px}
.pt-paste-actions .pt-record{flex:1 1 auto;width:auto;min-height:50px}
.pt-paste-actions .pt-secondary{flex:0 0 auto;padding:0 20px;font-size:16px;background:transparent;color:var(--ink);border:1px solid var(--line)}
/* Instant press feedback (iOS waits for nothing): the button gives a little under the finger. */
.pt-record{transition:transform .1s ease-out}
.pt-record:active:not(:disabled){transform:scale(.97)}
@media(max-width:767px){
  /* A bottom sheet, like the Scripts editor. With the keyboard up, ptFitSheet sets --pt-kb/--pt-vh so the
     header clears the status bar and the actions sit on top of the keyboard and its accessory bar. */
  #pt-paste-dialog{inset:auto 0 var(--pt-kb,0px);width:100%;max-width:none;margin:0;max-height:calc(var(--pt-vh,100dvh) - env(safe-area-inset-top) - 12px);border-width:1px 0 0;border-radius:20px 20px 0 0;padding:10px 16px calc(16px + env(safe-area-inset-bottom))}
  #pt-paste-dialog[data-kb]{padding-bottom:12px}
}

.pt-filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 16px}
.pt-filters label{display:grid;gap:6px;min-width:0;font-size:13px;color:var(--muted)}
.pt-filters select,.pt-filters button{box-sizing:border-box;width:100%;min-width:0;height:48px;min-height:48px;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--ink);font:inherit;font-size:16px}
.pt-filters select:focus-visible,.pt-filters button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(max-width:767px){.pt-filters{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}
/* Search, iOS style: the magnifier inside, a 44pt clear button, 16px text so Safari never zooms. */
/* Search beside a Filters button; the chips and selects open under them (prompter-tab.js ptControls). */
.pt-search-row{display:flex;gap:8px;margin:0 0 12px}
.pt-search{position:relative;flex:1 1 auto;min-width:0}
.pt-filter-toggle{flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;height:48px;padding:0 14px;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--ink);font:inherit;font-size:15px;cursor:pointer;transition:transform .1s ease-out}
.pt-filter-toggle:active{transform:scale(.97)}
.pt-filter-toggle[aria-expanded="true"]{border-color:var(--accent)}
.pt-filter-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.pt-filter-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.pt-badge{min-width:20px;height:20px;padding:0 6px;box-sizing:border-box;border-radius:10px;background:var(--accent);color:var(--bg);font-size:12px;font-weight:700;line-height:20px;text-align:center}
.pt-badge[hidden]{display:none}
.pt-filter-panel{margin:0 0 14px;padding:12px;border:1px solid var(--line);border-radius:14px;background:var(--panel);animation:pt-open .18s ease-out}
.pt-filter-panel[hidden]{display:none}
.pt-filter-panel .pt-chips{margin:0 0 12px}
.pt-filter-panel .pt-filters{margin:0}
.pt-filter-panel .pt-filters select,.pt-filter-panel .pt-filters button{background:var(--bg)}
@keyframes pt-open{from{opacity:0;transform:translateY(-4px)}}
.pt-search::before{content:'';position:absolute;left:14px;top:50%;width:18px;height:18px;margin-top:-9px;background:var(--muted);pointer-events:none;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 20 20'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 20 20'/%3E%3C/svg%3E") center/contain no-repeat}
.pt-search input{box-sizing:border-box;width:100%;height:48px;min-height:48px;padding:0 46px 0 42px;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--ink);font:inherit;font-size:16px;-webkit-appearance:none;appearance:none}
.pt-search input::placeholder{color:var(--muted)}
.pt-search input::-webkit-search-cancel-button,.pt-search input::-webkit-search-decoration{-webkit-appearance:none;display:none}
.pt-search input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.pt-search-clear{position:absolute;top:2px;right:2px;display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;background:transparent;cursor:pointer}
.pt-search-clear[hidden]{display:none}
.pt-search-clear span{width:20px;height:20px;border-radius:50%;background:var(--muted);color:var(--panel);font-size:16px;font-weight:700;line-height:20px;text-align:center}
.pt-search-clear:focus-visible{outline:2px solid var(--accent);outline-offset:-4px;border-radius:12px}
.pt-count{margin:-4px 0 12px;color:var(--muted);font-size:13px}
.pt-count:empty{display:none}

.pt-paste-dialog [hidden]{display:none}

/* Emphasis colours (prompter.js paintEmphasis). Stress comes from the accent, pivots are a soft violet;
   both clear 4.5:1 on the card: dark 7.1 and 8.3, light 5.7 and 6.5. */
.pt-script .pe-stress{color:var(--accent)}
.pt-script .pe-pivot{color:#b3a1f7}
html.light .pt-script .pe-stress{color:#9e4f29}
html.light .pt-script .pe-pivot{color:#6545c2}
