/* Free tool (/tools/field-report-maker, /tools/punch-list-maker) and guest links (/r/<id>).
   Loaded after site.css. Same rules (.claude/skills/landing-page-design): Tailwind type pairs, B2 spacing,
   Tailwind radii, B7 easing; npm run check lints this file too. Phone first, 390px wide and up. */

:root {
  --accent-tint: #fdebdd;
  --accent-ink: #9a3f07;
  --success-tint: #e6f2e8;
  --error-tint: #fcebe9;
  --skeleton: #ebeae4;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

/* page */
.tool-page .breadcrumb { margin-bottom: var(--s-300); }
.tool-hero { display: grid; gap: var(--s-200); justify-items: start; max-width: 680px; }
.tool-hero h1 {
  max-width: 680px;
  font-size: 2.25rem;
  line-height: 2.5rem;
  letter-spacing: -0.025em;
  background: linear-gradient(90deg, #000000, #666666);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@media (min-width: 1024px) { .tool-hero h1 { font-size: 3rem; line-height: 1; } }
.tool-facts { display: flex; flex-wrap: wrap; gap: var(--s-75) var(--s-200); color: var(--muted); }
.tool-facts li { display: inline-flex; align-items: center; gap: var(--s-50); }
.tool-facts .icon { color: var(--success); }
.tool-wrap { display: grid; gap: var(--s-300); margin-top: var(--s-400); }

/* app frame */
.tool-app {
  display: grid;
  gap: var(--s-300);
  padding: var(--s-200);
  border: 1px solid var(--border);
  border-radius: var(--r-3xl);
  background: var(--surface);
}
@media (min-width: 640px) { .tool-app { padding: var(--s-300); } }
@media (min-width: 1024px) { .tool-app { padding: var(--s-400); } }
.tool-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-100); }

/* mode switch: 12px outer radius, 4px gap, so buttons get 8px */
.mode-switch {
  display: inline-flex;
  gap: var(--s-50);
  padding: var(--s-50);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--bg);
}
.mode-btn {
  padding: var(--s-75) var(--s-100);
  border: 0;
  border-radius: var(--r-lg);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 300ms var(--ease), color 300ms var(--ease), transform 300ms var(--ease);
}
.mode-btn:hover { color: var(--text); }
.mode-btn:active { transform: scale(0.98); }
.mode-btn[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(10, 10, 10, 0.12); }

/* notices */
.tool-notices { display: grid; gap: var(--s-75); }
.tool-notices:empty { display: none; }
.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-75) var(--s-100);
  padding: var(--s-100) var(--s-200);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--bg);
}
.notice > span { flex: 1 1 200px; }
.notice .icon { color: var(--accent); }
.notice-warn { background: var(--accent-tint); border-color: var(--accent-tint); color: var(--accent-ink); }
.notice-warn .icon { color: var(--accent-ink); }

/* stepper */
.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-75); }
.step-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-50);
  width: 100%;
  padding: var(--s-75) var(--s-50);
  border: 0;
  border-radius: var(--r-lg);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 300ms var(--ease), color 300ms var(--ease);
}
@media (min-width: 640px) { .step-btn { flex-direction: row; justify-content: center; font-size: 0.875rem; line-height: 1.25rem; } }
.step-btn:hover:not([disabled]) { background: var(--bg); color: var(--text); }
.step-btn[disabled] { cursor: default; opacity: 0.55; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--muted);
}
.step-num .icon { width: 16px; height: 16px; }
.step.is-current .step-btn { color: var(--text); opacity: 1; }
.step.is-current .step-num { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.step.is-done .step-num { background: var(--text); border-color: var(--text); color: var(--surface); }
.stepper-skel { height: 44px; }

/* panel and step parts */
.tool-panel { display: grid; gap: var(--s-300); min-width: 0; }
.tool-panel:focus, .step-head h2:focus { outline: none; }
.step-head { display: grid; gap: var(--s-75); }
.step-head h2 { letter-spacing: -0.025em; }
.step-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-100);
  padding-top: var(--s-300);
  border-top: 1px solid var(--border);
}
.step-nav > :only-child { margin-left: auto; }
.sub-head { font-size: 1rem; line-height: 1.5rem; }
.spacer { flex: 1; }

