/* ================================================================
   my-calculator.app — Global Styles
   v7 · New 5-color palette · Flat buttons · Compact footer
   Palette: #074f57 #077187 #74a57f #9ece9a #e4c5af
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── DESIGN TOKENS ──────────────────────────────────────────────── */
:root {
  /* ── Brand palette (single source of truth) ──
     #074f57  Deepest — strongest accent / hover-dark
     #077187  Mid blue-teal — links, headings, button hover
     #74a57f  Sage — primary brand
     #9ece9a  Mint — soft highlight / hover
     #e4c5af  Warm beige — accent
  */
  --c1:           #074f57;   /* deepest */
  --c2:           #077187;   /* mid blue-teal */
  --c3:           #74a57f;   /* sage (primary) */
  --c4:           #9ece9a;   /* mint */
  --c5:           #e4c5af;   /* warm beige */

  /* Semantic aliases — change these mappings to recolor the whole app */
  --green:         var(--c3);     /* primary brand */
  --green-dark:    var(--c2);     /* darker brand */
  --green-darker:  var(--c1);     /* deepest */
  --green-mid:     var(--c4);     /* mid/hover */
  --green-soft:    #c8e0c5;       /* derived: lighter mint */
  --green-light:   #ebf3ea;       /* derived: very light tint */
  --green-tint:    #f5faf4;       /* derived: barely-there tint */
  --accent:        var(--c5);     /* warm beige accent */
  --accent-soft:   #f3e2d3;       /* derived: lighter beige */

  /* Neutrals — light & airy */
  --text:         #1E293B;
  --text2:        #5B6B7F;
  --text3:        #A3AEBE;
  --text-on:      #FFFFFF;

  --bg:           #FCFCFD;
  --bg2:          #F6F8FB;
  --bg3:          #EEF2F7;
  --bg-soft:      #FAFBFC;

  --border:       #ECEFF4;
  --border2:      #DDE3EC;
  --border-strong:#BAC4D1;

  --surface:      #FFFFFF;
  --surface-2:    #F8FAFC;

  /* Radii — fully flat for buttons, near-flat elsewhere */
  --r-xs:         0;
  --r-sm:         2px;
  --r-md:         2px;     /* boxes */
  --r-lg:         3px;     /* slightly bigger */
  --r-xl:         3px;     /* cards */
  --r-btn:        0;       /* buttons fully flat */
  --r-pill:       0;       /* "pills" now flat */
  --radius:       var(--r-md);
  --radius-lg:    var(--r-lg);

  /* Shadows */
  --shadow-xs:    0 1px 1px rgba(15,23,42,.03);
  --shadow-sm:    0 1px 2px rgba(15,23,42,.04);
  --shadow:       0 1px 2px rgba(15,23,42,.04), 0 2px 8px rgba(15,23,42,.04);
  --shadow-lg:    0 2px 8px rgba(15,23,42,.05), 0 12px 32px rgba(15,23,42,.08);
  --shadow-focus: 0 0 0 3px rgba(116,165,127,.22);

  /* Typography */
  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono:         ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Monaco, monospace;
  --tracking:     -0.011em;
  --tracking-tight: -0.022em;

  /* Layout — full width */
  --max-w:        100%;
  --content-pad:  clamp(16px, 3vw, 40px);
  --header-h:     60px;

  --ease:         cubic-bezier(.16, 1, .3, 1);
}

/* ── DARK THEME ─────────────────────────────────────────────────── */
[data-theme="dark"] {
  /* Brand tints stay similar — slightly brighter for contrast */
  --green:         #8fb89a;
  --green-dark:    #6fa385;
  --green-darker:  #4d8e74;
  --green-mid:     #a6cda9;
  --green-soft:    #2d4438;
  --green-light:   #1e3329;
  --green-tint:    #182721;
  --accent:        #e4c5af;
  --accent-soft:   #3a2f26;

  /* Neutrals — deep, near-black with subtle warmth */
  --text:          #E7ECF2;
  --text2:         #A7B2C0;
  --text3:         #6C7689;
  --text-on:       #0B1117;

  --bg:            #0E1218;
  --bg2:           #141A22;
  --bg3:           #1B2230;
  --bg-soft:       #11161E;

  --border:        #232C3A;
  --border2:       #2C374A;
  --border-strong: #3B475C;

  --surface:       #161C26;
  --surface-2:     #1A2230;

  /* Shadows lose their visibility in dark — tone down */
  --shadow-xs:     0 1px 1px rgba(0,0,0,.30);
  --shadow-sm:     0 1px 2px rgba(0,0,0,.35);
  --shadow:        0 1px 2px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.30);
  --shadow-lg:     0 2px 8px rgba(0,0,0,.45), 0 12px 32px rgba(0,0,0,.55);
  --shadow-focus:  0 0 0 3px rgba(143,184,154,.30);
}

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

