/* Habits First block card (web port of the iOS home-screen card).
   Sizes are the app's own CSS px at 1x on a 393pt phone; the card fills
   its container's width, so set that (the app leaves 20px either side). */

.bc-card {
  --bc-card: #2b2b30;
  --bc-well: #3a3a40;
  --bc-stroke: rgba(255, 255, 255, 0.06);
  --bc-ink: #ffffff;
  --bc-ink-2: rgba(235, 235, 245, 0.6);   /* .secondary */
  --bc-ink-3: rgba(235, 235, 245, 0.3);   /* .tertiary */
  --bc-green: #22c55e;
  --bc-orange: #ff9f0a;
  --bc-toggle-off: rgba(120, 120, 128, 0.32);
  --bc-toggle-on: #616166;                /* Theme.toggle, dark */

  box-sizing: border-box;
  padding: 20px;                          /* Theme.padding */
  border-radius: 24px;                    /* Theme.corner */
  background: var(--bc-card);
  box-shadow: inset 0 0 0 1px var(--bc-stroke);
  color: var(--bc-ink);
  /* SF Rounded where the platform has it; the system UI face elsewhere. */
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  gap: 10px;                              /* the card's VStack spacing */
  user-select: none;
}

.bc-card.bc-light {
  --bc-card: #ffffff;
  --bc-well: #ebedf0;
  --bc-stroke: rgba(0, 0, 0, 0.04);
  --bc-ink: #000000;
  --bc-ink-2: rgba(60, 60, 67, 0.6);
  --bc-ink-3: rgba(60, 60, 67, 0.3);
  --bc-toggle-on: #000000;
}

/* E-ink mode: BoardSkin.mono greys the colour out of everything, icons
   included (Theme.accent falls back to the soft ink). */
.bc-card.bc-mono { --bc-green: #6f6f76; --bc-orange: #6f6f76; }
.bc-card.bc-mono .bc-tile,
.bc-card.bc-mono .bc-cond-icon { filter: grayscale(1); }

/* A disabled block fades whole, the way the card does. */
.bc-card.bc-off { opacity: 0.6; }

/* ---- header: folder tile, name, toggle and padlock ---- */

.bc-head { display: flex; align-items: center; gap: 14px; }

.bc-tile {
  position: relative;
  flex: 0 0 auto;
  box-sizing: border-box;
  background: var(--bc-well);
  display: grid;
  place-content: center;
}
.bc-tile.bc-tile-grid {
  grid-template-columns: repeat(2, var(--bc-cell));
  gap: var(--bc-gap);
}
.bc-tile.bc-dim { opacity: 0.55; }
.bc-slot { overflow: hidden; background: #48484e; display: grid; place-items: center; }
.bc-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bc-slot-label { font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.bc-slot-web { background: #fff; color: #007aff; }
.bc-slot-cat { background: #5c5c66; color: rgba(255, 255, 255, 0.9); }
.bc-slot svg { display: block; }
/* iOS-folder-style overflow badge, tucked in the bottom-right corner. */
.bc-extra {
  position: absolute;
  right: -3px;
  bottom: -3px;
  padding: 1.5px 4px;
  border-radius: 999px;
  background: var(--bc-card);
  box-shadow: inset 0 0 0 1px var(--bc-stroke);
  color: var(--bc-ink-2);
  font-weight: 800;
}
.bc-shield { color: var(--bc-ink-2); display: grid; place-items: center; }

.bc-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bc-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }

/* iOS switch, drawn to the system's 51 x 31. */
.bc-switch {
  position: relative;
  width: 51px;
  height: 31px;
  border-radius: 999px;
  background: var(--bc-toggle-off);
  transition: background 0.2s ease;
}
.bc-switch.bc-on { background: var(--bc-green); }
.bc-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s ease;
}
.bc-switch.bc-on::after { transform: translateX(20px); }
.bc-switch.bc-dim { opacity: 0.6; }

.bc-lock {
  width: 30px;
  height: 24px;
  border-radius: 999px;
  background: var(--bc-well);
  color: var(--bc-ink-3);
  display: grid;
  place-items: center;
}
.bc-lock.bc-locked { background: rgba(255, 159, 10, 0.15); color: var(--bc-orange); }
.bc-lock svg { display: block; }

/* ---- the orange "add apps" notice and its dismiss line ---- */

.bc-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--bc-orange);
  font-size: 12.5px;
  font-weight: 600;
}
.bc-notice svg { display: block; flex: 0 0 auto; }
.bc-dismiss { display: flex; align-items: center; gap: 8px; color: var(--bc-ink-2); }
.bc-dismiss-text {
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  padding: 2px 0;
}
.bc-dismiss-why { margin-left: auto; padding: 4px; display: grid; place-items: center; }
.bc-dismiss svg { display: block; }

/* ---- gate row: "Mon to Fri · 9:00 to 17:00" + verdict capsule ---- */

.bc-gate {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 14px;
  /* Theme.well at 50%: the row sits on the card, not in it. */
  background: color-mix(in srgb, var(--bc-well) 50%, transparent);
}
.bc-gate-icon { color: var(--bc-ink-2); display: grid; place-items: center; }
.bc-gate-icon svg { display: block; }
.bc-gate-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--bc-ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bc-capsule {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: var(--bc-well);
  color: var(--bc-ink-2);
}
.bc-capsule.bc-open {
  background: color-mix(in srgb, var(--bc-green) 13%, transparent);
  color: var(--bc-green);
}

/* ---- the big action button (redeem / unlock / why there is none) ---- */

.bc-action {
  box-sizing: border-box;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.bc-action.bc-go { background: var(--bc-green); color: #fff; }
.bc-action.bc-quiet { background: var(--bc-well); color: var(--bc-ink-2); }
.bc-action.bc-lock-back { background: var(--bc-well); color: var(--bc-ink); }
.bc-action svg { display: block; }

/* DO BOTH / EITHER / ANY 2 */
.bc-require {
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bc-well);
  color: var(--bc-ink-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
}

/* ---- condition rows ---- */

.bc-conds { display: flex; flex-direction: column; gap: 8px; }
.bc-cond { display: flex; align-items: center; gap: 10px; }
.bc-cond-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
}
.bc-cond-icon img { width: 22px; height: 22px; border-radius: 6px; display: block; }
.bc-cond-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bc-cond-top { display: flex; align-items: center; gap: 5px; }
.bc-cond-label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bc-cond-source { font-size: 11px; font-weight: 400; color: var(--bc-ink-2); white-space: nowrap; }
.bc-cond-count {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--bc-ink-2);
  white-space: nowrap;
}
.bc-cond-count svg { display: block; }
.bc-cond-warn { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--bc-orange); white-space: nowrap; }
.bc-bar { height: 6px; border-radius: 999px; background: var(--bc-well); overflow: hidden; }
.bc-bar-fill { height: 100%; border-radius: 999px; transition: width 0.42s cubic-bezier(0.22, 1, 0.36, 1); }

/* A habit row's quick-add circle, and a timer row's start capsule. */
.bc-quick {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--bc-well);
  color: var(--bc-ink-2);
}
.bc-quick.bc-done { background: color-mix(in srgb, var(--bc-green) 18%, transparent); color: var(--bc-green); }
.bc-quick svg { display: block; }
