/*! Satnam Siri WaheGuru Shaib Ji
 * texttools.css — Text Tools workbench. Reuses site tokens/header/footer from main.css. */

.tt-main { max-width: 1220px; padding-top: 24px; padding-bottom: 56px; }
.tt-main svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tt-head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.tt-head .tt-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 20px; flex: none; }
.tt-head h1 { margin: 0; font-size: 1.4rem; letter-spacing: -.02em; }
.tt-head .pill { margin-left: auto; }

.tt-layout { display: grid; grid-template-columns: 290px 1fr; gap: 22px; align-items: start; }

/* ---------- sidebar ---------- */
.tt-sidebar { background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px; padding: 14px; position: sticky; top: 82px; box-shadow: var(--shadow-sm); }
.tt-search { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 11px; padding: 9px 12px; margin-bottom: 14px; }
.tt-search svg { width: 17px; height: 17px; color: var(--faint); flex: none; }
.tt-search input { flex: 1; border: 0; background: transparent; outline: 0; color: var(--text); font: inherit; min-width: 0; }
.tt-search .kbd { font-size: .7rem; color: var(--muted); background: var(--bg-3); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.tt-seclabel { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; margin: 12px 4px 8px; }

.tt-tool { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 10px; background: none; border: 0; cursor: pointer; color: var(--text); }
.tt-tool:hover { background: var(--bg-3); }
.tt-tool.active { background: var(--accent-soft); }
.tt-tool.active .tt-name { color: var(--accent); }
.tt-badge { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-family: ui-monospace, monospace; font-weight: 700; font-size: .82rem; flex: none; }
.tt-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tt-name { font-weight: 620; font-size: .9rem; }
.tt-desc { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-star { width: 26px; height: 26px; border-radius: 7px; border: 0; background: none; color: var(--border); cursor: pointer; display: grid; place-items: center; flex: none; }
.tt-star:hover { color: var(--faint); }
.tt-star.on { color: var(--c-amber); }
.tt-star svg { width: 16px; height: 16px; }
.tt-star.on svg { fill: var(--c-amber); }

.tt-cat { border-top: 1px solid var(--border-2); }
.tt-cat-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 8px; background: none; border: 0; cursor: pointer; color: var(--text); font: inherit; }
.tt-cat-head .tt-cat-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; font-size: .72rem; font-weight: 800; font-family: ui-monospace, monospace; }
.tt-cat-head .tt-cat-label { flex: 1; text-align: left; font-weight: 650; font-size: .92rem; }
.tt-cat-head .tt-count { font-size: .74rem; color: var(--muted); background: var(--bg-3); border-radius: 999px; padding: 1px 8px; }
.tt-cat-head .tt-chev { width: 16px; height: 16px; color: var(--faint); transition: transform .15s; }
.tt-cat.open .tt-chev { transform: rotate(180deg); }
.tt-cat-body { display: none; padding-bottom: 6px; }
.tt-cat.open .tt-cat-body { display: block; }
.tt-cat-body .tt-tool { padding: 7px 10px; }
.tt-cat-body .tt-badge { width: 28px; height: 28px; font-size: .74rem; }

/* category colours (badges + cat icons) */
.cat-formatting { background: color-mix(in srgb, var(--c-purple) 15%, transparent); color: var(--c-purple); }
.cat-cleaning   { background: color-mix(in srgb, var(--c-blue) 15%, transparent);   color: var(--c-blue); }
.cat-encoding   { background: color-mix(in srgb, var(--c-amber) 18%, transparent);  color: var(--c-amber); }
.cat-extraction { background: color-mix(in srgb, var(--c-green) 16%, transparent);  color: var(--c-green); }
.cat-conversion { background: color-mix(in srgb, var(--accent) 15%, transparent);   color: var(--accent); }
.cat-fun        { background: color-mix(in srgb, var(--c-rose) 15%, transparent);   color: var(--c-rose); }

/* ---------- main ---------- */
.tt-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tt-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); }
.tt-card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.tt-card-head h2 { margin: 0; font-size: 1.05rem; letter-spacing: -.01em; }
.tt-card-head .tt-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tt-mini { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-2); color: var(--muted); font-size: .82rem; font-weight: 600; cursor: pointer; }
.tt-mini:hover { color: var(--text); border-color: var(--accent); }
.tt-mini svg { width: 15px; height: 15px; }
.tt-mini.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.tt-mini.copied { color: var(--ok); border-color: var(--ok); }

textarea.tt-area { width: 100%; margin: 14px 0 0; padding: 14px 18px 16px; border: 0; background: transparent; color: var(--text);
  font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .95rem; line-height: 1.55; resize: vertical; min-height: 190px; outline: 0; display: block; }
.tt-out { padding: 14px 18px 18px; }
.tt-out pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, monospace; font-size: .95rem; line-height: 1.55; color: var(--text); }
.tt-out .tt-empty { text-align: center; color: var(--faint); padding: 30px; border: 1.5px dashed var(--border); border-radius: 12px; font-size: .9rem; }
.tt-out .tt-empty svg { width: 40px; height: 40px; display: block; margin: 0 auto 10px; opacity: .7; }
.tt-out .tt-err { color: var(--c-red); font-size: .9rem; }

/* read-aloud control */
.tt-speak { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 0 18px 14px; }
.tt-speak select { font: inherit; font-size: .82rem; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; max-width: 170px; }
.tt-speak input[type=range] { width: 90px; }

