/* ============================================================
   Gamler.io — tool interiors (ROI calculator, UTM builder,
   creative uniquifier).

   Geometry, type and colour all come from the shared design
   system in gamler.css. Nothing here declares a raw brand
   colour or a font stack — if a value should change, change
   the token there.
   ============================================================ */

:root {
    --blue-deep: #0c3f9e;
    --lime: var(--accent);
    --lime-hi: #d8ff7a;
    --green: #2E7D32;
    --red: #C62828;
    /* legacy aliases kept so any stray selector still resolves */
    --slate-900: var(--ink);
    --slate-700: #2E2E2E;
    --slate-500: var(--muted);
    --slate-400: var(--muted-dark);
    --slate-200: var(--line);
    --slate-100: var(--light);
}

[x-cloak] { display: none !important; }
html { scroll-behavior: smooth; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--light); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-dark); }

/* Icon sizing (previously Tailwind utilities) */
.w-4 { width: 16px } .h-4 { height: 16px }
.w-7 { width: 28px } .h-7 { height: 28px }
.hidden { display: none }

/* ---------- Page head ----------
   Inner pages in this system don't get a full-bleed coloured
   hero — they get a quiet head with a thin display title. */
.calc-hero { background: var(--light); padding: 44px 0 0 }
.calc-hero-inner {
    max-width: var(--shell); margin: 0 auto;
    padding: 0 var(--gutter) 34px;
    border-bottom: 1px solid var(--line);
}
.calc-eyebrow {
    display: block; font: 500 11px/1 var(--mono);
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--muted-dark); margin-bottom: 16px;
}
.calc-h1 {
    font-family: var(--display); font-weight: 300;
    letter-spacing: .4px; line-height: 1.08;
    font-size: clamp(32px, 5vw, 52px);
    color: var(--ink); margin: 0 0 16px;
}
.calc-sub { font-size: 18px; line-height: 28px; color: var(--muted); margin: 0; max-width: 68ch }

/* ---------- Calculator band ---------- */
.calc-section { background: var(--light); border-radius: 0; padding: 44px 0 60px }
.calc-wrap { max-width: var(--shell); margin: 0 auto; padding: 0 var(--gutter) }
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start }

.calc-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 26px }
.calc-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px }
.calc-panel-title { font-family: var(--display); font-weight: 500; font-size: 19px; letter-spacing: .2px; color: var(--ink); margin: 0 }

/* Currency switch */
.cur-switch { display: inline-flex; gap: 2px; padding: 3px; background: var(--light); border: 1px solid var(--line); border-radius: var(--r-btn) }
.cur-btn {
    border: 0; background: transparent; cursor: pointer;
    font: 500 12px/1 var(--mono); letter-spacing: .04em; color: var(--muted);
    padding: 7px 11px; border-radius: 9px;
    transition: background .18s ease, color .18s ease;
}
.cur-btn:hover { color: var(--ink) }
.cur-btn.is-active { background: var(--ink); color: #fff }

/* Fields */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0 }
.field-label { display: flex; align-items: center; gap: 7px; font: 500 13px/1.3 var(--ui); color: var(--muted) }
.field-label svg { width: 14px; height: 14px; opacity: .55 }
.field-input-wrap {
    display: flex; align-items: center; background: var(--card);
    border: 1px solid var(--line); border-radius: var(--r-btn);
    transition: border-color .18s ease, box-shadow .18s ease;
}
.field-input-wrap:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23, 23, 23, .06) }
.field-input {
    flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
    font: 500 16px/1 var(--ui); color: var(--ink); padding: 13px 14px;
}
.field-input::placeholder { color: var(--muted-dark); font-weight: 400 }
.field-suffix { padding-right: 14px; font: 500 12px/1 var(--mono); letter-spacing: .04em; color: var(--muted-dark); white-space: nowrap }

