/* ============================================================
   PhotoRevive AI — common.css
   Warm, clean, nostalgic design system
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #FBF7F0;
  --bg-alt: #F4EDE0;
  --surface: #FFFFFF;
  --ink: #2F2A24;
  --ink-soft: #6E6355;
  --ink-faint: #9A8F80;
  --brand: #9A5B33;
  --brand-deep: #7C4526;
  --brand-soft: #F0E2D3;
  --teal: #2F6B62;
  --teal-deep: #24534C;
  --teal-soft: #E3EFEC;
  --gold: #C9A24B;
  --line: #E8DFCC;
  --danger: #B34A3C;
  --success: #3E7A4E;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 3px rgba(66, 48, 28, .08), 0 1px 2px rgba(66, 48, 28, .05);
  --shadow: 0 4px 16px rgba(66, 48, 28, .10);
  --shadow-lg: 0 14px 40px rgba(66, 48, 28, .16);
  --font-serif: "Playfair Display", "Noto Serif SC", Georgia, "Songti SC", "Times New Roman", serif;
  --font-sans: "Nunito Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --header-h: 64px;
  --container: 1180px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.45rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 720px; margin: 0 auto 34px; text-align: center; }
.section-head h2 { margin-bottom: .35em; }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 2000;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-weight: 700; font-size: 1rem;
  padding: 12px 22px; min-height: 46px; border-radius: 999px;
  border: 2px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none; line-height: 1.2;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-deep); box-shadow: var(--shadow); }
.btn-teal { background: var(--teal); color: #fff; box-shadow: var(--shadow-sm); }
.btn-teal:hover { background: var(--teal-deep); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--brand-deep); border-color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-light { background: #fff; color: var(--brand-deep); box-shadow: var(--shadow); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none !important; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Member (Pro) buttons in tool download bars ---------- */
.dl-sep { flex-basis: 100%; height: 0; }
.member-btn { flex: 1 1 100px; }
.member-btn .pro-chip {
  font-size: .62rem; font-weight: 800; letter-spacing: .08em;
  background: var(--gold); color: #fff; border-radius: 999px; padding: 2px 8px; line-height: 1.4;
}
.btn-outline { background: transparent; color: var(--brand-deep); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand-soft); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251, 247, 240, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 18px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-serif); font-weight: 800; font-size: 1.25rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; border-radius: 8px; }
.brand small { display: block; font-family: var(--font-sans); font-weight: 600; font-size: .66rem; letter-spacing: .08em; color: var(--ink-faint); text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 13px; border-radius: 999px; font-weight: 600; font-size: .95rem; color: var(--ink-soft);
  transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--brand-soft); color: var(--brand-deep); text-decoration: none; }
.nav-links a.active { background: var(--brand-soft); color: var(--brand-deep); }
.nav-links a svg { width: 17px; height: 17px; }
.nav-lang {
  display: inline-flex; align-items: center; gap: 2px; margin-left: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px;
}
.nav-lang button {
  font-family: var(--font-sans); font-size: .82rem; font-weight: 700; cursor: pointer;
  border: 0; background: transparent; color: var(--ink-faint); padding: 6px 11px; border-radius: 999px;
  min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center;
}
.nav-lang button.on { background: var(--teal); color: #fff; }
.nav-burger {
  display: none; margin-left: auto; background: transparent; border: 0; cursor: pointer;
  width: 46px; height: 46px; border-radius: 10px; align-items: center; justify-content: center;
}
.nav-burger svg { width: 24px; height: 24px; }

/* ---------- Hero (home) ---------- */
.hero { padding: 64px 0 56px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--teal-soft); color: var(--teal-deep); font-size: .85rem; font-weight: 700;
  padding: 8px 15px; border-radius: 999px; margin-bottom: 20px;
}
.hero-badge svg { width: 16px; height: 16px; }
.hero h1 { margin-bottom: .3em; }
.hero h1 .accent { color: var(--brand); font-style: italic; }
.hero .lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 540px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 22px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 22px; }
.hero-stat { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .92rem; color: var(--ink-soft); }
.hero-stat svg { width: 18px; height: 18px; color: var(--teal); }

