/* =========================================================
   CoolText.CC — component layer
   ========================================================= */

/* ===== composer ===== */
.composer {
    position: relative;
    width: 100%;
    max-width: 720px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.18s, box-shadow 0.18s;
}

.composer:focus-within {
    border-color: var(--brand);
    box-shadow: var(--ring);
}

.composer textarea {
    display: block;
    width: 100%;
    min-height: 62px;
    max-height: 220px;
    padding: 18px 18px 6px;
    border: 0;
    background: transparent;
    font-size: 1.08rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    line-height: 1.5;
    resize: none;
    outline: none;
    overflow: hidden;
}

.composer textarea::placeholder { color: var(--ink-3); font-weight: 400; }

.composer-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 8px 18px;
    border-top: 1px solid var(--line);
}

.composer-count {
    font-size: 0.76rem;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.composer-count b { color: var(--ink-2); font-weight: 700; }

.composer-hint {
    margin-inline-start: auto;
    font-size: 0.72rem;
    color: var(--ink-3);
    white-space: nowrap;
}

.composer-hint kbd {
    padding: 1px 5px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel-2);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--ink-2);
}

.composer-tools { display: flex; align-items: center; gap: 4px; }

.ghostbtn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: var(--ink-3);
    transition: 0.16s;
}

.ghostbtn svg { width: 18px; height: 18px; }
.ghostbtn:hover { color: var(--ink); background: var(--panel-2); }

/* the composer follows the scroll on long result lists */
.composer-dock {
    position: sticky;
    top: calc(var(--header-h) + 8px);
    z-index: 40;
    padding: 10px 0;
    margin-bottom: 6px;
    background: var(--bg);
}

.composer-dock .composer {
    max-width: none;
    box-shadow: var(--shadow);
}

/* ===== tool tabs ===== */
.switcher { margin-bottom: 16px; }

.tooltabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    overflow-x: auto;
    scrollbar-width: none;
}

.tooltabs::-webkit-scrollbar { display: none; }

.tooltab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 9px;
    color: var(--ink-2);
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.16s, color 0.16s;
}

.tooltab i { font-style: normal; line-height: 1; }

.tooltab b {
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    background: var(--panel-2);
    color: var(--ink-3);
    font-size: 0.68rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tooltab:hover { color: var(--ink); background: var(--panel-2); }

.tooltab.is-active {
    background: var(--ink);
    color: var(--bg);
}

.tooltab.is-active b {
    background: color-mix(in srgb, var(--bg) 22%, transparent);
    color: inherit;
}

/* ===== panel ===== */
.panels { position: relative; }

.panel {
    display: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.panel.is-active { display: block; animation: panel-in 0.22s ease; }

@keyframes panel-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel-2) 55%, transparent);
}

.panel-head.is-plain { border-bottom: 1px solid var(--line); }
.panel-head.is-plain .panel-tools { flex: 1 1 100%; justify-content: space-between; }

.panel-id { min-width: 0; }
.panel-index { display: none; }

.panel-title { font-size: 1.05rem; letter-spacing: -0.025em; }
.panel-sub { font-size: 0.8rem; color: var(--ink-3); margin-top: 2px; }

.panel-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.panel-body { padding: 16px 18px 18px; }
.panel-foot {
    padding: 14px 18px 16px;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel-2) 45%, transparent);
}

.panel-foot .morelink { margin-top: 0; }

.rail-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin: 22px 0 10px;
}

.rail-title:first-child { margin-top: 0; }

.rail-title span {
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    background: var(--panel-2);
    font-size: 0.66rem;
    letter-spacing: 0;
    color: var(--ink-3);
}

/* ===== segment control ===== */
.segment {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-2);
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.segment::-webkit-scrollbar { display: none; }

.seg {
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-2);
    white-space: nowrap;
    transition: 0.16s;
}

.seg:hover { color: var(--ink); }

.seg.is-active {
    background: var(--panel);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

/* ===== list search ===== */
.listsearch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 1 1 180px;
    min-width: 0;
    max-width: 280px;
    height: 36px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--ink-3);
    transition: border-color 0.16s, box-shadow 0.16s;
}

.listsearch:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.listsearch svg { flex: none; width: 16px; height: 16px; }

.listsearch input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    outline: none;
    font-size: 0.85rem;
    color: var(--ink);
}

