/* FOURMI THINK — Personal: montar o treino (A/B/C), biblioteca e modelos. Carvão e dourado. */
.trw-dialog{--trw-ink:#141a17;--trw-muted:#5c6660;--trw-line:#e6e0d2;--trw-paper:#fffdf8;--trw-cream:#f8f5ee;--trw-gold:#e6ad3e;--trw-deep:#121916}
.trw-dialog,.trw-card{color:var(--trw-ink,#141a17)}
:is(.trw-dialog,.trw-card) svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.trw-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Cartão na ficha */
.trw-open{display:flex;align-items:center;justify-content:center;gap:8px;min-height:46px;border:0;border-radius:14px;background:#121916;color:#fff;font-weight:800;cursor:pointer}
.trw-open.is-gold{background:linear-gradient(110deg,#eab248,#f5d26f 60%,#e2aa3b);color:#1b1407}
.trw-mini-tabs{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none}
.trw-mini-tabs::-webkit-scrollbar{display:none}
.trw-mini-tabs button{flex:none;display:flex;align-items:center;gap:6px;min-height:38px;padding:0 12px 0 6px;border:1px solid #e6e0d2;border-radius:12px;background:#fff;color:#141a17;font-size:.8rem;font-weight:700;cursor:pointer;max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.trw-mini-tabs b{display:grid;place-items:center;width:26px;height:26px;border-radius:8px;background:#121916;color:#e6ad3e;font-size:.78rem}

/* Tela cheia */
.trw-dialog{width:min(100%,560px);max-width:100%;height:100dvh;max-height:100dvh;margin:0 auto;padding:0;border:0;background:var(--trw-cream);display:none;flex-direction:column;overflow:hidden}
.trw-dialog[open]{display:flex}
.trw-dialog::backdrop{background:rgba(11,16,14,.55)}
@media(min-width:600px){.trw-dialog{height:calc(100dvh - 32px);max-height:860px;margin:16px auto;border-radius:26px;box-shadow:0 30px 70px rgba(11,16,14,.4)}}
.trw-head{flex:none;display:grid;gap:8px;padding:max(14px,env(safe-area-inset-top,0px)) 16px 12px;background:radial-gradient(120% 90% at 100% 0,#2a3a1c66,transparent 55%),linear-gradient(180deg,#1b241f,#0b100e);color:#f6f3ea}
.trw-back{justify-self:start;display:flex;align-items:center;gap:4px;min-height:40px;max-width:100%;padding:0 10px 0 4px;border:0;border-radius:12px;background:rgba(255,255,255,.08);color:#f6f3ea;font-weight:700;cursor:pointer}
.trw-back span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.trw-name{width:100%;min-width:0;min-height:44px;padding:4px 8px;margin:0 -8px;border:1px solid transparent;border-radius:12px;background:transparent;color:#fff;font:inherit;font-size:1.35rem;font-weight:800;letter-spacing:-.01em}
.trw-name::placeholder{color:#c9cfc8;font-weight:600}
.trw-name:hover,.trw-name:focus{border-color:rgba(230,173,62,.5);background:rgba(255,255,255,.06);outline:none}
.trw-meta{justify-self:start;max-width:100%;min-height:32px;padding:0;border:0;background:none;color:#e1e6df;font-size:.84rem;text-align:left;text-decoration:underline dotted rgba(230,173,62,.7);text-underline-offset:4px;cursor:pointer}
.trw-adjust{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.trw-adjust label{display:grid;gap:4px;font-size:.72rem;font-weight:700;color:#d6dcd4;min-width:0}
.trw-adjust input{width:100%;min-width:0;min-height:40px;padding:6px 8px;border:1px solid rgba(255,255,255,.2);border-radius:10px;background:rgba(255,255,255,.08);color:#fff;font:inherit;color-scheme:dark}
.trw-tabs{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;margin:2px -16px 0;padding:0 16px}
.trw-tabs::-webkit-scrollbar{display:none}
.trw-tabs button{flex:none;min-height:40px;max-width:180px;padding:0 13px;border:1px solid rgba(255,255,255,.16);border-radius:12px;background:rgba(255,255,255,.06);color:#e7ebe5;font-weight:700;font-size:.84rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.trw-tabs button[aria-selected="true"]{border-color:transparent;background:#e6ad3e;color:#1b1407}
.trw-tabs .trw-tab-add{display:grid;place-items:center;width:40px;padding:0;border-style:dashed}

.trw-body{flex:1;min-height:0;overflow-y:auto;display:grid;align-content:start;gap:12px;padding:14px 16px 20px;-webkit-overflow-scrolling:touch}
.trw-wh{display:flex;align-items:center;gap:8px}
.trw-wh h3{flex:none;margin:0;font-size:1rem}
.trw-focus{flex:1;min-width:0;min-height:38px;padding:6px 10px;border:1px solid var(--trw-line);border-radius:10px;background:#fff;color:var(--trw-ink);font:inherit;font-size:.9rem}
.trw-list{display:grid;gap:2px}
.trw-ex{display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:center;gap:10px;width:100%;min-height:58px;padding:8px 2px;border:0;border-bottom:1px solid #efe9dc;background:none;color:var(--trw-ink);text-align:left;cursor:pointer}
.trw-ex.is-open{border-bottom-color:transparent}
.trw-num{display:grid;place-items:center;width:28px;height:28px;border-radius:9px;background:#121916;color:#e6ad3e;font-size:.8rem;font-weight:800}
.trw-ex-main{display:grid;gap:2px;min-width:0}
.trw-ex-main b{font-size:.92rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.trw-ex-main small{color:var(--trw-muted);font-size:.78rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.trw-load{padding:4px 9px;border-radius:999px;background:#fbf0d2;color:#6d4a00;font-size:.78rem;font-weight:800;white-space:nowrap}
.trw-ex-edit{display:grid;gap:10px;margin:0 0 8px;padding:12px;border-radius:14px;background:var(--trw-cream)}
.trw-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.trw-ex-edit label{display:grid;gap:4px;font-size:.72rem;font-weight:800;color:var(--trw-muted);min-width:0}
.trw-ex-edit input{width:100%;min-width:0;min-height:42px;padding:6px 9px;border:1px solid #d9d2c1;border-radius:10px;background:#fff;color:var(--trw-ink);font:inherit;font-size:.92rem}
.trw-ex-tools{display:flex;gap:6px}
.trw-ex-tools button{display:grid;place-items:center;min-width:42px;min-height:42px;border:1px solid var(--trw-line);border-radius:12px;background:#fff;color:var(--trw-ink);cursor:pointer}
.trw-ex-tools button:disabled{opacity:.35;cursor:default}
.trw-ex-tools .is-danger{color:#b24a3c}
.trw-ex-tools .trw-done{flex:1;border:0;background:#121916;color:#fff;font-weight:800}
.trw-add{display:flex;align-items:center;justify-content:center;gap:8px;min-height:46px;border:1px dashed #d8c08a;border-radius:14px;background:#fffaf0;color:#6d4a00;font-weight:800;cursor:pointer}
.trw-remove-w{justify-self:center;min-height:36px;border:0;background:none;color:#b24a3c;font-size:.8rem;font-weight:700;cursor:pointer}
.trw-start p{margin:0;color:var(--trw-muted)}
.trw-templates h4{margin:4px 0 0;font-size:.78rem;color:var(--trw-muted);letter-spacing:.06em;text-transform:uppercase}
.trw-chips{display:flex;flex-wrap:wrap;gap:6px}
.trw-chips.is-scroll{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin:0 -16px;padding:0 16px}
.trw-chips.is-scroll::-webkit-scrollbar{display:none}
.trw-chips button{flex:none;display:flex;align-items:center;gap:6px;min-height:38px;padding:0 13px;border:1px solid var(--trw-line);border-radius:999px;background:#fff;color:var(--trw-ink);font-weight:700;font-size:.82rem;cursor:pointer}
.trw-chips button[aria-pressed="true"]{border-color:var(--trw-deep);background:var(--trw-deep);color:#fff}
.trw-chips svg{width:16px;height:16px;color:#b07f1c}
.trw-mine{display:flex;align-items:center;border:1px solid var(--trw-line);border-radius:999px;background:#fff}
.trw-mine button{border:0!important;background:none!important}
.trw-mine .trw-x{min-height:38px;padding:0 10px 0 4px;color:var(--trw-muted)}
.trw-confirm{display:grid;gap:10px;padding:14px;border:1px solid #ecd29a;border-radius:16px;background:#fffaf0}
.trw-confirm p{margin:0;font-weight:700}
.trw-confirm div{display:flex;gap:8px}

.trw-lib{display:grid;gap:10px;min-width:0}
.trw-lib-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.trw-lib-head h3{margin:0;font-size:1rem}
.trw-search{display:flex;align-items:center;gap:8px;min-height:46px;padding:0 12px;border:1px solid var(--trw-line);border-radius:14px;background:#fff;color:var(--trw-muted)}
.trw-search input{flex:1;min-width:0;min-height:44px;border:0;background:none;color:var(--trw-ink);font:inherit;font-size:.95rem;outline:none}
.trw-added{min-height:1.2em;margin:0;color:#3f7a1f;font-size:.82rem;font-weight:800}
.trw-lib-list{display:grid;gap:6px}
.trw-lib-item{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:54px;padding:8px 12px;border:1px solid var(--trw-line);border-radius:14px;background:var(--trw-paper);color:var(--trw-ink);text-align:left;cursor:pointer}
.trw-lib-item span{display:grid;gap:2px;min-width:0}
.trw-lib-item small{color:var(--trw-muted);font-size:.76rem}
.trw-lib-item>svg{color:#b07f1c}
.trw-lib-item.is-in{border-color:#c8e3ad;background:#f3f9ec}
.trw-lib-item.is-in>svg{color:#3f7a1f}
.trw-lib-item.is-create{justify-content:flex-start;border-style:dashed;border-color:#d8c08a;background:#fffaf0}

.trw-foot{flex:none;display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px;padding:10px 16px max(12px,env(safe-area-inset-bottom,0px));border-top:1px solid var(--trw-line);background:var(--trw-paper)}
.trw-btn{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 16px;border:1px solid var(--trw-line);border-radius:14px;background:#fff;color:var(--trw-ink);font-weight:800;cursor:pointer;min-width:0}
.trw-btn span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.trw-btn.is-dark{border:0;background:var(--trw-deep);color:#fff}
.trw-btn.is-gold{border:0;background:linear-gradient(110deg,#eab248,#f5d26f 60%,#e2aa3b);color:#1b1407}
.trw-confirm .trw-btn{flex:1;min-height:42px}
.trw-lib-head .trw-btn{min-height:40px}
@media(max-width:359px){.trw-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.trw-adjust{grid-template-columns:1fr 1fr}.trw-adjust label:last-child{grid-column:1/-1}.trw-head{padding-inline:12px}.trw-body{padding-inline:12px}.trw-tabs{margin-inline:-12px;padding-inline:12px}}
@media(prefers-reduced-motion:reduce){.trw-dialog *{transition:none!important}}
.trw-dialog :is(input,select,textarea){margin:0;box-sizing:border-box}
.trw-search input{height:44px;padding:0;line-height:44px}
.trw-grid{align-items:end}
.trw-name::placeholder{color:#8d968e;font-weight:600}
@media(max-width:359px){.trw-foot .trw-btn:first-child{padding:0 14px}.trw-foot .trw-btn:first-child span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}}
