/* ==========================================================================
   ToolCMB — Percentage Calculator (extends /assets/css/style.css design tokens)
   ==========================================================================
   01. Page & hero            05. Inputs (sentence & grid)   09. Panels (history, settings)
   02. App shell & ask box    06. Result                     10. Content blocks
   03. Calculator list        07. Visuals                    11. Toasts, language
   04. Cards                  08. Steps                      12. Responsive · 13. Contrast
   ========================================================================== */

/* ---------- 01. Page & hero --------------------------------------------- */
.pc-hero { position: relative; padding: 32px 0 18px; isolation: isolate; overflow: hidden; }
.pc-hero .hero-bg { opacity: .8; }
.pc-hero .breadcrumbs ol { margin-bottom: 20px; }
.pc-hero .breadcrumbs .icon { width: 16px; height: 16px; }
.pc-hero-head { display: flex; align-items: center; gap: 18px; }
.pc-hero-head h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -.03em; }
.pc-hero-head .lead { margin: 6px 0 0; font-size: 1.05rem; max-width: 860px; }
.pc-trust { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.pc-trust li {
    display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border); font-size: .85rem; font-weight: 550; color: var(--text-2);
}
.pc-trust .icon { color: var(--primary); }
.pc-tool { padding: 6px 0 64px; scroll-margin-top: var(--header-h, 68px); }
.pc-blocked { margin-bottom: 16px; padding: 18px 20px; border-radius: var(--radius-lg); background: rgba(220, 38, 38, .08); border: 1px solid rgba(220, 38, 38, .25); }
.pc-blocked p { margin: 6px 0 0; }

/* ---------- 02. App shell & ask box ------------------------------------- */
.pc-app { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.pc-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 14px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--primary-soft), transparent 140%); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.pc-ask { position: relative; display: flex; align-items: center; min-width: 0; }
.pc-ask-ico { position: absolute; left: 14px; display: grid; color: var(--primary-dark); pointer-events: none; }
.pc-ask-ico .icon { width: 20px; height: 20px; }
.pc-ask-in {
    width: 100%; height: 52px; padding: 0 44px 0 44px; border: 1.5px solid var(--border-strong); border-radius: 14px; background: var(--surface); color: var(--text);
    font: inherit; font-size: 1.02rem; font-weight: 550; outline: none; transition: border-color .15s, box-shadow .15s;
}
.pc-ask-in::placeholder { color: var(--muted); font-weight: 450; }
.pc-ask-in:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.pc-ask-kbd { position: absolute; right: 12px; }
.pc-ask-in:focus + .pc-ask-kbd { display: none; }
.pc-bar { display: flex; align-items: center; gap: 8px; }
.pc-viewsw { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border); }
.pc-vbtn, .pc-tbtn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 12px; border: 0; border-radius: 10px;
    background: none; color: var(--text-2); font: inherit; font-size: .86rem; font-weight: 650; white-space: nowrap; cursor: pointer; transition: background-color .15s, color .15s, box-shadow .15s;
}
.pc-vbtn { height: 40px; }
.pc-vbtn .icon, .pc-tbtn .icon { width: 17px; height: 17px; }
.pc-vbtn:hover, .pc-tbtn:hover { color: var(--text); }
.pc-vbtn[aria-pressed="true"] { background: var(--surface); color: var(--link); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--primary-ring); }
.pc-tbtn { height: 46px; border: 1px solid var(--border); background: var(--surface); }
.pc-tbtn[aria-expanded="true"] { border-color: var(--primary); color: var(--link); background: var(--primary-soft); }
.pc-vbtn:focus-visible, .pc-tbtn:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 2px; }
.pc-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary-soft); color: var(--link); font-size: .72rem; font-weight: 750; line-height: 20px; text-align: center; }
.pc-count[hidden] { display: none; }
.pc-ask-out { grid-column: 1 / -1; min-height: 34px; }
.pc-ask-ex { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pc-ask-ex[hidden], .pc-ask-ans[hidden] { display: none; }
.pc-ask-lbl { margin-right: 2px; font-size: .76rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pc-qc {
    display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-2); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s;
}
.pc-qc:hover { border-color: var(--primary); color: var(--link); }
.pc-qc:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 2px; }
.pc-ask-hit {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; width: 100%; padding: 10px 14px; border: 1px solid var(--primary-ring); border-radius: 12px;
    background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; animation: pop .16s var(--ease);
}
.pc-ask-hit:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pc-ask-hit:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 2px; }
.pc-ask-val { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pc-ask-sum { flex: 1 1 240px; color: var(--text-2); font-size: .92rem; }
.pc-ask-go { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--link); font-size: .82rem; font-weight: 700; }
.pc-ask-none { margin: 4px 2px; font-size: .88rem; color: var(--muted); }
.pc-app kbd { font: 650 .72rem var(--font); padding: 2px 7px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }

.pc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 520px; background: linear-gradient(90deg, var(--surface-2) 250px, transparent 250px); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ---------- 03. Calculator list ----------------------------------------- */
.pc-nav {
    position: sticky; top: var(--header-h, 68px); align-self: start; max-height: calc(100vh - var(--header-h, 68px)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
    padding: 12px 10px 16px; border-right: 1px solid var(--border); min-height: 100%;
}
.pc-nav-search { position: relative; display: flex; align-items: center; margin: 0 2px 10px; }
.pc-nav-search .icon { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.pc-nav-search input { width: 100%; height: 36px; padding: 0 10px 0 32px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: .85rem; outline: none; }
.pc-nav-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.pc-nav-group { margin-top: 10px; }
.pc-nav-group[hidden] { display: none; }
.pc-nav-title { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; padding: 0 10px; font-size: .7rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.pc-nav-title .icon { width: 13px; height: 13px; color: #D97706; fill: currentColor; }
.pc-nav ul { margin: 0; padding: 0; list-style: none; }
.pc-nav li[hidden] { display: none; }
.pc-nav-link {
    display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 9px; color: var(--text-2); font-size: .88rem; font-weight: 560; line-height: 1.3;
    text-decoration: none !important; transition: background-color .12s, color .12s;
}
.pc-nav-link .icon { width: 16px; height: 16px; flex: none; color: var(--muted); }
.pc-nav-link:hover { background: var(--surface); color: var(--text); }
.pc-nav-link[aria-current="true"] { background: var(--surface); color: var(--link); font-weight: 700; box-shadow: var(--shadow-sm), inset 3px 0 0 var(--primary); }
.pc-nav-link[aria-current="true"] .icon { color: var(--primary-dark); }
.pc-nav-link:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: -1px; }

/* ---------- 04. Cards ---------------------------------------------------- */
.pc-cards { display: flex; flex-direction: column; min-width: 0; padding: 18px; gap: 18px; }
.pc-card { position: relative; min-width: 0; scroll-margin-top: calc(var(--header-h, 68px) + 12px); }
.pc-card[hidden] { display: none; }
.pc-app[data-view="all"] .pc-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; background: var(--surface-2); }
.pc-app[data-view="all"] .pc-card { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.pc-app[data-view="all"] .pc-card.is-active { border-color: var(--primary-ring); }
.pc-card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.pc-card-head .tile { flex: none; }
.pc-card-titles { flex: 1; min-width: 0; }
.pc-card-title { margin: 0; font-size: 1.22rem; letter-spacing: -.02em; line-height: 1.3; }
.pc-card-desc { margin: 3px 0 0; font-size: .88rem; color: var(--muted); }
.pc-card-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.pc-app[data-view="all"] .pc-card-title { font-size: 1.02rem; }
.pc-app[data-view="all"] .pc-card-desc { display: none; }
.pc-app[data-view="all"] .pc-card-head { margin-bottom: 12px; align-items: center; }
.pc-tb {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; min-width: 34px; padding: 0 10px; border: 1px solid transparent; border-radius: 9px;
    background: none; color: var(--text-2); font: inherit; font-size: .82rem; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color .15s, color .15s;
}
.pc-tb .icon { width: 16px; height: 16px; flex: none; }
.pc-tb:hover { background: var(--surface-2); color: var(--text); }
.pc-tb:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 1px; }
.pc-tb--icon { width: 34px; padding: 0; }
.pc-star[aria-pressed="true"] .icon, .pc-star-sm[aria-pressed="true"] .icon { color: #D97706; fill: #FBBF24; }
.pc-app[data-view="all"] .pc-card-tools .pc-tb span { display: none; }
.pc-app[data-view="all"] .pc-card-tools .pc-tb { width: 32px; padding: 0; }

.pc-card-body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pc-app[data-view="all"] .pc-card-body { grid-template-columns: minmax(0, 1fr); gap: 12px; }

/* ---------- 05. Inputs --------------------------------------------------- */
.pc-form { min-width: 0; margin: 0; }
.pc-sentence { margin: 0; font-size: 1.15rem; font-weight: 600; line-height: 2.7; color: var(--text); }
.pc-app[data-view="all"] .pc-sentence { font-size: 1.02rem; line-height: 2.5; }
.pc-sentence .pc-in { vertical-align: middle; margin: 0 2px; }
.pc-in { position: relative; display: inline-flex; align-items: center; }
.pc-num, .pc-sel, .pc-lbl {
    height: 48px; min-width: 0; padding: 0 12px; border: 1.5px solid var(--border-strong); border-radius: 12px; background: var(--bg); color: var(--text);
    font: inherit; font-size: 1.05rem; font-weight: 650; font-variant-numeric: tabular-nums; outline: none; transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.pc-num::placeholder, .pc-lbl::placeholder { color: var(--muted); opacity: .75; font-weight: 500; }
.pc-num:hover, .pc-sel:hover, .pc-lbl:hover { border-color: var(--primary); }
.pc-num:focus, .pc-sel:focus, .pc-lbl:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 4px var(--primary-ring); }
.pc-num[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, .18); }
.pc-sentence .pc-num { width: 7.5ch; text-align: center; padding: 0 8px; }
.pc-sentence .pc-in--pct .pc-num { padding-right: 26px; }
.pc-sel { padding: 0 34px 0 12px; cursor: pointer; appearance: none; -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.pc-sentence .pc-sel { font-size: 1.02rem; }
.pc-adorn { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; color: var(--muted); font-weight: 650; pointer-events: none; }
.pc-pct { right: 11px; }
.pc-cur { left: 12px; }
.pc-in--pct .pc-num { padding-right: 30px; }
.pc-in--money .pc-num { padding-left: calc(var(--pc-cur-w, 1ch) + 20px); }
.pc-form--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-content: start; }
.pc-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.pc-field[hidden] { display: none; }
.pc-field--wide { grid-column: 1 / -1; }
.pc-label { display: block; margin: 0 0 6px; padding: 0; font-size: .84rem; font-weight: 650; color: var(--text-2); }
.pc-label small { font-weight: 500; color: var(--muted); }
.pc-field .pc-in { display: flex; width: 100%; }
.pc-field .pc-num { width: 100%; }
.pc-field--check { grid-column: 1 / -1; }
.pc-field--check .pc-switch { margin: 0; }
.pc-help { display: block; margin: 6px 0 0; font-size: .76rem; line-height: 1.45; color: var(--muted); }
.pc-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.pc-chip { height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; }
.pc-chip:hover { border-color: var(--primary); color: var(--link); }
.pc-chip:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 1px; }
.pc-rate { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; }
.pc-rate .pc-sel { width: 100%; font-size: .9rem; font-weight: 600; }
.pc-seg { display: grid; gap: 3px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.pc-seg--2 { grid-template-columns: repeat(2, 1fr); }
.pc-seg--4 { grid-template-columns: repeat(4, 1fr); }
.pc-seg--5 { grid-template-columns: repeat(5, 1fr); }
.pc-seg--7 { grid-template-columns: repeat(7, 1fr); }
.pc-seg label { position: relative; margin: 0; }
.pc-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pc-seg span { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 3px 4px; border-radius: 9px; font-size: .8rem; font-weight: 650; line-height: 1.2; text-align: center; color: var(--text-2); cursor: pointer; transition: all .15s var(--ease); }
.pc-seg span:hover { color: var(--text); }
.pc-seg input:checked + span { background: var(--surface); color: var(--link); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--primary-ring); }
.pc-seg input:focus-visible + span { outline: 3px solid var(--primary-ring); outline-offset: 1px; }
.pc-rows { display: grid; gap: 8px; }
.pc-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 36px; align-items: center; gap: 8px; }
.pc-rows--items .pc-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 36px; }
.pc-row-n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: .76rem; font-weight: 750; }
.pc-row .pc-in { width: 100%; }
.pc-row .pc-num, .pc-row .pc-lbl { width: 100%; height: 42px; font-size: .98rem; }
.pc-row .pc-lbl { font-weight: 550; }
.pc-row-del { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; }
.pc-row-del:hover { background: var(--surface-2); color: var(--danger); }
.pc-row-del:focus-visible { outline: 3px solid var(--primary-ring); }
.pc-add { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 10px; border: 1px dashed var(--border-strong); border-radius: 9px; background: none; color: var(--link); font: inherit; font-size: .84rem; font-weight: 650; cursor: pointer; }
.pc-add:hover { border-color: var(--primary); background: var(--primary-soft); }
.pc-add:focus-visible { outline: 3px solid var(--primary-ring); }
.pc-expr { margin: 8px 0 0; font-size: .84rem; font-weight: 650; color: var(--link); font-variant-numeric: tabular-nums; }
.pc-expr[hidden] { display: none; }