/* ── BASE ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.55;
  letter-spacing: var(--tracking);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--green-dark);
  text-decoration: none;
  transition: color .15s var(--ease);
}
a:hover { color: var(--green-darker); }

img { max-width: 100%; display: block; }

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: var(--font);
  font-size: 15.5px;
  color: var(--text);
}

::selection { background: var(--green); color: #fff; }

/* ── LAYOUT — full width ───────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 var(--content-pad);
}

.page-wrap {
  padding-top: var(--header-h);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; width: 100%; }

/* ── HEADER ─────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 var(--content-pad);
}

.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; }
.logo-icon { font-size: 20px; line-height: 1; }
.logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--green-dark);
  letter-spacing: -.3px;
}
.logo-text span { color: var(--text); font-weight: 500; }

/* Header search */
.header-search { flex: 1; position: relative; max-width: 480px; }

.header-search input {
  width: 100%;
  padding: 9px 36px;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.header-search input::placeholder { color: var(--text3); }
.header-search input:focus { border-color: var(--green); box-shadow: var(--shadow-focus); }

.header-search .search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text3); pointer-events: none; font-size: 14px;
}

.header-search .clear-btn {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text3); font-size: 18px; display: none;
  padding: 2px; line-height: 1; border-radius: 0;
}
.header-search .clear-btn:hover { color: var(--text); }

/* Autocomplete dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
  z-index: 200;
  max-height: 360px;
  overflow-y: auto;
}
.autocomplete-dropdown.open { display: block; }

.ac-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.focused { background: var(--bg2); color: var(--text); }
.ac-icon { font-size: 16px; }
.ac-name { flex: 1; }
.ac-theme { font-size: 12px; color: var(--text3); }

/* Header nav */
.header-nav { display: none; gap: 4px; margin-left: auto; flex-shrink: 0; align-items: center; }

.nav-link {
  padding: 7px 12px;
  border-radius: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text2);
  white-space: nowrap;
}
.nav-link:hover { background: var(--bg2); color: var(--text); text-decoration: none; }

.btn-login {
  padding: 7px 14px;
  border-radius: 0;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text);
}
.btn-login:hover { background: var(--bg2); text-decoration: none; }

.btn-premium {
  padding: 7px 14px;
  border-radius: 0;
  font-size: 13.5px;
  font-weight: 600;
  background: var(--green);
  color: #fff;
}
.btn-premium:hover { background: var(--green-dark); text-decoration: none; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 0;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 4px;
}
.theme-toggle:hover { background: var(--bg2); color: var(--text); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.menu-toggle {
  margin-left: auto;
  flex-shrink: 0;
  padding: 7px;
  color: var(--text2);
  font-size: 20px;
  display: flex;
  align-items: center;
  border-radius: 0;
}
.menu-toggle:hover { background: var(--bg2); color: var(--text); }

/* ── HERO ────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 56px 0 48px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(116,165,127,.10), transparent 70%),
    linear-gradient(180deg, var(--green-tint) 0%, var(--bg) 80%);
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
  margin-bottom: 12px;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--green-darker) 0%, var(--green-dark) 50%, var(--green) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: 17px;
  color: var(--text2);
  margin-bottom: 28px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero search bar — flat */
.hero-search {
  position: relative;
  display: flex;
  max-width: 600px;
  margin: 0 auto 18px;
  border: 1px solid var(--border2);
  border-radius: 0;
  overflow: visible;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.hero-search:focus-within {
  border-color: var(--green);
  box-shadow: var(--shadow), var(--shadow-focus);
}

.hero-search .hero-search-icon {
  position: absolute;
  left: 18px; top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
  font-size: 15px;
  z-index: 1;
}

.hero-search input {
  flex: 1;
  padding: 14px 18px 14px 44px;
  border: none;
  outline: none;
  font-size: 16px;
  background: transparent;
  color: var(--text);
  min-width: 0;
}
.hero-search input::placeholder { color: var(--text3); }

.hero-search button {
  padding: 12px 24px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0;
  flex-shrink: 0;
  transition: background .15s var(--ease);
}
.hero-search button:hover { background: var(--green-dark); }

/* Hero autocomplete sits below the search bar */
.hero-search .autocomplete-dropdown {
  top: calc(100% + 6px);
}

/* Stat strip */
.stat-strip { display: flex; justify-content: center; gap: 36px; flex-wrap: wrap; margin-top: 24px; }
.stat-item { text-align: center; }
.stat-num {
  font-size: 26px;
  font-weight: 700;
  color: var(--green-dark);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  font-feature-settings: 'tnum' 1;
}
.stat-lbl {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── SECTION HEADERS ────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: var(--tracking-tight);
}

.section-link { font-size: 13px; color: var(--green-dark); white-space: nowrap; font-weight: 500; }
.section-link:hover { color: var(--green-darker); }

/* ── THEME GRID ─────────────────────────────────────────────────── */
.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.theme-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .12s var(--ease);
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
}
.theme-card:hover {
  border-color: var(--green);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--text);
}