.listsearch input::placeholder { color: var(--ink-3); }

.noresult {
    padding: 26px 18px;
    text-align: center;
    font-size: 0.88rem;
    color: var(--ink-3);
}

/* ===== rows ===== */
.rows {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    overflow: hidden;
}

.rows + .rail-title { margin-top: 24px; }

.row {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border-top: 1px solid var(--line);
    transition: background 0.14s;
}

.row:first-child { border-top: 0; }
.row:hover { background: var(--panel-2); }

.row-label {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    font-size: 0.8rem;
    color: var(--ink-3);
    overflow: hidden;
}

.row-label a {
    color: var(--ink-2);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-label a:hover { color: var(--brand); }

.row-label b {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-label .tag {
    flex: none;
    padding: 1px 7px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    font-size: 0.64rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.row-text {
    font-size: 1.04rem;
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-line;
}

.row-actions { display: flex; align-items: center; gap: 4px; }

.copybtn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    color: var(--ink-2);
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
    transition: 0.16s;
}

.copybtn svg { width: 15px; height: 15px; }
.copybtn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.copybtn.is-done { color: var(--on-brand); background: var(--ok); border-color: var(--ok); }

.favbtn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--ink-3);
    opacity: 0;
    transition: 0.16s;
}

.favbtn svg { width: 16px; height: 16px; }
.row:hover .favbtn,
.favbtn:focus-visible,
.favbtn.is-on { opacity: 1; }
.favbtn:hover { color: var(--hot); background: var(--panel-3); }
.favbtn.is-on { color: var(--hot); }
.favbtn.is-on svg { fill: var(--hot); }

/* ===== result block ===== */
.heroresult {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 30px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(120% 120% at 12% 0%, var(--brand-soft), transparent 62%),
        var(--panel-2);
    text-align: center;
}

.heroresult-text {
    font-size: clamp(1.4rem, 4.6vw, 2.4rem);
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-line;
}

.heroresult-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ===== buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: 0.16s;
}

.btn svg { width: 17px; height: 17px; }
.btn:hover { border-color: var(--brand); color: var(--brand); }

.btn-primary {
    border-color: transparent;
    background: var(--brand);
    color: var(--on-brand);
    box-shadow: 0 10px 22px -14px color-mix(in srgb, var(--brand) 90%, transparent);
}

.btn-primary:hover {
    color: var(--on-brand);
    background: var(--brand-ink);
    border-color: transparent;
}

.btn-sm { padding: 7px 13px; font-size: 0.79rem; }

.linkbtn {
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.linkbtn:hover { color: var(--brand); }

/* ===== chips ===== */
.chips {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
    gap: 7px;
}

.chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    font-size: 0.84rem;
    color: var(--ink-2);
    transition: 0.16s;
}

.chip:hover { color: var(--ink); border-color: var(--line-2); background: var(--panel-2); }
.chip.is-active { border-color: var(--brand); color: var(--ink); background: var(--brand-soft); }

.chip-icon { flex: none; font-style: normal; line-height: 1; }
.chip-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-sample { flex: none; color: var(--ink-3); font-size: 0.9rem; }

/* ===== symbols ===== */
.symbolgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 5px;
    margin-bottom: 6px;
}

.sym {
    aspect-ratio: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    font-size: 1.22rem;
    line-height: 1;
    transition: 0.14s;
}

.sym:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
    transform: translateY(-2px);
}

.sym.is-done { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 20%, transparent); }

/* ===== stats / steps / faq ===== */
.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    overflow: hidden;
}

.stat {
    padding: 16px 12px;
    border-inline-start: 1px solid var(--line);
    text-align: center;
}

.stat:first-child { border-inline-start: 0; }

.stat b {
    display: block;
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.stat span {
    display: block;
    margin-top: 2px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 12px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

.step-num {
    grid-row: span 2;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: 0.72rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .step-num { color: var(--brand); }

.step h3 { font-size: 0.95rem; font-weight: 700; }
.step p { font-size: 0.85rem; color: var(--ink-2); }

.faq-list { display: flex; flex-direction: column; gap: 7px; }

.faq-item {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    overflow: hidden;
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 18px;
    font-size: 0.93rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    transition: background 0.16s;
}

.faq-item summary:hover { background: var(--panel-2); }

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: "+";
    flex: none;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--brand);
    transition: transform 0.2s;
}

.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 18px 16px; font-size: 0.88rem; color: var(--ink-2); }

