﻿/*
  TotInk shared production polish.
  This file is intentionally conservative: it improves accessibility,
  mobile resilience, and media behavior without changing page-specific logic.
*/
:root {
  --totink-site-max: 1680px;
  --totink-focus: #1d7f78;
  --totink-ink: #243042;
  --totink-muted: #5f6b7a;
  --totink-card: #ffffff;
  --totink-line: #eadfd6;
  --totink-primary: #e96847;
  --totink-primary-dark: #bd4d34;
  --totink-teal: #2f9b8f;
  --totink-yellow: #ffd56a;
  --totink-blue-soft: #e8f6ff;
  --totink-pink-soft: #fff0f5;
  --totink-shadow-sm: 0 8px 20px rgba(36, 48, 66, 0.07);
  --totink-shadow-md: 0 14px 34px rgba(36, 48, 66, 0.1);
  --totink-radius: 8px;
  --totink-control-radius: 14px;
}

html {
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  overflow-wrap: anywhere;
  color: var(--text, var(--totink-ink));
  background-color: var(--bg, #fffaf6);
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

img {
  height: auto;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

input,
select,
textarea {
  border-color: var(--line, var(--totink-line));
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--totink-focus) 72%, white);
  outline-offset: 3px;
}

:where(.btn, .card, .choice-card, .tool-card, .resource-card, .money-card) {
  overflow-wrap: anywhere;
}

/*
  Child-friendly, adult-usable surface polish.
  Low specificity keeps page-level designs and JavaScript state classes intact.
*/
:where(.topbar, header.topbar) {
  box-shadow: 0 1px 0 rgba(234, 223, 214, 0.7), 0 10px 24px rgba(36, 48, 66, 0.04);
}

:where(.brand) {
  letter-spacing: 0;
}

:where(.nav-links a) {
  border-radius: 999px;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

:where(.nav-links a:hover) {
  transform: translateY(-1px);
}

:where(.btn) {
  border-radius: var(--totink-control-radius);
  font-weight: 900;
  letter-spacing: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

:where(.btn:hover) {
  transform: translateY(-1px);
  box-shadow: var(--totink-shadow-sm);
}

:where(.btn-primary) {
  background: var(--primary, var(--totink-primary));
  color: #fff;
  border-color: transparent;
}

:where(.btn-primary:hover) {
  background: var(--primary-dark, var(--totink-primary-dark));
}

:where(.btn-secondary) {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text, var(--totink-ink));
  border: 1px solid var(--line, var(--totink-line));
}

:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea, .search-input, .lang-switch) {
  border-radius: var(--totink-control-radius);
  border: 1px solid var(--line, var(--totink-line));
  background: rgba(255, 255, 255, 0.96);
  color: var(--text, var(--totink-ink));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea, .search-input, .lang-switch):focus {
  border-color: color-mix(in srgb, var(--totink-teal) 66%, white);
  box-shadow: 0 0 0 4px rgba(47, 155, 143, 0.12);
}

:where(.card, .choice-card, .tool-card, .resource-card, .info-card, .guide-card, .section-card, .activity, .money-card, .currency-panel) {
  border-radius: var(--totink-radius);
  border-color: var(--line, var(--totink-line));
  box-shadow: var(--totink-shadow-sm);
}

:where(.card, .choice-card, .tool-card, .resource-card, .info-card, .guide-card, .money-card) {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

:where(.card, .choice-card, .tool-card, .resource-card, .info-card, .guide-card, .money-card):hover {
  transform: translateY(-2px);
  box-shadow: var(--totink-shadow-md);
  border-color: color-mix(in srgb, var(--line, var(--totink-line)) 72%, var(--totink-primary));
}

:where(.section) {
  scroll-margin-top: 96px;
}

:where(.section-title, h1, h2, h3) {
  letter-spacing: 0;
  text-wrap: balance;
}

:where(.section-desc, .card p, .activity p, .footer-copy p) {
  color: var(--muted, var(--totink-muted));
}

:where(.chip, .meta-chip, .badge, .hero-badges span, .country-tab, .filter-btn, .skill-pill) {
  border-radius: 999px;
  letter-spacing: 0;
}

:where(.icon-wrap) {
  border-radius: var(--totink-radius);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.64);
}

:where(.hero) {
  position: relative;
}

:where(.hero)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 213, 106, 0.14), transparent 34%),
    linear-gradient(240deg, rgba(47, 155, 143, 0.1), transparent 30%);
}

:where(.footer-list a) {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}