/* stats bar */
.tt-statbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; padding: 13px 18px; }
.tt-statbar .tt-detect { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--accent); }
.tt-statbar .tt-detect svg { width: 16px; height: 16px; }
.tt-statbar .s { color: var(--muted); font-size: .9rem; }
.tt-statbar .s b { color: var(--text); font-weight: 650; }
.tt-statbar .dot { color: var(--faint); }
.tt-statbar .tt-morebtn { margin-left: auto; color: var(--accent); font-weight: 600; font-size: .85rem; background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.tt-morebtn svg { width: 14px; height: 14px; transition: transform .15s; }
.tt-statmore { display: none; grid-template-columns: repeat(3, 1fr); gap: 16px 24px; padding: 4px 18px 18px; border-top: 1px solid var(--border-2); margin-top: 2px; }
.tt-statmore.open { display: grid; }
.tt-statmore .k { font-size: .78rem; color: var(--muted); }
.tt-statmore .v { font-weight: 650; font-size: 1.02rem; }
.tt-chipwords { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tt-chipwords span { font-size: .78rem; background: var(--bg-3); border: 1px solid var(--border-2); border-radius: 999px; padding: 2px 9px; color: var(--muted); }

/* suggestions */
.tt-suggest-wrap { }
.tt-suggest-wrap h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 2px 2px 10px; }
.tt-suggest { display: flex; gap: 10px; flex-wrap: wrap; }
.tt-chip { display: inline-flex; align-items: center; gap: 9px; padding: 10px 14px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg-2); cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--text); box-shadow: var(--shadow-sm); }
.tt-chip:hover { border-color: var(--accent); }
.tt-chip.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tt-chip .tt-badge { width: 26px; height: 26px; font-size: .72rem; }

/* selected tool card (doubles as the mobile bottom bar) */
#tt-toolcard[data-empty="1"] { display: none; }   /* desktop: nothing to show until a tool is picked */
.tt-tc-top { display: flex; align-items: center; gap: 14px; padding: 18px; }
.tt-tc-top .tt-badge { width: 46px; height: 46px; font-size: 1rem; }
.tt-tc-top .tt-tc-info { flex: 1; min-width: 0; }
.tt-tc-top h3 { margin: 0; font-size: 1.1rem; letter-spacing: -.01em; }
.tt-tc-top p { margin: 3px 0 0; color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-change { display: none; }   /* mobile-only: on desktop the sidebar is always visible */
.tt-iconbtn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-2); color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.tt-iconbtn:hover { color: var(--accent); border-color: var(--accent); }
.tt-deselect:hover { color: var(--c-red); border-color: var(--c-red); }   /* clear is the destructive one */
.tt-iconbtn svg { width: 16px; height: 16px; }
/* "Choose a tool" call to action — the empty state of the bottom bar (discoverable, not hidden) */
.tt-choose { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 16px; border: 0; background: none; cursor: pointer; color: var(--text); text-align: left; font: inherit; }
.tt-choose > svg:first-child { width: 22px; height: 22px; color: var(--accent); flex: none; }
.tt-choose-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tt-choose-tt b { font-size: .98rem; font-weight: 650; }
.tt-choose-tt small { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-choose > svg:last-child { width: 18px; height: 18px; color: var(--faint); flex: none; }
.tt-tc-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; padding: 0 18px 18px; border-top: 1px solid var(--border-2); margin-top: 2px; padding-top: 16px; }
.tt-field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 200px; }
.tt-field label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.tt-field input[type=text] { font: inherit; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); color: var(--text); }
.tt-field input:focus, .tt-tc-opts select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tt-opt { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.tt-opt select { font: inherit; font-size: .85rem; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.tt-toggle { position: relative; width: 40px; height: 23px; cursor: pointer; }
.tt-toggle input { position: absolute; opacity: 0; }
.tt-toggle .tk { position: absolute; inset: 0; border-radius: 99px; background: var(--bg-3); border: 1px solid var(--border); transition: background .15s; }
.tt-toggle .tk::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.tt-toggle input:checked ~ .tk { background: var(--accent); border-color: var(--accent); }
.tt-toggle input:checked ~ .tk::after { transform: translateX(17px); }

/* mobile drawer */
.tt-drawer-btn, .tt-drawer-close, .tt-scrim { display: none; }

@media (max-width: 900px) {
  .tt-layout { grid-template-columns: 1fr; }
  .tt-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 300px; max-width: 86vw; z-index: 60; border-radius: 0; overflow-y: auto; transform: translateX(-102%); transition: transform .22s; }
  .tt-sidebar.open { transform: none; }
  .tt-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .tt-scrim.open { opacity: 1; pointer-events: auto; }
  .tt-drawer-close { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-2); color: var(--muted); margin-left: auto; cursor: pointer; }
  .tt-drawer-close svg { width: 18px; height: 18px; }
  .tt-statmore.open { grid-template-columns: 1fr 1fr; }
  /* the tool card floats as a sticky bottom bar and appears last (after output);
     the CTA shows even when no tool is picked, so tools are always discoverable */
  #tt-toolcard { order: 5; position: sticky; bottom: 8px; margin-top: 40px; z-index: 40; box-shadow: 0 -1px 12px rgba(0,0,0,.30); }
  #tt-toolcard[data-empty="1"] { display: block; }
  .tt-change { display: grid; }               /* icon-only change button (matches .tt-iconbtn) */
  .tt-tc-info p { display: none; }            /* description clutters the compact bar; still shown in the tool menu */
  .tt-tc-top { padding: 12px 14px; gap: 10px; }
  .tt-tc-top .tt-badge { width: 38px; height: 38px; font-size: .9rem; }
  .tt-tc-opts { padding: 12px 14px 14px; }
}
@media (max-width: 520px) {
  .tt-card-head { flex-wrap: wrap; }
  .tt-statmore.open { grid-template-columns: 1fr; }
  .tt-tc-top { flex-wrap: wrap; }
}
/* hayerapps · v0.1.0 */