/* ---------- Compare slider ---------- */
.compare { position: relative; user-select: none; touch-action: none; }
.compare-frame {
  position: relative; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lg); aspect-ratio: var(--ar, 4 / 3); max-height: 78vh;
  background: #ddd; width: 100%;
}
.compare-frame > img, .compare-frame > canvas { object-fit: contain; }
.compare-frame > img, .compare-frame > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.compare-after-wrap { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare-after-wrap > img, .compare-after-wrap > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.compare-handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 3px;
  background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15), 0 0 10px rgba(0,0,0,.3);
  transform: translateX(-1.5px); cursor: ew-resize; z-index: 3;
}
.compare-handle::before, .compare-handle::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3);
  transform: translate(-50%, -50%);
}
.compare-handle::before {
  clip-path: polygon(38% 24%, 62% 24%, 62% 40%, 38% 40%, 38% 24%, 38% 60%, 62% 60%, 62% 76%, 38% 76%);
}
.compare-label {
  position: absolute; top: 12px; z-index: 4; font-size: .74rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: #fff;
  background: rgba(30, 25, 18, .62); padding: 5px 11px; border-radius: 999px;
}
.compare-label.before { left: 12px; }
.compare-label.after { right: 12px; }
.compare-tip { text-align: center; font-size: .82rem; color: var(--ink-faint); margin-top: 10px; }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 620px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .card-grid { grid-template-columns: repeat(4, 1fr); } }
.card-grid.g3 { }
@media (min-width: 1080px) { .card-grid.g3 { grid-template-columns: repeat(3, 1fr); } }