:where(.nav-links a[aria-current="page"]) {
  color: var(--primary-dark, #bd4d34);
  background: rgba(255, 255, 255, 0.86);
}

:where(.topbar, header.topbar) {
  isolation: isolate;
}

@media (max-width: 760px) {
  :where(.container) {
    width: min(100% - 24px, var(--max, 1180px));
  }

  :where(.nav-links) {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  :where(.nav-links a, .btn) {
    min-height: 44px;
  }

  :where(.btn) {
    width: auto;
    max-width: 100%;
    padding-inline: 14px;
  }

  :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    min-height: 44px;
  }

  :where(.grid-3, .grid-4, .footer-grid, .hero-grid, .activity-grid, .money-grid) {
    grid-template-columns: 1fr !important;
  }

  :where(.card, .choice-card, .tool-card, .resource-card, .info-card, .guide-card, .section-card, .activity, .money-card, .currency-panel) {
    padding: clamp(14px, 4vw, 18px);
  }

  :where(h1) {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  :where(.section-title) {
    font-size: clamp(1.45rem, 7vw, 2rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* Visible TotInk UI refresh layer
   This intentionally uses stronger rules because most pages have large inline
   style blocks. It changes presentation only; markup and page scripts remain intact.
*/
body.totink-ui-refresh,
.totink-ui-refresh body {
  color: #243042 !important;
  background:
    linear-gradient(180deg, #f7f8fb 0%, #f9fbfd 44%, #fff8f2 100%) !important;
}

.totink-ui-refresh .container {
  width: min(100% - 32px, 1540px) !important;
  max-width: 1540px !important;
}

.totink-ui-refresh main {
  width: 100% !important;
}

.totink-ui-refresh .topbar,
.totink-ui-refresh header.topbar {
  background: rgba(255, 255, 255, 0.94) !important;
  border-bottom: 1px solid rgba(218, 226, 236, 0.95) !important;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06) !important;
}

.totink-ui-refresh .brand-logo {
  border-radius: 10px !important;
  box-shadow: 0 8px 18px rgba(233, 104, 71, 0.16) !important;
}

.totink-ui-refresh .nav-links {
  gap: 4px !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  max-width: min(72vw, 980px) !important;
}

.totink-ui-refresh .nav-links a {
  min-height: 40px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  color: #526174 !important;
  font-weight: 850 !important;
}

.totink-ui-refresh .nav-links a:hover,
.totink-ui-refresh .nav-links a.active,
.totink-ui-refresh .nav-links a[aria-current="page"] {
  color: #243042 !important;
  background: #fff3ea !important;
  box-shadow: inset 0 0 0 1px rgba(233, 104, 71, 0.16) !important;
}

.totink-ui-refresh .hero {
  padding-block: clamp(18px, 2.8vw, 38px) clamp(18px, 2.4vw, 32px) !important;
  border-bottom: 1px solid rgba(218, 226, 236, 0.72) !important;
  background:
    linear-gradient(90deg, rgba(255,255,255,.72), rgba(255,255,255,.28)),
    radial-gradient(circle at 8% 20%, rgba(47,155,143,.11), transparent 24%),
    radial-gradient(circle at 88% 12%, rgba(233,104,71,.10), transparent 22%) !important;
}

.totink-ui-refresh .hero-copy,
.totink-ui-refresh .hero > .container > div:first-child {
  min-width: 0 !important;
}

.totink-ui-refresh .hero-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr) !important;
  gap: clamp(18px, 2vw, 32px) !important;
  align-items: start !important;
}

.totink-ui-refresh .hero-grid,
.totink-ui-refresh .hero-center-wrap,
.totink-ui-refresh .hero-board,
.totink-ui-refresh .hero-visual {
  position: relative !important;
}

.totink-ui-refresh .hero-board,
.totink-ui-refresh .hero-visual,
.totink-ui-refresh .hero-center-wrap {
  border-radius: 8px !important;
  border: 1px solid rgba(218, 226, 236, 0.95) !important;
  background: rgba(255, 255, 255, 0.88) !important;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08) !important;
}

.totink-ui-refresh .hero-center-wrap {
  padding: clamp(22px, 5vw, 48px) !important;
}

.totink-ui-refresh h1 {
  color: #223047 !important;
  font-weight: 950 !important;
  letter-spacing: 0 !important;
  font-size: clamp(2rem, 3.6vw, 3.8rem) !important;
  max-width: 980px !important;
}

.totink-ui-refresh .section {
  padding-block: clamp(22px, 3vw, 42px) !important;
}

.totink-ui-refresh .section:nth-of-type(even) {
  background: rgba(255, 255, 255, 0.42) !important;
}

.totink-ui-refresh .section-title,
.totink-ui-refresh .card-title {
  color: #223047 !important;
  font-weight: 950 !important;
}

.totink-ui-refresh .section-desc,
.totink-ui-refresh .card-text,
.totink-ui-refresh .card p,
.totink-ui-refresh .activity p,
.totink-ui-refresh .hero p {
  color: #5d6b7d !important;
}

.totink-ui-refresh .btn,
.totink-ui-refresh button.btn,
.totink-ui-refresh a.btn {
  min-height: 46px !important;
  border-radius: 14px !important;
  padding-inline: 17px !important;
  font-weight: 950 !important;
  box-shadow: 0 10px 22px rgba(36, 48, 66, 0.08) !important;
}

.totink-ui-refresh .hero-actions,
.totink-ui-refresh .toolbar,
.totink-ui-refresh .controls,
.totink-ui-refresh .form-actions,
.totink-ui-refresh .action-row,
.totink-ui-refresh .nav-actions {
  gap: 10px !important;
  align-items: center !important;
}

.totink-ui-refresh .btn-primary,
.totink-ui-refresh a.btn-primary,
.totink-ui-refresh button.btn-primary {
  background: #e96847 !important;
  color: #fff !important;
  border: 1px solid #e96847 !important;
}

.totink-ui-refresh .btn-primary:hover,
.totink-ui-refresh a.btn-primary:hover,
.totink-ui-refresh button.btn-primary:hover {
  background: #bd4d34 !important;
  border-color: #bd4d34 !important;
}

.totink-ui-refresh .btn-secondary,
.totink-ui-refresh a.btn-secondary,
.totink-ui-refresh button.btn-secondary {
  background: #ffffff !important;
  color: #243042 !important;
  border: 1px solid #eadfd6 !important;
}

.totink-ui-refresh .card,
.totink-ui-refresh .choice-card,
.totink-ui-refresh .tool-card,
.totink-ui-refresh .resource-card,
.totink-ui-refresh .info-card,
.totink-ui-refresh .guide-card,
.totink-ui-refresh .section-card,
.totink-ui-refresh .activity,
.totink-ui-refresh .money-card,
.totink-ui-refresh .currency-panel,
.totink-ui-refresh .feature-card,
.totink-ui-refresh .theme-card,
.totink-ui-refresh .age-card {
  border-radius: 8px !important;
  border: 1px solid rgba(218, 226, 236, 0.95) !important;
  background: #ffffff !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06) !important;
}

.totink-ui-refresh .card::before,
.totink-ui-refresh .choice-card::before,
.totink-ui-refresh .tool-card::before,
.totink-ui-refresh .resource-card::before,
.totink-ui-refresh .info-card::before,
.totink-ui-refresh .guide-card::before,
.totink-ui-refresh .money-card::before {
  content: "";
  display: block;
  height: 4px;
  margin: -1px -1px 14px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, #2f9b8f, #ffd56a 52%, #e96847);
}

.totink-ui-refresh .card:hover,
.totink-ui-refresh .choice-card:hover,
.totink-ui-refresh .tool-card:hover,
.totink-ui-refresh .resource-card:hover,
.totink-ui-refresh .info-card:hover,
.totink-ui-refresh .guide-card:hover,
.totink-ui-refresh .money-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 18px 42px rgba(36, 48, 66, 0.12) !important;
}

.totink-ui-refresh .icon-wrap {
  border-radius: 8px !important;
  box-shadow: inset 0 0 0 1px rgba(36, 48, 66, 0.04) !important;
}

.totink-ui-refresh .chip,
.totink-ui-refresh .meta-chip,
.totink-ui-refresh .badge,
.totink-ui-refresh .skill-pill,
.totink-ui-refresh .country-tab,
.totink-ui-refresh .filter-btn,
.totink-ui-refresh .hero-badges span {
  background: #fff7ed !important;
  color: #334155 !important;
  border: 1px solid rgba(234, 223, 214, 0.92) !important;
  border-radius: 999px !important;
  font-weight: 900 !important;
}

.totink-ui-refresh .country-tab[aria-pressed="true"],
.totink-ui-refresh .filter-btn[aria-pressed="true"] {
  background: #243042 !important;
  color: #fff !important;
  border-color: #243042 !important;
}

.totink-ui-refresh input:not([type="checkbox"]):not([type="radio"]),
.totink-ui-refresh select,
.totink-ui-refresh textarea,
.totink-ui-refresh .search-input,
.totink-ui-refresh .lang-switch {
  min-height: 44px !important;
  border-radius: 14px !important;
  border: 1px solid #e4d6c9 !important;
  background: #fff !important;
  color: #243042 !important;
  font-weight: 800 !important;
}

.totink-ui-refresh .grid-3 {
  grid-template-columns: repeat(3, minmax(240px, 1fr)) !important;
}

.totink-ui-refresh .grid-4 {
  grid-template-columns: repeat(4, minmax(220px, 1fr)) !important;
}

.totink-ui-refresh .money-grid,
.totink-ui-refresh .resource-grid,
.totink-ui-refresh .tool-grid,
.totink-ui-refresh .cards-grid,
.totink-ui-refresh .gallery-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
}

