/* ══════════════════════════════════════════════════════════════
   Ferramentas Clube Ceramista — Protótipo Fase 2.1
   Visual premium: creme, terracota, areia, argila
   ══════════════════════════════════════════════════════════════ */

:root {
  --bg: #f3ebe0;
  --bg-warm: #ebe0d0;
  --paper: #fdfaf4;
  --cream: #fbf6ef;
  --sand: #e8dcc8;
  --ink: #2b241d;
  --ink-soft: #4a3f35;
  --muted: #7a6d60;
  --line: #e0d2c0;
  --line-strong: #d4c4ae;
  --soft: #f0e6d6;
  --clay: #8d5232;
  --clay-deep: #6b3d24;
  --clay-soft: #c4926e;
  --accent: #d85a30;
  --accent-hover: #c04a22;
  --accent-deep: #a63d18;
  --accent-soft: #fbe7dd;
  --accent-glow: rgba(216, 90, 48, 0.14);
  --ok: #4d6b4c;
  --ok-soft: #e8f0e7;
  --warn-soft: #faf0e4;
  --radius: 22px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Segoe UI", Arial, sans-serif;
  --shadow-sm: 0 1px 2px rgba(55, 42, 31, 0.04), 0 3px 10px rgba(55, 42, 31, 0.06);
  --shadow-md: 0 6px 18px rgba(55, 42, 31, 0.08), 0 18px 44px rgba(55, 42, 31, 0.1);
  --shadow-lg: 0 12px 32px rgba(55, 42, 31, 0.12), 0 32px 72px rgba(55, 42, 31, 0.1);
  --shadow-card: 0 2px 0 rgba(255, 255, 255, 0.65) inset, var(--shadow-md);
  --speckle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cg fill='%23b45f3c' fill-opacity='0.045'%3E%3Ccircle cx='18' cy='26' r='1.3'/%3E%3Ccircle cx='64' cy='11' r='1'/%3E%3Ccircle cx='112' cy='34' r='1.5'/%3E%3Ccircle cx='143' cy='71' r='1.1'/%3E%3Ccircle cx='36' cy='88' r='1.4'/%3E%3Ccircle cx='87' cy='63' r='1'/%3E%3Ccircle cx='129' cy='118' r='1.3'/%3E%3Ccircle cx='53' cy='137' r='1.2'/%3E%3Ccircle cx='9' cy='112' r='1'/%3E%3Ccircle cx='98' cy='148' r='1.4'/%3E%3Ccircle cx='160' cy='22' r='1.1'/%3E%3Ccircle cx='22' cy='160' r='1.2'/%3E%3C/g%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    var(--grain),
    var(--speckle),
    radial-gradient(1200px 520px at 72% -8%, rgba(216, 90, 48, 0.11), transparent 58%),
    radial-gradient(900px 480px at -8% 100%, rgba(141, 82, 50, 0.08), transparent 52%),
    linear-gradient(175deg, #faf4ea 0%, var(--bg) 380px, var(--bg-warm) 100%);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.15;
}

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.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;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.container--narrow {
  width: min(780px, calc(100% - 40px));
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px) saturate(1.2);
  background: rgba(253, 250, 244, 0.92);
  border-bottom: 1px solid rgba(224, 210, 192, 0.95);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  transition: opacity 0.2s var(--ease);
}

.brand:hover { opacity: 0.88; }

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(155deg, #fff 0%, var(--accent-soft) 100%);
  border: 1px solid var(--line);
  color: var(--accent-deep);
  box-shadow: var(--shadow-sm);
}

.brand-mark svg { display: block; }

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.08rem;
}

.brand-text small {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}

/* ── Main & Views ── */

.main {
  flex: 1;
  padding: 40px 0 64px;
}

.view {
  display: none;
  animation: fadeIn 0.4s var(--ease);
}

.view--active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Hero home ── */

.hero--home {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: center;
  margin-bottom: 52px;
  padding: 36px 40px;
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0%, rgba(251, 246, 239, 0.5) 100%),
    var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.hero--home::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(480px 280px at 100% 0%, var(--accent-glow), transparent 70%);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; }

.eyebrow,
.page-label,
.section-label {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero--home h1 {
  margin: 0 0 14px;
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  color: var(--ink);
}

.hero-lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 52ch;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 500;
}

.hero-visual {
  position: relative;
  height: 220px;
  display: grid;
  place-items: center;
}

.hero-ring {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 2px solid rgba(216, 90, 48, 0.18);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.9), rgba(251, 231, 221, 0.4));
  box-shadow: var(--shadow-md);
}

