/* Ponto Cruz Fácil: identidade "ateliê" (vinho, sálvia e linha dourada sobre linho) */
:root {
  /* Cores */
  --primary: #8C2F4B;          /* vinho: linha de bordado */
  --primary-hover: #74243D;
  --primary-soft: #F4E4E8;
  --secondary: #4F6B58;        /* sálvia escura */
  --secondary-soft: #E5ECE6;
  --accent: #C79A4A;           /* linha dourada */
  --accent-soft: #F5EBD9;
  --rose: #EBCFCF;
  --bg: #FAF6F1;               /* linho */
  --bg-alt: #F2EAE1;
  --surface: #FFFDFB;
  --text: #2B2226;
  --text-muted: #6B5D63;
  --border: #E6DAD0;
  --aida: #FCFAF5;
  --wood: #D8B88A;
  --wood-dark: #B48B58;

  /* Tipografia */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Figtree', 'Trebuchet MS', sans-serif;
  --fs-hero: clamp(2.35rem, 9vw, 4.25rem);
  --fs-h1: clamp(1.75rem, 5.5vw, 2.4rem);
  --fs-h2: clamp(1.5rem, 4.6vw, 2rem);
  --fs-body: 1.125rem;   /* 18px */
  --fs-small: 1rem;      /* 16px */
  --fs-tiny: .9rem;

  /* Espaços e forma */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --section: clamp(3rem, 8vw, 5rem);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --tap: 56px;
  --shadow: 0 1px 2px rgba(60, 30, 40, .05), 0 8px 24px -12px rgba(60, 30, 40, .22);
  --shadow-lift: 0 2px 4px rgba(60, 30, 40, .06), 0 18px 36px -16px rgba(60, 30, 40, .32);
  --shadow-primary: 0 12px 24px -10px rgba(140, 47, 75, .55);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 150ms; --t: 300ms; --t-slow: 500ms;

  /* Costura (linha tracejada de bordado) */
  --stitch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='4'%3E%3Cline x1='1.5' y1='2' x2='7.5' y2='2' stroke='%238C2F4B' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  --stitch-gold: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='4'%3E%3Cline x1='1.5' y1='2' x2='7.5' y2='2' stroke='%23C79A4A' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  /* Faixa de pontos-cruz */
  --xrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='14'%3E%3Cpath d='M5 3 L13 11 M13 3 L5 11' stroke='%238C2F4B' stroke-width='2.2' stroke-linecap='round' opacity='.55'/%3E%3C/svg%3E");

  --tabbar-h: 74px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  /* Trama de linho bem discreta */
  background-image:
    repeating-linear-gradient(0deg, rgba(120, 90, 70, .028) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(120, 90, 70, .028) 0 1px, transparent 1px 4px);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 var(--space-3); }
p { margin: 0 0 var(--space-3); max-width: 65ch; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg, canvas { display: block; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-small); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ topo */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--space-3) + env(safe-area-inset-top)) var(--space-4) var(--space-3);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
}
.topbar::after { /* costura sob o topo */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: var(--stitch) repeat-x; opacity: .45;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__mark { width: 40px; height: 40px; transition: transform var(--t) var(--ease); }
.brand:hover .brand__mark { transform: rotate(-8deg); }
.brand__name { font-family: var(--font-display); font-size: 1.45rem; line-height: 1; }
.brand__name em { font-style: italic; color: var(--primary); }

/* ------------------------------------------------------------------ navegação inferior */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  box-shadow: 0 -1px 0 var(--border), 0 -10px 30px -20px rgba(60, 30, 40, .35);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; font-size: .92rem; font-weight: 600; color: var(--text-muted);
  min-height: var(--tap); position: relative;
  transition: color var(--t-fast) var(--ease);
}
.tabbar svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--primary); font-weight: 800; }
.tabbar a[aria-current="page"] svg { stroke-width: 2.1; }
.tabbar a[aria-current="page"]::before {
  content: ''; position: absolute; top: 6px; width: 46px; height: 4px; border-radius: 4px;
  background: var(--stitch) repeat-x; background-size: 12px 4px;
}