/* forms */
.visit-form { display: grid; gap: var(--s-300); }
.field { display: grid; gap: var(--s-50); align-content: start; min-width: 0; }
.field-label { font-weight: 600; }
.field-label .muted { font-weight: 400; }
.field-grid { display: grid; gap: var(--s-200); }
@media (min-width: 640px) { .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .field-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.field-row-inline { display: flex; flex-wrap: wrap; gap: var(--s-75); }
.field-row-inline .input { flex: 1 1 220px; }
.field-error { color: var(--error); }
.field-error:empty { display: none; }
.field-hint.is-error { color: var(--error); }
.input, .select { width: 100%; min-height: 40px; }
.field-row-inline .btn { flex: none; }
.textarea { resize: vertical; min-height: 72px; line-height: 1.5rem; }
.input:focus-visible, .select:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.input.is-loading { opacity: 0.6; }
.btn-danger { background: var(--error); color: var(--surface); }
.btn-danger:hover { background: #8f1c13; }
.btn[aria-busy="true"] { cursor: progress; }
.text-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-50);
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 300ms var(--ease);
}
.text-btn:hover { color: var(--accent); }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 0;
  border-radius: var(--r-lg);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 300ms var(--ease), color 300ms var(--ease), transform 300ms var(--ease);
}
.icon-btn:hover:not([disabled]) { background: var(--bg); color: var(--text); }
.icon-btn:active:not([disabled]) { transform: scale(0.94); }
.icon-btn[disabled] { opacity: 0.4; cursor: default; }
.flip .icon { transform: rotate(180deg); }

/* walk step */
.walk-grid { display: grid; gap: var(--s-300); }
.walk-grid > * { display: grid; gap: var(--s-100); align-content: start; min-width: 0; }
@media (min-width: 1024px) { .walk-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.plan-box { display: grid; gap: var(--s-100); }
.empty-tile, .error-tile {
  display: grid;
  justify-items: start;
  gap: var(--s-75);
  padding: var(--s-300);
  border: 1px dashed var(--border);
  border-radius: var(--r-2xl);
  background: var(--bg);
}
.empty-tile .btn, .empty-actions { margin-top: var(--s-75); }
.error-tile { border-style: solid; border-color: var(--error-tint); background: var(--surface); }
.error-tile .empty-icon { color: var(--error); }
.empty-title { font-weight: 600; }
.plan-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-50); }
.plan-pages { display: inline-flex; align-items: center; gap: var(--s-50); color: var(--muted); }
.plan-view {
  position: relative;
  max-height: 75vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  overscroll-behavior: contain;
}
.plan-stage { position: relative; min-width: 100%; }
.plan-img { display: block; width: 100%; height: auto; cursor: crosshair; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.plan-hint { display: inline-flex; align-items: center; gap: var(--s-50); }
.plan-hint .icon { color: var(--accent); }
.pin {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--surface);
  border-radius: var(--r-full);
  background: var(--accent);
  color: var(--surface);
  font: inherit;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(10, 10, 10, 0.28);
  transform: translate(-50%, -50%);
  cursor: pointer;
  animation: pin-drop 500ms var(--ease);
  transition: transform 300ms var(--ease), background-color 300ms var(--ease);
}
.pin:hover { transform: translate(-50%, -50%) scale(1.12); }
.pin.is-fixed { background: var(--success); }
@keyframes pin-drop { from { opacity: 0; transform: translate(-50%, -80%) scale(0.6); } to { opacity: 1; transform: translate(-50%, -50%); } }
.plan-skeleton { width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r-xl); }

.obs-list { display: grid; gap: var(--s-100); }
.obs-card, .review-card, .item-card, .share-card, .guest-item {
  display: grid;
  gap: var(--s-100);
  padding: var(--s-200);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  background: var(--surface);
  min-width: 0;
  animation: rise 500ms var(--ease);
  transition: border-color 300ms var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(var(--s-75)); } to { opacity: 1; transform: none; } }
.obs-head, .review-head, .item-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-75); }
.obs-title { font-size: 1rem; line-height: 1.5rem; }
.pin-dot.is-plain { background: var(--muted); }
.item-head .pin-dot, .obs-head .pin-dot { width: 24px; height: 24px; margin-right: 0; }
.obs-actions { display: flex; flex-wrap: wrap; gap: var(--s-75); }
.obs-msg:empty { display: none; }
.obs-msg.is-error { color: var(--error); }
.mic-btn.is-on { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-ink); }
.mic-btn.is-on .icon { animation: breathe 1600ms var(--ease) infinite alternate; }
@keyframes breathe { from { opacity: 1; } to { opacity: 0.35; } }