.theme-card-icon { font-size: 22px; flex-shrink: 0; }
.theme-card-info { min-width: 0; flex: 1; overflow: hidden; }
.theme-card-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.theme-card-count { font-size: 11px; color: var(--text3); margin-top: 2px; font-weight: 500; }

/* On very small screens, hide overflowing categories beyond 6 */
@media (max-width: 479px) {
  .theme-grid > .theme-card:nth-child(n+7) { display: none; }
  .tool-list > .tool-card:nth-child(n+7) { display: none; }
}

/* ── TOOL LIST / CARDS ──────────────────────────────────────────── */
.tool-list { display: grid; grid-template-columns: 1fr; gap: 10px; }

.tool-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .12s var(--ease);
}
.tool-card:hover {
  border-color: var(--green);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--text);
}

.tool-card-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tool-card-name { flex: 1; font-size: 14.5px; font-weight: 500; color: var(--text); }
.tool-card-icon { font-size: 14px; color: var(--text3); }

/* Favorite star — flat */
.fav-btn {
  color: var(--text3);
  font-size: 16px;
  padding: 4px;
  border-radius: 0;
  transition: color .15s var(--ease), transform .12s var(--ease), background .15s var(--ease);
  flex-shrink: 0;
}
.fav-btn:hover { color: #B45309; background: rgba(228,197,175,.30); transform: scale(1.1); }
.fav-btn.active { color: #B45309; }

/* ── SEARCH RESULTS ─────────────────────────────────────────────── */
.search-results-page { padding: 24px 0; }
.search-results-header { margin-bottom: 20px; }
.search-results-header h2 { font-size: 22px; font-weight: 700; letter-spacing: var(--tracking-tight); }
.search-results-header p { font-size: 14px; color: var(--text2); margin-top: 4px; }
.search-results-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }

/* ── TOOL PAGE ──────────────────────────────────────────────────── */
.tool-page { padding: 28px 0; }
.tool-page-header { margin-bottom: 24px; }

.tool-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text3);
  margin-bottom: 12px;
  flex-wrap: wrap;
  font-weight: 500;
}
.tool-breadcrumb a { color: var(--text3); }
.tool-breadcrumb a:hover { color: var(--green-dark); text-decoration: none; }
.tool-breadcrumb span { color: var(--border2); }

.tool-page-title {
  font-size: clamp(26px, 4.5vw, 36px);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  margin-bottom: 8px;
  line-height: 1.15;
  color: var(--text);
}

.tool-page-desc {
  font-size: 16px;
  color: var(--text2);
  line-height: 1.6;
}

.tool-layout { display: flex; flex-direction: column; gap: 24px; }

.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow-xs);
}

.calc-card h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text2);
  margin-bottom: 18px;
}

/* Form elements */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13.5px; font-weight: 500; color: var(--text2); margin-bottom: 7px; }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
  font-feature-settings: 'tnum' 1;
}
.form-group input:hover, .form-group select:hover { border-color: var(--border-strong); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--green);
  box-shadow: var(--shadow-focus);
}

.form-group .hint { font-size: 12.5px; color: var(--text3); margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Buttons — FULLY FLAT (no radius) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 0;
  font-size: 14.5px;
  font-weight: 600;
  transition: all .15s var(--ease);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 1px 2px rgba(7,113,135,.20);
}
.btn-primary:hover {
  background: var(--green-dark);
  box-shadow: 0 2px 6px rgba(7,113,135,.25);
  text-decoration: none;
  color: #fff;
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text);
}
.btn-outline:hover {
  background: var(--bg2);
  border-color: var(--border-strong);
  text-decoration: none;
  color: var(--text);
}

