/* "Get AI estimation" popup on the AI result screens (src/lib/aiestimate.jsx), 2026-11-04.
   The look of the catalogue's AI estimate (home.css: dialog.est, .phone-card), scoped to dialog.ai-est only. */
dialog.ai-est { width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--line, #e1e5cf);
  border-radius: 22px; background: var(--th-paper, #fff); color: var(--ink, #292524); box-shadow: 0 30px 80px -30px rgba(32, 53, 18, .45); overflow-y: auto; }
dialog.ai-est::backdrop { background: rgba(32, 38, 26, .4); }
.ai-est-card { position: relative; padding: 26px 24px 22px; display: grid; gap: 12px; font-size: 14px; }
.ai-est-card h3 { font-size: 10.5px; text-transform: uppercase; letter-spacing: .24em; color: var(--tone2, #61953f); margin: 0; font-weight: 700; padding-right: 40px; }
.ai-est-card h2 { font: 400 24px/1.15 var(--serif, Georgia, serif); margin: 0; padding-right: 40px; }
.ai-est-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  border: 0; background: var(--th-paper, #fff); color: var(--accent-ink, #385e1f); cursor: pointer; }
.ai-est .muted { color: var(--muted, #78716c); font-size: 13.5px; line-height: 1.5; }
.ai-est .bad { color: var(--danger, #b42318); font-size: 13.5px; }
.ai-est-pic { width: 100%; max-height: 220px; object-fit: contain; border-radius: 14px; border: 1px solid var(--line, #e1e5cf); background: var(--th-paper-2, #fbfef9); }
.ai-est-field { display: grid; gap: 6px; }
.ai-est-field > span { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #78716c); }
.ai-est .estmat { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line, #e1e5cf); border-radius: 999px; width: max-content; max-width: 100%; flex-wrap: wrap; }
.ai-est .estmat button { border: 0; background: none; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted, #78716c); cursor: pointer; }
.ai-est .estmat button[aria-pressed="true"] { background: var(--th-gold-tint, #e9f2c2); color: var(--ink, #292524); box-shadow: inset 0 0 0 1px var(--line-strong, #c8d3ac); }
.ai-est .price { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--th-gold-tint, #f1f6de); border: 1px solid var(--line-strong, #c8d3ac); }
.ai-est .price small { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink, #385e1f); }
.ai-est .price b { font: 500 32px/1.15 var(--serif, Georgia, serif); }
.ai-est .price span { font-size: 13px; color: var(--muted, #78716c); }
.ai-est table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ai-est th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #78716c); font-weight: 700; padding: 0 0 6px; }
.ai-est td { padding: 8px 0; border-top: 1px solid var(--line, #e1e5cf); vertical-align: top; }
.ai-est td.n { text-align: right; white-space: nowrap; padding-left: 12px; font-variant-numeric: tabular-nums; }
.ai-est td small { display: block; color: var(--muted, #78716c); font-size: 12px; }
.ai-est tr.tot td { font-weight: 700; border-top: 1.5px solid var(--line-strong, #c8d3ac); }
.ai-est .wts { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted, #78716c); }
.ai-est .wts b { color: var(--ink, #292524); font-weight: 600; }
.ai-est .warn { font-size: 12.5px; line-height: 1.5; padding: 10px 12px; border-radius: 12px; background: var(--th-warn-bg, #fffaeb); border: 1px solid var(--th-warn-line, #fedf89); color: var(--th-warn-text, #93370d); }
.ai-est .send { display: grid; gap: 8px; }
.ai-est .send .primary, .ai-est .send .ghost { width: 100%; min-height: 44px; justify-content: center; }
.ai-est .send .primary:disabled { opacity: .5; cursor: not-allowed; }
.ai-est-link { justify-self: center; border: 0; background: none; padding: 4px; color: var(--accent-ink, #385e1f); font-family: inherit; font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer; }
.ai-est .busy { display: grid; justify-items: center; gap: 10px; padding: 26px 0; text-align: center; color: var(--muted, #78716c); font-size: 14px; }
.ai-est .spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line, #e1e5cf); border-top-color: var(--tone2, #61953f); animation: aiestspin 1s linear infinite; }
@keyframes aiestspin { to { transform: rotate(360deg); } }
@media (max-width: 480px) { .ai-est-card { padding: 22px 16px 18px; } .ai-est .price b { font-size: 28px; } }

/* 2026-11-23: the piece details (the BOM tool's form, for the customer): purity, size, weights, known stones, stone hints */
.ai-est-card, .ai-est-field { grid-template-columns: minmax(0, 1fr); }   /* a long row of pills wraps instead of widening the card */
.ai-est .ai-est-card .estmat { border-radius: 20px; }   /* the same on one line; a wrapped group keeps its corners */
.ai-est .ai-est-in { box-sizing: border-box; width: 100%; min-width: 0; height: 40px; padding: 8px 12px; border: 1px solid var(--line, #e1e5cf); border-radius: 12px;
  background: var(--th-paper-2, #fbfef9); color: var(--ink, #292524); font: inherit; font-size: 14px; }
.ai-est .ai-est-in:focus { outline: 2px solid var(--tone2, #61953f); outline-offset: 1px; }
.ai-est .ai-est-in::placeholder { color: var(--muted, #78716c); opacity: .8; }
.ai-est .ai-est-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ai-est .ai-est-hint { margin: -4px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted, #78716c); }
.ai-est .ai-est-stone { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .7fr) minmax(0, 1.2fr) minmax(0, .8fr) 32px; gap: 6px; align-items: center; }
.ai-est .ai-est-stone-head i { font-style: normal; font-size: 11px; font-weight: 600; color: var(--muted, #78716c); }
.ai-est .ai-est-del { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted, #78716c); cursor: pointer; font-size: 13px; }
.ai-est .ai-est-del:hover { color: var(--danger, #b42318); }
.ai-est .ai-est-add { justify-self: start; border: 1px solid var(--line, #e1e5cf); border-radius: 10px; background: none; padding: 6px 12px;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink, #292524); cursor: pointer; }
@media (max-width: 480px) {
  .ai-est .ai-est-in { font-size: 16px; }   /* iPhones don't zoom into 16px fields */
  .ai-est .ai-est-row2 { grid-template-columns: 1fr; }
  .ai-est .ai-est-stone { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; padding-bottom: 8px; border-bottom: 1px dashed var(--line, #e1e5cf); }
  .ai-est .ai-est-stone > :nth-child(1) { grid-area: 1 / 1; } .ai-est .ai-est-stone > :nth-child(2) { grid-area: 1 / 2; }
  .ai-est .ai-est-stone > :nth-child(3) { grid-area: 2 / 1; } .ai-est .ai-est-stone > :nth-child(4) { grid-area: 2 / 2; }
  .ai-est .ai-est-stone > :nth-child(5) { grid-area: 1 / 3; }
  .ai-est .ai-est-stone-head { display: none; }
}
.ai-est .estmat[aria-label="Kind of piece"] button { padding: 6px 9px; }   /* Auto-detect + 5 kinds on one line in the 520px card */