/* Actions */
.calc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px }
.btn-primary, .btn-lime, .btn-reset {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: 600 14px/1 var(--ui); padding: 13px 22px; border-radius: var(--r-btn);
    cursor: pointer; border: 1px solid transparent;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.btn-primary { background: var(--ink); color: #fff }
.btn-primary:hover { background: #000 }
.btn-lime { background: var(--accent); color: var(--ink) }
.btn-lime:hover { background: var(--lime-hi) }
.btn-reset { background: transparent; color: var(--muted); border-color: var(--line) }
.btn-reset:hover { color: var(--ink); border-color: var(--ink) }
.calc-hint { margin-top: 16px; font-size: 13px; line-height: 21px; color: var(--muted-dark) }
.calc-hint i { font-style: normal; color: var(--ink) }

/* ---------- Results ---------- */
.res-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 20px }
.res-title { font-family: var(--display); font-weight: 500; font-size: 19px; letter-spacing: .2px; color: var(--ink); margin: 0 }
.res-note { font-size: 13px; color: var(--muted-dark) }
.res-hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px }
.res-hero { padding: 22px; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--card) }
.res-hero-blue, .res-hero-dark { background: var(--ink); border-color: var(--ink); color: #fff }
.res-hero-lime { background: var(--accent); border-color: var(--accent); color: var(--ink) }
.res-hero-label { display: block; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; opacity: .6; margin-bottom: 12px }
.res-hero-val { display: block; font-family: var(--display); font-weight: 300; font-size: clamp(26px, 3.4vw, 36px); line-height: 1; letter-spacing: .5px }
.res-hero-desc { display: block; margin-top: 10px; font-size: 13px; line-height: 19px; opacity: .65 }

.res-metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 12px }
.metric { padding: 18px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card) }
.metric-top { display: flex; align-items: center; gap: 9px; margin-bottom: 12px }
.metric-ico {
    width: 28px; height: 28px; flex: 0 0 28px; border-radius: 9px; background: var(--light);
    display: flex; align-items: center; justify-content: center; color: var(--muted);
}
.metric-ico svg { width: 14px; height: 14px }
.metric-name { font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted-dark) }
.metric-val { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.1; color: var(--ink) }
.metric-desc { margin-top: 8px; font-size: 13px; line-height: 19px; color: var(--muted) }
.pos { color: var(--green) }
.neg { color: var(--red) }

/* ---------- How it works ---------- */
.how-section { background: var(--card); padding: 60px 0; border-top: 1px solid var(--line) }
.how-wrap { max-width: var(--shell); margin: 0 auto; padding: 0 var(--gutter) }
.how-head { margin-bottom: 40px }
.how-h2 { font-family: var(--display); font-weight: 300; letter-spacing: .4px; line-height: 1.12; font-size: clamp(26px, 3.6vw, 40px); color: var(--ink); margin: 0 0 14px }
.how-lead { font-size: 17px; line-height: 27px; color: var(--muted); margin: 0; max-width: 68ch }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px }
.how-card { background: var(--light); border: 1px solid var(--line); border-radius: var(--r-card); padding: 26px }
.how-num {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 11px; background: var(--ink); color: #fff;
    font: 500 15px/1 var(--display); margin-bottom: 16px;
}
.how-card-title { font-family: var(--display); font-weight: 500; font-size: 18px; color: var(--ink); margin: 0 0 10px }
.how-card-text { font-size: 15px; line-height: 24px; color: var(--muted); margin: 0 }

/* ---------- Long-form copy ---------- */
.prose-section { background: var(--light); padding: 60px 0; border-top: 1px solid var(--line) }
.prose-wrap { max-width: 812px; margin: 0 auto; padding: 0 var(--gutter); font-size: 17px; line-height: 29px; color: #2E2E2E }
.prose-wrap h2 { font-family: var(--display); font-weight: 300; letter-spacing: .3px; font-size: clamp(24px, 3.2vw, 32px); line-height: 1.2; color: var(--ink); margin: 48px 0 0 }
.prose-wrap h3 { font-family: var(--display); font-weight: 400; font-size: 21px; color: var(--ink); margin: 34px 0 0 }
.prose-wrap p { margin: 20px 0 0 }
.prose-wrap strong { font-weight: 600; color: var(--ink) }

/* ---------- FAQ (mirrors the landing) ---------- */
.faq-section { background: var(--card); padding: 60px 0; border-top: 1px solid var(--line) }
.faq-container {
    max-width: var(--shell); margin: 0 auto; padding: 0 var(--gutter);
    display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 48px; align-items: start;
}
.faq-intro { position: sticky; top: 96px }
.faq-eyebrow { display: block; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted-dark); margin-bottom: 16px }
.faq-title { font-family: var(--display); font-weight: 300; letter-spacing: .4px; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.12; color: var(--ink); margin: 0 0 14px }
.faq-lead { font-size: 16px; line-height: 26px; color: var(--muted); margin: 0 0 20px }
.faq-contact { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 2px }
.faq-contact:hover { border-bottom-color: var(--ink) }
.faq-list { border-top: 1px solid var(--line) }
.faq-item { border-bottom: 1px solid var(--line) }
.faq-q {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px;
    background: transparent; border: 0; cursor: pointer; text-align: left;
    font-family: var(--display); font-weight: 300; letter-spacing: .3px;
    font-size: clamp(17px, 2.1vw, 21px); line-height: 1.35; color: var(--ink); padding: 22px 0;
}
.faq-icon { flex: 0 0 auto; width: 13px; height: 13px; color: var(--muted); transition: transform .2s ease }
.faq-item-open .faq-icon { transform: rotate(45deg) }
.faq-a { padding: 0 44px 24px 0; font-size: 16px; line-height: 26px; color: var(--muted); max-width: 78ch }