.hero-bowl {
  position: absolute;
  width: 100px;
  height: 56px;
  border-radius: 0 0 50px 50px;
  background: linear-gradient(180deg, var(--clay-soft) 0%, var(--clay) 100%);
  box-shadow: 0 8px 24px rgba(107, 61, 36, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.25);
}

.hero-bowl::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 8px;
  right: 8px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(180deg, #d4a574, var(--clay-soft));
}

/* ── Page head (inner pages) ── */

.page-head {
  margin-bottom: 32px;
}

.page-head--center {
  text-align: center;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.page-head h1 {
  margin: 0 0 10px;
  font-size: clamp(1.85rem, 3.5vw, 2.45rem);
}

.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

/* ── Tool sections (home) ── */

.tool-section {
  margin-bottom: 44px;
}

.section-head {
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 58ch;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tool-grid--pair { gap: 18px; }

/* ── Tool cards ── */

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  padding: 28px 28px 24px;
  border-radius: var(--radius);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.85) 0%, rgba(253, 250, 244, 0.95) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s var(--ease);
  position: relative;
  overflow: hidden;
}

.tool-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 60%, rgba(216, 90, 48, 0.04) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s var(--ease);
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(216, 90, 48, 0.32);
  box-shadow: var(--shadow-md);
}

.tool-card:hover::after { opacity: 1; }

.tool-card--featured {
  min-height: auto;
  padding: 32px 36px;
  background:
    linear-gradient(135deg, rgba(251, 231, 221, 0.55) 0%, rgba(253, 250, 244, 0.98) 45%, rgba(240, 230, 214, 0.6) 100%);
  border-color: rgba(216, 90, 48, 0.28);
  box-shadow: var(--shadow-card);
}

.tool-card--featured:hover {
  border-color: rgba(216, 90, 48, 0.45);
  box-shadow: var(--shadow-lg);
}

.tool-card--wide {
  min-height: auto;
}

.tool-card--library {
  background:
    linear-gradient(135deg, rgba(232, 240, 231, 0.35) 0%, rgba(253, 250, 244, 0.98) 50%);
}

.tool-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tool-badge {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(216, 90, 48, 0.12);
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tool-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--clay);
  flex-shrink: 0;
}

.tool-icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

.tool-icon--featured {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--accent-soft), #fff);
  color: var(--accent-deep);
  border-color: rgba(216, 90, 48, 0.2);
}

.tool-card h3 {
  margin: 0;
  font-size: 1.38rem;
  position: relative;
  z-index: 1;
}

.tool-card p {
  margin: 0;
  flex: 1;
  color: var(--muted);
  font-size: 0.96rem;
  position: relative;
  z-index: 1;
}

.tool-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
  margin-top: 4px;
}

/* ── Badges ── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge--beta {
  background: var(--warn-soft);
  color: var(--clay-deep);
  border: 1px solid var(--line-strong);
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(180deg, #e0683a 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(216, 90, 48, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
  box-shadow: 0 6px 20px rgba(216, 90, 48, 0.38);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.6);
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--soft);
  border-color: var(--clay-soft);
}

.btn-chip {
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.btn-chip:hover {
  background: var(--accent-soft);
  border-color: rgba(216, 90, 48, 0.35);
  color: var(--accent-deep);
}

.btn-block { width: 100%; }

.btn-lg {
  padding: 16px 24px;
  font-size: 1rem;
}

/* ── Guide steps (diagnóstico) ── */

.guide-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.guide-step {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.guide-step.is-active {
  background: var(--accent-soft);
  border-color: rgba(216, 90, 48, 0.3);
  color: var(--accent-deep);
}

/* ── Forms ── */

.form-panel,
.chat-panel,
.result-panel {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.form-panel--guided {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, var(--paper) 120px);
}

.form-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--line);
}

.form-section:last-of-type {
  margin-bottom: 24px;
  padding-bottom: 0;
  border-bottom: none;
}

.form-section-title {
  margin: 0 0 16px;
  font-size: 1.05rem;
  color: var(--clay);
  font-family: var(--font-display);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field--full { grid-column: 1 / -1; }

.field label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--clay-deep);
  letter-spacing: 0.01em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(216, 90, 48, 0.55);
  box-shadow: 0 0 0 4px rgba(216, 90, 48, 0.1);
}

.field textarea { resize: vertical; min-height: 110px; }

/* ── Results — dashboard ── */

.result-panel {
  margin-top: 28px;
}

.result-panel--dashboard,
.result-panel--laudo {
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.7) 0%, var(--paper) 100%);
  box-shadow: var(--shadow-md);
}

.result-panel h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
}

