/* Daily2ools – public theme */
:root {
  --c-primary: #4F46E5;
  --c-primary-600: #3E1EFB;
  --c-primary-700: #0229BE;
  --c-primary-50: #EEF2FF;
  --c-primary-100: #E0E7FF;
  --c-ink: #1E1B4B;
  --c-amber: #FC5A03;
  --c-amber-50: #FFFBEB;
  --c-green: #059669;
  --c-green-50: #ECFDF5;
  --c-red: #DC2626;
  --c-red-50: #FEF2F2;
  --c-text: #1F2937;
  --c-muted: #6B7280;
  --c-border: #E5E7EB;
  --c-border-2: #D1D5DB;
  --c-bg: #FFFFFF;
  --c-soft: #F8FAFC;
  --c-soft-2: #F1F5F9;
  --c-card: #FFFFFF;
  --c-input: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 6px 24px -8px rgba(30, 27, 75, .16);
  --shadow-lg: 0 24px 60px -20px rgba(30, 27, 75, .32);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'Cascadia Code', Menlo, Consolas, monospace;
  --header-h: 68px;
  --wrap: 1240px;
  color-scheme: light;
}
[data-theme="dark"] {
  --c-primary: #818CF8;
  --c-primary-600: #6366F1;
  --c-primary-700: #A5B4FC;
  --c-primary-50: rgba(129, 140, 248, .12);
  --c-primary-100: rgba(129, 140, 248, .22);
  --c-ink: #F8FAFC;
  --c-amber-50: rgba(245, 158, 11, .12);
  --c-green: #34D399;
  --c-green-50: rgba(52, 211, 153, .12);
  --c-red: #F87171;
  --c-red-50: rgba(248, 113, 113, .12);
  --c-text: #E5E7EB;
  --c-muted: #9CA3AF;
  --c-border: #243045;
  --c-border-2: #334155;
  --c-bg: #0B1120;
  --c-soft: #0F172A;
  --c-soft-2: #162033;
  --c-card: #111A2E;
  --c-input: #0E1628;
  --shadow: 0 6px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--c-text); background: var(--c-bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg, canvas, video { max-width: 100%; }
img { height: auto; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-600); }
h1, h2, h3, h4, h5 { color: var(--c-ink); font-weight: 800; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 1.15rem + 1.3vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--c-primary) 55%, transparent); outline-offset: 2px; }
::selection { background: var(--c-primary-100); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.section { padding: 72px 0; }
.section--soft { background: var(--c-soft); }
.section--tight { padding: 44px 0; }
.kicker { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--c-primary); margin-bottom: 10px; }
.kicker::before { content: ""; width: 18px; height: 2px; background: var(--c-amber); border-radius: 2px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 8px 0 0; color: var(--c-muted); max-width: 640px; }
.lead { font-size: 1.12rem; color: var(--c-muted); }
.muted { color: var(--c-muted); }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--c-primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 1000; }
.skip-link:focus { left: 8px; color: #fff; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: .95rem; cursor: pointer; transition: .18s ease; white-space: nowrap; text-decoration: none; line-height: 1.2; }
.btn--primary { background: var(--c-primary); color: #fff; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--c-primary) 70%, transparent); }
.btn--primary:hover { background: var(--c-primary-600); color: #fff; transform: translateY(-1px); }
.btn--amber { background: var(--c-amber); color: #1E1B4B; }
.btn--amber:hover { background: #FBBF24; color: #1E1B4B; }
.btn--ghost { background: var(--c-card); color: var(--c-text); border-color: var(--c-border); }
.btn--ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn--white { background: #fff; color: #1E1B4B; }
.btn--white:hover { background: #EEF2FF; color: #1E1B4B; }
.btn--sm { padding: 8px 14px; font-size: .86rem; border-radius: 10px; }
.btn--icon { width: 42px; height: 42px; padding: 0; border-radius: 12px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--c-bg) 86%, transparent); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--c-border); }
.site-header__in { height: var(--header-h); display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--c-ink); font-weight: 800; font-size: 1.32rem; letter-spacing: -.03em; flex-shrink: 0; }
.brand:hover { color: var(--c-ink); }
.brand img { width: 36px; height: 36px; }
.brand b { color: var(--c-primary); font-weight: 800; }
.brand__logo { height: 38px; width: auto; }
.brand__logo        { height: 40px; width: auto; display: block; }
.brand__logo--dark  { display: none; }             
.brand__logo--light { display: block; }             
[data-theme="dark"]  .brand__logo--light { display: none; }
[data-theme="dark"]  .brand__logo--dark  { display: block; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: 14px; }
.nav__link { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 10px; color: var(--c-text); font-weight: 600; font-size: .94rem; background: none; border: 0; cursor: pointer; }
.nav__link:hover, .nav__link.is-active, .nav__item.is-open > .nav__link { background: var(--c-soft-2); color: var(--c-primary); }
.nav__link .fa-chevron-down { font-size: .65rem; transition: transform .2s; }
.nav__item { position: relative; }
.nav__item.is-open .fa-chevron-down { transform: rotate(180deg); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-trigger { display: inline-flex; align-items: center; gap: 10px; height: 42px; min-width: 240px; padding: 0 12px 0 14px; border-radius: 12px; border: 1px solid var(--c-border); background: var(--c-soft); color: var(--c-muted); cursor: pointer; font-size: .92rem; transition: .15s; }
.search-trigger:hover { border-color: var(--c-primary); color: var(--c-text); }
.search-trigger kbd { margin-left: auto; font-family: var(--font); font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--c-border); background: var(--c-card); color: var(--c-muted); }
.icon-btn { position: relative; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--c-border); background: var(--c-card); color: var(--c-text); cursor: pointer; transition: .15s; font-size: 1rem; }
.icon-btn:hover { color: var(--c-primary); border-color: var(--c-primary); }
.icon-btn__count { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--c-amber); color: #1E1B4B; font-size: .7rem; font-weight: 800; display: none; align-items: center; justify-content: center; }
.icon-btn__count.is-on { display: inline-flex; }
.theme-toggle .fa-sun { display: none; }
[data-theme="dark"] .theme-toggle .fa-sun { display: inline; }
[data-theme="dark"] .theme-toggle .fa-moon { display: none; }
.menu-toggle { display: none; }

/* mega menu */
.mega { position: absolute; top: calc(100% + 10px); left: -120px; width: min(980px, calc(100vw - 40px)); background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 22px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s ease; z-index: 70; }
.nav__item.is-open .mega { opacity: 1; visibility: visible; transform: none; }
.mega__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 18px; max-height: calc(100vh - 160px); overflow: auto; }
.mega__col h4 { display: flex; align-items: center; gap: 8px; font-size: .86rem; margin: 10px 0 6px; }
.mega__col h4 a { color: var(--c-ink); }
.mega__col h4 i { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: .74rem; }
.mega__col ul { list-style: none; padding: 0; margin: 0 0 6px; }
.mega__col li a { display: block; padding: 4px 0 4px 34px; color: var(--c-muted); font-size: .87rem; font-weight: 500; }
.mega__col li a:hover { color: var(--c-primary); }
.mega__col .more { font-weight: 700; color: var(--c-primary); }
.mega__foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--c-border); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .9rem; color: var(--c-muted); }

/* drawer (mobile) */
.drawer { position: fixed; inset: 0; z-index: 90; visibility: hidden; }
.drawer.is-open { visibility: visible; }
.drawer__bg { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); opacity: 0; transition: .2s; }
.drawer.is-open .drawer__bg { opacity: 1; }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 88vw); background: var(--c-bg); transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--c-border); }
.drawer__body { overflow-y: auto; padding: 12px 18px 30px; flex: 1; }
.drawer__body > a { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--c-border); color: var(--c-text); font-weight: 700; }
.drawer details { border-bottom: 1px solid var(--c-border); }
.drawer summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 4px; font-weight: 700; cursor: pointer; }
.drawer summary::-webkit-details-marker { display: none; }
.drawer summary::after { content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .7rem; margin-left: auto; color: var(--c-muted); transition: .2s; }
.drawer details[open] summary::after { transform: rotate(180deg); }
.drawer summary i, .drawer__body > a i { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--c-primary-50); color: var(--c-primary); font-size: .8rem; }
.drawer details ul { list-style: none; margin: 0; padding: 0 0 10px 38px; }
.drawer details li a { display: block; padding: 6px 0; color: var(--c-muted); font-size: .93rem; }