.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 0; }

/* Result box */
.result-box {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(135deg, var(--green-light) 0%, var(--green-tint) 100%);
  border: 1px solid var(--green-soft);
  border-radius: var(--r-sm);
  display: none;
}
.result-box.visible { display: block; }

.result-label {
  font-size: 12px;
  color: var(--green-dark);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}

.result-value {
  font-weight: 700;
  color: var(--green-darker);
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
  font-feature-settings: 'tnum' 1;
}

.result-sub { font-size: 13.5px; color: var(--text2); margin-top: 8px; }

/* Share bar */
.share-bar { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; align-items: center; }

.share-bar .share-input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  font-size: 12.5px;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  background: var(--bg2);
  color: var(--text2);
  font-family: var(--mono);
  outline: none;
}
.share-bar .share-input:focus { border-color: var(--green); }

/* Sidebar */
.tool-sidebar { display: flex; flex-direction: column; gap: 16px; }

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 18px;
  box-shadow: var(--shadow-xs);
}

.sidebar-card h3 {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text2);
  margin-bottom: 12px;
}

.related-list { display: flex; flex-direction: column; gap: 4px; }
.related-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 0;
  text-decoration: none;
  transition: background .12s var(--ease);
}
.related-item:hover { background: var(--bg2); text-decoration: none; color: var(--text); }

/* ── BROWSE PAGE ─────────────────────────────────────────────────── */
.browse-section { padding: 24px 0; }
.browse-section + .browse-section { padding-top: 0; }

.theme-tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── FEEDBACK PAGE — full width ─────────────────────────────────── */
.feedback-page {
  padding: 32px 0;
  max-width: 100%;       /* full width per user request */
  margin: 0;
}

.feedback-page h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  margin-bottom: 8px;
}

.feedback-page .intro {
  color: var(--text2);
  font-size: 15px;
  margin-bottom: 28px;
  line-height: 1.6;
}

.feedback-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow-xs);
  /* Form card itself stays readable — wrap inputs at a comfortable width */
  max-width: 800px;
}

.feedback-form .form-group:last-of-type { margin-bottom: 0; }

/* Type pills — flat rectangular chips */
.type-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.type-pill {
  padding: 6px 14px;
  border-radius: 0;
  border: 1px solid var(--border2);
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  transition: all .15s var(--ease);
  background: var(--surface);
  font-weight: 500;
}
.type-pill:hover { border-color: var(--green); color: var(--green-dark); }
.type-pill.active { background: var(--green); border-color: var(--green); color: #fff; }

.star-rating { display: flex; gap: 8px; margin-bottom: 16px; }

.star-rating .star {
  font-size: 28px;
  cursor: pointer;
  opacity: .3;
  transition: opacity .15s var(--ease), transform .12s var(--ease);
}
.star-rating .star.active, .star-rating .star:hover { opacity: 1; transform: scale(1.15); }

.feedback-success {
  display: none;
  text-align: center;
  padding: 32px 24px;
  background: linear-gradient(135deg, var(--green-light) 0%, var(--green-tint) 100%);
  border: 1px solid var(--green-soft);
  border-radius: var(--r-sm);
}
.feedback-success .success-icon { font-size: 44px; margin-bottom: 12px; }
.feedback-success h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 6px;
  letter-spacing: var(--tracking-tight);
}
.feedback-success p { font-size: 14.5px; color: var(--text2); }

