/* ==========================================================================
   CHARACTER COUNTER — ch.css
   ========================================================================== */
*,*::before,*::after{box-sizing:border-box;}
input,textarea,select,button{font-family:var(--font-body,inherit);font-size:inherit;color:inherit;}

.ucv-tool{display:flex;flex-direction:column;gap:1rem;padding:1.25rem;width:100%;max-width:820px;margin:0 auto;}

/* category tabs */

/* inputs */
.ucv-field{display:flex;flex-direction:column;gap:0.3rem;min-width:0;}
.ucv-field>label,.ucv-label{font-size:0.72rem;font-weight:600;letter-spacing:0.05em;text-transform:uppercase;color:var(--text-muted,rgba(255,255,255,0.45));}
.ucv-input,.ucv-select{width:100%;height:46px;color:var(--text-primary,#fff);background:rgba(255,255,255,.06);border:0.5px solid var(--glass-border,rgba(255,255,255,0.14));border-radius:var(--radius-sm,8px);padding:0 0.8em;font-size:1rem;}
.ucv-select{appearance:none;-webkit-appearance:none;cursor:pointer;text-overflow:ellipsis;padding-right:2em;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ffffff99' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 0.8em center;}
.ucv-select option{background:#15131f;color:#fff;}
.ucv-input:focus,.ucv-select:focus{outline:none;border-color:var(--accent,#c084fc);box-shadow:0 0 0 2px rgba(192,132,252,0.15);}

.ucv-note{font-size:0.78rem;color:var(--text-muted,rgba(255,255,255,0.55));line-height:1.4;margin:0;text-align:center;}
#ucv-error{display:none;color:#f87171;font-size:0.82rem;padding:0.45rem 0.7rem;background:rgba(248,113,113,0.08);border:0.5px solid rgba(248,113,113,0.25);border-radius:var(--radius-sm,8px);}

/* result */

/* all units */

.ucv-security-note{font-size:0.7rem;color:var(--text-muted,rgba(255,255,255,0.3));line-height:1.4;text-align:center;margin:0;}


/* ── USP pills — force single row, no wrap, correct font size ──────────── */
.u-usp-row{flex-wrap:nowrap !important;gap:0.35rem !important;justify-content:center;}
.u-usp-pill{white-space:nowrap;padding:0.28em 0.75em !important;}
@media (max-width: 600px){.u-usp-row{flex-wrap:wrap !important;}}
@media (max-width: 440px) {
  .u-nav .u-container { gap: .4rem; }
  .u-nav .u-brand { gap: .25em; }
  .u-nav .u-brand-prefix { font-size: .7rem; letter-spacing: .1em; }
  .u-nav .u-brand-name { font-size: .92rem; }
}
@media (max-width: 340px) {
  .u-nav .u-brand-prefix { font-size: .6rem; letter-spacing: .06em; }
  .u-nav .u-brand-name { font-size: .78rem; }
}

main{overflow-x:clip!important;}

/* ── Character counter ── */
.ucv-tool{gap:1.1rem;}
.chv-ta{width:100%;min-height:220px;resize:vertical;height:auto;padding:0.85rem 0.95rem;line-height:1.5;font-size:1rem;display:block;}
.chv-acts{display:flex;gap:0.5rem;flex-wrap:wrap;justify-content:space-between;}
.chv-acts .u-btn{height:40px;font-size:0.86rem;padding:0 1.1em;}
.chv-acts .u-btn:disabled{opacity:.45;cursor:default;}
.chv-stats{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0.55rem;}
.chv-stat{display:flex;flex-direction:column;gap:0.15rem;padding:0.7rem 0.8rem;border-radius:var(--radius-sm,8px);background:rgba(255,255,255,0.04);border:0.5px solid rgba(255,255,255,0.1);min-width:0;text-align:left;}
.chv-stat.is-main{background:rgba(192,132,252,0.08);border-color:rgba(192,132,252,0.4);}
.chv-v{font-size:clamp(1.25rem,3.4vw,1.75rem);font-weight:800;color:#fff;line-height:1.15;word-break:break-word;font-variant-numeric:tabular-nums;}
.chv-l{font-size:0.7rem;font-weight:600;letter-spacing:0.05em;text-transform:uppercase;color:var(--text-muted,rgba(255,255,255,0.5));}
.chv-limit{display:flex;flex-direction:column;gap:0.5rem;}
.chv-lim-row{display:flex;gap:0.6rem;align-items:flex-end;flex-wrap:wrap;}
.chv-lim-row .ucv-field{flex:1 1 240px;}
.chv-lim-row .ucv-input{flex:0 0 120px;width:120px;}
.chv-bar{height:10px;border-radius:999px;background:rgba(255,255,255,0.1);overflow:hidden;}
.chv-bar-fill{height:100%;width:0;background:linear-gradient(90deg,#a855f7,#c084fc);border-radius:999px;transition:width .15s;}
.chv-bar.is-over .chv-bar-fill{background:#f87171;}
.chv-bar-txt{font-size:0.82rem;color:var(--text-secondary,rgba(255,255,255,0.75));margin:0;}
.chv-bar.is-over+.chv-bar-txt{color:#fca5a5;}
.chv-det{border:0.5px solid rgba(255,255,255,0.1);border-radius:var(--radius-sm,8px);background:rgba(255,255,255,0.03);}
.chv-det>summary{cursor:pointer;padding:0.7rem 0.9rem;font-weight:600;font-size:0.9rem;list-style:none;display:flex;justify-content:space-between;align-items:center;gap:.6rem;}
.chv-det>summary::-webkit-details-marker{display:none;}
.chv-det>summary::after{content:"+";font-size:1.2rem;line-height:1;color:var(--text-muted,rgba(255,255,255,0.6));}
.chv-det[open]>summary::after{content:"−";}
.chv-det-body{padding:0 0.9rem 0.9rem;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem 1.2rem;text-align:left;}
.chv-dl{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:0.35rem;}
.chv-dl li{display:flex;justify-content:space-between;gap:0.8rem;font-size:0.88rem;border-bottom:0.5px solid rgba(255,255,255,0.06);padding-bottom:0.3rem;min-width:0;}
.chv-dl li span:first-child{color:var(--text-muted,rgba(255,255,255,0.6));}
.chv-dl li span:last-child,.chv-top-n{font-weight:700;color:#fff;font-variant-numeric:tabular-nums;text-align:right;word-break:break-word;}
.chv-top-w{word-break:break-word;min-width:0;}
.chv-top-empty{color:var(--text-muted,rgba(255,255,255,0.5));font-size:0.85rem;border:0!important;}
.chv-h{font-size:0.72rem;font-weight:600;letter-spacing:0.05em;text-transform:uppercase;color:var(--text-muted,rgba(255,255,255,0.45));margin:0 0 0.5rem;}
@media(max-width:700px){
  .chv-stats{grid-template-columns:repeat(2,minmax(0,1fr));}
  .chv-det-body{grid-template-columns:minmax(0,1fr);}
  .ucv-tool{padding:1rem;}
  .chv-lim-row .ucv-input{flex:1 1 100%;width:100%;}
  .chv-acts .u-btn{flex:1;}
}

/* ── v2 additions ── */
.chv-acts{align-items:stretch;}
.chv-acts-g{display:flex;gap:0.45rem;flex-wrap:wrap;}
.chv-acts .u-btn{height:38px;font-size:0.82rem;padding:0 0.95em;white-space:nowrap;}
.chv-chips{display:flex;flex-wrap:wrap;gap:0.4rem;margin:0 0 0.2rem;}
.chv-chip,.chv-tab{height:34px;padding:0 0.85em;border-radius:999px;border:0.5px solid rgba(255,255,255,0.18);background:rgba(255,255,255,0.05);color:var(--text-secondary,rgba(255,255,255,0.8));font-size:0.82rem;font-weight:600;cursor:pointer;white-space:nowrap;}
.chv-chip:hover,.chv-tab:hover{background:rgba(255,255,255,0.1);}
.chv-chip.is-on,.chv-tab.is-on{background:rgba(192,132,252,0.22);border-color:rgba(192,132,252,0.7);color:#fff;}
.chv-chip:focus-visible,.chv-tab:focus-visible{outline:2px solid var(--accent,#c084fc);outline-offset:2px;}
.chv-tabs{display:flex;flex-wrap:wrap;gap:0.35rem;margin:0 0 0.6rem;}
.chv-tab{height:30px;font-size:0.76rem;}
.chv-chk{display:flex;align-items:center;gap:0.55rem;font-size:0.84rem;color:var(--text-secondary,rgba(255,255,255,0.8));cursor:pointer;text-align:left;margin:0 0 0.5rem;}
.chv-chk input{width:18px;height:18px;flex:0 0 18px;accent-color:#a855f7;}
.chv-lim-row .chv-unit{flex:0 0 130px;width:130px;}
.chv-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}
.chv-tools{padding:0 0.9rem 0.9rem;display:flex;flex-wrap:wrap;gap:0.4rem;}
.chv-tools .u-btn{height:34px;font-size:0.78rem;padding:0 0.85em;}
.chv-tools .u-btn:disabled{opacity:.45;cursor:default;}
.chv-det[open]>summary{padding-bottom:0.5rem;}
.chv-top-w{flex:1;}
@media(max-width:700px){
  .chv-acts{flex-direction:column;}
  .chv-acts-g .u-btn{flex:1 1 auto;}
  .chv-lim-row .chv-unit{flex:1 1 100%;width:100%;}
}