.totink-ui-refresh [class*="generator"],
.totink-ui-refresh [class*="workspace"],
.totink-ui-refresh [class*="preview"],
.totink-ui-refresh [class*="controls"],
.totink-ui-refresh [class*="panel"] {
  min-width: 0 !important;
}

.totink-ui-refresh footer {
  background: rgba(255, 255, 255, 0.82) !important;
  border-top: 1px solid rgba(234, 223, 214, 0.92) !important;
}

@media (max-width: 760px) {
  .totink-ui-refresh .container {
    width: min(100% - 20px, 1540px) !important;
  }

  .totink-ui-refresh .nav-links {
    max-width: 100% !important;
    flex-wrap: nowrap !important;
  }

  .totink-ui-refresh .hero-grid {
    grid-template-columns: 1fr !important;
  }

  .totink-ui-refresh .hero-center-wrap,
  .totink-ui-refresh .hero-board,
  .totink-ui-refresh .hero-visual {
    padding: 16px !important;
  }

  .totink-ui-refresh .hero-actions,
  .totink-ui-refresh .nav-actions {
    gap: 10px !important;
  }

  .totink-ui-refresh .hero-actions .btn,
  .totink-ui-refresh .nav-actions .btn {
    flex: 1 1 180px !important;
  }

  .totink-ui-refresh .card,
  .totink-ui-refresh .choice-card,
  .totink-ui-refresh .tool-card,
  .totink-ui-refresh .resource-card,
  .totink-ui-refresh .info-card,
  .totink-ui-refresh .guide-card,
  .totink-ui-refresh .section-card,
  .totink-ui-refresh .activity,
  .totink-ui-refresh .money-card {
    box-shadow: 0 8px 20px rgba(36, 48, 66, 0.07) !important;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .totink-ui-refresh .container {
    width: min(100% - 24px, 1540px) !important;
  }

  .totink-ui-refresh .nav {
    gap: 10px !important;
  }

  .totink-ui-refresh .nav-links {
    max-width: 62vw !important;
  }

  .totink-ui-refresh .hero {
    padding-block: 18px 22px !important;
  }

  .totink-ui-refresh h1 {
    font-size: clamp(1.9rem, 3.2vw, 3rem) !important;
  }

  .totink-ui-refresh .section {
    padding-block: 22px !important;
  }
}

/* Full-site redesign v2
   A stronger shared presentation layer for every existing page. It keeps
   original selectors and JavaScript hooks in place while making the whole
   site wider, cleaner, and easier to operate on lower desktop resolutions.
*/
.totink-redesign-v2 {
  --totink-page-gutter: clamp(12px, 2.2vw, 34px);
  --max: var(--totink-site-max);
  --totink-wide: var(--max);
  --totink-orange: #ff8c5a;
  --totink-orange-dark: #cf5f34;
  --totink-green: #2f9b8f;
  --totink-cream: #fff7ed;
  --totink-ink-v2: #202b3d;
  --totink-muted-v2: #64748b;
  --totink-line-v2: #e5e7eb;
}

body.totink-ui-refresh {
  min-height: 100vh !important;
  background:
    linear-gradient(180deg, #ffffff 0%, #f7fafc 42%, #fff7ed 100%) !important;
}

.totink-ui-refresh .container,
.totink-ui-refresh .nav.container,
.totink-ui-refresh footer .container {
  width: min(calc(100% - (var(--totink-page-gutter) * 2)), var(--totink-wide)) !important;
  max-width: var(--totink-wide) !important;
}

.totink-ui-refresh .topbar,
.totink-ui-refresh header.topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 50 !important;
  backdrop-filter: blur(18px) !important;
}

.totink-ui-refresh .topbar::before,
.totink-ui-refresh header.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--totink-orange), #ffd56a 48%, var(--totink-green));
  pointer-events: none;
}