.tool-card, .article-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 220px; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); background: var(--surface);
  transition: transform .18s ease, box-shadow .18s ease;
}
.tool-card:hover, .article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.tool-card-img, .article-card-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.tool-card:hover .tool-card-img, .article-card:hover .article-card-img { transform: scale(1.05); }
.tool-card-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(30,22,14,.05) 30%, rgba(30,22,14,.55) 62%, rgba(30,22,14,.78) 100%);
}
.tool-card-body, .article-card-body { position: relative; z-index: 1; padding: 18px; color: #fff; }
.tool-card-tag {
  display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: #F7E8D8; background: rgba(60, 40, 20, .45); border: 1px solid rgba(255,255,255,.35);
  padding: 3px 10px; border-radius: 999px; margin-bottom: 9px;
}
.tool-card-title, .article-card-title { font-family: var(--font-serif); font-size: 1.22rem; margin: 0 0 5px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.35); }
.tool-card-desc, .article-card-desc { font-size: .88rem; line-height: 1.55; margin: 0; color: rgba(255,255,255,.92); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-card-meta { font-size: .78rem; color: rgba(255,255,255,.8); margin-top: 7px; display: flex; gap: 10px; }

.cta-card {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 12px;
  min-height: 220px; padding: 26px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%);
  color: #fff; box-shadow: var(--shadow-sm);
}
.cta-card h3 { color: #fff; font-size: 1.3rem; margin: 0; }
.cta-card p { color: rgba(255,255,255,.88); margin: 0; font-size: .92rem; }
.cta-card .btn { background: #fff; color: var(--teal-deep); }
.cta-card .btn:hover { background: var(--teal-soft); }

/* ---------- Tool workspace ---------- */
.tool-hero { padding: 48px 0 26px; text-align: center; }
.tool-hero h1 { margin-bottom: .2em; }
.tool-hero .lead { max-width: 660px; margin: 0 auto 8px; color: var(--ink-soft); }
.tool-hero .privacy-note {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 12px;
  font-size: .85rem; font-weight: 700; color: var(--teal-deep); background: var(--teal-soft);
  padding: 7px 15px; border-radius: 999px;
}
.tool-hero .privacy-note svg { width: 16px; height: 16px; }

.dropzone {
  max-width: 660px; margin: 26px auto 0; padding: 40px 24px;
  border: 2px dashed var(--brand); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; transition: background .15s, border-color .15s;
}
.dropzone:hover, .dropzone.drag { background: var(--brand-soft); border-color: var(--brand-deep); }
.dropzone .dz-icon { width: 46px; height: 46px; margin: 0 auto 12px; color: var(--brand); }
.dropzone p { margin: 0; font-weight: 700; }
.dropzone .dz-sub { font-weight: 400; font-size: .85rem; color: var(--ink-soft); margin-top: 4px; }
.dropzone .dz-formats { font-size: .78rem; color: var(--ink-faint); margin-top: 10px; }
.dz-actions { display: flex; justify-content: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.tool-workspace { padding: 30px 0 40px; }
.workspace-grid { display: grid; grid-template-columns: 1fr; gap: 26px; }
@media (min-width: 980px) { .workspace-grid { grid-template-columns: 1.15fr .85fr; align-items: start; } }
.workspace-main { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.workspace-side { display: flex; flex-direction: column; gap: 18px; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm);
}
.panel h3 { font-size: 1.02rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.panel h3 svg { width: 19px; height: 19px; color: var(--brand); }

.param { margin-bottom: 15px; }
.param:last-child { margin-bottom: 0; }
.param-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.param-row label { font-size: .92rem; font-weight: 700; }
.param-row output { font-size: .85rem; color: var(--brand-deep); font-weight: 700; font-variant-numeric: tabular-nums; }
.param input[type="range"] {
  width: 100%; height: 30px; margin: 0; cursor: pointer; accent-color: var(--brand);
  background: transparent; appearance: auto;
}

.auto-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.download-bar { display: flex; flex-wrap: wrap; gap: 10px; }
.download-bar .btn { flex: 1 1 100px; }
.progress-wrap { display: none; margin-top: 14px; }
.progress-wrap.show { display: block; }
.progress-track { height: 8px; border-radius: 99px; background: var(--bg-alt); overflow: hidden; }
.progress-fill { height: 100%; width: 0%; border-radius: 99px; background: var(--brand); transition: width .2s ease; }
.progress-label { font-size: .82rem; color: var(--ink-soft); margin-top: 6px; }
.result-meta { font-size: .82rem; color: var(--ink-faint); margin-top: 12px; display: flex; flex-wrap: wrap; gap: 14px; }

.file-chip {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 15px; font-size: .85rem; font-weight: 600; color: var(--ink-soft); max-width: 100%;
}
.file-chip svg { width: 15px; height: 15px; color: var(--brand); flex: none; }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Text blocks (tool principles / how-to) ---------- */
.text-block { max-width: 780px; margin: 0 auto; }
.text-block p, .text-block li { color: var(--ink-soft); }
.text-block h2 { margin-top: 1.6em; }
.pros-grid { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 18px; }
@media (min-width: 760px) { .pros-grid { grid-template-columns: repeat(2, 1fr); } }
.pro-item { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius-sm); padding: 16px 18px; }
.pro-item h3 { font-size: 1.02rem; margin-bottom: 6px; }
.pro-item p { font-size: .92rem; margin: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 18px 0 0; }
.steps li {
  counter-increment: step; position: relative; padding: 0 0 20px 52px; color: var(--ink-soft);
}
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 36px; height: 36px; border-radius: 50%; background: var(--teal); color: #fff;
  font-weight: 800; font-size: 1rem; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
}
.steps li::after { content: ""; position: absolute; left: 17px; top: 38px; bottom: 0; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li strong { color: var(--ink); display: block; margin-bottom: 2px; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-bottom: 12px; overflow: hidden;
}
.faq-item summary {
  cursor: pointer; list-style: none; padding: 16px 46px 16px 18px; position: relative;
  font-weight: 700; font-size: .98rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 11px; height: 11px;
  border-right: 2.5px solid var(--brand); border-bottom: 2.5px solid var(--brand);
  transform: translateY(-70%) rotate(45deg); transition: transform .2s ease;
}
.faq-item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-item .faq-body { padding: 0 18px 18px; color: var(--ink-soft); font-size: .95rem; }

/* ---------- Article page ---------- */
.article-hero { padding: 44px 0 20px; }
.article-hero .crumb { font-size: .84rem; color: var(--ink-faint); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.article-hero .crumb a { color: var(--ink-soft); }
.article-hero h1 { max-width: 860px; }
.article-hero .meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--ink-faint); font-size: .88rem; margin-top: 10px; }
.article-cover { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin: 24px 0 8px; }
.article-cover img { width: 100%; height: auto; max-height: 480px; object-fit: cover; }
.article-body { max-width: 780px; margin: 0 auto; padding: 26px 0 10px; }
.article-body h2 { margin-top: 1.7em; padding-top: .3em; border-top: 2px solid var(--line); }
.article-body h3 { margin-top: 1.4em; }
.article-body p, .article-body li { color: var(--ink-soft); }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body img { border-radius: var(--radius-sm); margin: 18px 0; box-shadow: var(--shadow-sm); }
.article-body blockquote {
  margin: 20px 0; padding: 14px 20px; background: var(--bg-alt);
  border-left: 4px solid var(--gold); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
}
.article-body table { width: 100%; border-collapse: collapse; margin: 20px 0; table-layout: fixed; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; font-size: .9rem; }
.article-body th { background: var(--bg-alt); font-weight: 700; }
.article-body code { background: var(--bg-alt); border-radius: 5px; padding: 2px 7px; font-size: .88em; }
.article-toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 22px; margin: 22px 0; }
.article-toc strong { display: block; margin-bottom: 8px; }
.article-toc a { display: block; padding: 3px 0; font-size: .92rem; color: var(--ink-soft); }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0; }
.article-tags span { background: var(--teal-soft); color: var(--teal-deep); font-size: .8rem; font-weight: 700; padding: 5px 13px; border-radius: 999px; }
.article-cta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; text-align: center; margin: 34px 0; box-shadow: var(--shadow-sm); }
.article-cta h3 { margin-bottom: 6px; }
.article-cta p { color: var(--ink-soft); max-width: 560px; margin: 0 auto 18px; }