.result-panel-subtitle {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.94rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.result-grid--hero {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.result-card {
  padding: 18px 16px;
  border-radius: var(--radius-sm);
  background: var(--soft);
  border: 1px solid var(--line);
  transition: transform 0.2s var(--ease);
}

.result-card strong {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 700;
}

.result-card span {
  font-family: var(--font-display);
  font-size: 1.42rem;
  color: var(--clay-deep);
  line-height: 1.1;
}

.result-card--highlight {
  background: var(--accent-soft);
  border-color: rgba(216, 90, 48, 0.28);
  box-shadow: 0 4px 16px rgba(216, 90, 48, 0.12);
}

.result-card--highlight span { color: var(--accent-deep); }

.result-card--premium {
  background: linear-gradient(145deg, #faf0e4, var(--soft));
  border-color: var(--line-strong);
}

.result-card--premium span {
  color: var(--ink);
  font-size: 1.5rem;
}

.result-formula {
  margin: 0 0 18px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  font-family: ui-monospace, "Cascadia Code", monospace;
}

/* ── Laudo (diagnóstico) ── */

.laudo-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.laudo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.laudo-tag {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.laudo-tag--accent {
  background: var(--accent-soft);
  border-color: rgba(216, 90, 48, 0.25);
  color: var(--accent-deep);
}

.laudo-context {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.94rem;
}

.laudo-hint {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  border-left: 4px solid var(--clay-soft);
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.result-section {
  margin-top: 20px;
  padding: 18px;
  border-radius: var(--radius-sm);
  background: rgba(240, 230, 214, 0.35);
  border: 1px solid var(--line);
}

.result-section h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--clay-deep);
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-section h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.result-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink);
  font-size: 0.94rem;
}

.result-list li + li { margin-top: 7px; }

.result-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 0.92rem;
  line-height: 1.5;
}

.result-note--info {
  background: var(--warn-soft);
  color: var(--clay-deep);
  border: 1px solid var(--line);
}

/* ── Chat premium ── */

.chat-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 560px;
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
}

.chat-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--accent-deep);
  flex-shrink: 0;
}

.chat-avatar svg {
  width: 22px;
  height: 22px;
}

.chat-header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-header-text strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.chat-header-text span {
  color: var(--muted);
  font-size: 0.82rem;
}

.chat-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 380px;
  overflow-y: auto;
  padding: 24px;
  background:
    var(--grain),
    linear-gradient(180deg, var(--cream) 0%, var(--paper) 100%);
}

.msg {
  max-width: 86%;
  padding: 15px 18px;
  border-radius: 20px;
  line-height: 1.55;
  font-size: 0.95rem;
}

.msg--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.msg--bot.msg--welcome {
  max-width: 94%;
  padding: 20px 22px;
  background: linear-gradient(135deg, #fff 0%, var(--accent-soft) 120%);
  border-color: rgba(216, 90, 48, 0.22);
  font-size: 1rem;
  box-shadow: 0 4px 18px rgba(216, 90, 48, 0.08);
}

.msg--user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 14px rgba(216, 90, 48, 0.25);
}

.quick-actions-label {
  padding: 14px 24px 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 24px 16px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.chat-input {
  display: flex;
  gap: 10px;
  padding: 18px 24px 22px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.chat-input input {
  flex: 1;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  min-width: 0;
}

.chat-input input:focus {
  outline: none;
  border-color: rgba(216, 90, 48, 0.55);
  box-shadow: 0 0 0 4px rgba(216, 90, 48, 0.1);
}

/* ── Library ── */

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.library-card {
  padding: 0;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
  overflow: hidden;
}

.library-card:hover {
  border-color: rgba(216, 90, 48, 0.32);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.library-card.is-open {
  border-color: rgba(216, 90, 48, 0.42);
  box-shadow: var(--shadow-md);
}

.library-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 22px 18px;
}

.library-card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--clay);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  flex-shrink: 0;
}

.library-card-body { flex: 1; min-width: 0; }

.library-card h3 {
  margin: 0 0 6px;
  font-size: 1.12rem;
}