/* ── FOOTER — inline single-row ───────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 8px 0 6px;
  margin-top: 12px;
  background: var(--bg2);
}

.footer-grid {
  display: flex;
  flex-direction: row;
  gap: 4px;
  margin-bottom: 4px;
}

.footer-grid-left {
  display: flex;
  flex-grow: 1;
  flex-direction: column;
}

.footer-grid-right {
  display: flex;
  flex-direction: column;
}

.footer-brand { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.footer-brand p {
  font-size: 11.5px;
  color: var(--text3);
  margin: 0;
  line-height: 1.3;
}

.footer-heading {
  display: inline;
  font-size: 10.5px;
  font-weight: 600;
  margin-right: 6px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.footer-links {
  list-style: none;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  margin: 0;
}
.footer-links li { display: inline; }
.footer-links li + li::before {
  content: "·";
  margin: 0 6px;
  color: var(--text3);
  opacity: .5;
}

.footer-links a {
  font-size: 11.5px;
  color: var(--text3);
  transition: color .12s var(--ease);
}
.footer-links a:hover { color: var(--green-dark); text-decoration: none; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 10.5px;
  color: var(--text3);
}

/* ── UTILITY ─────────────────────────────────────────────────────── */
.section { padding: 32px 0; }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .01em;
}
.badge-free    { background: var(--bg3); color: var(--text2); }
.badge-premium { background: var(--accent-soft); color: #8B5E0F; border: 1px solid var(--accent); }
.badge-new     { background: var(--green-light); color: var(--green-dark); }

.divider { height: 1px; background: var(--border); margin: 24px 0; }

.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text3); }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── TOAST — flat rectangle ─────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--green-darker);
  color: #fff;
  padding: 11px 18px;
  border-radius: 0;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  transition: transform .25s var(--ease);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── MOBILE NAV DRAWER ───────────────────────────────────────────── */
.nav-drawer {
  position: fixed;
  top: var(--header-h);
  right: -300px;
  width: 290px;
  bottom: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 90;
  transition: right .25s var(--ease);
  overflow-y: auto;
  padding: 14px 0;
  box-shadow: var(--shadow-lg);
}
.nav-drawer.open { right: 0; }

.nav-drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  font-size: 14.5px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: background .12s var(--ease);
}
.nav-drawer-item:hover { background: var(--bg2); text-decoration: none; color: var(--text); }

.nav-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,41,59,.35);
  z-index: 89;
  backdrop-filter: blur(2px);
}
.nav-drawer-overlay.open { display: block; }

/* ── PER-TOOL INLINE STYLE OVERRIDES ─────────────────────────────────
   Tool pages have their own inline <style> blocks with pill shapes.
   Override them globally so no buttons are rounded anywhere.
   Using !important because inline <style> in <head> has equal cascade
   weight but is parsed after this stylesheet; for safety, force flat.
*/
.fav-pill, .tip-pill, .preset-pill, .swap-btn,
.mode-tab, .mode-tabs, .unit-toggle, .unit-toggle button,
.stepper button, .stepper input,
.warn-box, .rate-notice, .equation, .result-mini, .result-grid,
.bmi-bar, .bmi-marker, .browse-search input, .browse-search,
.filter-pill {
  border-radius: 0 !important;
}

/* Make the inline-styled pill chips match new palette */
.fav-pill.active { background: var(--accent-soft) !important; border-color: var(--accent) !important; color: #8B5E0F !important; }
.tip-pill.active, .filter-pill.active { background: var(--green-light) !important; border-color: var(--green) !important; color: var(--green-dark) !important; }
.mode-tab.active, .unit-toggle button.active { background: var(--green) !important; color: #fff !important; }
.swap-btn { background: var(--bg2); border: 1px solid var(--border2); width:36px; height:36px; }
.swap-btn:hover { background: var(--bg3); }

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (min-width: 480px) {
  .theme-tools-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 640px) {
  .theme-grid { grid-template-columns: repeat(3, 1fr); }
  .tool-list { grid-template-columns: 1fr 1fr; }
  .search-results-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { justify-content: space-between; }
}

@media (min-width: 768px) {
  .header-nav { display: flex; align-items: center; gap: 4px; }
  .menu-toggle { display: none; }
  .theme-grid { grid-template-columns: repeat(4, 1fr); }
  .theme-tools-grid { grid-template-columns: repeat(3, 1fr); }
  .tool-layout { flex-direction: row; align-items: flex-start; }
  .tool-main { flex: 1; min-width: 0; }
  .tool-sidebar { width: 300px; flex-shrink: 0; position: sticky; top: calc(var(--header-h) + 20px); }
  .header-search { max-width: 380px; }
  .tool-list { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .theme-grid { grid-template-columns: repeat(6, 1fr); }
  .theme-tools-grid { grid-template-columns: repeat(4, 1fr); }
  .header-search { max-width: 480px; }
  .tool-list { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1280px) {
  .theme-tools-grid { grid-template-columns: repeat(5, 1fr); }
  .tool-list { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 1600px) {
  .theme-tools-grid { grid-template-columns: repeat(6, 1fr); }
  .tool-list { grid-template-columns: repeat(6, 1fr); }
}

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