/* ---------- Info pages (about / privacy / contact) ---------- */
.info-hero { padding: 52px 0 24px; text-align: center; }
.info-hero h1 { margin-bottom: .25em; }
.info-hero p { color: var(--ink-soft); max-width: 640px; margin: 0 auto; }
.info-body { max-width: 800px; margin: 0 auto; padding: 20px 0 30px; }
.info-body h2 { margin-top: 1.8em; border-top: 2px solid var(--line); padding-top: .4em; }
.info-body p, .info-body li { color: var(--ink-soft); }
.info-body ul { padding-left: 1.3em; }
.contact-ways { display: grid; grid-template-columns: 1fr; gap: 18px; margin: 24px 0; }
@media (min-width: 700px) { .contact-ways { grid-template-columns: repeat(2, 1fr); } }
.contact-way { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 22px; text-align: center; box-shadow: var(--shadow-sm); }
.contact-way svg { width: 30px; height: 30px; color: var(--brand); margin: 0 auto 10px; }
.contact-way h3 { margin-bottom: 6px; }
.contact-way p { font-size: .9rem; margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: #2E2A24; color: #D9CFC0; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 30px; padding: 48px 0 30px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-brand .brand { color: #fff; margin-bottom: 12px; }
.footer-brand p { font-size: .9rem; color: #B7AA99; max-width: 320px; }
.footer-col h4 { font-family: var(--font-sans); font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: #F1E8DA; margin-bottom: 14px; }
.footer-col a { display: block; padding: 4px 0; color: #B7AA99; font-size: .92rem; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-pro { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 18px; font-size: .85rem; color: #D9CFC0; display: block; text-decoration: none; }
.footer-pro:hover { color: #fff; border-color: rgba(255,255,255,.28); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0 26px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; font-size: .85rem; color: #9C8F7E; }
.footer-bottom .legal a { color: #B7AA99; margin-left: 14px; }

/* ---------- Floating buttons ---------- */
.float-stack { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.float-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--surface); color: var(--brand-deep); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; transition: transform .15s, background .15s;
}
.float-btn:hover { transform: translateY(-2px); background: var(--brand-soft); }
.float-btn svg { width: 21px; height: 21px; }
.float-btn.on { background: var(--brand); color: #fff; }
.float-btn.to-top { opacity: 0; pointer-events: none; }
.float-btn.to-top.show { opacity: 1; pointer-events: auto; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: #2E2A24; color: #fff; padding: 12px 22px; border-radius: 999px;
  font-size: .9rem; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 300;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: 88vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Pro / membership page ---------- */
.pro-status {
  margin-top: 18px; padding: 14px 18px; border: 1px solid var(--line);
  border-left: 4px solid var(--gold); border-radius: var(--radius-sm);
  background: #fff; max-width: 720px;
}
.pro-status p { margin: 2px 0; }
.pro-note { font-size: .85rem; color: var(--ink-faint); max-width: 760px; margin: 12px 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.table-wrap { overflow-x: auto; margin-top: 22px; }
.cmp-table { width: 100%; table-layout: fixed; border-collapse: collapse; background: #fff; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
.cmp-table th, .cmp-table td { padding: 13px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); font-size: .95rem; }
.cmp-table thead th { background: var(--brand-soft); color: var(--brand-deep); }
.cmp-table tbody tr:nth-child(even) { background: #FDFAF4; }
.cmp-table tbody tr:last-child td { border-bottom: 0; }
.cmp-table td:first-child { font-weight: 600; color: var(--ink); }

/* ---------- Gallery (local album) ---------- */
.gallery-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.gallery-meta { font-size: .9rem; color: var(--ink-faint); }
.gallery-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 28px;
}
.gallery-item {
  margin: 0; background: #fff; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
}
.gallery-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; cursor: zoom-in; display: block; }
.gallery-item figcaption { padding: 10px 12px 14px; }
.gallery-name { font-weight: 700; font-size: .92rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-date { font-size: .8rem; color: var(--ink-faint); margin: 2px 0 10px; }
.gallery-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-acts .btn { min-height: 40px; padding: 8px 14px; font-size: .85rem; }
.gallery-empty { text-align: center; padding: 70px 20px; color: var(--ink-faint); }
.gallery-empty svg { width: 56px; height: 56px; margin-bottom: 14px; }
.gallery-empty p { max-width: 460px; margin: 0 auto 20px; }
.gallery-modal {
  position: fixed; inset: 0; background: rgba(30, 26, 20, .72); z-index: 400;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.gallery-modal[hidden] { display: none; }
.gallery-modal-box { background: #fff; border-radius: var(--radius); max-width: 92vw; max-height: 92vh; overflow: auto; padding: 18px; }
.gallery-modal-box img { max-width: 84vw; max-height: 66vh; display: block; border-radius: var(--radius-sm); }
.gallery-modal-meta { margin: 12px 0; font-size: .9rem; color: var(--ink-faint); }
.gallery-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 979px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 619px) {
  .gallery-grid { grid-template-columns: repeat(1, 1fr); }
  .cmp-table { font-size: .85rem; }
}

/* ---------- Misc ---------- */
.breadcrumb { font-size: .85rem; color: var(--ink-faint); padding: 22px 0 0; }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb .sep { margin: 0 7px; color: var(--ink-faint); }
.not-found { text-align: center; padding: 90px 0 70px; }
.not-found h1 { font-size: clamp(3rem, 9vw, 5.5rem); color: var(--brand); }
.saved-empty { text-align: center; padding: 50px 0; color: var(--ink-soft); }
.saved-empty svg { width: 54px; height: 54px; color: var(--ink-faint); margin: 0 auto 14px; }
.saved-list { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .saved-list { grid-template-columns: repeat(2, 1fr); } }
.saved-item { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; box-shadow: var(--shadow-sm); }
.saved-item .thumb { width: 58px; height: 58px; border-radius: 8px; object-fit: cover; flex: none; background: var(--bg-alt); }
.saved-item h3 { font-size: 1rem; margin: 0 0 2px; }
.saved-item small { color: var(--ink-faint); }
.saved-item .actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------- Pro restorer: prescriptions, diagnosis, groups ---------- */
.preset-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 14px;
}
.preset-btn {
  padding: 8px 15px;
  border-radius: 999px;
  font-size: .86rem;
  font-weight: 700;
  border: 1.5px solid var(--brand);
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.preset-btn:active { transform: scale(.97); }
.preset-primary {
  background: var(--teal); color: #fff; border-color: var(--teal);
}
.preset-primary:hover { background: var(--teal-deep); border-color: var(--teal-deep); }
.preset-btn.preset-active {
  background: var(--brand); color: #fff; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.preset-primary.preset-active {
  background: var(--teal-deep); border-color: var(--teal-deep);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.diagnosis {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  margin-bottom: 14px;
}
.diagnosis[hidden] { display: none; }
.diagnosis-title {
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-right: 3px;
}
.diag-chip {
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  border: 1px solid rgba(154, 91, 51, .25);
}
.diag-chip.diag-good {
  background: var(--teal-soft);
  color: var(--teal-deep);
  border-color: rgba(47, 107, 98, .28);
}

.param-group-title {
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin: 16px 0 9px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.param-group-title:first-child { margin-top: 2px; }
.param-group .param:last-child { margin-bottom: 0; }

@media (max-width: 619px) {
  .preset-btn { padding: 7px 12px; font-size: .82rem; }
}
.saved-item .actions a, .saved-item .actions button {
  border: 0; background: var(--bg-alt); border-radius: 8px; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-soft);
}
.saved-item .actions a:hover, .saved-item .actions button:hover { background: var(--brand-soft); color: var(--brand-deep); }
.saved-item .actions svg { width: 18px; height: 18px; }

.adsense-slot { display: none; } /* AdSense code goes here after approval — see README */

/* ---------- Responsive ---------- */
@media (max-width: 979px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero { padding: 44px 0 40px; }
  .nav-links {
    position: fixed; top: var(--header-h); right: 0; bottom: 0; width: min(320px, 86vw);
    background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
    flex-direction: column; align-items: stretch; gap: 4px; padding: 18px;
    transform: translateX(105%); transition: transform .25s ease; margin-left: 0; overflow-y: auto;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { padding: 13px 16px; font-size: 1rem; }
  .nav-lang { margin: 8px 0 0; justify-content: center; }
  .nav-burger { display: inline-flex; }
}
@media (max-width: 619px) {
  .section { padding: 42px 0; }
  .tool-card, .article-card, .cta-card { min-height: 200px; }
  .float-stack { right: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