.thumbs { display: flex; flex-wrap: wrap; gap: var(--s-75); }
.thumbs:empty { display: none; }
.thumb {
  position: relative;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-sm { width: 56px; height: 56px; }
.thumb-btn { padding: 0; cursor: zoom-in; width: 88px; height: 88px; transition: transform 300ms var(--ease); }
.thumb-btn:hover { transform: scale(1.03); }
/* 8px thumb radius with a 4px inset gives the close button 4px */
.thumb-x {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: rgba(10, 10, 10, 0.72);
  color: var(--surface);
  cursor: pointer;
}
.thumb-x .icon { width: 14px; height: 14px; }

/* chips */
.chip { align-items: center; gap: var(--s-50); color: var(--muted); }
.chip .icon { width: 14px; height: 14px; }
.chip-ai { background: var(--accent-tint); border-color: var(--accent-tint); color: var(--accent-ink); }
.chip-ok { background: var(--success-tint); border-color: var(--success-tint); color: var(--success); }

/* review */
.review-card.is-confirmed, .item-card.is-confirmed { border-color: #bcdcc4; }
.item-card.is-safety { border-color: var(--accent); }
.review-items, .item-list, .line-list { display: grid; gap: var(--s-100); }
.review-items > .btn { justify-self: start; }
.line-row { display: flex; align-items: flex-start; gap: var(--s-75); }
.line-row .input { flex: 1; }
.line-input { min-height: 48px; }
.count-input { flex: none !important; width: 88px; }
.item-foot { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-100); }
.field-src { width: 140px; }
.item-media { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-50); }
.confirmed-note { display: inline-flex; align-items: center; gap: var(--s-50); color: var(--success); font-weight: 600; }
.skel-stack { display: grid; gap: var(--s-100); }
.skel-card, .skel-stack .review-card { animation: none; }
.skel-row { display: flex; gap: var(--s-100); }

/* skeletons (B9: shaped like the real layout, no spinners) */
.skeleton { display: block; border-radius: var(--r-lg); background: var(--skeleton); animation: shimmer 1400ms var(--ease) infinite alternate; }
@keyframes shimmer { from { opacity: 1; } to { opacity: 0.45; } }
.skel-line { height: 12px; }
.skel-title { height: 32px; width: 60%; }
.skel-input { height: 40px; width: 100%; }
.skel-switch { height: 40px; width: 280px; max-width: 100%; border-radius: var(--r-xl); }
.w-20 { width: 20%; } .w-30 { width: 30%; } .w-40 { width: 40%; } .w-60 { width: 60%; } .w-70 { width: 70%; } .w-90 { width: 90%; } .w-100 { width: 100%; }
.tool-app[aria-busy="true"] .tool-panel { gap: var(--s-200); }
.thumb.skeleton { border: 0; }

/* share */
.ready-tile { display: flex; align-items: center; gap: var(--s-100); padding: var(--s-200); border-radius: var(--r-2xl); background: var(--success-tint); }
.ready-tile > .icon-lg { color: var(--success); }
.share-grid { display: grid; gap: var(--s-200); }
@media (min-width: 768px) { .share-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.share-card { align-content: start; padding: var(--s-300); }
.link-box { display: grid; gap: var(--s-100); }
.link-box > .btn { justify-self: start; }
.progress { height: 4px; overflow: hidden; border-radius: var(--r-full); background: var(--border); }
.progress-bar { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 500ms var(--ease); }
.progress-bar.is-indeterminate { width: 40%; transform: none; animation: slide 1400ms var(--ease) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.is-success { color: var(--success); }
.is-error { color: var(--error); }
.owner-box { display: grid; gap: var(--s-75); justify-items: start; padding: var(--s-100) var(--s-200); border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--bg); }
.owner-box strong { font-weight: 600; }
.privacy-note { display: flex; gap: var(--s-75); align-items: flex-start; }
.privacy-note .icon { width: 16px; height: 16px; color: var(--success); }

.tool-waitlist { opacity: 0; transform: translateY(var(--s-200)); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.tool-waitlist.is-visible { opacity: 1; transform: none; }

/* dialogs */
.tool-dialog {
  max-width: 420px;
  width: calc(100% - 32px);
  padding: var(--s-300);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  background: var(--surface);
  color: var(--text);
}
.tool-dialog::backdrop { background: rgba(10, 10, 10, 0.44); }
.tool-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-75); margin-top: var(--s-300); }
.lightbox { max-width: 960px; padding: var(--s-100); display: grid; gap: var(--s-100); justify-items: end; }
.lightbox img { width: 100%; max-height: 80vh; object-fit: contain; border-radius: var(--r-sm); }
.lightbox:not([open]) { display: none; }