.pc-more { margin-top: 6px; padding-top: 18px; border-top: 1px dashed var(--border); }
.pc-more[hidden] { display: none; }
.pc-more-title { margin: 0 0 10px; font-size: .74rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pc-more-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.pc-more-item {
    display: flex; align-items: flex-start; gap: 10px; height: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s var(--ease);
}
.pc-more-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.pc-more-item:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 2px; }
.pc-more-item .icon { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--primary-dark); }
.pc-more-item span { display: grid; gap: 2px; min-width: 0; }
.pc-more-item strong { font-size: .9rem; }
.pc-more-item small { font-size: .78rem; line-height: 1.4; color: var(--muted); }

/* ---------- 06. Result --------------------------------------------------- */
.pc-out { min-width: 0; min-height: 132px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.pc-out[data-state="ok"] { background: linear-gradient(160deg, var(--primary-soft), var(--surface-2) 70%); border-color: var(--primary-ring); }
.pc-out[data-state="error"] { background: rgba(220, 38, 38, .06); border-color: rgba(220, 38, 38, .25); }
.pc-out-empty, .pc-out-err { display: flex; align-items: center; gap: 10px; margin: 0; min-height: 94px; font-size: .92rem; color: var(--text-2); }
.pc-out-empty .icon { width: 22px; height: 22px; color: var(--primary); opacity: .8; }
.pc-out-err { color: var(--danger); font-weight: 550; }
.pc-out-err .icon { width: 20px; height: 20px; flex: none; }
.pc-res { animation: fade .2s var(--ease); }
.pc-res-lab { margin: 0; font-size: .74rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pc-res-main { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; }
.pc-res-val { display: block; min-width: 0; font-size: clamp(1.9rem, 3.4vw, 2.5rem); font-weight: 800; line-height: 1.15; letter-spacing: -.03em; color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pc-res-val.is-up { color: var(--success); }
.pc-res-val.is-down { color: var(--danger); }
.pc-app[data-view="all"] .pc-res-val { font-size: 1.8rem; }
.pc-copy { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-2); cursor: pointer; transition: color .15s, border-color .15s; }
.pc-copy:hover { color: var(--link); border-color: var(--primary); }
.pc-copy:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 2px; }
.pc-copy .icon { width: 16px; height: 16px; }
.pc-res-sum { margin: 0; font-size: .95rem; color: var(--text-2); }
.pc-res-read { margin: 4px 0 0; font-size: .8rem; color: var(--muted); }
.pc-res-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--border); }
.pc-res-rows div { min-width: 0; }
.pc-res-rows dt { font-size: .76rem; color: var(--muted); }
.pc-res-rows dd { margin: 1px 0 0; font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pc-note { margin: 10px 0 0; padding: 8px 10px; border-radius: 9px; background: rgba(217, 119, 6, .1); color: #92400E; font-size: .82rem; }
[data-theme="dark"] .pc-note { color: #FCD34D; }
.pc-res-actions { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px -8px -6px; }

/* ---------- 07. Visuals -------------------------------------------------- */
.pc-vis { margin: 12px 0 0; }
.pc-track { position: relative; height: 12px; border-radius: 999px; background: var(--border); overflow: hidden; }
.pc-bar-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary-light), var(--primary-dark)); transition: width .35s var(--ease); }
.pc-bar-fill.is-over { background: linear-gradient(90deg, #F59E0B, #D97706); }
.pc-bar-fill.is-base { background: var(--border-strong); }
.pc-bar-fill.is-up { background: linear-gradient(90deg, #34D399, var(--success)); }
.pc-bar-fill.is-down { background: linear-gradient(90deg, #F87171, var(--danger)); }
.pc-bar-fill.is-alt { background: linear-gradient(90deg, #A78BFA, #7C3AED); }
.pc-vis-leg { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pc-vis-leg strong { color: var(--text-2); }
.pc-vis--rows { display: grid; gap: 7px; }
.pc-vrow { display: grid; grid-template-columns: minmax(64px, auto) minmax(0, 1fr); align-items: center; gap: 10px; }
.pc-vrow-l { font-size: .8rem; font-weight: 650; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pc-stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--border); }
.pc-stack-seg { display: block; height: 100%; }
.pc-share-list { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.pc-share-list li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 64px; align-items: center; gap: 8px; font-size: .88rem; }
.pc-share-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-share-v { color: var(--muted); font-variant-numeric: tabular-nums; }
.pc-share-p { text-align: right; font-variant-numeric: tabular-nums; }
.pc-dot { width: 12px; height: 12px; border-radius: 4px; }
.c0 { background: #06B6D4; } .c1 { background: #8B5CF6; } .c2 { background: #F59E0B; } .c3 { background: #10B981; }
.c4 { background: #EF4444; } .c5 { background: #3B82F6; } .c6 { background: #EC4899; } .c7 { background: #64748B; }

/* ---------- 08. Steps ---------------------------------------------------- */
.pc-steps { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.pc-steps summary { display: flex; align-items: center; gap: 8px; padding: 11px 14px; font-size: .9rem; font-weight: 650; cursor: pointer; list-style: none; border-radius: var(--radius); }
.pc-steps summary::-webkit-details-marker { display: none; }
.pc-steps summary:hover { background: var(--surface-2); }
.pc-steps summary:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: -2px; }
.pc-steps summary .icon:first-child { color: var(--primary); }
.pc-caret { margin-left: auto; color: var(--muted); transition: transform .2s var(--ease); }
.pc-steps[open] .pc-caret { transform: rotate(180deg); }
.pc-steps-body { padding: 0 14px 14px; }
.pc-formula { margin: 0 0 10px; font-size: .84rem; color: var(--muted); }
.pc-formula span { font-weight: 700; }
.pc-formula code { display: inline-block; margin-top: 2px; padding: 3px 8px; border-radius: 7px; background: var(--surface-2); color: var(--text); font-family: var(--mono); font-size: .82rem; white-space: normal; overflow-wrap: anywhere; }
.pc-steps-list { margin: 0; padding-left: 22px; display: grid; gap: 5px; font-family: var(--mono); font-size: .86rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pc-steps-list:empty { display: none; }
.pc-steps-list li { overflow-wrap: anywhere; }
.pc-steps-list li::marker { color: var(--muted); font-size: .78rem; }
.pc-step-trail { color: var(--muted); }

/* ---------- 09. Panels (history, settings) ------------------------------ */
.pc-panel {
    position: absolute; top: 10px; right: 10px; z-index: 40; width: 380px; max-height: min(720px, calc(100vh - 110px)); overflow: auto; overscroll-behavior: contain;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: pop .18s var(--ease); scrollbar-width: thin;
}
.pc-panel[hidden], .pc-scrim[hidden] { display: none; }
.pc-scrim { position: fixed; inset: 0; z-index: 35; background: transparent; }
.pc-panel-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 12px 12px 10px 18px; background: var(--surface); border-bottom: 1px solid var(--border); }
.pc-panel-title { display: flex; align-items: center; gap: 8px; margin: 0 auto 0 0; font-size: 1rem; }
.pc-panel-title .icon { color: var(--primary); }
.pc-panel-body { padding: 4px 18px 18px; }
.pc-link-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .82rem; font-weight: 600; border-radius: 8px; cursor: pointer; }
.pc-link-btn[hidden] { display: none; }
.pc-link-btn:hover { color: var(--link); background: var(--surface-2); }
.pc-link-btn .icon { width: 14px; height: 14px; }
.pc-mini { width: 34px; height: 34px; flex: none; }
.pc-sub { margin: 18px 0 0; font-size: .74rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pc-sfield { margin: 12px 0 0; padding: 0; border: 0; min-width: 0; }
.pc-sfield > legend, .pc-sfield > label { display: block; padding: 0; margin: 0 0 7px; font-size: .84rem; font-weight: 650; color: var(--text-2); }
.pc-sfield .pc-sel { width: 100%; height: 40px; font-size: .9rem; border-radius: 10px; }
.pc-seg--dec span { min-height: 32px; font-size: .78rem; }
.pc-switch { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 0; font-size: .86rem; line-height: 1.4; color: var(--text-2); cursor: pointer; }
.pc-switch small { display: block; margin-top: 2px; font-size: .76rem; color: var(--muted); }
.pc-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pc-switch-ui { position: relative; flex: none; width: 36px; height: 20px; margin-top: 1px; border-radius: 999px; background: var(--border-strong); transition: background-color .2s var(--ease); }
.pc-switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .3); transition: transform .2s var(--ease); }
.pc-switch input:checked + .pc-switch-ui { background: var(--primary-dark); }
.pc-switch input:checked + .pc-switch-ui::after { transform: translateX(16px); }
.pc-switch input:focus-visible + .pc-switch-ui { outline: 3px solid var(--primary-ring); outline-offset: 2px; }
.pc-manage { display: grid; gap: 2px; margin: 8px 0 6px; padding: 0; list-style: none; }
.pc-manage li { display: flex; align-items: center; gap: 6px; }
.pc-manage label { display: flex; flex: 1; align-items: center; gap: 9px; min-width: 0; padding: 5px 6px; border-radius: 8px; font-size: .86rem; cursor: pointer; }
.pc-manage label:hover { background: var(--surface-2); }
.pc-manage label span { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pc-manage label .icon { width: 15px; height: 15px; color: var(--muted); flex: none; }
.pc-manage input { width: 16px; height: 16px; accent-color: var(--primary-dark); flex: none; }
.pc-star-sm { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.pc-star-sm:hover { background: var(--surface-2); }
.pc-star-sm:focus-visible { outline: 3px solid var(--primary-ring); }
.pc-star-sm .icon { width: 16px; height: 16px; }
.pc-set-note { display: flex; gap: 8px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: .78rem; line-height: 1.5; color: var(--muted); }
.pc-set-note .icon { flex: none; margin-top: 2px; color: var(--primary); }
.pc-keys { margin-top: 18px; border-top: 1px solid var(--border); }
.pc-keys summary { display: flex; align-items: center; gap: 8px; padding: 14px 0 0; font-size: .86rem; font-weight: 650; cursor: pointer; list-style: none; }
.pc-keys summary::-webkit-details-marker { display: none; }
.pc-keys summary .icon:first-child { color: var(--primary); }
.pc-keys[open] .pc-caret { transform: rotate(180deg); }
.pc-keys dl { display: grid; gap: 6px; margin: 10px 0 0; }
.pc-keys dl div { display: flex; justify-content: space-between; gap: 10px; font-size: .8rem; }
.pc-keys dd { margin: 0; color: var(--muted); text-align: right; }
.pc-hist-list { margin: 0; padding: 8px; list-style: none; display: grid; gap: 4px; }
.pc-hist-list:empty { display: none; }
.pc-hist-item { display: grid; gap: 2px; width: 100%; padding: 9px 12px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pc-hist-item:hover { background: var(--surface-2); border-color: var(--border); }
.pc-hist-item:focus-visible { outline: 3px solid var(--primary-ring); }
.pc-hist-sum { font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.pc-hist-meta { font-size: .74rem; color: var(--muted); }
.pc-hist-empty { margin: 0; padding: 22px 20px; font-size: .88rem; color: var(--muted); }
.pc-hist-empty[hidden] { display: none; }

/* ---------- 10. Content blocks ------------------------------------------ */
.pc-steps-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 0; padding: 0; list-style: none; }
.pc-step { position: relative; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.pc-step h3 { margin: 16px 0 8px; }
.pc-step p { margin: 0; color: var(--muted); font-size: .95rem; }
.pc-step-n { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: #fff; font-weight: 800; background: linear-gradient(135deg, var(--primary-light), var(--primary-dark)); }
.pc-features { grid-template-columns: repeat(3, 1fr); }
.pc-guide { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; }
.pc-guide-main { max-width: 820px; min-width: 0; }
.pc-guide-main > h2:first-child { margin-top: 0; }
.pc-guide-main > p { margin: 0 0 1em; }
.pc-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 1em; }
.pc-gtable { width: 100%; border-collapse: collapse; font-size: .92rem; }
.pc-gtable th, .pc-gtable td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.pc-gtable thead th { font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); background: var(--surface-2); }
.pc-gtable th[scope="row"] { font-weight: 650; }
.pc-gtable code { font-size: .82rem; white-space: nowrap; }
.pc-gtable--num td, .pc-gtable--num th[scope="row"] { font-variant-numeric: tabular-nums; }
.pc-ad { min-height: 120px; margin-top: 20px; }

/* ---------- 11. Toasts, language ---------------------------------------- */
.pc-lang { position: relative; }
.pc-lang-btn { width: auto; padding: 0 12px; gap: 6px; display: inline-flex; }
.pc-lang-code { font-size: .76rem; font-weight: 750; letter-spacing: .03em; }
.pc-lang-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 150; min-width: 180px; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); animation: pop .18s var(--ease); }
.pc-lang-menu a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 8px; color: var(--text); font-size: .92rem; font-weight: 550; text-decoration: none !important; }
.pc-lang-menu a:hover { background: var(--surface-2); }
.pc-lang-menu a[aria-current] { color: var(--link); font-weight: 650; }
.pc-toasts { position: fixed; left: 50%; bottom: 24px; z-index: 1000; display: flex; flex-direction: column; align-items: center; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.pc-toast { max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: 999px; background: var(--navy); color: #fff; font-size: .88rem; font-weight: 600; box-shadow: var(--shadow-lg); animation: pop .2s var(--ease); transition: opacity .3s, transform .3s; text-align: center; }
[data-theme="dark"] .pc-toast { background: #1E293B; border: 1px solid var(--border-strong); }
.pc-toast.is-ok { background: #047857; }
.pc-toast.is-err { background: #B91C1C; }
.pc-toast.is-out { opacity: 0; transform: translateY(8px); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- 12. Responsive ---------------------------------------------- */
@media (max-width: 1200px) {
    .pc-card-body { grid-template-columns: minmax(0, 1fr); }
    .pc-more-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pc-app[data-view="all"] .pc-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
    .pc-guide { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .pc-guide-side .sticky { position: static; }
    .pc-features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 899px) {
    .header-actions { margin-left: auto; }
    .pc-top { grid-template-columns: minmax(0, 1fr); }
    .pc-bar { justify-content: space-between; }
    .pc-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; background: none; }
    .pc-nav { position: sticky; top: var(--header-h, 68px); z-index: 20; max-height: none; min-height: 0; overflow-y: hidden; background: var(--surface-2); display: flex; gap: 6px; padding: 10px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); border-radius: 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
    .pc-nav::-webkit-scrollbar { display: none; }
    .pc-nav-search, .pc-nav-title { display: none; }
    .pc-nav-group, .pc-nav ul { display: flex; gap: 6px; margin: 0; }
    .pc-nav-group[hidden] { display: none; }
    .pc-nav li { flex: none; scroll-snap-align: center; }
    .pc-nav-link { height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); white-space: nowrap; font-size: .84rem; }
    .pc-nav-link[aria-current="true"] { box-shadow: inset 0 0 0 1px var(--primary); border-color: var(--primary); }
    .pc-nav-fav .pc-nav-link .icon { color: #D97706; }
    .pc-cards { padding: 16px 14px; }
    .pc-steps-how { grid-template-columns: 1fr; }
    .pc-panel { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 82vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding-bottom: env(safe-area-inset-bottom); z-index: 960; }
    .pc-scrim { z-index: 955; background: rgba(15, 23, 42, .4); }
}
@media (max-width: 600px) {
    .pc-lang-btn { width: 40px; padding: 0; justify-content: center; }
    .pc-lang-code { display: none; }
    .pc-hero { padding: 20px 0 10px; }
    .pc-hero-head .tile { display: none; }
    .pc-hero-head .lead { font-size: .98rem; }
    .pc-trust { gap: 6px; }
    .pc-trust li { font-size: .78rem; padding: 5px 10px; }
    .pc-app { margin: 0 -16px; border-radius: 0; border-left: 0; border-right: 0; }
    .pc-top { padding: 12px; border-radius: 0; }
    .pc-ask-in { height: 50px; font-size: 16px; padding-right: 14px; }
    .pc-ask-kbd { display: none; }
    .pc-ask-ex { flex-wrap: nowrap; margin: 0 -12px; padding: 0 12px 2px; overflow-x: auto; scrollbar-width: none; }
    .pc-ask-ex::-webkit-scrollbar { display: none; }
    .pc-qc { flex: none; }
    .pc-vbtn span, .pc-tbtn span:not(.pc-count) { display: none; }
    .pc-vbtn, .pc-tbtn { width: 46px; padding: 0; }
    .pc-bar { gap: 6px; }
    .pc-viewsw { margin-right: auto; }
    .pc-card-head { gap: 10px; }
    .pc-card-head .tile { display: none; }
    .pc-card-title { font-size: 1.1rem; }
    .pc-card-tools .pc-tb span { display: none; }
    .pc-card-tools .pc-tb { width: 34px; padding: 0; }
    .pc-sentence { font-size: 1.05rem; line-height: 2.6; }
    .pc-num, .pc-sel, .pc-lbl { font-size: 16px; }   /* no zoom on iOS */
    .pc-form--grid { gap: 12px 10px; }
    .pc-field--mwide { grid-column: 1 / -1; }
    .pc-hero-head .lead { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
    .pc-trust { flex-wrap: nowrap; margin: 14px -16px 0; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
    .pc-trust::-webkit-scrollbar { display: none; }
    .pc-trust li { flex: none; }
    .pc-more-list { grid-template-columns: minmax(0, 1fr); }
    .pc-rate { grid-template-columns: minmax(0, 1fr); }
    .pc-seg--4 { grid-template-columns: repeat(2, 1fr); }
    .pc-seg--5 { grid-template-columns: repeat(3, 1fr); }
    .pc-seg--7 { grid-template-columns: repeat(4, 1fr); }
    .pc-out { padding: 16px; }
    .pc-res-rows { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .pc-features { grid-template-columns: 1fr; }
    .pc-gtable code { white-space: normal; }
}
@media print {
    .pc-top, .pc-nav, .pc-card-tools, .pc-res-actions, .pc-copy, .pc-panel { display: none !important; }
    .pc-layout { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .pc-app *, .pc-toast, .pc-panel { animation: none !important; transition: none !important; } }

/* ---------- 13. Contrast (WCAG AA for small text, light theme) ---------- */
:root:not([data-theme="dark"]) .pc-seg input:checked + span,
:root:not([data-theme="dark"]) .pc-vbtn[aria-pressed="true"],
:root:not([data-theme="dark"]) .pc-nav-link[aria-current="true"],
:root:not([data-theme="dark"]) .pc-tbtn[aria-expanded="true"],
:root:not([data-theme="dark"]) .pc-add,
:root:not([data-theme="dark"]) .pc-expr,
:root:not([data-theme="dark"]) .pc-ask-go,
:root:not([data-theme="dark"]) .pc-count { color: #0E7490; }
:root:not([data-theme="dark"]) .pc-res-val.is-up { color: #047857; }
