/* Dkay photo and voice search: clean light sheet */
.dk-scan {
  position: fixed;
  inset: 0;
  z-index: 300;
  font-family: Manrope;
}

.dk-scan[hidden] { display: none; }

body.dk-scan-open { overflow: hidden; }

.dk-scan-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 23, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: dk-scan-fade 0.2s ease-out;
}

.dk-scan-sheet {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  width: min(480px, calc(100vw - 32px));
  max-height: min(84vh, 640px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e6e7ea;
  border-radius: 20px;
  box-shadow:
    0 36px 80px -26px rgba(15, 18, 23, 0.42),
    0 8px 22px -12px rgba(15, 18, 23, 0.16);
  overflow: hidden;
  color: #17181a;
  animation: dk-scan-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes dk-scan-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dk-scan-in {
  from { opacity: 0; transform: translateX(-50%) translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateX(-50%); }
}

.dk-scan-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid #f0f1f3;
}

.dk-scan-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(150deg, #ff8a3d, #f76502);
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(247, 101, 2, 0.6);
}

.dk-scan-mark svg { width: 21px; height: 21px; }

.dk-scan-head { flex: 1 1 auto; min-width: 0; }
.dk-scan-head b { display: block; font-size: 14px; font-weight: 800; letter-spacing: -0.01em; color: #17181a; }
.dk-scan-head span { display: block; margin-top: 2px; font-size: 11px; font-weight: 600; color: #6b7280; }

.dk-scan-x {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f4f5f7;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dk-scan-x:hover { background: #e8eaed; color: #17181a; }
.dk-scan-x svg { width: 14px; height: 14px; }

/* Idle stage */
.dk-scan-stage { flex: 0 0 auto; padding: 14px 16px 0; }

.dk-scan-idle { text-align: center; }
.dk-scan-idle[hidden], .dk-scan-wait[hidden], .dk-scan-out[hidden] { display: none; }

.dk-scan-drop {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 20px 16px 18px;
  border: 1.5px dashed #dfe2e6;
  border-radius: 14px;
  background: #fafafb;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dk-scan-drop:hover,
.dk-scan-drop:focus-visible {
  border-color: #f76502;
  background: #fff7f1;
  outline: 0;
}

.dk-scan-idle.has-photo .dk-scan-drop { display: none; }

.dk-scan-drop-ic {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 5px;
  border-radius: 50%;
  background: #fff0e6;
  color: #f76502;
}

.dk-scan-drop-ic svg { width: 22px; height: 22px; }
.dk-scan-drop b { font-size: 13.5px; font-weight: 800; color: #17181a; }
.dk-scan-drop > span:last-child { font-size: 11px; font-weight: 600; color: #8a8f98; }

.dk-scan-preview { margin-top: 2px; }
.dk-scan-preview[hidden] { display: none; }
.dk-scan-preview img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 176px;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid #e9eaec;
  box-shadow: 0 14px 30px -18px rgba(15, 18, 23, 0.45);
}

.dk-scan-retake {
  margin-top: 9px;
  padding: 6px 13px;
  border: 1px solid #e9eaec;
  border-radius: 999px;
  background: #fff;
  color: #4b5563;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.dk-scan-retake:hover { border-color: #f76502; color: #f76502; }

.dk-scan-hint {
  margin: 10px auto 2px;
  max-width: 320px;
  font-size: 12px;
  line-height: 1.5;
  color: #6b7280;
}

.dk-scan-hint.is-error { color: #b42318; }

.dk-scan.is-listening .dk-scan-drop { border-color: #f76502; background: #fff7f1; }
.dk-scan.is-listening .dk-scan-drop-ic { animation: dk-scan-listen 1.4s ease-in-out infinite; }
.dk-scan.is-listening .dk-scan-hint { color: #f76502; }

@keyframes dk-scan-listen {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Waiting */
.dk-scan-wait { text-align: center; padding: 10px 0 18px; }

.dk-scan-loader {
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 30%, #f76502 82%, #ffb37a 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: dk-scan-spin 1s linear infinite;
}

@keyframes dk-scan-spin { to { transform: rotate(360deg); } }

.dk-scan-wait p { margin: 0; font-size: 12.5px; font-weight: 600; color: #4b5563; }

/* Results */
.dk-scan-out {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px 4px;
  scrollbar-width: thin;
  scrollbar-color: #d6d9de transparent;
}

.dk-scan-out::-webkit-scrollbar { width: 5px; }
.dk-scan-out::-webkit-scrollbar-thumb { background: #d6d9de; border-radius: 999px; }

.dk-scan-say {
  position: relative;
  margin: 0 2px 12px;
  padding-left: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: #17181a;
}

.dk-scan-say::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 3px;
  border-radius: 999px;
  background: #f76502;
}

.dk-scan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.dk-scan-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e9eaec;
  text-decoration: none;
  color: #17181a;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.dk-scan-card:hover {
  border-color: #f7b78c;
  box-shadow: 0 10px 24px -16px rgba(247, 101, 2, 0.55);
  transform: translateY(-1px);
}

.dk-scan-card-img {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 9px;
  overflow: hidden;
  background: #f4f5f7;
}

.dk-scan-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.dk-scan-card-body { min-width: 0; flex: 1 1 auto; }
.dk-scan-card-body b {
  display: block;
  font-size: 11.8px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dk-scan-card-body em {
  display: block;
  margin: 2px 0 4px;
  font-style: normal;
  font-size: 10px;
  color: #8a8f98;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dk-scan-card-body strong { display: block; font-size: 11.8px; font-weight: 800; color: #f76502; }

.dk-scan-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 12px 0 6px;
  padding: 10px 14px;
  border: 1px solid #f76502;
  border-radius: 999px;
  background: #fff;
  color: #f76502;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.15s;
}

.dk-scan-all:hover { background: #fff3eb; }
.dk-scan-all[hidden] { display: none; }
.dk-scan-all svg { width: 15px; height: 15px; }

/* Composer bar */
.dk-scan-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px;
  border-top: 1px solid #f0f1f3;
}

.dk-scan-round {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #e9eaec;
  border-radius: 14px;
  background: #fff;
  color: #4b5563;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.dk-scan-round svg { width: 20px; height: 20px; }
.dk-scan-round:hover { color: #f76502; border-color: #f7b78c; }
.dk-scan-round.is-live {
  color: #fff;
  border-color: #f76502;
  background: #f76502;
  animation: dk-scan-live 1.2s ease-in-out infinite;
}

@keyframes dk-scan-live {
  0%, 100% { box-shadow: 0 0 0 0 rgba(247, 101, 2, 0.4); }
  50% { box-shadow: 0 0 0 7px rgba(247, 101, 2, 0); }
}

.dk-scan-form {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  padding: 0 4px 0 13px;
  background: #f4f5f7;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.dk-scan-form:focus-within {
  background: #fff;
  border-color: rgba(247, 101, 2, 0.65);
  box-shadow: 0 0 0 3px rgba(247, 101, 2, 0.12);
}

.dk-scan-form input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: #17181a;
}

.dk-scan-form input::placeholder { color: #8a8f98; }

.dk-scan-send {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: #f76502;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.dk-scan-send:hover { background: #e65c00; }
.dk-scan-send svg { width: 17px; height: 17px; }
.dk-scan-send:disabled { opacity: 0.45; cursor: default; }

.dk-scan-foot {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 16px 12px;
  font-size: 10px;
  text-align: center;
  color: #9aa0a8;
}

/* Search bar triggers */
.mk-search .mk-search-tool {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-right: 0;
  border-radius: 50%;
  background: transparent;
  color: #5f6469;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s, color 0.15s;
}

.mk-search .mk-search-tool:hover { background: #f2f3f4; color: #f76502; }
.mk-search .mk-search-tool svg { width: 18px; height: 18px; }

@media (max-width: 760px) {
  .dk-scan-sheet {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 86vh;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    transform: none;
    animation: dk-scan-in-m 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
  }

  @keyframes dk-scan-in-m {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: none; }
  }

  .dk-scan-top { padding: 12px 12px 10px; }
  .dk-scan-stage { padding: 12px 12px 0; }
  .dk-scan-out { padding: 10px 12px 4px; }
  .dk-scan-grid { grid-template-columns: 1fr; gap: 7px; }
  .dk-scan-card { padding: 8px; }
  .dk-scan-card-img { width: 56px; height: 56px; }
  .dk-scan-bar { padding: 9px 10px; gap: 7px; }
  .dk-scan-round { width: 42px; height: 42px; }
  .dk-scan-form { height: 42px; }
  .dk-scan-foot { padding: 0 14px calc(12px + env(safe-area-inset-bottom)); }
}

.mk-appsearch .mk-appsearch-tool { width: 42px; }
.mk-appsearch .mk-appsearch-tool svg { width: 20px; height: 20px; }

.mka-searchpill .mka-search-cam { width: 38px; }
.mka-searchpill .mka-search-cam svg { width: 19px; height: 19px; }