/* ---------- UTM builder ---------- */
.utm-url-wrap { display: flex; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-btn) }
.utm-url-wrap:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23, 23, 23, .06) }
.utm-url-prefix { padding-left: 14px; font: 500 13px/1 var(--mono); color: var(--muted-dark) }
.utm-url-input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 13px 14px; font: 500 15px/1 var(--ui); color: var(--ink) }
.utm-tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--light); border: 1px solid var(--line); border-radius: var(--r-btn); margin-bottom: 18px }
.utm-tab { border: 0; background: transparent; cursor: pointer; font: 500 13px/1 var(--ui); color: var(--muted); padding: 9px 15px; border-radius: 9px; transition: background .18s ease, color .18s ease }
.utm-tab:hover { color: var(--ink) }
.utm-tab.is-active { background: var(--ink); color: #fff }
.utm-tpl-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px }
.utm-tpl {
    display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--card);
    font: 500 13px/1 var(--ui); color: var(--muted); cursor: pointer;
    transition: border-color .18s ease, color .18s ease;
}
.utm-tpl:hover { color: var(--ink); border-color: var(--ink) }
.utm-tpl svg { width: 14px; height: 14px }
.utm-tpl.is-active { background: var(--ink); border-color: var(--ink); color: #fff }
.utm-param { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr); gap: 10px; align-items: center; margin-bottom: 10px }
.utm-param-key { display: flex; align-items: center; gap: 7px; font: 500 13px/1 var(--mono); letter-spacing: .02em; color: var(--muted) }
.utm-param-input { border: 1px solid var(--line); border-radius: var(--r-btn); background: var(--card); padding: 11px 14px; font: 400 15px/1 var(--ui); color: var(--ink); outline: none; min-width: 0; transition: border-color .18s ease }
.utm-param-input:focus { border-color: var(--ink) }
.utm-out-box { background: var(--ink); border-radius: var(--r-card); padding: 22px; word-break: break-all; font: 400 14px/24px var(--mono); color: var(--accent) }
.utm-out-empty { color: rgba(255, 255, 255, .35) }
.utm-short-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px }
.utm-short-out { font: 400 14px/1 var(--mono); color: var(--muted) }

/* ---------- Creative uniquifier ---------- */
.uniq-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start }
.uniq-drop {
    border: 1px dashed var(--line); border-radius: var(--r-card); background: var(--card);
    padding: 44px 26px; text-align: center; cursor: pointer;
    transition: border-color .18s ease, background .18s ease;
}
.uniq-drop:hover { border-color: var(--ink); background: var(--light) }
.uniq-drop-ico { width: 46px; height: 46px; margin: 0 auto 16px; border-radius: 14px; background: var(--light); display: flex; align-items: center; justify-content: center; color: var(--muted) }
.uniq-drop-ico svg { width: 20px; height: 20px }
.uniq-drop-title { font-family: var(--display); font-weight: 500; font-size: 17px; color: var(--ink); margin: 0 0 8px }
.uniq-drop-sub { font-size: 14px; line-height: 22px; color: var(--muted); margin: 0 }
.uniq-preview { border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; background: var(--card) }
.uniq-preview img { display: block; width: 100%; height: auto }
.uniq-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line) }
.uniq-file-name { font: 500 14px/1.3 var(--ui); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.uniq-file-meta { font: 500 12px/1 var(--mono); color: var(--muted-dark) }
.uniq-x { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 8px }
.uniq-x:hover { color: var(--ink); background: var(--light) }
.uniq-progress { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 16px }
.uniq-progress-fill { height: 100%; background: var(--accent); transition: width .25s ease }
.uniq-done-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: var(--accent); color: var(--ink); font: 600 12px/1 var(--ui) }
.uniq-limit { display: flex; align-items: baseline; gap: 8px; margin-top: 16px }
.uniq-limit-num { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--ink) }
.uniq-limit-txt { font-size: 13px; color: var(--muted) }
.uniq-disclaimer { margin-top: 18px; font-size: 13px; line-height: 21px; color: var(--muted-dark) }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .calc-grid { grid-template-columns: 1fr }
    .uniq-grid { grid-template-columns: 1fr }
    .faq-container { grid-template-columns: 1fr; gap: 30px }
    .faq-intro { position: static }
}
@media (max-width: 640px) {
    .calc-hero { padding: 30px 0 0 }
    .calc-hero-inner { padding-bottom: 26px }
    .calc-section { padding: 32px 0 46px }
    .calc-panel { padding: 20px }
    .field-grid { grid-template-columns: 1fr }
    .how-section, .prose-section, .faq-section { padding: 46px 0 }
    .prose-wrap { font-size: 16px; line-height: 27px }
}
@media (max-width: 520px) {
    .utm-param { grid-template-columns: 1fr; gap: 6px }
}