/* SEO content under the tool */
.tool-seo { display: grid; gap: var(--s-700); margin-top: var(--s-800); max-width: 1024px; }
.tool-sec { display: grid; gap: var(--s-300); }
.tool-sec h2 { letter-spacing: -0.025em; }
.tool-sec .tile .icon-lg { color: var(--accent); }
.tool-sec .ticks li { align-items: flex-start; }
.tool-sec a { text-underline-offset: 2px; text-decoration-color: var(--accent); }
.tool-seo .article-faq { margin-top: 0; }

/* guest link page */
.guest-page { padding-top: var(--s-900); }
.guest-app { display: grid; gap: var(--s-400); max-width: 880px; margin: 0 auto; }
.guest-skel { display: grid; gap: var(--s-200); }
.guest-head { display: grid; gap: var(--s-100); }
.guest-title {
  font-size: 1.875rem;
  line-height: 2.25rem;
  letter-spacing: -0.025em;
  background: linear-gradient(90deg, #000000, #666666);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@media (min-width: 640px) { .guest-title { font-size: 2.25rem; line-height: 2.5rem; } }
.guest-meta { display: grid; grid-template-columns: auto 1fr; gap: var(--s-50) var(--s-200); margin: 0; }
.guest-meta dt { color: var(--muted); }
.guest-meta dd { margin: 0; }
.guest-sec { display: grid; gap: var(--s-100); }
.guest-bullets { list-style: disc; padding-left: var(--s-300); display: grid; gap: var(--s-75); }
.guest-items { display: grid; gap: var(--s-100); }
.guest-item { scroll-margin-top: var(--s-900); }
.guest-item.is-fixed { border-color: #bcdcc4; }
.guest-item.is-safety:not(.is-fixed) { border-color: var(--accent); }
.guest-item-title { font-size: 1rem; line-height: 1.5rem; flex: 1 1 200px; }
.guest-item-meta { margin-top: 0; }
.replies { display: grid; gap: var(--s-75); }
.replies:empty { display: none; }
.reply { padding: var(--s-75) var(--s-100); border-radius: var(--r-lg); background: var(--bg); }
.reply-meta { margin-bottom: var(--s-25); }
.reply-box summary { display: inline-flex; align-items: center; gap: var(--s-50); font-weight: 600; cursor: pointer; list-style: none; }
.reply-box summary::-webkit-details-marker { display: none; }
.reply-form { display: grid; gap: var(--s-75); margin-top: var(--s-100); }
.reply-row { display: flex; flex-wrap: wrap; gap: var(--s-75); }
.reply-row .input { flex: 1 1 180px; }
.guest-foot { display: grid; gap: var(--s-75); padding-top: var(--s-300); border-top: 1px solid var(--border); }
.made-with { display: inline-flex; align-items: center; gap: var(--s-75); text-decoration: none; }
.made-with strong { font-weight: 600; }
.made-with:hover strong { color: var(--accent); }
.guest-owner { margin-top: 0; }
.guest-state { max-width: 560px; }
.guest-state h1 { font-size: 1.5rem; line-height: 2rem; }

@media (prefers-reduced-motion: reduce) {
  .pin, .obs-card, .review-card, .item-card, .share-card, .guest-item { animation: none; }
  .skeleton, .mic-btn.is-on .icon { animation: none; }
  .progress-bar.is-indeterminate { animation: none; width: 100%; opacity: 0.5; }
  .tool-waitlist { transform: none; }
  .mode-btn:active, .icon-btn:active:not([disabled]), .pin:hover, .thumb-btn:hover { transform: none; }
  .pin:hover { transform: translate(-50%, -50%); }
}