/* ---------- search palette ---------- */
.palette { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; }
.palette.is-open { display: flex; }
.palette__bg { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
.palette__box { position: relative; width: 100%; max-width: 640px; background: var(--c-card); border: 1px solid var(--c-border); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .16s ease; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.palette__input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--c-border); }
.palette__input i { color: var(--c-primary); }
.palette__input input { flex: 1; height: 60px; border: 0; outline: 0; background: none; font-size: 1.08rem; }
.palette__input kbd { font-family: var(--font); font-size: .72rem; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--c-border); color: var(--c-muted); }
.palette__list { max-height: min(60vh, 460px); overflow-y: auto; padding: 8px; margin: 0; list-style: none; }
.palette__group { padding: 10px 12px 4px; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); }
.palette__item a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--c-text); }
.palette__item a i { width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--c-primary-50); color: var(--c-primary); }
.palette__item strong { display: block; font-size: .95rem; }
.palette__item small { display: block; color: var(--c-muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 440px; }
.palette__item span.cat { margin-left: auto; font-size: .74rem; color: var(--c-muted); white-space: nowrap; }
.palette__item.is-sel a, .palette__item a:hover { background: var(--c-primary-50); }
.palette__empty { padding: 30px 16px; text-align: center; color: var(--c-muted); }
.palette__foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--c-border); font-size: .76rem; color: var(--c-muted); }
mark.hl { background: color-mix(in srgb, var(--c-amber) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 500px at 85% -10%, rgba(245, 158, 11, 0.12), transparent 60%), radial-gradient(900px 600px at -10% 10%, rgba(79, 70, 229, 0.15), transparent 60%), linear-gradient(160deg, var(--c-bg) 0%, var(--c-soft) 100%); color: var(--c-ink); padding: 76px 0 92px; border-bottom: 1px solid var(--c-border); }
[data-theme="dark"] .hero { background: radial-gradient(1200px 500px at 85% -10%, rgba(245, 158, 11, 0.08), transparent 60%), radial-gradient(900px 600px at -10% 10%, rgba(129, 140, 248, 0.12), transparent 60%), linear-gradient(160deg, var(--c-bg) 0%, var(--c-soft-2) 100%); }
.hero::after { content: ""; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'%3E%3Cpath d='M28 2 54 17v30L28 62 2 47V17z' fill='none' stroke='%234F46E5' stroke-opacity='.08' stroke-width='1.5'/%3E%3C/svg%3E"); background-size: 56px 64px; mask-image: linear-gradient(to bottom, #000, transparent 85%); pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; }
.hero__badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 30px; background: var(--c-primary-50); border: 1px solid var(--c-primary-100); color: var(--c-primary-600); font-size: .85rem; font-weight: 600; margin-bottom: 20px; }
.hero__badge b { color: var(--c-amber); }
.hero h1 { color: var(--c-ink); max-width: 820px; margin-bottom: 16px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--c-amber), #FC5A03); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--c-muted); max-width: 640px; font-size: 1.15rem; }
.hero-search { position: relative; max-width: 700px; margin: 30px 0 18px; }
.hero-search input { width: 100%; height: 64px; border-radius: 18px; border: 1px solid var(--c-border); padding: 0 140px 0 56px; font-size: 1.05rem; color: var(--c-text); background: var(--c-card); box-shadow: var(--shadow); outline: 0; transition: border-color .2s; }
.hero-search input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-50); }
.hero-search > i { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); color: var(--c-primary); font-size: 1.1rem; }
.hero-search button { position: absolute; right: 8px; top: 8px; height: 48px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hero-chips span { color: var(--c-muted); font-size: .9rem; margin-right: 4px; }
.hero-chips a { padding: 6px 13px; border-radius: 30px; background: var(--c-card); border: 1px solid var(--c-border); color: var(--c-text); font-size: .86rem; font-weight: 600; transition: all 0.2s; }
.hero-chips a:hover { background: var(--c-primary-50); border-color: var(--c-primary); color: var(--c-primary); }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-top: 44px; max-width: 860px; }
.hero-stats div { padding: 16px 18px; border-radius: 16px; background: var(--c-card); border: 1px solid var(--c-border); box-shadow: var(--shadow-sm); text-align: center; display: flex; flex-direction: column; justify-content: center; }
.hero-stats strong { display: block; font-size: clamp(1.15rem, 1.5vw, 1.6rem); font-weight: 800; color: var(--c-ink); line-height: 1.2; white-space: nowrap; margin-bottom: 4px;}
.hero-stats span { font-size: .85rem; color: var(--c-muted); line-height: 1.3;}
/* page hero (inner pages) */
.page-hero { background: linear-gradient(180deg, var(--c-primary-50), transparent); border-bottom: 1px solid var(--c-border); padding: 34px 0 30px; }
.page-hero h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); margin: 6px 0 10px; }
.page-hero p { color: var(--c-muted); max-width: 760px; margin: 0; font-size: 1.05rem; }
.page-hero__icon { width: 58px; height: 58px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1.45rem; margin-bottom: 8px; box-shadow: var(--shadow); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; padding: 0; margin: 0 0 8px; font-size: .86rem; color: var(--c-muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.crumbs a { color: var(--c-muted); }
.crumbs a:hover { color: var(--c-primary); }

/* ---------- cards ---------- */
.grid { display: grid; gap: 18px; }
.grid--tools { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid--cats { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.tool-card { position: relative; display: flex; gap: 14px; padding: 18px; border-radius: var(--r-lg); background: var(--c-card); border: 1px solid var(--c-border); color: var(--c-text); transition: .18s ease; min-height: 100%; }
.tool-card:hover { border-color: color-mix(in srgb, var(--c-primary) 45%, var(--c-border)); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--c-text); }
.tool-card__icon { width: 46px; height: 46px; flex-shrink: 0; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--tc, var(--c-primary)); background: color-mix(in srgb, var(--tc, var(--c-primary)) 12%, transparent); }
.tool-card h3 { font-size: 1rem; margin: 1px 0 4px; padding-right: 26px; }
.tool-card p { font-size: .86rem; color: var(--c-muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-card__badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: .7rem; font-weight: 800; letter-spacing: .02em; }
.badge--new { background: var(--c-green-50); color: var(--c-green); }
.badge--hot { background: var(--c-amber-50); color: #B45309; }
[data-theme="dark"] .badge--hot { color: #FCD34D; }
.badge--cat { background: var(--c-primary-50); color: var(--c-primary); }
.fav-btn { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 9px; border: 0; background: transparent; color: var(--c-border-2); cursor: pointer; font-size: .95rem; display: inline-flex; align-items: center; justify-content: center; transition: .15s; z-index: 2; }
.fav-btn:hover { color: #EF4444; background: var(--c-red-50); }
.fav-btn.is-on { color: #EF4444; }
.fav-btn.is-on i::before { font-weight: 900; }
.fav-toggle.is-on { border-color: #FCA5A5; color: #EF4444; background: var(--c-red-50); }

.cat-card { display: flex; flex-direction: column; padding: 22px; border-radius: var(--r-lg); background: var(--c-card); border: 1px solid var(--c-border); color: var(--c-text); transition: .18s; position: relative; overflow: hidden; }
.cat-card::before { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--cc, var(--c-primary)); opacity: .07; transition: .25s; }
.cat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: color-mix(in srgb, var(--cc) 40%, var(--c-border)); color: var(--c-text); }
.cat-card:hover::before { transform: scale(1.3); }
.cat-card__icon { width: 50px; height: 50px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--cc, var(--c-primary)); font-size: 1.2rem; margin-bottom: 14px; box-shadow: 0 10px 20px -10px var(--cc); }
.cat-card h3 { font-size: 1.08rem; margin-bottom: 6px; }
.cat-card p { font-size: .88rem; color: var(--c-muted); margin-bottom: 14px; }
.cat-card__links { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 4px; }
.cat-card__links span { font-size: .86rem; color: var(--c-text); display: flex; align-items: center; gap: 8px; }
.cat-card__links span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--cc); }

.cat-card__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: .85rem; font-weight: 700; color: var(--c-primary); }
.cat-card__foot span { color: var(--c-muted); font-weight: 600; }

/* country cards */
.country-card { padding: 22px; border-radius: var(--r-lg); background: var(--c-card); border: 1px solid var(--c-border); }
.country-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.country-card__flag { font-size: 1.9rem; line-height: 1; }
.country-card h3 { margin: 0; font-size: 1.05rem; }
.country-card small { color: var(--c-muted); }
.country-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.country-card li a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--c-soft); color: var(--c-text); font-size: .9rem; font-weight: 600; }
.country-card li a:hover { background: var(--c-primary-50); color: var(--c-primary); }
.country-card li a i { color: var(--c-primary); width: 16px; text-align: center; }

/* feature list */
.feature { padding: 24px; border-radius: var(--r-lg); background: var(--c-card); border: 1px solid var(--c-border); }
.feature i { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: var(--c-primary-50); color: var(--c-primary); font-size: 1.15rem; margin-bottom: 14px; }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--c-muted); font-size: .92rem; margin: 0; }

