/* Double KM print widget — landing-style tool card for Hugo articles */
.doublekm-landing {
  --bg: #f5f3f0;
  --bg-elev: #ebe7e2;
  --bg-card: #fffcf9;
  --line: #ddd6cd;
  --text: #1c1917;
  --muted: #6b6560;
  --dim: #9a928a;
  --amber: #f5ad4f;
  --amber-dim: rgba(245, 173, 79, 0.18);
  --amber-ink: #b45309;
  --cyan: #6b5e54;
  --green: #166534;
  --green-dim: rgba(22, 101, 52, 0.1);
  --shadow: 0 6px 20px rgba(40, 32, 24, 0.08);
  --btn-primary-fg: #1c1917;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  margin: 1.5rem 0 1.25rem;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.45;
}

.doublekm-landing__row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 22px 28px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.doublekm-landing__visual {
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.doublekm-landing__visual .tools-demo {
  margin: 0;
  width: 100%;
  text-align: center;
}

.doublekm-landing__visual .spd-caption {
  display: none;
}

.doublekm-landing__visual .spd-stage {
  min-height: 0;
  margin-bottom: 0;
}

.doublekm-landing__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
}

.doublekm-landing__who {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
}

.doublekm-landing__title {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.doublekm-landing__text {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  max-width: 42ch;
}

.doublekm-landing__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--amber-ink);
  margin-top: 4px;
  text-decoration: none;
}

.doublekm-landing__link:hover {
  filter: brightness(1.08);
  text-decoration: underline;
}

@media (max-width: 720px) {
  .doublekm-landing__row {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px 14px;
  }
  .doublekm-landing__copy {
    align-items: center;
    text-align: center;
  }
  .doublekm-landing__text {
    max-width: none;
  }
}

/* Phone demo (from widget.cleverence.ru landing) */
.spd { position: relative; z-index: 1; }
.spd-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  margin-bottom: 14px;
  padding: 0 4px;
}
.spd-phone {
  position: relative;
  flex: 0 0 auto;
  width: min(228px, 70vw);
  z-index: 2;
}
.spd-bezel {
  border-radius: 30px;
  padding: 11px 9px 13px;
  background: linear-gradient(160deg, #342c24 0%, #12100e 100%);
  box-shadow:
    0 22px 40px rgba(28, 22, 16, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.spd-notch {
  width: 68px; height: 7px; margin: 1px auto 8px;
  border-radius: 999px; background: #080706;
}
.spd-screen {
  border-radius: 18px;
  background: var(--bg-card);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  overflow: hidden;
  text-align: left;
  height: 360px;
  display: flex;
  flex-direction: column;
}
.spd-statusbar {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 9px 10px 5px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--dim);
}
.spd-live {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--green); max-width: 58%;
}
.spd-live em {
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
  letter-spacing: 0;
  font-size: 9px;
}
.spd-live i {
  flex: 0 0 auto;
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  animation: spd-pulse 1.4s ease-in-out infinite;
}
.spd[data-view="print"] .spd-live { color: var(--amber-ink); }
.spd[data-view="print"] .spd-live i { background: var(--amber); }

.spd-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}
.spd-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.spd[data-view="scan"] .spd-view-scan,
.spd[data-view="print"] .spd-view-print {
  opacity: 1;
  pointer-events: auto;
}

.spd-camera { padding: 2px 10px 6px; flex: 0 0 auto; }
.spd-frame {
  position: relative;
  height: 112px;
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(245, 173, 79, 0.14), transparent 58%),
    linear-gradient(180deg, #1c1712 0%, #0b0908 100%);
  overflow: hidden;
}
.spd-corner {
  position: absolute; width: 14px; height: 14px;
  border: 2px solid rgba(245, 173, 79, 0.9);
}
.spd-corner.tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.spd-corner.tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.spd-corner.bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.spd-corner.br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.spd-target {
  position: absolute;
  left: 50%; top: 54%;
  transform: translate(-50%, -50%) scale(0.7);
  color: #f5f0ea;
  opacity: 0;
  filter: blur(1.5px);
  transition: opacity 0.35s ease, transform 0.5s ease, filter 0.35s ease;
}
.spd-target.is-visible {
  opacity: 1;
  filter: none;
  transform: translate(-50%, -50%) scale(1);
}
.spd-laser {
  position: absolute; left: 12%; right: 12%; height: 2px;
  border-radius: 2px; background: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.9);
  top: 18%; opacity: 0;
}
.spd[data-phase="scanning"] .spd-laser {
  opacity: 1;
  animation: spd-laser 1.35s ease-in-out infinite;
}
.spd-flash {
  position: absolute; inset: 0;
  background: rgba(255, 250, 240, 0.55);
  opacity: 0; pointer-events: none;
}
.spd[data-phase="got-1"] .spd-flash,
.spd[data-phase="got-2"] .spd-flash {
  animation: spd-flash 0.5s ease-out;
}