.totink-ui-refresh .nav {
  min-height: 62px !important;
  gap: clamp(10px, 1.6vw, 24px) !important;
}

.totink-ui-refresh .brand {
  flex: 0 0 auto !important;
  color: var(--totink-ink-v2) !important;
}

.totink-ui-refresh .nav-links {
  flex: 1 1 auto !important;
  justify-content: center !important;
  max-width: none !important;
  min-width: 0 !important;
}

.totink-ui-refresh .nav-actions {
  flex: 0 0 auto !important;
}

.totink-ui-refresh .hero {
  padding: clamp(10px, 1.8vw, 24px) 0 clamp(14px, 2.2vw, 30px) !important;
  border-bottom: 0 !important;
  background:
    linear-gradient(180deg, rgba(255, 247, 237, 0.9), rgba(255, 255, 255, 0.62)),
    linear-gradient(90deg, rgba(255, 140, 90, 0.14), rgba(47, 155, 143, 0.08)) !important;
}

.totink-ui-refresh .hero > .container {
  border: 1px solid rgba(229, 231, 235, 0.95) !important;
  border-radius: 24px !important;
  padding: clamp(18px, 2.8vw, 42px) !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 242, 0.9)),
    linear-gradient(90deg, rgba(255, 140, 90, 0.08), rgba(47, 155, 143, 0.06)) !important;
  box-shadow: 0 20px 50px rgba(32, 43, 61, 0.09) !important;
}