/* ------------------------------------------------------------------ layout */
main { outline: none; }
.screen { max-width: 780px; margin: 0 auto; padding: var(--space-5) var(--space-4) var(--section); }
.screen--wide { max-width: 1120px; }
.section { margin-top: var(--space-7); }
.section__head { margin-bottom: var(--space-5); }
.section__head h2 { font-size: var(--fs-h2); margin: 0; }
.section__head p { margin: 4px 0 0; color: var(--text-muted); font-size: var(--fs-small); }
.page-title { font-size: var(--fs-h1); margin-bottom: var(--space-2); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .85rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--secondary);
  margin-bottom: var(--space-2);
}
.eyebrow::before {
  content: ''; width: 14px; height: 14px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 2.5 L11.5 11.5 M11.5 2.5 L2.5 11.5' stroke='%238C2F4B' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.x-divider { height: 14px; margin: var(--space-7) auto 0; max-width: 220px; background: var(--xrow) repeat-x center; }

/* ------------------------------------------------------------------ hero (início) */
.hero {
  position: relative; overflow: hidden;
  margin: calc(var(--space-5) * -1) calc(var(--space-4) * -1) 0;
  padding: var(--space-6) var(--space-4) var(--space-7);
  background:
    radial-gradient(90% 70% at 100% 10%, rgba(235, 207, 207, .75), transparent 62%),
    radial-gradient(70% 60% at 0% 100%, rgba(199, 154, 74, .18), transparent 60%),
    linear-gradient(180deg, var(--bg-alt), var(--bg));
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.hero::after { /* ruído de tecido */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero__inner {
  position: relative; z-index: 1; max-width: 1000px; margin: 0 auto;
  display: grid; gap: var(--space-5); align-items: center;
}
@media (min-width: 760px) { .hero__inner { grid-template-columns: 1.3fr 1fr; } }
.hero h1 { font-size: var(--fs-hero); letter-spacing: -0.02em; margin-bottom: var(--space-4); }
.stitched { position: relative; display: inline-block; color: var(--primary); font-style: italic; padding-bottom: .08em; }
.stitched::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -.05em; height: 4px;
  background: var(--stitch) repeat-x; background-size: 12px 4px;
}
.hero__lead { font-size: 1.2rem; color: var(--text-muted); max-width: 32ch; }
.hero .btn-row { margin-top: var(--space-5); }

/* Bastidor (assinatura visual) */
.hoop-wrap { display: flex; justify-content: center; position: relative; }
@media (max-width: 759px) { .hoop-wrap { justify-content: flex-end; margin-top: calc(var(--space-3) * -1); } }
.hoop {
  --size: clamp(190px, 46vw, 300px);
  position: relative; width: var(--size); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  background:
    repeating-linear-gradient(0deg, rgba(120, 90, 70, .09) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(90deg, rgba(120, 90, 70, .09) 0 1px, transparent 1px 7px),
    var(--aida);
  box-shadow:
    inset 0 0 0 9px var(--wood),
    inset 0 0 0 11px var(--wood-dark),
    inset 0 0 0 13px rgba(255, 255, 255, .5),
    inset 0 6px 18px 13px rgba(60, 30, 20, .10),
    0 22px 40px -20px rgba(60, 30, 20, .45);
  transform: rotate(-6deg);
}
.hoop::before { /* parafuso do bastidor */
  content: ''; position: absolute; top: -12px; left: 50%; width: 30px; height: 22px; transform: translateX(-50%);
  border-radius: 5px; background: linear-gradient(180deg, #E4C89E, var(--wood-dark));
  box-shadow: 0 2px 4px rgba(60, 30, 20, .3);
}
.hoop::after { /* linha solta saindo do bastidor */
  content: ''; position: absolute; right: -6px; bottom: 14%; width: 70px; height: 70px;
  border: 2px solid var(--primary); border-color: transparent transparent var(--primary) transparent;
  border-radius: 50%; transform: rotate(-30deg); opacity: .7;
}
.hoop canvas { width: 52% !important; height: auto !important; transform: rotate(6deg); }

/* ------------------------------------------------------------------ botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap); padding: 0 26px; border-radius: 14px; border: 2px solid transparent;
  font-weight: 700; font-size: 1.08rem; text-decoration: none; cursor: pointer;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn--primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.btn--primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 18px 30px -12px rgba(140, 47, 75, .65); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.btn-row .btn { flex: 1 1 220px; }
.icon-btn {
  min-width: var(--tap); height: var(--tap); padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 700; font-size: 1.05rem; text-decoration: none;
  transition: border-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease);
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn--big { font-size: 1.6rem; font-weight: 500; }

/* ------------------------------------------------------------------ cartões com costura */
.stitch-card { position: relative; }
.stitch-card::after {
  content: ''; position: absolute; inset: 7px; border-radius: calc(var(--radius) - 7px); pointer-events: none;
  border: 1.5px dashed rgba(140, 47, 75, .22);
  transition: border-color var(--t) var(--ease);
}

/* ------------------------------------------------------------------ ferramentas */
.tools { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }
@media (min-width: 560px) { .tools { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .tools { grid-template-columns: repeat(3, 1fr); } }
.tool {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 4px var(--space-4); align-items: start;
  padding: var(--space-5) var(--space-5) var(--space-5) var(--space-4);
  background: var(--surface); border-radius: var(--radius); text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.tool:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.tool:hover::after { border-color: rgba(140, 47, 75, .5); }
.tool__icon { grid-row: span 2; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; }
.tool__icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tool h3 { font-size: 1.35rem; margin: 2px 0 0; }
.tool p { font-size: var(--fs-small); color: var(--text-muted); margin: 0; line-height: 1.45; }
.tool--red .tool__icon { background: var(--primary-soft); color: var(--primary); }
.tool--green .tool__icon { background: var(--secondary-soft); color: var(--secondary); }
.tool--gold .tool__icon { background: var(--accent-soft); color: #8A6420; }
.tool--featured { background: var(--primary); color: #fff; }
@media (min-width: 560px) { .tool--featured { grid-column: span 2; } }
.tool--featured p { color: rgba(255, 255, 255, .85); }
.tool--featured::after { border-color: rgba(255, 255, 255, .35); }
.tool--featured:hover::after { border-color: rgba(255, 255, 255, .7); }
.tool--featured .tool__icon { background: rgba(255, 255, 255, .14); color: #fff; }
.tool--soon { pointer-events: none; background: color-mix(in srgb, var(--surface) 60%, var(--bg-alt)); box-shadow: none; }
.tool--soon h3, .tool--soon p, .tool--soon .tool__icon { opacity: .6; }
.badge {
  display: inline-block; margin-left: 8px; vertical-align: middle;
  font-family: var(--font-body); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: #7A561A;
}

/* ------------------------------------------------------------------ continuar bordando / listas */
.resume {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-4) var(--space-5) var(--space-4) var(--space-4);
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.resume:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.resume--floating { margin-top: calc(var(--space-6) * -1); position: relative; z-index: 2; }
.resume__art { width: 84px; height: 84px; flex: none; border-radius: 14px; background: var(--aida); display: grid; place-items: center; padding: 8px; border: 1px solid var(--border); }
.resume__art canvas { max-width: 100%; max-height: 100%; width: auto !important; height: auto !important; }
.resume__body { flex: 1; min-width: 0; }
.resume__title { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume .eyebrow { margin: 0; font-size: .78rem; }

.progress { height: 10px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #A8465F); transition: width var(--t-slow) var(--ease); }

/* ------------------------------------------------------------------ biblioteca */
.library { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
@media (min-width: 760px) { .library { grid-template-columns: repeat(4, 1fr); gap: var(--space-4); } }
.pattern {
  display: flex; flex-direction: column; text-decoration: none; background: var(--surface);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.pattern:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.pattern__art {
  aspect-ratio: 1; display: grid; place-items: center; padding: 18%;
  background:
    radial-gradient(circle, var(--aida) 62%, transparent 63%),
    var(--bg-alt);
}
.pattern__art canvas { max-width: 100%; max-height: 100%; width: auto !important; height: auto !important; }
.pattern__body { padding: 12px 14px 16px; }
.pattern__name { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.2; }
.pattern__meta { font-size: .9rem; color: var(--text-muted); margin-top: 2px; }

/* ------------------------------------------------------------------ formulários */
.card { background: var(--surface); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow); }
@media (max-width: 420px) { .card { padding: var(--space-5) var(--space-4); } }
.field { display: grid; gap: 8px; margin-bottom: var(--space-5); }
.field > span, .label { font-weight: 700; font-size: 1.02rem; }
.input, textarea.input, select.input {
  width: 100%; min-height: var(--tap); padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: #fff; font-size: 1.12rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
textarea.input { resize: vertical; min-height: 96px; font-family: var(--font-display); font-size: 1.55rem; line-height: 1.3; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
@media (max-width: 380px) { .grid-2 { grid-template-columns: 1fr; } }
.hint { font-size: var(--fs-small); color: var(--text-muted); }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 5px; background: var(--bg-alt); border-radius: 16px; }
.segmented button {
  min-height: var(--tap); border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  font-weight: 700; font-size: 1.02rem; display: grid; align-content: center; line-height: 1.15; padding: 6px 6px;
  transition: background-color var(--t-fast), box-shadow var(--t-fast), color var(--t-fast);
}
.segmented button small { font-weight: 500; font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.segmented button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 4px 12px -6px rgba(60, 30, 40, .45); color: var(--primary); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .1); cursor: pointer; position: relative;
  transition: transform var(--t-fast) var(--ease);
}
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5.5px var(--text); }
.swatch-label { font-size: var(--fs-small); color: var(--text-muted); min-height: 1.4em; }

.check { display: flex; align-items: center; gap: 12px; min-height: var(--tap); font-weight: 700; cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--primary); }

/* ------------------------------------------------------------------ gerador: prévia */
.preview {
  position: relative; overflow: auto; text-align: center;
  padding: var(--space-5); min-height: 200px; border-radius: var(--radius-lg);
  background:
    repeating-linear-gradient(0deg, rgba(120, 90, 70, .07) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(90deg, rgba(120, 90, 70, .07) 0 1px, transparent 1px 8px),
    var(--aida);
  box-shadow: inset 0 0 0 1.5px var(--border);
  display: grid; align-items: center;
}
.preview canvas { display: inline-block; margin: 0 auto; }
.preview__empty { color: var(--text-muted); margin: 0 auto; }
.preview-hint { font-size: var(--fs-tiny); color: var(--text-muted); text-align: center; margin: 8px 0 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin-top: var(--space-4); }
.stat { background: var(--surface); border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--shadow); }
.stat b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; line-height: 1.1; }
.stat span { font-size: .85rem; color: var(--text-muted); font-weight: 600; }
.threads { list-style: none; padding: 0; margin: var(--space-3) 0 0; display: grid; gap: 10px; }
.threads li { display: flex; align-items: center; gap: 12px; font-size: 1.02rem; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid rgba(0, 0, 0, .14); flex: none; }
.gen-layout { display: grid; gap: var(--space-5); }
@media (min-width: 900px) { .gen-layout { grid-template-columns: 400px 1fr; align-items: start; } .gen-layout .sticky { position: sticky; top: 90px; } }

/* ------------------------------------------------------------------ modo bordar */
.stitch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.stitch-head h1 { font-size: var(--fs-h1); margin: 0; overflow-wrap: anywhere; }
.stitch-head__actions { display: flex; gap: 8px; flex: none; }
.stitch-progress { margin: var(--space-4) 0; }
.stitch-progress .row { display: flex; justify-content: space-between; font-size: 1rem; font-weight: 700; }
.toolbar { display: grid; gap: var(--space-2); margin-bottom: var(--space-3); }
.toolbar__row { display: flex; align-items: center; gap: var(--space-2); }
.toolbar__row .spacer { flex: 1; }
.zoom { display: inline-flex; align-items: center; gap: 4px; background: var(--bg-alt); border-radius: 16px; padding: 4px; }
.zoom .icon-btn { border: 0; min-width: 48px; height: 48px; background: var(--surface); }
.zoom output { min-width: 56px; text-align: center; font-weight: 700; font-size: .95rem; color: var(--text-muted); }
@media (min-width: 760px) { .toolbar { grid-template-columns: 1fr auto; align-items: center; } }
.board {
  position: relative; overflow: auto; -webkit-overflow-scrolling: touch;
  height: min(60vh, 640px); border-radius: var(--radius); background: var(--aida);
  box-shadow: inset 0 0 0 1.5px var(--border), inset 0 2px 12px rgba(60, 30, 20, .06);
  overscroll-behavior: contain;
}
.board__inner { padding: 24px; width: max-content; min-width: 100%; display: grid; place-items: center; min-height: 100%; }
.board canvas { touch-action: auto; box-shadow: 0 0 0 1px rgba(90, 60, 40, .15); }
.board.is-marking { box-shadow: inset 0 0 0 2.5px var(--primary), inset 0 2px 12px rgba(60, 30, 20, .06); }
.board.is-marking canvas { touch-action: none; cursor: crosshair; }
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; margin-top: var(--space-4); scrollbar-width: thin; }
.chip {
  flex: none; display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 6px 16px 6px 8px;
  border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 700; font-size: 1rem;
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.chip--all { padding-left: 16px; }
.chip .dot { width: 34px; height: 34px; display: grid; place-items: center; font-size: .9rem; }
.chip[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); }
.chip small { color: var(--text-muted); font-weight: 500; font-size: .88rem; }
.empty {
  text-align: center; padding: var(--space-7) var(--space-4); background: var(--surface); border-radius: var(--radius-lg);
}
.empty::after { border-radius: calc(var(--radius-lg) - 7px); }
.list { display: grid; gap: var(--space-3); }

/* ------------------------------------------------------------------ calculadoras */
.calc { margin-bottom: var(--space-5); }
.calc h2 { font-size: 1.5rem; display: flex; align-items: center; gap: 12px; margin-bottom: var(--space-5); }
.calc h2 .num {
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--primary-soft); color: var(--primary); font-family: var(--font-body); font-weight: 800; font-size: 1rem;
}
.result { margin-top: var(--space-2); padding: var(--space-5); border-radius: var(--radius); background: var(--secondary); color: #fff; }
.result b { font-family: var(--font-display); font-weight: 400; font-size: 2rem; display: block; line-height: 1.1; }
.result p { margin: 6px 0 0; color: rgba(255, 255, 255, .86); font-size: 1rem; }

/* ------------------------------------------------------------------ toast e animações */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: #fff; padding: 14px 20px; border-radius: 14px; font-weight: 600; font-size: 1rem;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5); max-width: calc(100% - 32px); text-align: center;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.reveal { opacity: 0; transform: translateY(12px); animation: rise var(--t-slow) var(--ease) forwards; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}