.spd-list-wrap {
  flex: 1 1 auto;
  padding: 0 10px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.spd-list-head {
  flex: 0 0 auto;
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 10px; color: var(--muted); margin-bottom: 5px;
}
.spd-list-head strong {
  font-family: var(--mono); font-size: 12px; color: var(--amber-ink);
}
.spd-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 0 0 auto;
}
.spd-slot {
  position: relative;
  height: 42px;
  border-radius: 8px;
  border: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  overflow: hidden;
}
.spd-slot-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--dim); opacity: 0.45;
  transition: opacity 0.2s ease;
}
.spd-slot-fill {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 7px; align-items: center;
  padding: 0 7px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.28s ease, transform 0.28s ease, border-color 0.25s ease, background 0.25s ease;
}
.spd-slot.is-filled {
  border-style: solid;
  border-color: transparent;
  background: transparent;
}
.spd-slot.is-filled .spd-slot-empty { opacity: 0; }
.spd-slot.is-filled .spd-slot-fill {
  opacity: 1;
  transform: translateY(0);
}
.spd-slot.is-new .spd-slot-fill {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
  background: var(--green-dim);
}
.spd-item-dm { color: var(--text); width: 18px; height: 18px; }
.spd-item-dm .spd-dm { width: 18px; height: 18px; display: block; }
.spd-item-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.spd-item-body strong {
  font-size: 11px; font-weight: 600; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.spd-item-body span {
  font-family: var(--mono); font-size: 9px; color: var(--dim);
}
.spd-ok { color: var(--green); font-size: 12px; font-weight: 700; line-height: 1; }

.spd-view-print {
  padding: 4px 10px 8px;
  justify-content: flex-start;
}
.spd-print-title {
  flex: 0 0 auto;
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.spd-labels {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.spd-label-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--amber) 45%, var(--line));
  background: #fffefb;
  color: #1c1917;
  box-shadow: 0 4px 12px rgba(40, 32, 24, 0.08);
  opacity: 0;
  transform: translateY(8px) scale(0.96);
}
[data-theme="dark"] .spd-label-card {
  background: #f7f2eb;
}
.spd[data-view="print"] .spd-label-card {
  animation: spd-label-in 0.45s ease forwards;
}
.spd[data-view="print"] .spd-label-card:nth-child(2) {
  animation-delay: 0.18s;
}
.spd-label-card .spd-dm { width: 32px; height: 32px; display: block; }
.spd-label-card strong {
  font-size: 11px; font-weight: 700; text-align: center; line-height: 1.2;
}
.spd-label-card span {
  font-family: var(--mono); font-size: 9px; color: #6b6560;
}

.spd-actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 8px 10px 10px;
}
.spd-btn {
  display: flex; align-items: center; justify-content: center;
  height: 34px; border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-size: 12px; font-weight: 600; color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.spd[data-count="0"] .spd-btn-scan,
.spd[data-count="1"] .spd-btn-scan {
  background: var(--amber);
  border-color: transparent;
  color: var(--btn-primary-fg);
}
.spd[data-count="2"] .spd-btn-print,
.spd[data-view="print"] .spd-btn-print {
  background: var(--amber);
  border-color: transparent;
  color: var(--btn-primary-fg);
}
.spd[data-press="scan"] .spd-btn-scan,
.spd[data-press="print"] .spd-btn-print {
  transform: scale(0.94);
  filter: brightness(1.12);
  box-shadow: 0 0 0 3px var(--amber-dim);
  animation: spd-btn-flash 0.38s ease;
}

.spd-caption {
  position: relative;
  font-size: 13px; color: var(--muted);
  margin: 0 auto 14px;
  max-width: 28ch;
  line-height: 1.4;
}

@keyframes spd-laser {
  0%, 100% { top: 16%; opacity: 0.45; }
  50% { top: 78%; opacity: 1; }
}
@keyframes spd-flash {
  0% { opacity: 0.7; }
  100% { opacity: 0; }
}
@keyframes spd-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
@keyframes spd-btn-flash {
  0% { filter: brightness(1); }
  40% { filter: brightness(1.25); }
  100% { filter: brightness(1.08); }
}
@keyframes spd-label-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .spd-live i, .spd-laser, .spd-flash, .spd-btn, .spd-label-card { animation: none !important; }
  .spd-view, .spd-slot-fill, .spd-target { transition: none; }
  .spd[data-view="print"] .spd-label-card { opacity: 1; transform: none; }
}