/* post card */
.post-card { display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; background: var(--c-card); border: 1px solid var(--c-border); transition: .18s; height: 100%; }
.post-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.post-card__img { aspect-ratio: 16 / 9; background: var(--c-soft-2); overflow: hidden; display: block; }
.post-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card:hover .post-card__img img { transform: scale(1.04); }
.post-card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.post-card__meta { display: flex; gap: 12px; font-size: .78rem; color: var(--c-muted); margin-bottom: 8px; flex-wrap: wrap; }
.post-card h3 { font-size: 1.08rem; margin-bottom: 8px; }
.post-card h3 a { color: var(--c-ink); }
.post-card h3 a:hover { color: var(--c-primary); }
.post-card p { font-size: .9rem; color: var(--c-muted); flex: 1; }
.post-card__more { font-weight: 700; font-size: .88rem; }

/* recent / favourites strip */
.mytools { display: none; padding: 26px 0 0; }
.mytools.is-on { display: block; }
.mytools__row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.mytools__row a { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; background: var(--c-card); border: 1px solid var(--c-border); color: var(--c-text); font-weight: 600; font-size: .88rem; }
.mytools__row a:hover { border-color: var(--c-primary); color: var(--c-primary); }
.mytools__row a i { color: var(--c-primary); }
.mytools h4 { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); margin: 0 0 10px; }

/* filter bar */
.filter-bar { position: sticky; top: var(--header-h); z-index: 20; background: color-mix(in srgb, var(--c-bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--c-border); padding: 14px 0; }
.filter-bar__in { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.filter-search { position: relative; flex: 1 1 280px; max-width: 460px; }
.filter-search i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--c-muted); }
.filter-search input { width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--c-border); background: var(--c-input); padding: 0 14px 0 42px; outline: 0; }
.filter-search input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-50); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 8px 14px; border-radius: 30px; border: 1px solid var(--c-border); background: var(--c-card); color: var(--c-text); font-size: .86rem; font-weight: 600; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover, .chip.is-active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.cat-block { padding-top: 34px; scroll-margin-top: calc(var(--header-h) + 90px); }
.cat-block__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cat-block__head i { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.cat-block__head h2 { font-size: 1.35rem; margin: 0; }
.cat-block__head a { margin-left: auto; font-weight: 700; font-size: .88rem; }
.no-results { text-align: center; padding: 60px 20px; color: var(--c-muted); display: none; }
.no-results.is-on { display: block; }
.no-results i { font-size: 2.4rem; color: var(--c-border-2); margin-bottom: 12px; }

/* ---------- tool page ---------- */
.tool-head { padding: 26px 0 8px; }
.tool-head__row { display: flex; gap: 18px; align-items: flex-start; }
.tool-head__icon { width: 62px; height: 62px; flex-shrink: 0; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; color: #fff; background: var(--tc, var(--c-primary)); box-shadow: 0 14px 30px -14px var(--tc, var(--c-primary)); }
.tool-head h1 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); margin: 0 0 6px; }
.tool-head p { margin: 0; color: var(--c-muted); font-size: 1.03rem; max-width: 820px; }
.tool-head__actions { display: flex; gap: 8px; margin-left: auto; flex-shrink: 0; }
.tool-head__meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: .84rem; color: var(--c-muted); }
.tool-head__meta span { display: inline-flex; align-items: center; gap: 6px; }
.tool-head__meta i { color: var(--c-green); }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; padding: 18px 0 70px; align-items: start; }
.tool-main { min-width: 0; }
.tool-app { position: relative; background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--r-xl); padding: 26px; box-shadow: var(--shadow); min-height: 220px; }
.tool-app.is-full { position: fixed; inset: 0; z-index: 95; border-radius: 0; overflow: auto; padding: 28px max(20px, calc((100vw - 1200px) / 2)); }
.tool-app__bar { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 3; }
.tool-app__bar button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--c-border); background: var(--c-card); color: var(--c-muted); cursor: pointer; }
.tool-app__bar button:hover { color: var(--c-primary); border-color: var(--c-primary); }
#thTool { min-height: 160px; }
#thTool:not(.is-ready) { display: flex; align-items: center; justify-content: center; }
.tool-app noscript p { margin: 0; }
.tool-side { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 18px; }
.side-card { background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 18px; }
.side-card h4 { font-size: .92rem; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.side-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.side-list a { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 10px; color: var(--c-text); font-size: .88rem; font-weight: 600; }
.side-list a:hover { background: var(--c-soft-2); color: var(--c-primary); }
.side-list a i { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; background: var(--c-primary-50); color: var(--c-primary); }
.side-list a span.n { margin-left: auto; font-size: .75rem; color: var(--c-muted); }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-row a, .share-row button { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--c-border); background: var(--c-card); color: var(--c-text); cursor: pointer; }
.share-row a:hover, .share-row button:hover { color: #fff; background: var(--c-primary); border-color: var(--c-primary); }

/* article / prose */
.prose { font-size: 1.02rem; line-height: 1.78; color: var(--c-text); overflow-wrap: anywhere; }
.prose h2 { font-size: 1.55rem; margin: 1.8em 0 .6em; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h3 { font-size: 1.2rem; margin: 1.5em 0 .5em; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--c-primary); }
.prose img { border-radius: var(--r); margin: 1em 0; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--c-primary) 35%, transparent); }
.prose blockquote { margin: 1.4em 0; padding: 14px 20px; border-left: 4px solid var(--c-amber); background: var(--c-amber-50); border-radius: 0 12px 12px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--c-border); padding: 10px 12px; text-align: left; }
.prose th { background: var(--c-soft-2); font-weight: 700; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--c-soft-2); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: #0F172A; color: #E2E8F0; padding: 16px; border-radius: 12px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose .formula, .prose .callout { padding: 16px 18px; border-radius: 14px; background: var(--c-primary-50); border: 1px solid var(--c-primary-100); margin: 1.2em 0; }
.guide { margin-top: 34px; background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--r-xl); padding: 32px; }
.toc { background: var(--c-soft); border: 1px solid var(--c-border); border-radius: 14px; padding: 16px 20px; margin-bottom: 26px; }
.toc strong { display: block; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 1.2em; columns: 2; column-gap: 28px; }
.toc li { font-size: .92rem; margin: 3px 0; break-inside: avoid; }

/* faq accordion */
.faq-list { display: grid; gap: 10px; }
.faq { border: 1px solid var(--c-border); border-radius: 14px; background: var(--c-card); overflow: hidden; }
.faq summary { list-style: none; cursor: pointer; padding: 16px 52px 16px 20px; font-weight: 700; color: var(--c-ink); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 8px; background: var(--c-primary-50); color: var(--c-primary); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 700; transition: .2s; }
.faq[open] summary::after { content: "−"; background: var(--c-primary); color: #fff; }
.faq__a { padding: 0 20px 18px; color: var(--c-muted); }
.faq__a p:last-child { margin: 0; }
.block-title { display: flex; align-items: center; gap: 10px; font-size: 1.35rem; margin: 40px 0 16px; }
.block-title i { color: var(--c-primary); }

/* ---------- blog ---------- */
.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; padding: 40px 0 70px; align-items: start; }
.article-cover { border-radius: var(--r-xl); overflow: hidden; margin-bottom: 28px; aspect-ratio: 16 / 8; background: var(--c-soft-2); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--c-muted); font-size: .88rem; margin-top: 8px; }
.article-meta i { color: var(--c-primary); margin-right: 4px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 42px; height: 42px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--c-border); background: var(--c-card); color: var(--c-text); font-weight: 700; font-size: .9rem; }
.pager a:hover { border-color: var(--c-primary); color: var(--c-primary); }
.pager .is-active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.pager .is-disabled { opacity: .4; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 36px; }
.post-nav a { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--c-border); background: var(--c-card); color: var(--c-text); }
.post-nav a:hover { border-color: var(--c-primary); }
.post-nav small { display: block; color: var(--c-muted); font-size: .78rem; margin-bottom: 4px; }
.post-nav strong { font-size: .95rem; }
.post-nav .next { text-align: right; }