.about-copy { max-width: 900px; }
.about-copy p { color: var(--ink-2); font-size: 0.92rem; margin-bottom: 12px; }
.about-copy p:last-child { margin-bottom: 0; }

/* ===== glass card ===== */
.glass {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
}

/* ===== sprite / skeleton ===== */
.sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.skeleton {
    height: 50px;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--panel-2) 0%, var(--panel-3) 50%, var(--panel-2) 100%);
    background-size: 220% 100%;
    animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
    from { background-position: 120% 0; }
    to { background-position: -120% 0; }
}

/* ===== modal ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal.is-open { opacity: 1; visibility: visible; }

.modal-bg {
    position: absolute;
    inset: 0;
    background: rgba(6, 8, 16, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-box {
    position: relative;
    width: 100%;
    max-width: 470px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--solid);
    box-shadow: var(--shadow-lg);
    transform: translateY(8px) scale(0.99);
    transition: transform 0.2s;
}

.modal.is-open .modal-box { transform: none; }

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.modal-head h3 { font-size: 0.96rem; }

.lang-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 12px;
    overflow-y: auto;
}

.langitem {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    color: var(--ink-2);
    transition: 0.16s;
}

.langitem:hover { background: var(--panel-2); color: var(--ink); }
.langitem.is-active { background: var(--brand-soft); color: var(--ink); font-weight: 600; }

.share-body { padding: 14px 16px 18px; }

.share-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 14px;
}

.share-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 11px 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--ink-2);
    transition: 0.16s;
}

.share-item:hover { border-color: var(--brand); color: var(--brand); }
.share-item b { font-size: 1.05rem; font-weight: 500; }

.share-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
}

.share-link input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    outline: none;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--ink-2);
}

.share-field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    margin-bottom: 10px;
}

.share-field label {
    flex: none;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.share-field input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    outline: none;
    font-family: var(--font-mono);
    font-size: 0.76rem;
}

/* ===== toast ===== */
.toast {
    position: fixed;
    inset-inline: 0;
    bottom: calc(18px + var(--safe-b));
    z-index: 200;
    width: fit-content;
    max-width: 88vw;
    margin-inline: auto;
    padding: 10px 18px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-pill);
    background: var(--ink);
    color: var(--bg);
    box-shadow: var(--shadow);
    font-size: 0.84rem;
    font-weight: 600;
    text-align: center;
    opacity: 0;
    transform: translateY(70px);
    transition: 0.26s;
    pointer-events: none;
}

.toast.is-on { opacity: 1; transform: none; }

/* ===== browse / catalog ===== */
.browse-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.browse-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
}

.browse-card h3 {
    margin-bottom: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.browse-card .chips { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.browse-card--wide { grid-column: 1 / -1; }

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
}

.catalog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 142px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    transition: 0.18s;
}

.catalog-card:hover {
    border-color: var(--line-2);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.catalog-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--brand-soft);
    font-size: 1.2rem;
    line-height: 1;
}

.catalog-count {
    position: absolute;
    top: 14px;
    inset-inline-end: 14px;
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--ink-3);
    font-size: 0.66rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.catalog-card strong {
    margin-top: 12px;
    font-size: 0.9rem;
    font-weight: 700;
}

.catalog-card small {
    margin-top: 2px;
    color: var(--ink-3);
    font-size: 0.73rem;
    line-height: 1.45;
}

.catalog-arrow {
    position: absolute;
    inset-inline-end: 14px;
    bottom: 14px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--ink-3);
    font-size: 0.7rem;
    transition: 0.16s;
}

.catalog-card:hover .catalog-arrow { color: var(--brand); border-color: var(--brand); }

/* ===== tool cards ===== */
.toolgrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.toolcard {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto auto;
    align-items: start;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    transition: 0.18s;
}

.toolcard:hover {
    border-color: var(--line-2);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.toolcard-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--panel-2);
    font-size: 1.15rem;
    line-height: 1;
}

.toolcard-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.toolcard-body strong { font-size: 0.94rem; font-weight: 700; }
.toolcard-body small { font-size: 0.8rem; line-height: 1.5; color: var(--ink-3); }