.totink-ui-refresh .hero-grid {
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr) !important;
  align-items: center !important;
}

.totink-ui-refresh .hero-copy,
.totink-ui-refresh .hero > .container > div:first-child {
  display: flex !important;
  flex-direction: column !important;
  gap: clamp(10px, 1.4vw, 18px) !important;
}

.totink-ui-refresh .hero p {
  max-width: 760px !important;
  line-height: 1.72 !important;
}

.totink-ui-refresh .hero-actions,
.totink-ui-refresh .form-actions,
.totink-ui-refresh .action-row,
.totink-ui-refresh .toolbar,
.totink-ui-refresh .controls {
  display: flex !important;
  flex-wrap: wrap !important;
}

.totink-ui-refresh .hero-visual,
.totink-ui-refresh .hero-board,
.totink-ui-refresh .hero-center-wrap,
.totink-ui-refresh [class*="preview"],
.totink-ui-refresh [class*="workspace"],
.totink-ui-refresh [class*="editor"],
.totink-ui-refresh [class*="generator"] {
  max-width: 100% !important;
}

.totink-ui-refresh .hero-visual,
.totink-ui-refresh .hero-board,
.totink-ui-refresh [class*="preview"] {
  max-height: min(62vh, 620px) !important;
  overflow: auto !important;
}

.totink-ui-refresh .section {
  padding: clamp(18px, 2.4vw, 36px) 0 !important;
}

.totink-ui-refresh .section > .container {
  max-width: var(--totink-wide) !important;
}

.totink-ui-refresh .section-head,
.totink-ui-refresh .section-header,
.totink-ui-refresh .content-header,
.totink-ui-refresh .tool-header {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: end !important;
  justify-content: space-between !important;
  gap: 12px 22px !important;
  margin-bottom: clamp(14px, 2vw, 24px) !important;
  padding-left: 16px !important;
  border-left: 5px solid var(--totink-orange) !important;
}

.totink-ui-refresh .section-title,
.totink-ui-refresh h2 {
  font-size: clamp(1.45rem, 2.2vw, 2.35rem) !important;
  line-height: 1.16 !important;
}

.totink-ui-refresh .grid-3,
.totink-ui-refresh .grid-4,
.totink-ui-refresh .cards-grid,
.totink-ui-refresh .tool-grid,
.totink-ui-refresh .resource-grid,
.totink-ui-refresh .activity-grid,
.totink-ui-refresh .gallery-grid {
  gap: clamp(14px, 1.6vw, 24px) !important;
}

.totink-ui-refresh .grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
}

.totink-ui-refresh .grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
}

.totink-ui-refresh .card,
.totink-ui-refresh .choice-card,
.totink-ui-refresh .tool-card,
.totink-ui-refresh .resource-card,
.totink-ui-refresh .info-card,
.totink-ui-refresh .guide-card,
.totink-ui-refresh .section-card,
.totink-ui-refresh .activity,
.totink-ui-refresh .feature-card,
.totink-ui-refresh .theme-card,
.totink-ui-refresh .age-card {
  padding: clamp(16px, 1.8vw, 24px) !important;
}

