/* Hallmark · pre-emit critique: P5 H5 E5 S5 R4 V4
 * component: bottom-left contact panel · genre: modern-minimal · theme: site cobalt
 * audience: website visitors · use: leave a message · tone: clear and compact
 * states: default · hover · focus · active · disabled · loading · error · success
 */
.lm-widget,
.lm-preview {
  --lm-paper: oklch(99.5% 0.002 265);
  --lm-soft: oklch(97% 0.012 265);
  --lm-ink: oklch(28% 0.035 265);
  --lm-muted: oklch(47% 0.025 265);
  --lm-rule: oklch(88% 0.025 265);
  --lm-input-rule: oklch(64% 0.035 265);
  --lm-accent: oklch(53% 0.225 267);
  --lm-accent-hover: oklch(47% 0.215 267);
  --lm-on-accent: oklch(99.5% 0.002 265);
  --lm-header-note: oklch(95% 0.020 265);
  --lm-icon-bg: oklch(61% 0.18 267);
  --lm-focus: oklch(16% 0.025 265);
  --lm-error: oklch(43% 0.16 25);
  --lm-error-bg: oklch(96% 0.020 25);
  --lm-success: oklch(38% 0.09 155);
  --lm-shadow: oklch(25% 0.065 265 / 0.20);
  --lm-clear: transparent;
  --lm-font: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --lm-display: var(--lm-font);
  --lm-z: 400;
  --lm-ease: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--lm-font);
  color: var(--lm-ink);
  font-size: 16px;
  line-height: 1.6;
  text-align: left;
}
.lm-widget {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(340px, calc(100% - 32px));
  z-index: var(--lm-z);
  pointer-events: none;
}
.lm-widget[data-side="right"] { left: auto; right: max(16px, env(safe-area-inset-right)); }
.lm-widget *, .lm-widget *::before, .lm-widget *::after,
.lm-preview *, .lm-preview *::before, .lm-preview *::after { box-sizing: border-box; }
.lm-widget [hidden], .lm-preview [hidden] { display: none !important; }
.lm-widget input[type="hidden"] { display: none !important; }
.lm-widget button, .lm-widget input, .lm-widget textarea,
.lm-preview button { font: inherit; letter-spacing: normal; }
.lm-widget button, .lm-preview button { cursor: pointer; white-space: nowrap; }
.lm-widget button:focus-visible, .lm-preview button:focus-visible,
.lm-preview .is-focus {
  outline: 3px solid var(--lm-focus);
  outline-offset: 3px;
}
.lm-widget svg, .lm-preview svg { display: block; width: 22px; height: 22px; flex: 0 0 auto; }
.lm-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  width: auto;
  padding: 12px 20px;
  border: 1px solid var(--lm-accent);
  border-radius: 12px;
  background: var(--lm-accent);
  color: var(--lm-on-accent);
  box-shadow: 0 4px 20px var(--lm-shadow);
  pointer-events: auto;
  font-weight: 700;
  transition: background-color 140ms var(--lm-ease);
}
.lm-trigger__label { line-height: 1; }
.lm-widget[data-side="right"] .lm-trigger { float: right; }
.lm-dialog {
  position: relative;
  display: block;
  margin: 0;
  width: 100%;
  max-height: calc(100dvh - 32px - env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0;
  border: 1px solid var(--lm-rule);
  border-radius: 14px;
  background: var(--lm-paper);
  color: var(--lm-ink);
  box-shadow: 0 12px 40px var(--lm-shadow);
  font: inherit;
  pointer-events: auto;
}
.lm-dialog:not([hidden]) { animation: lm-appear 180ms var(--lm-ease); }
.lm-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 80px;
  padding: 16px 48px 16px 16px;
  background: var(--lm-accent);
  color: var(--lm-on-accent);
}
.lm-heading-copy { min-width: 0; }
.lm-heading-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  background: var(--lm-icon-bg);
  color: var(--lm-on-accent);
}
.lm-title { margin: 0; color: var(--lm-on-accent); font-family: var(--lm-font); font-size: 20px; font-weight: 700; font-style: normal; line-height: 1.3; overflow-wrap: anywhere; min-width: 0; letter-spacing: -0.025em; }
.lm-description { margin: 4px 0 0; color: var(--lm-header-note); font-size: 12px; line-height: 1.5; }
.lm-close {
  position: absolute;
  top: 8px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--lm-clear);
  color: var(--lm-on-accent);
}
.lm-close:active { background: var(--lm-accent-hover); color: var(--lm-on-accent); transform: translateY(1px); }
.lm-form { padding: 16px; margin: 0; }
.lm-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 12px; }
.lm-field { min-width: 0; }
.lm-field--wide { grid-column: 1 / -1; }
.lm-label { display: flex; gap: 4px; align-items: baseline; margin-bottom: 4px; color: var(--lm-ink); font-size: 13px; line-height: 18px; font-weight: 600; }
.lm-required { color: var(--lm-error); font-weight: 400; }
.lm-widget input, .lm-widget textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--lm-input-rule);
  border-radius: 8px;
  outline: 2px solid var(--lm-clear);
  outline-offset: 2px;
  padding: 10px;
  background: var(--lm-soft);
  color: var(--lm-ink);
  font-size: 16px;
  line-height: 22px;
  box-shadow: none;
}
.lm-widget input::placeholder, .lm-widget textarea::placeholder { color: var(--lm-muted); opacity: 1; }
.lm-widget textarea { min-height: 76px; height: 76px; max-height: 220px; resize: vertical; }
.lm-widget input:focus-visible, .lm-widget textarea:focus-visible { outline-color: var(--lm-focus); }
.lm-widget input:focus, .lm-widget textarea:focus { background: var(--lm-paper); color: var(--lm-ink); }
.lm-widget [aria-invalid="true"] { border-color: var(--lm-error); }
.lm-field__bottom { display: flex; justify-content: space-between; gap: 4px; margin: 2px 0; font-size: 11px; line-height: 16px; }
.lm-field__error { min-height: 16px; color: var(--lm-error); }
.lm-count { color: var(--lm-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lm-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--lm-accent);
  border-radius: 8px;
  background: var(--lm-accent);
  color: var(--lm-on-accent);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  line-height: 22px;
  transition: background-color 140ms var(--lm-ease), transform 100ms var(--lm-ease);
}
.lm-submit { width: 100%; margin-top: 8px; }
.lm-button:active, .lm-button.is-active { transform: translateY(1px); background: var(--lm-accent-hover); color: var(--lm-on-accent); }
.lm-trigger:active { background: var(--lm-accent-hover); color: var(--lm-on-accent); }
.lm-widget button:disabled, .lm-preview button:disabled { opacity: 0.5; cursor: not-allowed; }
.lm-button[data-state="loading"] { opacity: 0.8; cursor: wait; }
.lm-button[data-state="error"] { background: var(--lm-error); color: var(--lm-on-accent); border-color: var(--lm-error); }
.lm-button[data-state="success"] { background: var(--lm-success); color: var(--lm-on-accent); border-color: var(--lm-success); }
.lm-spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: var(--lm-clear); border-radius: 50%; animation: lm-spin 900ms linear infinite; }
.lm-note { margin: 8px 0 0; color: var(--lm-muted); font-size: 11px; line-height: 1.6; text-align: center; }
.lm-feedback { margin: 4px 0 8px; padding: 10px 12px; border-radius: 8px; background: var(--lm-error-bg); color: var(--lm-error); font-size: 13px; overflow-wrap: anywhere; }
.lm-success { padding: 40px 20px 24px; text-align: center; }
.lm-dialog:has(.lm-success:not([hidden])) .lm-close { color: var(--lm-muted); }
.lm-success__icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 20px; border: 1px solid var(--lm-rule); border-radius: 50%; background: var(--lm-soft); color: var(--lm-success); }
.lm-success__icon svg { width: 30px; height: 30px; }
.lm-success h3 { margin: 0; font-size: 22px; font-weight: 700; font-style: normal; }
.lm-success p { margin: 12px 0 28px; color: var(--lm-muted); font-size: 14px; }
.lm-success h3:focus { outline: none; }
@media (hover: hover) {
  .lm-trigger:hover, .lm-button:hover:not(:disabled), .lm-button.is-hover { background: var(--lm-accent-hover); color: var(--lm-on-accent); }
  .lm-close:hover { background: var(--lm-accent-hover); color: var(--lm-on-accent); }
  .lm-dialog:has(.lm-success:not([hidden])) .lm-close:hover { background: var(--lm-soft); color: var(--lm-muted); }
  .lm-widget input:hover, .lm-widget textarea:hover { background: var(--lm-paper); color: var(--lm-ink); }
}
@media (prefers-reduced-motion: reduce) {
  .lm-dialog:not([hidden]) { animation: lm-fade 120ms linear; }
  .lm-button, .lm-trigger { transition: none; }
  .lm-spinner { animation-duration: 1800ms; }
}
@keyframes lm-appear { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes lm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lm-spin { to { transform: rotate(360deg); } }