.toolcard-meta {
    color: var(--ink-3);
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.toolcard-arrow { color: var(--ink-3); font-size: 0.9rem; transition: 0.18s; }
.toolcard:hover .toolcard-arrow { transform: translateX(3px); color: var(--brand); }

/* ===== tag cloud / more link ===== */
.tagcloud { display: flex; flex-wrap: wrap; gap: 7px; }

.tagpill {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--panel);
    color: var(--ink-2);
    font-size: 0.8rem;
    font-weight: 600;
    transition: 0.16s;
}

.tagpill:hover { color: var(--brand); border-color: var(--brand); }

.morelink {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 12px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--brand);
    transition: gap 0.16s;
}

.morelink:hover { gap: 9px; }
.morelink svg { width: 15px; height: 15px; }

/* folded link lists */
.foot-fold > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
    transition: 0.16s;
}

.foot-fold > summary::-webkit-details-marker { display: none; }
.foot-fold > summary::after { content: "+"; margin-inline-start: auto; font-size: 1rem; letter-spacing: 0; }
.foot-fold[open] > summary::after { content: "−"; }
.foot-fold > summary:hover { color: var(--ink-2); }
.foot-fold[open] > summary { margin-bottom: 14px; }
.foot-fold span { opacity: 0.7; }

/* ===== ad slots ===== */
.adslot {
    width: min(970px, calc(100% - 32px));
    margin: 24px auto;
    padding: 8px 10px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    text-align: center;
}

.adslot-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.adslot .adsbygoogle { min-height: 90px; }

/* ===== cookie consent ===== */
.cookiebar {
    position: fixed;
    inset-inline: 0;
    bottom: calc(14px + var(--safe-b));
    z-index: 210;
    display: flex;
    align-items: center;
    gap: 16px;
    width: min(880px, calc(100vw - 28px));
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    margin-inline: auto;
    padding: 14px 16px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--solid);
    box-shadow: var(--shadow-lg);
    transform: translateY(140%);
    transition: transform 0.3s ease;
}

.cookiebar[hidden] { display: none; }
.cookiebar.is-on { transform: none; }

.cookiebar-body b { display: block; font-size: 0.88rem; margin-bottom: 2px; }
.cookiebar-body p { font-size: 0.79rem; color: var(--ink-2); }
.cookiebar-body a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.cookiebar-actions { display: flex; gap: 8px; flex: none; }

/* ===== responsive ===== */
@media (max-width: 900px) {
    .row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
    .row-label { grid-column: 1 / -1; }
    .row-text { font-size: 1rem; }
    .favbtn { opacity: 1; }
    .steps { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .browse-grid { grid-template-columns: 1fr; }
    .toolgrid { grid-template-columns: 1fr; }
    .copybtn span { display: none; }
    .copybtn { padding: 7px; }
    .share-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .composer-hint { display: none; }
}

@media (max-width: 640px) {
    .tooltabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 3px;
    }

    .tooltab {
        justify-content: center;
        gap: 5px;
        padding: 9px 4px;
        font-size: 0.76rem;
        overflow: hidden;
    }

    .tooltab b { display: none; }

    .panel-head { padding: 12px 14px; }
    .panel-body { padding: 14px; }
    .panel-foot { padding: 12px 14px 14px; }

    .panel-tools { width: 100%; justify-content: flex-start; }
    .listsearch { max-width: none; flex: 1 1 100%; }

    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat:nth-child(3) { border-inline-start: 0; }
    .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }

    .chips { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
    .heroresult { padding: 22px 14px; }
    .lang-grid { grid-template-columns: 1fr; }

    .composer textarea { padding: 15px 15px 4px; font-size: 1.02rem; }
    .composer-bar { padding-inline-start: 15px; }

    .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .toolcard { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 14px; }
    .toolcard-meta { display: none; }

    .cookiebar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: calc(100vw - 20px);
        padding: 12px 14px;
    }

    .cookiebar-actions .btn { flex: 1; }
}

@media (max-width: 520px) {
    .symbolgrid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
    .row { padding: 10px 11px; }
}

/* the docked composer only helps on tall screens */
@media (max-width: 700px) {
    .composer-dock { position: static; padding: 0; margin-bottom: 12px; background: none; }
    .composer-dock .composer { box-shadow: var(--shadow-sm); }
}