.totink-ui-refresh .card::before,
.totink-ui-refresh .choice-card::before,
.totink-ui-refresh .tool-card::before,
.totink-ui-refresh .resource-card::before,
.totink-ui-refresh .info-card::before,
.totink-ui-refresh .guide-card::before,
.totink-ui-refresh .money-card::before {
  background: linear-gradient(90deg, var(--totink-orange), #ffd56a 54%, var(--totink-green)) !important;
}

.totink-ui-refresh .btn-primary,
.totink-ui-refresh a.btn-primary,
.totink-ui-refresh button.btn-primary {
  background: var(--totink-orange) !important;
  border-color: var(--totink-orange) !important;
}

.totink-ui-refresh .btn-primary:hover,
.totink-ui-refresh a.btn-primary:hover,
.totink-ui-refresh button.btn-primary:hover {
  background: var(--totink-orange-dark) !important;
  border-color: var(--totink-orange-dark) !important;
}

.totink-ui-refresh input:not([type="checkbox"]):not([type="radio"]),
.totink-ui-refresh select,
.totink-ui-refresh textarea {
  width: auto;
  max-width: 100%;
}

.totink-ui-refresh table {
  width: 100% !important;
  border-collapse: collapse !important;
}

.totink-ui-refresh :where(.table-wrap, .table-container, .overflow-table) {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

@media (min-width: 1181px) {
  .totink-ui-refresh .hero-actions .btn,
  .totink-ui-refresh .form-actions .btn,
  .totink-ui-refresh .action-row .btn {
    flex: 0 0 auto !important;
  }
}

@media (min-width: 761px) and (max-height: 760px) {
  .totink-ui-refresh .nav {
    min-height: 54px !important;
  }

  .totink-ui-refresh .hero {
    padding-block: 8px 12px !important;
  }

  .totink-ui-refresh .hero > .container {
    padding: 16px 20px !important;
  }

  .totink-ui-refresh h1 {
    font-size: clamp(1.8rem, 2.7vw, 2.65rem) !important;
  }

  .totink-ui-refresh .hero p {
    line-height: 1.55 !important;
    margin-block: 0 !important;
  }

  .totink-ui-refresh .hero-visual,
  .totink-ui-refresh .hero-board,
  .totink-ui-refresh [class*="preview"] {
    max-height: 380px !important;
  }

  .totink-ui-refresh .section {
    padding-block: 18px !important;
  }
}

@media (max-width: 980px) {
  .totink-ui-refresh .hero-grid {
    grid-template-columns: 1fr !important;
  }

  .totink-ui-refresh .hero-visual,
  .totink-ui-refresh .hero-board,
  .totink-ui-refresh [class*="preview"] {
    max-height: none !important;
    overflow: visible !important;
  }
}

@media (max-width: 760px) {
  .totink-ui-refresh .container,
  .totink-ui-refresh .nav.container,
  .totink-ui-refresh footer .container {
    width: min(100% - 20px, var(--totink-wide)) !important;
  }

  .totink-ui-refresh .topbar,
  .totink-ui-refresh header.topbar {
    position: sticky !important;
  }

  .totink-ui-refresh .nav {
    min-height: 58px !important;
    align-items: center !important;
  }

  .totink-ui-refresh .nav-links {
    justify-content: flex-start !important;
    order: 3 !important;
    flex-basis: 100% !important;
  }

  .totink-ui-refresh .hero > .container {
    border-radius: 18px !important;
    padding: 18px !important;
  }

  .totink-ui-refresh .section-head,
  .totink-ui-refresh .section-header,
  .totink-ui-refresh .content-header,
  .totink-ui-refresh .tool-header {
    align-items: flex-start !important;
  }
}

/* Structural redesign layer. Every HTML page now wraps its original main in
   .totink-main-frame; the original main ids, form controls, and scripts stay intact.
*/
.totink-redesign-v2 .totink-main-frame {
  flex: 1 0 auto;
  width: 100%;
  min-width: 0;
}

.totink-ui-refresh .totink-main-frame {
  display: block;
  position: relative;
  padding: 0 0 clamp(18px, 3vw, 40px);
}

.totink-ui-refresh .totink-main-frame > main {
  min-width: 0;
}

.totink-ui-refresh .topbar .nav,
.totink-ui-refresh header.topbar .nav {
  position: relative;
}

.totink-ui-refresh .totink-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  gap: 4px;
  border: 1px solid rgba(229, 231, 235, 0.98);
  border-radius: 14px;
  background: #fff;
  color: var(--totink-ink-v2);
  box-shadow: 0 8px 18px rgba(32, 43, 61, 0.08);
  cursor: pointer;
}

.totink-ui-refresh .totink-menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.totink-ui-refresh .nav[data-nav-open="true"] .totink-menu-toggle {
  background: var(--totink-orange);
  border-color: var(--totink-orange);
  color: #fff;
}

.totink-ui-refresh.totink-tool-page .hero > .container,
.totink-ui-refresh.totink-has-preview .hero > .container {
  padding-block: clamp(16px, 2vw, 30px) !important;
}

.totink-ui-refresh.totink-tool-page #generator,
.totink-ui-refresh.totink-tool-page section[id="generator"] {
  width: min(calc(100% - (var(--totink-page-gutter) * 2)), var(--totink-wide)) !important;
  max-width: var(--totink-wide) !important;
  margin-inline: auto !important;
  padding: clamp(16px, 2vw, 28px) !important;
  border: 1px solid rgba(229, 231, 235, 0.98) !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: 0 18px 48px rgba(32, 43, 61, 0.08) !important;
}

.totink-ui-refresh.totink-tool-page :where(.generator-layout, .worksheet-layout, .tool-layout, .builder-layout, .app-grid, .workspace-grid) {
  display: grid !important;
  grid-template-columns: minmax(300px, 410px) minmax(0, 1fr) !important;
  align-items: start !important;
  gap: clamp(16px, 2vw, 28px) !important;
}

.totink-ui-refresh.totink-tool-page :where(.control-panel, .controls-panel, .settings-panel, .form-panel, .panel:first-child) {
  min-width: 0 !important;
}

.totink-ui-refresh.totink-tool-page :where(.preview-panel, .preview-shell, .preview-wrap, .canvas-panel, .output-panel) {
  min-width: 0 !important;
  background: #f8fafc !important;
  border: 1px solid rgba(226, 232, 240, 0.98) !important;
  border-radius: 18px !important;
}

.totink-ui-refresh.totink-tool-page :where(.btn, button, input, select, textarea) {
  max-width: 100%;
}

.totink-ui-refresh.totink-tool-page :where(.btn, button.btn) {
  white-space: normal;
}

.totink-ui-refresh footer {
  margin-top: 0 !important;
}

@media (max-width: 900px) {
  .totink-ui-refresh .totink-menu-toggle {
    display: inline-grid;
    flex: 0 0 auto;
  }

  .totink-ui-refresh .topbar .nav,
  .totink-ui-refresh header.topbar .nav {
    align-items: center !important;
  }

  .totink-ui-refresh .nav .nav-links {
    order: 4 !important;
    flex: 1 0 100% !important;
    width: 100% !important;
    max-width: none !important;
    margin-top: 8px !important;
    padding: 8px !important;
    border: 1px solid rgba(229, 231, 235, 0.98) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 12px 26px rgba(32, 43, 61, 0.08) !important;
  }

  .totink-ui-refresh .nav:not([data-nav-open="true"]) .nav-links {
    max-height: 0 !important;
    margin-top: 0 !important;
    padding-block: 0 !important;
    border-width: 0 !important;
    overflow: hidden !important;
  }

  .totink-ui-refresh .nav[data-nav-open="true"] .nav-links {
    max-height: 70vh !important;
    overflow: auto !important;
  }

  .totink-ui-refresh .nav .nav-links a {
    flex: 1 0 auto !important;
    justify-content: center !important;
  }
}

@media (max-width: 1180px) {
  .totink-ui-refresh.totink-tool-page :where(.generator-layout, .worksheet-layout, .tool-layout, .builder-layout, .app-grid, .workspace-grid) {
    grid-template-columns: 1fr !important;
  }

  .totink-ui-refresh.totink-tool-page #generator,
  .totink-ui-refresh.totink-tool-page section[id="generator"] {
    padding: 14px !important;
    border-radius: 18px !important;
  }
}

/* Unified full-site layout system.
   Every page reads the same --max value from the shared design layer instead
   of page-by-page hardcoded widths.
*/
.totink-ui-refresh :where(.container, .section > .container, footer .container, .topbar .container.nav) {
  width: min(calc(100% - (var(--totink-page-gutter) * 2)), var(--max)) !important;
  max-width: var(--max) !important;
}

.totink-ui-refresh .hero {
  display: flex !important;
  align-items: center !important;
  min-height: clamp(420px, 58vh, 700px) !important;
  padding: clamp(22px, 4vw, 56px) 0 !important;
}

.totink-ui-refresh .hero > .container {
  width: min(calc(100% - (var(--totink-page-gutter) * 2)), var(--max)) !important;
  max-width: var(--max) !important;
  padding: clamp(22px, 3.6vw, 56px) !important;
}

.totink-ui-refresh .hero-grid {
  grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.08fr) !important;
  gap: clamp(22px, 3.6vw, 64px) !important;
}

