:root {
    --tools-primary: #7067e8;
    --tools-primary-dark: #5c52d6;
    --tools-ink: #182034;
    --tools-muted: #737b8c;
    --tools-line: #e9ebf3;
    --tools-bg: #f6f7fb;
}

.tools-hub, .local-tool-page { min-height: calc(100vh - 72px); color: var(--tools-ink); background: var(--tools-bg); }
.tools-container, .local-tool-container { width: min(1240px, calc(100% - 32px)); margin: 0 auto; }
.tools-hero { padding: 58px 0 54px; background: radial-gradient(circle at 16% 10%, rgba(112, 103, 232, .17), transparent 34%), linear-gradient(145deg, #fff 0%, #f3f1ff 100%); border-bottom: 1px solid rgba(112, 103, 232, .09); }
.tools-eyebrow { display: inline-flex; padding: 5px 10px; border-radius: 999px; color: var(--tools-primary); background: rgba(112, 103, 232, .1); font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.tools-hero h1 { margin: 14px 0 8px; font-size: clamp(30px, 4vw, 46px); font-weight: 800; letter-spacing: -.035em; }
.tools-hero p { margin: 0; color: var(--tools-muted); font-size: 16px; }
.tools-search { display: flex; width: min(680px, 100%); height: 54px; align-items: center; gap: 10px; margin-top: 26px; padding: 5px 6px 5px 18px; border: 1px solid rgba(112, 103, 232, .15); border-radius: 18px; background: #fff; box-shadow: 0 15px 45px rgba(49, 43, 112, .09); }
.tools-search > i { color: #9298a8; font-size: 18px; }
.tools-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--tools-ink); background: transparent; font-size: 15px; }
.tools-search button { height: 42px; padding: 0 21px; border: 0; border-radius: 13px; color: #fff; background: var(--tools-primary); font-weight: 700; }
.tools-content { padding-top: 34px; padding-bottom: 56px; }
.tools-section + .tools-section { margin-top: 42px; }
.tools-section__head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.tools-section__head > div { display: flex; align-items: center; gap: 10px; }
.tools-section__head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.tools-section__head p { margin: 0; color: var(--tools-muted); font-size: 13px; }
.tools-section__icon { display: inline-grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: #f26f45; background: #fff0ea; }
.tools-section__icon.is-purple { color: var(--tools-primary); background: #eceaff; }
.tools-categories { display: flex; gap: 9px; margin: 0 0 20px; padding-bottom: 3px; overflow-x: auto; scrollbar-width: none; }
.tools-categories::-webkit-scrollbar { display: none; }
.tools-categories a { display: inline-flex; min-height: 38px; align-items: center; gap: 7px; padding: 0 14px; border: 1px solid var(--tools-line); border-radius: 13px; color: #5f6675; background: #fff; font-size: 13px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.tools-categories a.is-active { border-color: var(--tools-primary); color: #fff; background: var(--tools-primary); box-shadow: 0 8px 20px rgba(112, 103, 232, .2); }
.tools-categories em { font-style: normal; opacity: .72; }
.tools-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.tool-card { position: relative; display: flex; min-width: 0; min-height: 132px; align-items: center; gap: 14px; padding: 19px; overflow: hidden; border: 1px solid rgba(24, 32, 52, .06); border-radius: 22px; color: var(--tools-ink); background: #fff; box-shadow: 0 9px 28px rgba(31, 36, 65, .045); text-decoration: none !important; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.tool-card:hover { border-color: rgba(112, 103, 232, .25); color: var(--tools-ink); box-shadow: 0 16px 38px rgba(40, 35, 95, .1); transform: translateY(-3px); }
.tool-card.is-popular::after { position: absolute; top: 0; right: 0; width: 58px; height: 58px; border-radius: 0 0 0 58px; background: linear-gradient(135deg, transparent 28%, rgba(255, 187, 72, .14)); content: ''; }
.tool-card__icon { display: grid; width: 54px; height: 54px; flex: 0 0 54px; place-items: center; overflow: hidden; border-radius: 17px; color: var(--tools-primary); background: linear-gradient(145deg, #eeecff, #f8f7ff); font-size: 24px; }
.tool-card__icon img { width: 100%; height: 100%; object-fit: cover; }
.tool-card__body { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.tool-card__body strong { margin: 2px 0 5px; overflow: hidden; font-size: 15px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.tool-card__body small { display: -webkit-box; overflow: hidden; color: var(--tools-muted); font-size: 12.5px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tool-card__meta { display: flex; align-items: center; gap: 6px; color: #989eaa; font-size: 10.5px; }
.tool-card__meta b { padding: 2px 6px; border-radius: 99px; color: #398a69; background: #eaf8f1; font-size: 9px; font-weight: 750; }
.tool-card__arrow { flex: 0 0 auto; color: #c1c5d0; font-size: 12px; }
.tools-empty { padding: 56px 20px; border: 1px dashed #d9dcea; border-radius: 22px; color: var(--tools-muted); background: rgba(255,255,255,.65); text-align: center; }
.tools-empty > i { color: #a7a2e5; font-size: 34px; }
.tools-empty h3 { margin: 12px 0 5px; color: var(--tools-ink); font-size: 17px; }
.tools-empty p { margin: 0 0 13px; }
.tools-empty a { color: var(--tools-primary); font-weight: 700; }

.local-tool-page { padding: 32px 0 56px; }
.local-tool-container { max-width: 860px; }
.authenticator-container { max-width: 1160px; }
.tool-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px; color: #636a79; font-size: 14px; font-weight: 700; text-decoration: none !important; }
.tool-back:hover { color: var(--tools-primary); }
.local-tool-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.local-tool-heading > span { display: grid; width: 58px; height: 58px; flex: 0 0 58px; place-items: center; border-radius: 19px; color: var(--tools-primary); background: #e9e7ff; font-size: 25px; }
.local-tool-heading h1 { margin: 0 0 5px; font-size: clamp(24px, 3.5vw, 34px); font-weight: 850; letter-spacing: -.025em; }
.local-tool-heading p { margin: 0; color: var(--tools-muted); font-size: 14px; line-height: 1.55; }
.local-tool-card { padding: 25px; border: 1px solid rgba(24,32,52,.06); border-radius: 24px; background: #fff; box-shadow: 0 12px 35px rgba(34, 38, 69, .055); }
.tool-field { display: block; margin: 0; }
.tool-field > span { display: block; margin-bottom: 9px; color: #4d5566; font-size: 13px; font-weight: 750; }
.tool-field textarea, .tool-field input { display: block; width: 100%; box-sizing: border-box; border: 1px solid #dfe2ec; border-radius: 15px; outline: 0; color: var(--tools-ink); background: #fafbfe; font-size: 15px; line-height: 1.55; transition: border-color .15s, box-shadow .15s, background .15s; }
.tool-field textarea { min-height: 126px; padding: 14px 15px; resize: vertical; }
.tool-field input { height: 50px; padding: 0 15px; }
.tool-field textarea:focus, .tool-field input:focus { border-color: rgba(112,103,232,.65); background: #fff; box-shadow: 0 0 0 4px rgba(112,103,232,.1); }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.tool-button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid #e1e3ec; border-radius: 13px; color: #555d6c; background: #fff; font-size: 13px; font-weight: 750; cursor: pointer; }
.tool-button:hover { border-color: #cac7ed; color: var(--tools-primary); }
.tool-button.is-primary { border-color: var(--tools-primary); color: #fff; background: var(--tools-primary); box-shadow: 0 8px 18px rgba(112,103,232,.18); }
.tool-button.is-primary:hover { border-color: var(--tools-primary-dark); color: #fff; background: var(--tools-primary-dark); }
.tool-button.is-full { width: 100%; margin-top: 15px; }
.tool-feedback { min-height: 20px; margin: 12px 0 0; color: #32825f; font-size: 13px; }
.tool-feedback.is-error { color: #d4485e; }
.qr-preview { margin-top: 24px; padding-top: 23px; border-top: 1px solid var(--tools-line); text-align: center; }
.qr-preview h2 { margin: 0 0 16px; font-size: 17px; font-weight: 800; }
.qr-canvas-wrap { display: grid; width: min(320px, 100%); min-height: 260px; place-items: center; margin: 0 auto 16px; padding: 18px; border: 1px solid #eceef4; border-radius: 20px; background: #fff; }
.qr-canvas-wrap [data-qr-output] { display: block; width: 100% !important; max-width: 100%; }
.qr-canvas-wrap canvas, .qr-canvas-wrap img { display: block; width: 100% !important; max-width: 100%; height: auto !important; image-rendering: pixelated; }
.tool-privacy, .tool-time-tip { display: flex; align-items: flex-start; gap: 9px; margin: 14px 4px 0; color: #7e8594; font-size: 12px; line-height: 1.55; }
.tool-privacy i { margin-top: 2px; color: #43a47c; }
.tool-time-tip i { margin-top: 2px; color: #de9940; }

.auth-input-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; align-items: stretch; }
.auth-input-card { display: flex; min-width: 0; flex-direction: column; }
.auth-input-title { display: flex; align-items: center; gap: 11px; margin-bottom: 17px; }
.auth-input-title > span { display: grid; width: 31px; height: 31px; flex: 0 0 31px; place-items: center; border-radius: 10px; color: var(--tools-primary); background: #edebff; font-size: 13px; font-weight: 850; }
.auth-input-title h2 { margin: 0 0 3px; font-size: 16px; font-weight: 820; }
.auth-input-title p { margin: 0; color: var(--tools-muted); font-size: 11.5px; line-height: 1.4; }
.auth-file { display: flex; min-height: 190px; flex: 1; align-items: center; justify-content: center; flex-direction: column; padding: 18px; border: 1.5px dashed #cfd2e1; border-radius: 16px; color: #697082; background: #fafbfe; text-align: center; cursor: pointer; }
.auth-file:hover { border-color: var(--tools-primary); background: #f7f5ff; }
.auth-file > i { margin-bottom: 10px; color: var(--tools-primary); font-size: 29px; }
.auth-file strong { color: #454d5d; font-size: 13px; }
.auth-file small { margin-top: 5px; font-size: 11px; }
.auth-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.auth-feedback { margin: 14px 3px 0; }
.auth-candidates { margin-top: 18px; padding: 21px; border: 1px solid #e2dffb; border-radius: 20px; background: #f8f7ff; }
.auth-candidates h2 { margin: 0 0 4px; font-size: 17px; font-weight: 820; }
.auth-candidates > p { margin: 0 0 13px; color: var(--tools-muted); font-size: 12px; }
.auth-candidates [data-auth-candidate-list] { display: grid; gap: 8px; }
.auth-candidate { display: flex; min-height: 46px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; border: 1px solid #dfddec; border-radius: 13px; color: #4d5362; background: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.auth-candidate:hover { border-color: var(--tools-primary); color: var(--tools-primary); }
.auth-candidate span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-result { width: min(720px, 100%); margin: 20px auto 0; padding: 25px; border: 1px solid rgba(112,103,232,.18); border-radius: 26px; background: linear-gradient(160deg, #fff 40%, #f8f7ff 100%); box-shadow: 0 18px 46px rgba(56, 49, 126, .1); }
.auth-result__brand { display: flex; align-items: center; gap: 12px; }
.auth-result__brand > span { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 14px; color: #fff; background: var(--tools-primary); font-size: 19px; }
.auth-result__brand strong, .auth-result__brand small { display: block; }
.auth-result__brand strong { font-size: 16px; }
.auth-result__brand small { margin-top: 2px; color: var(--tools-muted); font-size: 11.5px; }
.auth-secret-line { margin-top: 20px; padding: 14px 16px; border: 1px solid var(--tools-line); border-radius: 15px; background: rgba(255,255,255,.8); }
.auth-secret-line > span { display: block; color: var(--tools-muted); font-size: 11px; }
.auth-secret-line > strong { display: block; margin-top: 4px; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; letter-spacing: .05em; }
.auth-secret-line > div { display: flex; gap: 14px; margin-top: 8px; }
.auth-secret-line button { padding: 0; border: 0; color: var(--tools-primary); background: transparent; font-size: 11.5px; font-weight: 750; cursor: pointer; }
.auth-code-block { padding: 26px 0 22px; text-align: center; }
.auth-code-block > span { display: block; color: var(--tools-muted); font-size: 12px; }
.auth-code-block > strong { display: block; margin: 6px 0 15px; color: #262d40; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(38px, 8vw, 54px); font-weight: 850; letter-spacing: .11em; line-height: 1.15; }
.auth-validity { padding-top: 16px; border-top: 1px solid var(--tools-line); }
.auth-validity > div:first-child { display: flex; align-items: center; justify-content: space-between; color: var(--tools-muted); font-size: 12px; }
.auth-validity strong { color: #444c5d; }
.auth-progress { height: 8px; margin: 9px 0 8px; overflow: hidden; border-radius: 999px; background: #e7e8f0; }
.auth-progress i { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--tools-primary), #8f86ff); transition: width .25s linear; }
.auth-validity > small { color: #9399a6; font-size: 10.5px; }

@media (max-width: 1099.98px) { .tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .auth-input-grid { grid-template-columns: 1fr 1fr; } .auth-input-card:last-child { grid-column: 1 / -1; } .auth-file { min-height: 130px; } }
@media (max-width: 767.98px) {
    .tools-container, .local-tool-container { width: min(100% - 24px, 1240px); }
    .tools-hero { padding: calc(24px + env(safe-area-inset-top, 0px)) 0 28px; }
    .tools-hero h1 { margin-top: 10px; font-size: 29px; }
    .tools-hero p { font-size: 13px; }
    .tools-search { height: 50px; margin-top: 19px; border-radius: 16px; }
    .tools-search button { height: 38px; padding: 0 15px; border-radius: 12px; }
    .tools-content { padding-top: 24px; padding-bottom: 24px; }
    .tools-section + .tools-section { margin-top: 30px; }
    .tools-section__head { display: block; margin-bottom: 14px; }
    .tools-section__head h2 { font-size: 19px; }
    .tools-section__head > p { margin: 6px 0 0 44px; }
    .tools-grid { grid-template-columns: 1fr; gap: 10px; }
    .tool-card { min-height: 104px; padding: 15px; border-radius: 18px; }
    .tool-card__icon { width: 50px; height: 50px; flex-basis: 50px; border-radius: 15px; }
    .local-tool-page { padding: calc(17px + env(safe-area-inset-top, 0px)) 0 24px; }
    .tool-back { margin-bottom: 17px; }
    .local-tool-heading { align-items: flex-start; gap: 12px; }
    .local-tool-heading > span { width: 48px; height: 48px; flex-basis: 48px; border-radius: 16px; font-size: 21px; }
    .local-tool-heading h1 { font-size: 23px; }
    .local-tool-heading p { font-size: 12.5px; }
    .local-tool-card { padding: 17px; border-radius: 20px; }
    .tool-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .tool-actions .is-primary { grid-column: 1 / -1; }
    .auth-input-grid { grid-template-columns: 1fr; gap: 11px; }
    .auth-input-card:last-child { grid-column: auto; }
    .auth-file { min-height: 130px; }
    .auth-result { padding: 18px; border-radius: 22px; }
    .auth-code-block > strong { letter-spacing: .075em; }
}

@media (max-width: 359.98px) { .tool-actions { grid-template-columns: 1fr; } .tool-actions .is-primary { grid-column: auto; } .auth-code-block > strong { font-size: 34px; } }
@media (prefers-reduced-motion: reduce) { .tool-card, .tool-button, .auth-progress i { transition: none; } }
