:root {
  --bc-ink: #0e2430;
  --bc-ink-soft: #1a3a4a;
  --bc-sand: #f3eee6;
  --bc-sand-deep: #e7dfd2;
  --bc-paper: #fbf8f3;
  --bc-accent: #c47a4a;
  --bc-accent-hot: #e8a87c;
  --bc-line: rgba(14, 36, 48, 0.1);
  --bc-shadow: 0 18px 40px rgba(14, 36, 48, 0.12);
  --bc-radius: 22px;
  --bc-nav-h: 64px;
  --bc-font: "Outfit", system-ui, sans-serif;
  --bc-display: "Fraunces", Georgia, serif;
}

html.bc-page,
body.bc-page {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(232, 168, 124, 0.22), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(26, 58, 74, 0.1), transparent 50%),
    linear-gradient(180deg, #f7f2ea 0%, var(--bc-sand) 48%, #ebe4d8 100%);
  color: var(--bc-ink);
  font-family: var(--bc-font);
  -webkit-font-smoothing: antialiased;
}

body.bc-module-page {
  padding-bottom: calc(var(--bc-nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
}

.bc-shell {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 16px 24px;
}

.bc-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0 18px;
  animation: bc-rise 0.55s ease both;
}

.bc-hero__mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(165deg, #fff 0%, #f4efe7 100%);
  box-shadow: var(--bc-shadow);
  display: grid;
  place-items: center;
}

.bc-hero__mark img {
  width: 44px;
  height: 44px;
}

.bc-hero__title {
  margin: 0;
  font-family: var(--bc-display);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.bc-hero__sub {
  margin: 4px 0 0;
  color: rgba(14, 36, 48, 0.62);
  font-size: 0.92rem;
}

.bc-login-banner {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(196, 122, 74, 0.12);
  border: 1px solid rgba(196, 122, 74, 0.28);
  font-size: 0.92rem;
}

.bc-login-banner a {
  color: var(--bc-ink);
  font-weight: 600;
}

.bc-panel[hidden] {
  display: none !important;
}

.bc-search-wrap {
  margin-bottom: 14px;
  animation: bc-rise 0.55s ease 0.06s both;
}

.bc-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--bc-line);
  box-shadow: 0 8px 24px rgba(14, 36, 48, 0.06);
  backdrop-filter: blur(10px);
}

.bc-search__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  opacity: 0.55;
}

.bc-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--bc-ink);
  min-width: 0;
}

.bc-search__clear {
  border: 0;
  background: rgba(14, 36, 48, 0.08);
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--bc-ink);
}

.bc-search-meta {
  margin: 8px 4px 0;
  font-size: 0.82rem;
  color: rgba(14, 36, 48, 0.55);
  min-height: 1.1em;
}

.bc-deck {
  display: grid;
  gap: 16px;
}

.bc-card {
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  width: 100%;
  cursor: pointer;
  animation: bc-rise 0.45s ease both;
}

.bc-card__flip {
  position: relative;
  width: 100%;
  aspect-ratio: 1.72 / 1;
  perspective: 1200px;
  border-radius: var(--bc-radius);
}

.bc-card__inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: inherit;
  box-shadow: var(--bc-shadow);
}

.bc-card.is-flipped .bc-card__inner {
  transform: rotateY(180deg);
}

.bc-card__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: inherit;
  overflow: hidden;
  background: #1a3a4a;
}

.bc-card__face--back {
  transform: rotateY(180deg);
}

.bc-card__face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bc-card__face--empty {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  background:
    linear-gradient(145deg, #1a3a4a, #0e2430);
}

.bc-card__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 0 4px;
}

.bc-card__name {
  margin: 0;
  font-family: var(--bc-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.bc-card__company {
  margin: 2px 0 0;
  color: rgba(14, 36, 48, 0.62);
  font-size: 0.9rem;
}

.bc-card__phone {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--bc-accent);
  font-weight: 560;
}

.bc-card__hint {
  flex: 0 0 auto;
  font-size: 0.75rem;
  color: rgba(14, 36, 48, 0.45);
  padding-top: 4px;
}

.bc-empty {
  text-align: center;
  padding: 48px 20px 24px;
  animation: bc-rise 0.5s ease both;
}

.bc-empty h2 {
  margin: 14px 0 6px;
  font-family: var(--bc-display);
  font-size: 1.4rem;
}

.bc-empty p {
  margin: 0 0 18px;
  color: rgba(14, 36, 48, 0.6);
}

.bc-scan-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.bc-scan-steps span {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  color: rgba(14, 36, 48, 0.45);
}

.bc-scan-steps span.is-active {
  background: var(--bc-ink);
  color: #fff;
}

.bc-scan-steps span.is-done {
  background: rgba(196, 122, 74, 0.18);
  color: var(--bc-ink);
}

.bc-capture {
  position: relative;
  width: 100%;
  aspect-ratio: 1.72 / 1;
  border: 0;
  border-radius: var(--bc-radius);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.7), rgba(243, 238, 230, 0.9));
  box-shadow: var(--bc-shadow);
  border: 1px dashed rgba(14, 36, 48, 0.18);
}

