:root {
  color-scheme: light dark;
  --bg: #f6f8f5;
  --surface: #ffffff;
  --surface-2: #eef5f0;
  --ink: #162321;
  --muted: #5d6f6b;
  --brand: #106466;
  --brand-2: #d9673b;
  --line: #d8e3df;
  --shadow: 0 22px 65px rgba(14, 36, 34, .13);
}

:root[data-theme="dark"] {
  --bg: #101816;
  --surface: #172320;
  --surface-2: #21302c;
  --ink: #edf7f3;
  --muted: #b4c5bf;
  --brand: #5cc8bd;
  --brand-2: #ff9a68;
  --line: #2f433d;
  --shadow: 0 24px 70px rgba(0, 0, 0, .32);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101816; --surface: #172320; --surface-2: #21302c; --ink: #edf7f3; --muted: #b4c5bf; --brand: #5cc8bd; --brand-2: #ff9a68; --line: #2f433d; --shadow: 0 24px 70px rgba(0,0,0,.32);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Tahoma, Arial, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.75; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.site-header {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  padding: 14px clamp(16px, 4vw, 58px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand, .site-header nav, .header-actions, .hero-actions, .site-footer div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { font-weight: 900; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--brand); color: var(--bg); }
.site-header nav { justify-content: center; }
.site-header nav a, .site-footer a { color: var(--muted); font-weight: 700; }
.site-header nav a:hover, .site-footer a:hover { color: var(--brand); }
.lang-select, .country-select, .theme-toggle {
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink);
  min-height: 40px; padding: 8px 10px;
}
.theme-toggle { cursor: pointer; }

.hero {
  min-height: 76vh;
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(340px, 1.1fr); gap: clamp(28px, 5vw, 70px);
  align-items: center;
  padding: clamp(38px, 8vw, 88px) clamp(16px, 5vw, 72px) 34px;
}
.hero h1, .tool-hero h1, .page h1, .language-gate h1 {
  margin: 0 0 18px;
  font-size: clamp(2.15rem, 4.8vw, 4.8rem);
  line-height: 1.08;
  letter-spacing: 0;
}
.hero p, .tool-hero p, .page p, .language-gate p { color: var(--muted); font-size: 1.08rem; max-width: 780px; }
.eyebrow { margin: 0 0 12px; color: var(--brand-2); font-weight: 900; }
.button, button.primary, button.secondary {
  border: 0; border-radius: 8px; min-height: 48px; padding: 13px 18px; font-weight: 900; cursor: pointer;
}
.primary { background: var(--brand); color: var(--bg); }
.secondary { background: var(--surface-2); color: var(--brand); }
.hero-visual { margin: 0; }
.hero-visual img {
  width: 100%; height: auto; display: block; border-radius: 8px; box-shadow: var(--shadow);
  aspect-ratio: 16 / 9; object-fit: cover;
}

.search-band { padding: 0 clamp(16px, 5vw, 72px) 22px; }
.search-band input {
  width: 100%; min-height: 58px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); padding: 14px 18px; box-shadow: var(--shadow);
}
.search-band p { min-height: 24px; color: var(--muted); margin: 8px 0 0; }

.ad-shell {
  display: none;
  margin: 18px clamp(16px, 5vw, 72px);
}

.ad-shell.is-active { display: block; }
.ad-shell.compact { margin: 10px 0 0; }
.ad-box {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.ad-box img {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}
.ad-box strong { display: block; margin-bottom: 4px; }
.ad-box span { color: var(--muted); }
.ad-box em {
  font-style: normal;
  color: var(--brand);
  font-weight: 900;
}
.ad-box.adsense {
  display: block;
  text-align: center;
  color: var(--muted);
}

.section, .tool-layout, .page { padding: 56px clamp(16px, 5vw, 72px); }
.section-heading { max-width: 820px; margin-bottom: 24px; }
.section-heading h2, .side-box h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.5rem); letter-spacing: 0; }
.muted { background: var(--surface-2); }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); gap: 16px; }
.tool-card, .tool-box, .side-box, details, .invoice-preview, .language-card {
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.tool-card { min-height: 190px; padding: 20px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.tool-card span { color: var(--brand-2); font-weight: 900; font-size: .9rem; }
.tool-card h3 { margin: 10px 0 8px; font-size: 1.2rem; }
.tool-card p { margin: 0; color: var(--muted); }
.tool-card.is-hidden { display: none; }
.category-list { display: flex; flex-wrap: wrap; gap: 12px; }
.category-list a { padding: 10px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--brand); font-weight: 900; }

.tool-hero { padding: 54px clamp(16px, 5vw, 72px) 22px; }
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: .95rem;
}
.breadcrumbs a { color: var(--brand); font-weight: 800; }
.breadcrumbs strong { color: var(--ink); }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; align-items: start; padding-top: 10px; }
.tool-box { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 22px; }
.tool-box textarea, .tool-box .result, .tool-box .invoice-preview, .tool-box button.primary, .gpa-grid, .tool-actions { grid-column: 1 / -1; }
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
label { display: grid; gap: 7px; color: var(--muted); font-weight: 800; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); padding: 12px 13px;
}
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.check input { width: auto; }
.result { min-height: 74px; padding: 16px; border-radius: 8px; background: var(--surface-2); color: var(--ink); font-weight: 900; }
.selectable { direction: ltr; text-align: left; user-select: all; overflow-wrap: anywhere; }
.side-box { display: grid; gap: 10px; padding: 18px; }
.side-box a { padding: 10px 0; border-top: 1px solid var(--line); color: var(--brand); font-weight: 900; }
.faq-list { display: grid; gap: 12px; max-width: 960px; }
details { padding: 16px 18px; }
summary { cursor: pointer; font-weight: 900; }
details p { color: var(--muted); }
.gpa-grid { display: grid; gap: 10px; }
.gpa-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.invoice-preview { padding: 16px; }
.page { max-width: 900px; min-height: 58vh; }
.site-footer { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 28px clamp(16px, 5vw, 72px); border-top: 1px solid var(--line); color: var(--muted); }
.language-gate { min-height: 100vh; display: grid; place-content: center; padding: 32px; background: var(--bg); }
.language-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; width: min(960px, 92vw); margin-top: 24px; }
.language-card { padding: 18px; display: grid; gap: 8px; }
.language-card span { color: var(--brand-2); font-weight: 900; }
.language-card small { color: var(--muted); }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr; align-items: start; }
  .site-header nav { justify-content: flex-start; }
  .hero, .tool-layout, .tool-box { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .gpa-row { grid-template-columns: 1fr; }
  .ad-box { grid-template-columns: 1fr; }
  .ad-box img { width: 100%; height: auto; aspect-ratio: 16 / 7; }
}