/* ---------- forms (site) ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.f-label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 6px; color: var(--c-ink); }
.f-input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--c-border); background: var(--c-input); outline: 0; transition: .15s; }
.f-input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-50); }
textarea.f-input { min-height: 140px; resize: vertical; }
.f-msg { margin-top: 12px; font-size: .92rem; font-weight: 600; }
.f-msg.is-ok { color: var(--c-green); }
.f-msg.is-err { color: var(--c-red); }
.contact-card { display: flex; gap: 14px; padding: 18px; border-radius: 16px; border: 1px solid var(--c-border); background: var(--c-card); align-items: flex-start; }
.contact-card i { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--c-primary-50); color: var(--c-primary); }
.contact-card strong { display: block; color: var(--c-ink); }
.contact-card a, .contact-card span { color: var(--c-muted); font-size: .92rem; word-break: break-word; }

/* about */
.about-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: 50px; align-items: center; margin-bottom: 70px; }
.about-row:last-child { margin-bottom: 0; }
.about-row.is-flip .about-row__media { order: 2; }
.about-row__media img { width: 100%; border-radius: var(--r-xl); box-shadow: var(--shadow); }
.about-row__art { aspect-ratio: 4 / 3; border-radius: var(--r-xl); background: linear-gradient(150deg, #1E1B4B, #4F46E5); display: flex; align-items: center; justify-content: center; color: #FCD34D; font-size: 5rem; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.about-row__art::after { content: ""; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'%3E%3Cpath d='M28 2 54 17v30L28 62 2 47V17z' fill='none' stroke='%23ffffff' stroke-opacity='.08' stroke-width='1.5'/%3E%3C/svg%3E"); }
@media (max-width: 991.98px) { .about-row { grid-template-columns: 1fr; gap: 24px; margin-bottom: 50px; } .about-row.is-flip .about-row__media { order: 0; } }

/* cta band */
.cta { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 46px; background: linear-gradient(135deg, #312E81, #4F46E5 60%, #6366F1); color: #fff; display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; align-items: center; }
.cta::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 280px; height: 280px; border-radius: 50%; background: rgba(245, 158, 11, .35); filter: blur(30px); }
.cta h2 { color: #fff; margin-bottom: 10px; }
.cta p { color: rgba(255, 255, 255, .82); margin: 0; }
.cta form { position: relative; z-index: 1; display: flex; gap: 10px; flex-wrap: wrap; }
.cta input { flex: 1 1 220px; height: 52px; border-radius: 14px; border: 0; padding: 0 16px; color: #111827; outline: 0; }
.cta .f-msg { width: 100%; color: #FCD34D; }

/* ---------- footer ---------- */
.site-footer { background: #0F0D2E; color: rgba(255, 255, 255, .72); padding: 64px 0 0; margin-top: 0; }
.site-footer a { color: rgba(255, 255, 255, .72); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.footer-about p { font-size: .92rem; margin: 14px 0 18px; max-width: 320px; }
.footer-col h4 { color: #fff; font-size: .95rem; margin: 6px 0 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; font-size: .9rem; }
.social { display: flex; gap: 8px; flex-wrap: wrap; }
.social a { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .08); }
.social a:hover { background: var(--c-amber); color: #1E1B4B; }
.footer-countries { margin-top: 40px; padding: 18px 0; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: .86rem; align-items: center; }
.footer-countries strong { color: #fff; }
.footer-bottom { padding: 20px 0 26px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .85rem; }
.footer-bottom nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- ads ---------- */
.th-ad { margin: 22px auto; text-align: center; max-width: 100%; overflow: hidden; }
.th-ad__label { display: block; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); opacity: .75; margin-bottom: 6px; }
.th-ad__body { min-height: 90px; display: flex; align-items: center; justify-content: center; }
.th-ad__body > * { max-width: 100%; }
.th-ad__placeholder { width: 100%; min-height: 90px; border: 2px dashed var(--c-border-2); border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--c-muted); font-size: .85rem; font-weight: 600; background: repeating-linear-gradient(45deg, transparent, transparent 10px, var(--c-soft) 10px, var(--c-soft) 20px); padding: 14px; }
.th-ad--tool_sidebar .th-ad__body, .th-ad--blog_sidebar .th-ad__body { min-height: 250px; }
.th-ad--tool_sidebar .th-ad__placeholder, .th-ad--blog_sidebar .th-ad__placeholder { min-height: 250px; flex-direction: column; }
.th-ad--header_below { margin: 14px auto 0; }
.ad-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.th-ad-sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: var(--c-card); border-top: 1px solid var(--c-border); box-shadow: 0 -6px 20px rgba(0, 0, 0, .08); padding: 6px; display: none; }
.th-ad-sticky .th-ad { margin: 0; }
.th-ad-sticky .th-ad__placeholder, .th-ad-sticky .th-ad__body { min-height: 50px; }
.th-ad-sticky__close { position: absolute; top: -28px; right: 8px; width: 28px; height: 28px; border-radius: 8px 8px 0 0; border: 1px solid var(--c-border); border-bottom: 0; background: var(--c-card); color: var(--c-muted); cursor: pointer; font-size: 1.1rem; line-height: 1; }
@media (min-width: 768px) { .th-ad--mobile { display: none !important; } }
@media (max-width: 767.98px) { .th-ad--desktop { display: none !important; } .th-ad-sticky { display: block; } body.has-sticky-ad { padding-bottom: 66px; } }

/* cookie consent */
.consent { position: fixed; left: 16px; bottom: 16px; z-index: 96; max-width: 420px; background: var(--c-card); border: 1px solid var(--c-border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 20px; display: none; }
.consent.is-on { display: block; animation: pop .2s ease; }
.consent h4 { font-size: 1rem; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.consent p { font-size: .88rem; color: var(--c-muted); margin-bottom: 14px; }
.consent__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 50; width: 46px; height: 46px; border-radius: 14px; border: 0; background: var(--c-primary); color: #fff; cursor: pointer; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(10px); transition: .2s; }
.to-top.is-on { opacity: 1; visibility: visible; transform: none; }
body.has-sticky-ad .to-top { bottom: 84px; }

/* =================================================================
   Tool components (rendered by /js/tools/*.js)
   ================================================================= */
.th-stack { display: grid; gap: 16px; min-width: 0; }
.th-stack > * { min-width: 0; }
.th-muted { color: var(--c-muted); }
.th-error { color: var(--c-red); font-weight: 600; margin: 0; }
.th-center { text-align: center; }
.th-mono { font-family: var(--mono); font-size: .92em; }
.th-wrap { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.th-lead { font-size: 1.05rem; line-height: 1.7; margin: 0; }
.th-list { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.th-list li::marker { color: var(--c-primary); }
.is-warn { color: #B45309 !important; }
.is-ok { color: var(--c-green) !important; }
[data-theme="dark"] .is-warn { color: #FCD34D !important; }
.th-scrollbox { max-height: 240px; overflow: auto; padding: 12px; background: var(--c-soft); border-radius: 10px; }

/* form controls */
.th-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.th-field__label { font-size: .84rem; font-weight: 700; color: var(--c-ink); }
.th-field__help { font-size: .78rem; color: var(--c-muted); }
.th-field--check, label.th-field--check { flex-direction: row; align-items: center; gap: 10px; font-size: .9rem; font-weight: 600; cursor: pointer; display: inline-flex; user-select: none; }
.th-field.th-field--check { display: flex; padding-top: 26px; }
.th-input { width: 100%; min-width: 0; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--c-border); background: var(--c-input); color: var(--c-text); outline: 0; transition: border-color .15s, box-shadow .15s; font-size: .98rem; }
.th-input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-50); }
.th-input::placeholder { color: color-mix(in srgb, var(--c-muted) 75%, transparent); }
.th-input[readonly] { background: var(--c-soft); }
.th-input--xl { height: 58px; font-size: 1.15rem; font-weight: 600; border-radius: 14px; }
.th-textarea { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.th-select { appearance: none; -webkit-appearance: none; padding-right: 38px; 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.5 6 6.5 11 1.5' fill='none' stroke='%236B7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; cursor: pointer; }
input[type="color"].th-input { padding: 4px; cursor: pointer; min-width: 56px; }
input[type="range"].th-input { padding: 0; height: 30px; border: 0; background: none; box-shadow: none; accent-color: var(--c-primary); }
input[type="file"].th-input { padding: 9px 10px; height: auto; }
.th-check { width: 20px; height: 20px; accent-color: var(--c-primary); cursor: pointer; flex-shrink: 0; margin: 0; }
.th-affix { position: relative; display: flex; }
.th-affix .th-input { padding-right: 64px; }
.th-unit { position: absolute; right: 6px; top: 6px; bottom: 6px; display: flex; align-items: center; padding: 0 10px; border-radius: 8px; background: var(--c-soft-2); color: var(--c-muted); font-size: .8rem; font-weight: 700; pointer-events: none; }
.th-unit:empty { display: none; }

.th-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: .92rem; cursor: pointer; transition: .15s; white-space: nowrap; text-decoration: none; }
.th-btn--primary { background: var(--c-primary); color: #fff; }
.th-btn--primary:hover { background: var(--c-primary-600); color: #fff; }
.th-btn--ghost { background: var(--c-card); border-color: var(--c-border); color: var(--c-text); }
.th-btn--ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }
.th-btn--sm { height: 36px; padding: 0 12px; font-size: .84rem; border-radius: 10px; }
.th-btn--icon { width: 40px; height: 40px; padding: 0; border-radius: 11px; background: var(--c-card); border: 1px solid var(--c-border); color: var(--c-text); }
.th-btn--icon:hover { color: var(--c-primary); border-color: var(--c-primary); }
.th-btn:disabled { opacity: .5; cursor: not-allowed; }
.th-btn.is-rec { background: var(--c-red); animation: rec 1.4s infinite; }
@keyframes rec { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--c-red) 15%, transparent); } }
.th-btngrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }

.th-form { display: grid; gap: 18px; }
.th-form__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 16px; }
.th-col-full { grid-column: span 6; }
.th-col-half { grid-column: span 3; }
.th-col-third { grid-column: span 2; }
.th-col-swap { grid-column: span 6; display: flex; justify-content: center; margin: -6px 0; }
.th-swap { border-radius: 50%; transform: rotate(90deg); }
.th-form__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.th-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.th-toolbar > .th-field { flex: 0 1 auto; }
.th-toolbar .th-input:not([type=checkbox]) { width: auto; min-width: 140px; }
.th-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.th-inline--grow > .th-input, .th-inline--grow > input { flex: 1 1 220px; }
.th-inline--wrap { gap: 10px 18px; }
.th-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.th-split > * { min-width: 0; }
.th-split--3 { grid-template-columns: repeat(3, 1fr); }
.th-split--wheel { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }

/* segmented & tabs */
.th-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 13px; background: var(--c-soft-2); max-width: 100%; }
.th-seg__btn { border: 0; background: none; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: .85rem; color: var(--c-muted); cursor: pointer; white-space: nowrap; }
.th-seg__btn:hover { color: var(--c-text); }
.th-seg__btn.is-active { background: var(--c-card); color: var(--c-primary); box-shadow: var(--shadow-sm); }
/* .th-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.th-tabs--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.th-tabs--scroll::-webkit-scrollbar { display: none; } */
.th-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }

/* Desktop: scrollbar visible (bottom par) */
.th-tabs--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--c-border-2) var(--c-soft-2);
  -webkit-overflow-scrolling: touch;
}
.th-tabs--scroll::-webkit-scrollbar { height: 8px; }
.th-tabs--scroll::-webkit-scrollbar-track {
  background: var(--c-soft-2);
  border-radius: 8px;
}
.th-tabs--scroll::-webkit-scrollbar-thumb {
  background: var(--c-border-2);
  border-radius: 8px;
}
.th-tabs--scroll::-webkit-scrollbar-thumb:hover {
  background: var(--c-primary);
}
.th-tab { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 11px; border: 1px solid var(--c-border); background: var(--c-card); color: var(--c-text); font-weight: 700; font-size: .86rem; cursor: pointer; }
.th-tab:hover { border-color: var(--c-primary); color: var(--c-primary); }
.th-tab.is-active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.th-details { border: 1px solid var(--c-border); border-radius: 14px; padding: 0 16px; margin-top: 16px; background: var(--c-soft); }
.th-details > summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
.th-details > summary::-webkit-details-marker { display: none; }
.th-details > summary::after { content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .7rem; margin-left: auto; color: var(--c-muted); transition: .2s; }
.th-details[open] > summary::after { transform: rotate(180deg); }
.th-details[open] { padding-bottom: 16px; }

/* calculator layout */
.th-calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.th-calc--wide { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.th-calc--qr { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.th-calc--editor { grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); }
.th-calc__in, .th-calc__out { min-width: 0; display: grid; gap: 16px; align-content: start; }
.th-calc__out { position: sticky; top: calc(var(--header-h) + 16px); }
.th-results { display: grid; gap: 14px; min-width: 0; }
.th-results__tools { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.th-block { min-width: 0; }
.th-block h4 { font-size: .9rem; margin: 0 0 10px; }
.th-rich { font-size: .94rem; }
.th-rich table { width: 100%; border-collapse: collapse; }
.th-rich td, .th-rich th { padding: 6px 8px; border-bottom: 1px solid var(--c-border); text-align: left; }

.th-panel { background: var(--c-soft); border: 1px solid var(--c-border); border-radius: 16px; padding: 18px; min-width: 0; display: grid; gap: 14px; }
.th-panel__title { font-size: .95rem; margin: 0; }

/* stats */
.th-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.th-stats--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.th-stat { padding: 14px 16px; border-radius: 14px; background: var(--c-soft); border: 1px solid var(--c-border); min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.th-stat__label { font-size: .76rem; font-weight: 700; color: var(--c-muted); text-transform: uppercase; letter-spacing: .04em; }
.th-stat__value { font-size: 1.15rem; font-weight: 800; color: var(--c-ink); word-break: break-word; line-height: 1.3; }
.th-stat__sub { font-size: .78rem; color: var(--c-muted); }
.th-stat--big { background: linear-gradient(135deg, var(--c-primary), #6366F1); border: 0; color: #fff; padding: 20px 22px; box-shadow: 0 16px 30px -18px var(--c-primary); }
.th-stat--big .th-stat__label { color: rgba(255, 255, 255, .78); }
.th-stat--big .th-stat__value { color: #fff; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
.th-stat--big .th-stat__sub { color: rgba(255, 255, 255, .8); }
[data-theme="dark"] .th-stat--big { background: linear-gradient(135deg, #4F46E5, #6366F1); }
.th-stat--up:not(.th-stat--big) { background: var(--c-green-50); border-color: color-mix(in srgb, var(--c-green) 25%, transparent); }
.th-stat--up .th-stat__value { color: var(--c-green); }
.th-stat--down:not(.th-stat--big) { background: var(--c-red-50); border-color: color-mix(in srgb, var(--c-red) 25%, transparent); }
.th-stat--down .th-stat__value { color: var(--c-red); }
.th-stat--warn:not(.th-stat--big) { background: var(--c-amber-50); border-color: color-mix(in srgb, var(--c-amber) 30%, transparent); }
.th-stat--warn .th-stat__value { color: #B45309; }
[data-theme="dark"] .th-stat--warn .th-stat__value { color: #FCD34D; }
.th-stat--big.th-stat--up { background: linear-gradient(135deg, #059669, #10B981); }
.th-stat--big.th-stat--down { background: linear-gradient(135deg, #DC2626, #EF4444); }
.th-stat--big.th-stat--warn { background: linear-gradient(135deg, #D97706, #FC5A03); }
.th-stat--big.th-stat--up .th-stat__value, .th-stat--big.th-stat--down .th-stat__value, .th-stat--big.th-stat--warn .th-stat__value, [data-theme="dark"] .th-stat--big.th-stat--warn .th-stat__value { color: #fff; }

/* tables */
.th-table-wrap { overflow: auto; border: 1px solid var(--c-border); border-radius: 12px; max-width: 100%; }
.th-table-wrap.is-tall { max-height: 420px; }
.th-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.th-table th { position: sticky; top: 0; background: var(--c-soft-2); font-weight: 700; color: var(--c-ink); text-align: left; padding: 10px 12px; white-space: nowrap; z-index: 1; }
.th-table td { padding: 9px 12px; border-top: 1px solid var(--c-border); vertical-align: top; word-break: break-word; }
.th-table tbody tr:hover td { background: var(--c-soft); }

/* bars, donut, gauge */
.th-bars { display: grid; gap: 8px; }
.th-bars__row { display: grid; grid-template-columns: minmax(80px, 140px) 1fr auto; gap: 10px; align-items: center; font-size: .85rem; }
.th-bars__label { color: var(--c-muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-bars__track { height: 10px; border-radius: 10px; background: var(--c-soft-2); overflow: hidden; }
.th-bars__fill { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--c-primary), #818CF8); transition: width .4s ease; }
.th-bars__val { font-weight: 700; font-variant-numeric: tabular-nums; }
.th-donut { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.th-donut__ring { width: 150px; height: 150px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.th-donut__hole { width: 96px; height: 96px; border-radius: 50%; background: var(--c-card); display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 800; font-size: .9rem; color: var(--c-ink); padding: 8px; line-height: 1.2; }
.th-donut__legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .88rem; flex: 1; min-width: 160px; }
.th-donut__legend li { display: flex; align-items: center; gap: 8px; }
.th-donut__legend i { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.th-donut__legend b { margin-left: auto; }
.th-gauge { position: relative; padding: 4px 0 0; }
.th-gauge__bar { display: flex; height: 14px; border-radius: 10px; overflow: hidden; }
.th-gauge__pin { position: absolute; top: -2px; width: 4px; height: 22px; margin-left: -2px; border-radius: 3px; background: var(--c-ink); box-shadow: 0 0 0 3px var(--c-card); transition: left .4s ease; }
.th-gauge__labels { display: flex; margin-top: 8px; font-size: .72rem; color: var(--c-muted); font-weight: 600; }
.th-gauge__labels span { text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }

/* chips, notes, empty, loading */
.th-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.th-chip { padding: 6px 12px; border-radius: 30px; border: 1px solid var(--c-border); background: var(--c-card); color: var(--c-text); font-size: .84rem; font-weight: 600; cursor: pointer; transition: .15s; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.th-chip:hover { border-color: var(--c-primary); color: var(--c-primary); }
.th-chip--toggle { opacity: .55; }
.th-chip--toggle.is-on { opacity: 1; background: var(--c-primary-50); border-color: var(--c-primary); color: var(--c-primary); }
.th-note { padding: 12px 14px; border-radius: 12px; font-size: .86rem; line-height: 1.55; background: var(--c-primary-50); color: var(--c-text); border: 1px solid var(--c-primary-100); }
.th-note i { color: var(--c-primary); margin-right: 4px; }
.th-note--warn { background: var(--c-amber-50); border-color: color-mix(in srgb, var(--c-amber) 30%, transparent); }
.th-note code { font-family: var(--mono); font-size: .9em; background: var(--c-card); padding: 1px 5px; border-radius: 5px; }
.th-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 34px 20px; border-radius: 16px; border: 2px dashed var(--c-border); color: var(--c-muted); }
.th-empty i { font-size: 1.8rem; color: var(--c-primary); opacity: .6; }
.th-empty p { margin: 0; max-width: 360px; }
.th-empty--err i { color: var(--c-red); }
.th-loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 30px 10px; color: var(--c-muted); font-weight: 600; }
.th-spin { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--c-primary-100); border-top-color: var(--c-primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.th-toasts { position: fixed; z-index: 120; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.th-toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px; background: #1E1B4B; color: #fff; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-lg); animation: pop .2s ease; transition: .3s; }
.th-toast i { color: #34D399; }
.th-toast--err i { color: #F87171; }
.th-toast.is-out { opacity: 0; transform: translateY(8px); }
body.has-sticky-ad .th-toasts { bottom: 90px; }

/* drop zone & files */
.th-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 30px 20px; border-radius: 18px; border: 2px dashed color-mix(in srgb, var(--c-primary) 40%, var(--c-border)); background: var(--c-primary-50); cursor: pointer; transition: .15s; }
.th-drop:hover, .th-drop.is-over { border-color: var(--c-primary); background: var(--c-primary-100); }
.th-drop__icon { width: 56px; height: 56px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; background: var(--c-primary); color: #fff; font-size: 1.4rem; margin-bottom: 4px; box-shadow: 0 12px 24px -12px var(--c-primary); }
.th-drop strong { color: var(--c-ink); }
.th-drop small { color: var(--c-muted); }
.th-drop__input { display: none; }
.th-files { display: grid; gap: 8px; }
.th-files__bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.th-file { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--c-border); background: var(--c-card); min-width: 0; }
.th-file__thumb { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; flex-shrink: 0; background: var(--c-soft-2); display: flex; align-items: center; justify-content: center; color: var(--c-red); font-size: 1.2rem; }
.th-file__thumb img, .th-file__thumb canvas { width: 100%; height: 100%; object-fit: cover; }
.th-file__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.th-file__meta strong { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-file__meta small { color: var(--c-muted); font-size: .78rem; }
.th-file__act { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.th-file__size { font-size: .78rem; color: var(--c-muted); font-weight: 600; }
.th-file__size.is-good { color: var(--c-green); }
.th-progress { position: relative; height: 34px; border-radius: 10px; background: var(--c-soft-2); overflow: hidden; }
.th-progress__bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, var(--c-primary-100), var(--c-primary)); transition: width .3s; }
.th-progress__text { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; height: 100%; font-size: .84rem; font-weight: 700; }

/* image stage */
.th-stage { position: relative; min-height: 280px; border-radius: 18px; border: 1px solid var(--c-border); background-color: var(--c-soft); background-image: linear-gradient(45deg, var(--c-soft-2) 25%, transparent 25%), linear-gradient(-45deg, var(--c-soft-2) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--c-soft-2) 75%), linear-gradient(-45deg, transparent 75%, var(--c-soft-2) 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; display: flex; align-items: center; justify-content: center; padding: 14px; overflow: hidden; }
.th-stage.is-empty { background-image: none; border-style: dashed; }
.th-stage__canvas, .th-stage img, .th-stage canvas { max-width: 100%; max-height: 560px; width: auto; height: auto; display: block; border-radius: 6px; box-shadow: var(--shadow); }
.th-crop, .th-pick { cursor: crosshair; touch-action: none; }
.th-palette { display: flex; flex-wrap: wrap; gap: 8px; }
.th-palette__sw, .th-palette .th-swatch { flex: 1 1 70px; min-height: 64px; border-radius: 12px; border: 0; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding: 6px; font-size: .72rem; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); font-family: var(--mono); }
.th-palette--big .th-swatch { min-height: 200px; flex-direction: column; justify-content: space-between; align-items: center; padding: 12px 6px; text-shadow: none; }
.th-swatch__lock, .th-swatch__hex { border: 0; background: rgba(255, 255, 255, .22); color: inherit; border-radius: 8px; padding: 6px 9px; cursor: pointer; font-family: var(--mono); font-weight: 700; font-size: .8rem; }
.th-swatch__lock:hover, .th-swatch__hex:hover { background: rgba(255, 255, 255, .4); }
.th-swatch-big { height: 140px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 800; font-size: 1.5rem; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.th-fav { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; padding: 16px; border-radius: 14px; background: var(--c-soft); }
.th-fav img, .th-fav canvas { image-rendering: pixelated; border-radius: 4px; box-shadow: var(--shadow-sm); background: #fff; }

/* kv rows */
.th-kv { display: grid; gap: 8px; }
.th-kv__row { display: grid; grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--c-soft); border: 1px solid var(--c-border); }
.th-kv__row > span { font-size: .8rem; font-weight: 700; color: var(--c-muted); }
.th-kv__row > code { font-size: .86rem; overflow-wrap: anywhere; }
.th-kv__row:has(> code:first-child) { grid-template-columns: minmax(0, 1fr) auto; }
.th-code { margin: 0; padding: 16px; border-radius: 14px; background: #0F172A; color: #E2E8F0; font-family: var(--mono); font-size: .84rem; line-height: 1.6; overflow: auto; max-height: 460px; white-space: pre; }
.th-code.th-wrap { white-space: pre-wrap; }

/* rows (timesheet, GPA) */
.th-rows { display: grid; gap: 8px; }
.th-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.th-row--5 { grid-template-columns: 52px repeat(3, minmax(0, 1fr)) 64px; }
.th-row--head { font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--c-muted); }
.th-row__val { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.th-row .th-input { height: 42px; padding: 0 10px; }

/* scientific calculator */
.th-calcpad { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr); gap: 22px; }
.th-calcpad__main { display: grid; gap: 14px; min-width: 0; }
.th-calcpad__screen { padding: 18px 20px; border-radius: 20px; background: linear-gradient(160deg, #1E1B4B, #312E81); color: #fff; display: grid; gap: 6px; text-align: right; box-shadow: inset 0 2px 10px rgba(0, 0, 0, .3); }
.th-calcpad__screen input, .th-calcpad__expr { width: 100%; border: 0; outline: 0; background: none; color: rgba(255, 255, 255, .8); font-family: var(--mono); font-size: 1.05rem; text-align: right; }
.th-calcpad__res, .th-calcpad__screen output, .th-calcpad__screen > div { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.7rem); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.1; min-height: 1.1em; }
.th-calcpad__screen .is-err { color: #FCA5A5; font-size: 1.1rem; }
.th-calcpad__keys { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.th-key { height: 52px; border-radius: 14px; border: 1px solid var(--c-border); background: var(--c-card); color: var(--c-text); font-weight: 700; font-size: 1rem; cursor: pointer; transition: .1s; user-select: none; }
.th-key:hover { border-color: var(--c-primary); }
.th-key:active { transform: scale(.96); }
.th-key--num { background: var(--c-soft); font-size: 1.15rem; }
.th-key--fn { color: var(--c-primary); font-size: .88rem; }
.th-key--op { background: var(--c-primary-50); color: var(--c-primary); font-size: 1.25rem; }
.th-key--clr { background: var(--c-red-50); color: var(--c-red); }
.th-key--eq { background: var(--c-amber); border-color: var(--c-amber); color: #1E1B4B; font-size: 1.3rem; }
.th-key--eq:hover { background: #FBBF24; }
.th-calcpad__side { display: grid; gap: 12px; align-content: start; }
.th-calcpad__side h4 { font-size: .9rem; margin: 0; }
.th-calcpad__hist, .th-calcpad__side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 340px; overflow: auto; }
.th-calcpad__side li { padding: 10px 12px; border-radius: 12px; background: var(--c-soft); cursor: pointer; display: flex; flex-direction: column; align-items: flex-end; font-family: var(--mono); font-size: .84rem; }
.th-calcpad__side li span { color: var(--c-muted); word-break: break-all; }
.th-calcpad__side li:hover { background: var(--c-primary-50); }

/* QR, barcode, scanner */
.th-qr { display: grid; gap: 14px; justify-items: center; padding: 20px; border-radius: 20px; background: var(--c-soft); border: 1px solid var(--c-border); }
.th-qr__preview { width: 100%; max-width: 300px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 16px; padding: 10px; box-shadow: var(--shadow); }
.th-qr__preview canvas, .th-qr__preview svg { width: 100% !important; height: auto !important; }
.th-qr__preview.is-empty { opacity: .35; }
.th-qr__dl { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.th-barcode { display: flex; align-items: center; justify-content: center; padding: 20px; border-radius: 16px; background: #fff; border: 1px solid var(--c-border); min-height: 160px; overflow: auto; }
.th-barcode svg { max-width: 100%; height: auto; }
.th-scan { display: grid; gap: 10px; }
.th-scan__view, .th-scan > div:first-child { width: 100%; min-height: 240px; border-radius: 18px; overflow: hidden; background: #0F172A; }
.th-scan video { width: 100% !important; border-radius: 18px; }

/* clocks & countdown */
.th-clocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; }
.th-clock { position: relative; padding: 18px; border-radius: 16px; background: var(--c-soft); border: 1px solid var(--c-border); display: flex; flex-direction: column; gap: 2px; }
.th-clock__city { font-weight: 700; font-size: .9rem; color: var(--c-muted); padding-right: 22px; }
.th-clock__time { font-size: 1.9rem; font-weight: 800; color: var(--c-ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.th-clock__date { color: var(--c-muted); font-size: .8rem; }
.th-clock__x { position: absolute; top: 10px; right: 10px; border: 0; background: none; color: var(--c-muted); font-size: 1.2rem; cursor: pointer; }
.th-clock__x:hover { color: var(--c-red); }
.th-count { margin-top: 22px; padding: 28px 20px; border-radius: 22px; background: linear-gradient(160deg, #1E1B4B, #3E1EFB); color: #fff; text-align: center; }
.th-count__title { color: #fff; margin-bottom: 18px; }
.th-count__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 640px; margin: 0 auto 14px; }
.th-count__cell { padding: 16px 6px; border-radius: 16px; background: rgba(255, 255, 255, .1); }
.th-count__cell strong { display: block; font-size: clamp(1.7rem, 1.1rem + 2.6vw, 3rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.th-count__cell span { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255, 255, 255, .72); }
.th-count .th-muted { color: rgba(255, 255, 255, .75); margin: 0; }

/* YouTube & text */
.th-searchbar { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; border-radius: 16px; border: 1px solid var(--c-border); background: var(--c-input); box-shadow: var(--shadow-sm); }
.th-searchbar:focus-within { border-color: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-50); }
.th-searchbar__icon { color: #FF0033; font-size: 1.35rem; }
.th-searchbar .th-input { border: 0; box-shadow: none !important; background: none; padding: 0 4px; height: 46px; }
.th-video { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 16px; background: var(--c-soft); border: 1px solid var(--c-border); }
.th-video img { width: 140px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.th-video strong { display: block; color: var(--c-ink); line-height: 1.35; }
.th-video small { color: var(--c-muted); }
.th-transcript { max-height: 460px; overflow-y: auto; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--c-border); background: var(--c-card); font-size: .94rem; line-height: 1.65; }
.th-transcript p { margin: 0 0 8px; }
.th-ts { display: inline-block; min-width: 48px; font-family: var(--mono); font-size: .78rem; font-weight: 700; color: var(--c-primary); background: var(--c-primary-50); border-radius: 6px; padding: 1px 6px; text-align: center; margin-right: 4px; }
.th-ideas { display: grid; gap: 8px; }
.th-idea { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--c-border); background: var(--c-card); }
.th-idea span { font-weight: 600; }
.th-idea small { font-size: .74rem; font-weight: 700; }
.th-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.th-thumb { margin: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--c-border); background: var(--c-card); }
.th-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.th-thumb figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; font-size: .85rem; }
.th-thumb small { color: var(--c-muted); }
.th-embed-prev { border-radius: 14px; overflow: hidden; background: #000; }
.th-embed-prev iframe { max-width: 100%; }
.th-limits { display: grid; gap: 8px; }
.th-limit { display: grid; grid-template-columns: minmax(110px, 1fr) 1.2fr auto; gap: 10px; align-items: center; font-size: .82rem; }
.th-limit__bar { height: 8px; border-radius: 8px; background: var(--c-soft-2); overflow: hidden; }
.th-limit__bar i { display: block; height: 100%; background: var(--c-green); border-radius: 8px; }
.th-limit.is-over .th-limit__bar i { background: var(--c-red); }
.th-limit.is-over b { color: var(--c-red); }
.th-diff { border: 1px solid var(--c-border); border-radius: 14px; overflow: auto; max-height: 520px; font-family: var(--mono); font-size: .86rem; background: var(--c-card); }
.th-diff__line { display: flex; gap: 10px; padding: 3px 12px; white-space: pre-wrap; word-break: break-word; }
.th-diff__sign { width: 12px; flex-shrink: 0; font-weight: 800; opacity: .7; }
.th-diff--add { background: var(--c-green-50); color: var(--c-green); }
.th-diff--del { background: var(--c-red-50); color: var(--c-red); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--c-red) 40%, transparent); }
.th-diff--words { padding: 14px; line-height: 1.8; white-space: pre-wrap; font-family: var(--font); font-size: .95rem; }
.th-diff--words ins { background: var(--c-green-50); color: var(--c-green); text-decoration: none; border-radius: 4px; padding: 1px 2px; }
.th-diff--words del { background: var(--c-red-50); color: var(--c-red); border-radius: 4px; padding: 1px 2px; }
.th-diff > .th-note { margin: 10px; font-family: var(--font); }
.th-wheel { width: 100%; max-width: 460px; height: auto; aspect-ratio: 1; cursor: pointer; filter: drop-shadow(0 16px 30px rgba(30, 27, 75, .25)); }
.th-winner { min-height: 66px; margin: 10px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.th-winner span { font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); }
.th-winner strong { font-size: 1.8rem; color: var(--c-primary); animation: pop .3s ease; }
.th-interim { min-height: 1.4em; font-style: italic; margin: 0; }

/* fonts & names */
.th-fontlist { display: grid; gap: 8px; }
.th-fontrow { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--c-border); background: var(--c-card); color: var(--c-text); text-align: left; cursor: pointer; transition: .12s; }
.th-fontrow:hover { border-color: var(--c-primary); background: var(--c-primary-50); }
.th-fontrow small { color: var(--c-muted); font-size: .76rem; font-weight: 700; }
.th-fontrow__text { font-size: 1.22rem; overflow-wrap: anywhere; line-height: 1.5; }
.th-fontrow__copy { font-size: .8rem; font-weight: 700; color: var(--c-primary); opacity: 0; transition: .12s; white-space: nowrap; }
.th-fontrow:hover .th-fontrow__copy { opacity: 1; }
.th-namegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.th-namecard { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--c-border); background: var(--c-card); color: var(--c-text); cursor: pointer; font-weight: 700; font-size: 1.02rem; text-align: left; transition: .12s; min-width: 0; }
.th-namecard:hover { border-color: var(--c-primary); background: var(--c-primary-50); }
.th-namecard > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.th-namecard > i { color: var(--c-muted); font-size: .85rem; }
.th-namecard__fav, .th-namecard__link { border: 0; background: none; color: var(--c-border-2); cursor: pointer; font-size: .95rem; padding: 4px; }
.th-namecard__fav:hover, .th-namecard__fav.is-on { color: #EF4444; }
.th-namecard__link { color: var(--c-muted); }
.th-namecard__link:hover { color: var(--c-primary); }
.th-symbols { display: flex; flex-wrap: wrap; gap: 6px; max-height: 210px; overflow: auto; }
.th-symbols button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--c-border); background: var(--c-card); cursor: pointer; font-size: 1.05rem; }
.th-symbols button:hover { border-color: var(--c-primary); background: var(--c-primary-50); }
.th-glitch-out { min-height: 120px; padding: 30px 20px; border-radius: 16px; background: var(--c-soft); font-size: 1.6rem; text-align: center; overflow: hidden; overflow-wrap: anywhere; line-height: 2.2; }
.th-dot { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--c-card); box-shadow: 0 0 0 1px var(--c-border); cursor: pointer; }
.th-siggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.th-sigcard { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 120px; padding: 14px; border-radius: 16px; border: 2px solid var(--c-border); background: #fff; cursor: pointer; overflow: hidden; transition: .12s; }
.th-sigcard:hover { border-color: var(--c-primary-100); }
.th-sigcard.is-active { border-color: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-50); }
.th-sigcard__text { white-space: nowrap; line-height: 1.4; max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.th-sigcard small { color: #6B7280; font-size: .74rem; font-weight: 600; }
.th-sigpad-wrap { position: relative; border-radius: 18px; border: 2px dashed var(--c-border-2); background: #fff; height: 260px; overflow: hidden; }
.th-sigpad { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.th-sigpad__line { position: absolute; left: 8%; right: 8%; bottom: 64px; border-bottom: 2px solid #CBD5E1; pointer-events: none; }
.th-sigpad__hint { position: absolute; left: 0; right: 0; bottom: 30px; text-align: center; color: #94A3B8; font-size: .82rem; pointer-events: none; }

/* dev tools */
.th-password { display: flex; gap: 8px; align-items: center; padding: 10px 10px 10px 18px; border-radius: 16px; background: var(--c-soft); border: 1px solid var(--c-border); }
.th-password code { flex: 1; font-size: 1.2rem; font-weight: 700; overflow-wrap: anywhere; color: var(--c-ink); }
.th-password .th-btn { width: 44px; padding: 0; }
.th-meter { display: grid; gap: 6px; }
.th-meter__bar { height: 10px; border-radius: 10px; background: var(--c-soft-2); overflow: hidden; }
.th-meter__bar i { display: block; height: 100%; border-radius: 10px; transition: width .3s; }
.th-meter--down i { background: var(--c-red); }
.th-meter--warn i { background: var(--c-amber); }
.th-meter--up i { background: var(--c-green); }
.th-meter small { color: var(--c-muted); font-size: .82rem; }
.th-gradient-prev { height: 260px; border-radius: 20px; box-shadow: var(--shadow); }
.th-shadow-prev { height: 260px; border-radius: 20px; background: var(--c-soft); display: flex; align-items: center; justify-content: center; }
.th-shadow-box { width: 160px; height: 120px; border-radius: 18px; background: var(--c-card); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--c-muted); }
.th-regex-bar { flex-wrap: nowrap !important; }
.th-regex-bar > span { font-size: 1.4rem; color: var(--c-muted); }
.th-regex-hl { padding: 14px; border-radius: 14px; border: 1px solid var(--c-border); background: var(--c-card); white-space: pre-wrap; word-break: break-word; min-height: 80px; line-height: 1.8; }
.th-regex-hl mark { background: color-mix(in srgb, var(--c-amber) 40%, transparent); color: inherit; border-radius: 4px; padding: 1px 2px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--c-amber) 60%, transparent); }
.th-cheat { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; font-size: .84rem; }
.th-cheat div { display: flex; gap: 10px; align-items: center; }
.th-cheat code { font-family: var(--mono); color: var(--c-primary); background: var(--c-primary-50); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.th-serp { padding: 18px 20px; border-radius: 16px; background: #fff; border: 1px solid #E5E7EB; font-family: Arial, sans-serif; color: #202124; max-width: 650px; }
.th-serp--mobile { max-width: 380px; }
.th-serp__site { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.th-serp__fav { width: 28px; height: 28px; border-radius: 50%; background: #F1F3F4; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; color: #4F46E5; }
.th-serp__site b { display: block; font-size: 14px; font-weight: 400; color: #202124; }
.th-serp__site small { display: block; font-size: 12px; color: #4D5156; word-break: break-all; }
.th-serp__title { font-size: 20px; line-height: 1.3; color: #1A0DAB; margin-bottom: 4px; }
.th-serp--mobile .th-serp__title { font-size: 18px; }
.th-serp__desc { font-size: 14px; line-height: 1.58; color: #4D5156; }
.th-ipbig { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 20px; border-radius: 22px; background: linear-gradient(160deg, #1E1B4B, #3E1EFB); color: #fff; text-align: center; }
.th-ipbig small { color: rgba(255, 255, 255, .75); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; font-size: .75rem; }
.th-ipbig strong { font-size: clamp(1.6rem, 1rem + 3vw, 2.6rem); word-break: break-all; }
.th-ipbig .th-btn--ghost { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); }

/* pdf pages */
.th-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.th-page { position: relative; border-radius: 14px; border: 1px solid var(--c-border); background: var(--c-card); padding: 10px 10px 8px; display: grid; gap: 8px; }
.th-page__img { display: flex; align-items: center; justify-content: center; min-height: 140px; background: var(--c-soft); border-radius: 8px; overflow: hidden; }
.th-page__img canvas { max-width: 100%; max-height: 170px; height: auto; transition: transform .25s; box-shadow: var(--shadow-sm); }
.th-page__no { position: absolute; top: 14px; left: 14px; min-width: 24px; height: 24px; border-radius: 8px; background: var(--c-ink); color: var(--c-bg); font-size: .74rem; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 6px; }
.th-page__act { display: flex; justify-content: space-between; gap: 4px; }
.th-page__act button { flex: 1; height: 30px; border-radius: 8px; border: 1px solid var(--c-border); background: var(--c-card); color: var(--c-muted); cursor: pointer; font-size: .78rem; }
.th-page__act button:hover:not(:disabled) { color: var(--c-primary); border-color: var(--c-primary); }
.th-page__act button:disabled { opacity: .35; cursor: default; }

/* ---------- responsive ---------- */
@media (max-width: 1199.98px) {
  .search-trigger { min-width: 0; width: 42px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .nav__link--xl { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
  .tool-layout { grid-template-columns: minmax(0, 1fr) 270px; }
}
@media (max-width: 991.98px) {
  .nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .tool-layout, .blog-layout { grid-template-columns: 1fr; }
  .tool-side { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .th-calc, .th-calc--wide, .th-calc--qr, .th-calc--editor, .th-calcpad { grid-template-columns: 1fr; }
  .th-calc__out { position: static; }
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .cta { grid-template-columns: 1fr; padding: 34px 26px; }
  .th-split--3 { grid-template-columns: 1fr; }
  .toc ol { columns: 1; }
}
@media (max-width: 767.98px) {
  :root { --header-h: 62px; }
  .section { padding: 52px 0; }
  .wrap, .ad-wrap { padding: 0 16px; }
  .header-actions .hide-sm { display: none; }
  .hero { padding: 50px 0 64px; }
  .hero-search input { height: 56px; padding: 0 16px 0 48px; font-size: 1rem; }
  .hero-search button { display: none; }
  .hero-search > i { left: 18px; }
  .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .grid--tools { grid-template-columns: 1fr; }
  .tool-head__row { flex-wrap: wrap; }
  .tool-head__icon { width: 52px; height: 52px; font-size: 1.25rem; border-radius: 15px; }
  .tool-head__actions { margin-left: 0; width: 100%; }
  .tool-app { padding: 18px 14px; border-radius: 20px; }
  .tool-app__bar { display: none; }
  .guide { padding: 22px 18px; border-radius: 20px; }
  .th-form__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .th-col-full, .th-col-swap { grid-column: span 2; }
  .th-col-half { grid-column: span 2; }
  .th-col-third { grid-column: span 1; }
  .th-split, .th-split--wheel { grid-template-columns: 1fr; }
  .th-stats--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .th-calcpad__keys { gap: 6px; }
  .th-key { height: 48px; font-size: .9rem; border-radius: 12px; }
  .th-fontrow { grid-template-columns: 1fr; gap: 4px; }
  .th-fontrow__copy { display: none; }
  .th-kv__row { grid-template-columns: 1fr auto; }
  .th-kv__row > span { grid-column: 1 / -1; }
  .th-row--5 { grid-template-columns: 40px repeat(3, minmax(0, 1fr)) 52px; gap: 4px; }
  .th-row--5 .th-input { padding: 0 4px; font-size: .82rem; }
  .th-video img { width: 100px; }
  .th-count__grid { gap: 6px; }
  .th-bars__row { grid-template-columns: 90px 1fr auto; }
  .th-toolbar .th-input:not([type=checkbox]) { min-width: 0; flex: 1 1 140px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .form-grid { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .consent { left: 10px; right: 10px; bottom: 10px; max-width: none; }
  .filter-bar { position: static; }
  .page-hero { padding: 26px 0 22px; }
}
@media (max-width: 420px) {
  .brand { font-size: 1.15rem; }
  .brand img { width: 32px; height: 32px; }
  .header-actions { gap: 6px; }
  .icon-btn { width: 38px; height: 38px; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-stats div { padding: 12px; }
  .hero-stats strong { font-size: 1.3rem; }
  .th-col-third { grid-column: span 2; }
  .th-seg__btn { padding: 7px 10px; font-size: .8rem; }
}
@media print {
  .site-header, .site-footer, .th-ad, .th-ad-sticky, .tool-side, .consent, .to-top, .tool-app__bar, .guide, .related, .crumbs { display: none !important; }
  .tool-layout { display: block; }
  .tool-app { box-shadow: none; border: 0; padding: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: no-preference) { .hero__badge, .hero h1, .hero p.lead, .hero-search, .hero-chips, .hero-stats { animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; will-change: transform, opacity; } .hero__badge { animation-delay: 0.1s; } .hero h1     { animation-delay: 0.2s; } .hero p.lead { animation-delay: 0.3s; } .hero-search { animation-delay: 0.4s; }.hero-chips  { animation-delay: 0.5s; } .hero-stats  { animation-delay: 0.6s; } }