.library-card-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.library-card-tag {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.library-card .library-detail {
  margin: 0;
  padding: 16px 22px 22px;
  border-top: 1px dashed var(--line);
  background: rgba(240, 230, 214, 0.25);
  color: var(--ink-soft);
  font-size: 0.93rem;
  line-height: 1.55;
  display: none;
}

.library-card.is-open .library-detail { display: block; }

/* ── Footer ── */

.site-footer {
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  background: rgba(253, 250, 244, 0.85);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  justify-content: space-between;
  align-items: flex-end;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-note { opacity: 0.85; }

.install-hint {
  margin: 0;
  max-width: 320px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid rgba(216, 90, 48, 0.2);
  color: var(--accent-deep);
  font-size: 0.82rem;
  line-height: 1.45;
}

/* ── Responsive ── */

@media (max-width: 820px) {
  .tool-grid,
  .tool-grid--pair { grid-template-columns: 1fr; }

  .form-grid { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }

  .chat-input { flex-direction: column; }
  .chat-input .btn { width: 100%; }

  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .container,
  .container--narrow {
    width: calc(100% - 28px);
  }

  .tool-card,
  .tool-card--featured {
    padding: 22px 20px;
  }

  .form-panel,
  .result-panel {
    padding: 20px 18px;
  }

  .chat-header,
  .chat-messages,
  .quick-actions,
  .chat-input {
    padding-left: 16px;
    padding-right: 16px;
  }

  .result-grid { grid-template-columns: 1fr; }

  .library-grid { grid-template-columns: 1fr; }

  .footer-inner { align-items: stretch; }

  .install-hint { max-width: none; width: 100%; }

  .btn-chip {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    text-align: center;
  }
}

.tool-card--atelie {
  background:
    linear-gradient(135deg, rgba(232, 240, 231, 0.45) 0%, rgba(253, 250, 244, 0.98) 50%, rgba(251, 231, 221, 0.35) 100%);
}

/* ── Mobile home: app-like, compact (somente < 768px) ── */

@media (max-width: 767px) {
  .container,
  .container--narrow {
    width: calc(100% - 24px);
  }

  .site-header .header-inner {
    padding: 10px 0;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-text strong {
    font-size: 0.95rem;
  }

  .brand-text small {
    font-size: 0.7rem;
  }

  .main {
    padding: 10px 0 36px;
  }

  #view-home .hero--home {
    display: grid;
    grid-template-columns: 1fr 96px;
    gap: 8px 12px;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
  }

  #view-home .hero--home::before {
    background: radial-gradient(180px 120px at 100% 0%, var(--accent-glow), transparent 72%);
  }

  #view-home .hero-inner {
    min-width: 0;
  }

  #view-home .hero--home .eyebrow {
    margin-bottom: 5px;
    padding: 3px 9px;
    font-size: 0.6rem;
    letter-spacing: 0.06em;
  }

  #view-home .hero--home h1 {
    margin-bottom: 5px;
    font-size: 1.32rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #view-home .hero-lead {
    margin-bottom: 8px;
    font-size: 0.8rem;
    line-height: 1.38;
    max-width: none;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #view-home .hero-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -2px;
    padding-bottom: 1px;
  }

  #view-home .hero-tags::-webkit-scrollbar {
    display: none;
  }

  #view-home .hero-tags .tag {
    flex: 0 0 auto;
    padding: 4px 8px;
    font-size: 0.66rem;
    font-weight: 600;
    white-space: nowrap;
  }

  #view-home .hero-visual {
    height: 96px;
    width: 96px;
    order: unset;
    align-self: center;
  }

  #view-home .hero-ring {
    width: 96px;
    height: 96px;
    border-width: 1.5px;
    box-shadow: var(--shadow-sm);
  }

  #view-home .hero-bowl {
    width: 50px;
    height: 28px;
    box-shadow: 0 3px 10px rgba(107, 61, 36, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }

  #view-home .hero-bowl::before {
    top: -5px;
    height: 8px;
  }

  #view-home .tool-section {
    margin-bottom: 26px;
  }

  #view-home .tool-section:first-of-type {
    margin-top: 0;
  }

  #view-home .tool-section:first-of-type .section-head {
    margin-bottom: 8px;
  }

  #view-home .tool-section:first-of-type .section-head .section-label {
    margin-bottom: 4px;
    padding: 3px 9px;
    font-size: 0.6rem;
  }

  #view-home .tool-section:first-of-type .section-head h2 {
    margin-bottom: 0;
    font-size: 1.12rem;
  }

  #view-home .tool-section:first-of-type .section-head p {
    display: none;
  }

  #view-home .tool-card--atelie {
    padding: 14px 14px;
  }

  #view-home .tool-card--atelie .tool-card-top {
    margin-bottom: 8px;
  }

  #view-home .tool-card--atelie h3 {
    font-size: 1.02rem;
    margin-bottom: 4px;
  }

  #view-home .tool-card--atelie p {
    margin-bottom: 10px;
    font-size: 0.84rem;
    line-height: 1.42;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #view-home .tool-card--atelie .tool-cta {
    font-size: 0.82rem;
  }
}

body.mode-atelie .main {
  padding: 0;
}