.bc-capture__preview {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.bc-capture__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 4px;
  color: var(--bc-ink);
  background: rgba(251, 248, 243, 0.28);
  transition: opacity 0.25s ease;
}

.bc-capture.has-image .bc-capture__label {
  opacity: 0;
}

.bc-capture:hover .bc-capture__label,
.bc-capture:focus-visible .bc-capture__label {
  opacity: 1;
}

.bc-capture__label strong {
  font-family: var(--bc-display);
  font-size: 1.35rem;
}

.bc-capture__label em {
  font-style: normal;
  font-size: 0.9rem;
  opacity: 0.65;
}

.bc-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.bc-scan-hint {
  margin: 0 0 12px;
  color: rgba(14, 36, 48, 0.6);
  font-size: 0.9rem;
}

.bc-form,
.bc-edit-sheet {
  display: grid;
  gap: 10px;
}

.bc-field {
  display: grid;
  gap: 4px;
}

.bc-field span {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(14, 36, 48, 0.5);
}

.bc-field input,
.bc-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--bc-line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: rgba(255, 255, 255, 0.82);
  color: var(--bc-ink);
}

.bc-field input:focus,
.bc-field textarea:focus {
  outline: 2px solid rgba(196, 122, 74, 0.45);
  border-color: transparent;
}

.bc-scan-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: center;
}

.bc-scan-actions--stack {
  flex-direction: column;
}

.bc-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.bc-btn:active {
  transform: scale(0.98);
}

.bc-btn--primary {
  background: linear-gradient(135deg, var(--bc-ink-soft), var(--bc-ink));
  color: #fff;
  box-shadow: 0 10px 24px rgba(14, 36, 48, 0.22);
}

.bc-btn--ghost {
  background: rgba(255, 255, 255, 0.55);
  color: var(--bc-ink);
  border: 1px solid var(--bc-line);
}

.bc-btn--danger {
  background: rgba(180, 55, 45, 0.1);
  color: #9b2c2c;
}

.bc-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, rgba(243, 238, 230, 0.92) 28%, #efe8dc);
  backdrop-filter: blur(8px);
}

.bc-tab {
  display: grid;
  justify-items: center;
  gap: 2px;
  border: 0;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  padding: 10px 8px 8px;
  color: rgba(14, 36, 48, 0.5);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.bc-tab svg {
  width: 22px;
  height: 22px;
}

.bc-tab.is-active {
  background: var(--bc-ink);
  color: #fff;
  box-shadow: 0 10px 20px rgba(14, 36, 48, 0.2);
}

.bc-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bc-nav-h) + 28px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 60;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--bc-ink);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 560;
  box-shadow: var(--bc-shadow);
  animation: bc-rise 0.25s ease both;
}

.bc-edit-dialog {
  border: 0;
  padding: 0;
  border-radius: 22px;
  width: min(420px, calc(100vw - 28px));
  background: var(--bc-paper);
  box-shadow: var(--bc-shadow);
}

.bc-edit-dialog::backdrop {
  background: rgba(14, 36, 48, 0.45);
  backdrop-filter: blur(4px);
}

.bc-edit-sheet {
  padding: 18px;
}

.bc-edit-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.bc-edit-sheet__head h2 {
  margin: 0;
  font-family: var(--bc-display);
  font-size: 1.25rem;
}

.bc-icon-btn {
  border: 0;
  background: rgba(14, 36, 48, 0.08);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 1.3rem;
  cursor: pointer;
}

.bc-edit-sheet__actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

@keyframes bc-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 720px) {
  .bc-shell {
    padding-top: 20px;
  }
  .bc-deck {
    gap: 20px;
  }
}

/* Ask AI dock clearance on module pages with bottom nav */
body.bc-module-page .v1-mobile-ask-dock {
  bottom: calc(var(--bc-nav-h) + 18px + env(safe-area-inset-bottom, 0px));
}