.totink-ui-refresh .hero-copy {
  max-width: min(720px, 100%) !important;
}

.totink-ui-refresh h1 {
  font-size: clamp(2.4rem, 4.8vw, 5.8rem) !important;
  line-height: 1.02 !important;
}

.totink-ui-refresh .hero p {
  max-width: min(720px, 100%) !important;
  font-size: clamp(1rem, 1.2vw, 1.28rem) !important;
}

.totink-ui-refresh .section {
  padding: clamp(34px, 4.8vw, 78px) 0 !important;
}

.totink-ui-refresh .grid-3,
.totink-ui-refresh .grid-4,
.totink-ui-refresh .cards-grid,
.totink-ui-refresh .tool-grid,
.totink-ui-refresh .resource-grid,
.totink-ui-refresh .activity-grid,
.totink-ui-refresh .gallery-grid {
  gap: clamp(18px, 2vw, 32px) !important;
}

.totink-ui-refresh .grid-3 {
  grid-template-columns: repeat(3, minmax(260px, 1fr)) !important;
}

.totink-ui-refresh .grid-4 {
  grid-template-columns: repeat(4, minmax(220px, 1fr)) !important;
}

.totink-ui-refresh .hero-visual,
.totink-ui-refresh .hero-board,
.totink-ui-refresh .visual-card {
  min-height: clamp(320px, 38vh, 560px) !important;
}

.totink-ui-refresh .visual-card,
.totink-ui-refresh .preview-grid {
  width: 100% !important;
}

.totink-ui-refresh.totink-tool-page #generator,
.totink-ui-refresh.totink-tool-page section[id="generator"] {
  width: min(calc(100% - (var(--totink-page-gutter) * 2)), var(--max)) !important;
  max-width: var(--max) !important;
}

@media (max-width: 1180px) {
  .totink-ui-refresh .hero {
    min-height: auto !important;
  }

  .totink-ui-refresh .hero-grid {
    grid-template-columns: 1fr !important;
  }

  .totink-ui-refresh h1 {
    font-size: clamp(2.15rem, 7vw, 4.4rem) !important;
  }

  .totink-ui-refresh .grid-3,
  .totink-ui-refresh .grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  .totink-ui-refresh {
    --totink-page-gutter: 10px;
  }

  .totink-ui-refresh .hero > .container {
    padding: 18px !important;
    border-radius: 18px !important;
  }

  .totink-ui-refresh .section {
    padding: 28px 0 !important;
  }
}

/* Visible global redesign pass.
   This is intentionally broad so every page shows the new system immediately
   once the shared stylesheet loads.
*/
.totink-ui-refresh .topbar,
.totink-ui-refresh header.topbar {
  background: rgba(32, 43, 61, 0.96) !important;
  border-bottom: 0 !important;
  box-shadow: 0 18px 42px rgba(32, 43, 61, 0.18) !important;
}

.totink-ui-refresh .brand,
.totink-ui-refresh .topbar .brand,
.totink-ui-refresh header.topbar .brand {
  color: #fff !important;
}

.totink-ui-refresh .nav-links a {
  color: rgba(255, 255, 255, 0.82) !important;
}

.totink-ui-refresh .nav-links a:hover,
.totink-ui-refresh .nav-links a.active,
.totink-ui-refresh .nav-links a[aria-current="page"] {
  color: #202b3d !important;
  background: #fff !important;
}

.totink-ui-refresh .lang-switch {
  background: rgba(255, 255, 255, 0.96) !important;
}

.totink-ui-refresh .hero {
  background:
    linear-gradient(135deg, rgba(255, 140, 90, 0.2), rgba(255, 213, 106, 0.12) 42%, rgba(47, 155, 143, 0.14)),
    linear-gradient(180deg, #fffaf6, #ffffff) !important;
}

.totink-ui-refresh .section:nth-of-type(odd) {
  background: #ffffff !important;
}

.totink-ui-refresh .section:nth-of-type(even) {
  background: #f8fafc !important;
}

/* Header and page-title normalization for mixed legacy structures.
   Covers both the original .topbar pages and Tailwind-built pages such as
   gallery/share so active navigation and hero titles line up everywhere.
*/
body.totink-ui-refresh > header,
.totink-ui-refresh .topbar,
.totink-ui-refresh header.topbar {
  background: rgba(32, 43, 61, 0.96) !important;
  border-bottom: 0 !important;
  box-shadow: 0 18px 42px rgba(32, 43, 61, 0.18) !important;
}

body.totink-ui-refresh > header > div,
.totink-ui-refresh .topbar .container.nav,
.totink-ui-refresh header.topbar .container.nav {
  width: min(calc(100% - (var(--totink-page-gutter) * 2)), var(--max)) !important;
  max-width: var(--max) !important;
}

body.totink-ui-refresh > header :where(.brand, .brand span, a[aria-label*="home"], a[aria-label*="Home"], a[aria-label*="home"] > span, a[aria-label*="Home"] > span) {
  color: #fff !important;
}

body.totink-ui-refresh header nav[aria-label="Primary navigation"] {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  scrollbar-width: thin !important;
}

body.totink-ui-refresh header nav[aria-label="Primary navigation"] a {
  box-sizing: border-box !important;
  min-height: 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-bottom: 0 !important;
  border-radius: 999px !important;
  color: rgba(255, 255, 255, 0.82) !important;
  background: transparent !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  transform: none !important;
}

body.totink-ui-refresh header nav[aria-label="Primary navigation"] a:hover,
body.totink-ui-refresh header nav[aria-label="Primary navigation"] a.active,
body.totink-ui-refresh header nav[aria-label="Primary navigation"] a[aria-current="page"],
body.totink-ui-refresh header nav[aria-label="Primary navigation"] a[class*="text-primary"] {
  color: #202b3d !important;
  background: #ffffff !important;
  border: 0 !important;
  border-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 140, 90, 0.2), 0 8px 18px rgba(0, 0, 0, 0.12) !important;
}

body.totink-ui-refresh main :where(.hero h1, section:first-of-type h1) {
  color: #202b3d !important;
  font-size: clamp(2.4rem, 4.8vw, 5.8rem) !important;
  line-height: 1.02 !important;
  letter-spacing: 0 !important;
  font-weight: 950 !important;
  max-width: min(920px, 100%) !important;
}

body.totink-ui-refresh main :where(.hero p, section:first-of-type p) {
  color: #64748b !important;
  font-size: clamp(1rem, 1.2vw, 1.28rem) !important;
  line-height: 1.72 !important;
}
