/**
 * CraftBelt — shell chrome (brand bar, auto-hide Ring & Rail, act-as,
 * offline badge, notch sheet). Mechanical only. No preview tip banners.
 */
html[data-cbr='1'] .cbr-shell {
  display: flex;
  min-height: 100dvh;
  width: 100%;
  max-width: min(480px, 100%);
  margin: 0 auto;
  position: relative;
  padding-bottom: 24px;
  overflow-x: hidden;
}

html[data-cbr='1'] .cbr-main {
  flex: 1;
  min-width: 0;
  padding: 6px 8px 16px;
}

/* ---- Dual logo brand bar (inner pages; Time Desk premium hero skips this) - */
html[data-cbr='1'] .cbr-brand-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 6px;
  margin: 0 0 4px;
  padding: 4px 8px;
  border-radius: var(--cbr-radius-lg);
  border: 1px solid rgba(240, 122, 40, 0.22);
  background: linear-gradient(180deg, var(--cbr-plank), var(--cbr-bench));
  box-shadow: var(--cbr-shadow-sm);
}

html[data-cbr='1'][data-cbr-premium-hero='1'] .cbr-brand-bar {
  display: none !important;
}

/* CB asset has more transparent padding than square tenant marks — nudge taller so it reads equal */
html[data-cbr='1'] .cbr-brand-bar__cb {
  height: 56px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  justify-self: start;
}

html[data-cbr='1'] .cbr-brand-bar__ver {
  justify-self: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--cbr-ink-mute);
  white-space: nowrap;
  line-height: 1.2;
  text-align: center;
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-cbr='1'] .cbr-brand-bar__tenant {
  height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  justify-self: end;
}

html[data-cbr='1'] .cbr-brand-bar__tenant-fallback {
  justify-self: end;
  font-family: var(--cbr-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--cbr-ink-mute);
  text-align: right;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Service header ------------------------------------------------------ */
html[data-cbr='1'] .cbr-service-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  padding: 4px 8px;
  border-radius: var(--cbr-radius-lg);
  border: 1px solid rgba(154, 120, 88, 0.38);
  background-color: var(--cbr-leather-mid);
  background-image:
    linear-gradient(
      125deg,
      rgba(220, 190, 150, 0.07) 0%,
      transparent 34%,
      rgba(0, 0, 0, 0.1) 100%
    ),
    var(--cbr-leather-nap),
    var(--cbr-leather-grain-fine),
    var(--cbr-leather-grain),
    var(--cbr-leather-base);
  background-size: auto, 180px 180px, 120px 120px, 180px 180px, auto;
  background-repeat: no-repeat, repeat, repeat, repeat, no-repeat;
  background-blend-mode: multiply, overlay, multiply, normal, normal;
  box-shadow:
    0 1px 0 rgba(220, 190, 150, 0.08) inset,
    0 -2px 5px rgba(0, 0, 0, 0.42) inset,
    0 0 0 1px rgba(0, 0, 0, 0.28) inset,
    var(--cbr-shadow-sm);
  text-decoration: none;
  color: inherit;
}

html[data-cbr='1'] .cbr-service-header__mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(150deg, var(--cbr-orange-hi), var(--cbr-orange) 55%, var(--cbr-orange-deep) 100%);
  color: #1a0c02;
  font-family: var(--cbr-stamp);
  font-weight: 800;
  font-size: 11px;
  box-shadow: var(--cbr-bevel-out);
  border: 2px solid rgba(240, 122, 40, 0.55);
}

html[data-cbr='1'] .cbr-service-header__mark--photo {
  padding: 0;
  background: var(--cbr-plank);
}

html[data-cbr='1'] .cbr-service-header__mark--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

html[data-cbr='1'] .cbr-service-header__mark--empty .cbr-ico {
  width: 18px;
  height: 18px;
  color: #1a0c02;
}

html[data-cbr='1'] .cbr-service-header__body {
  min-width: 0;
  flex: 1;
}

html[data-cbr='1'] .cbr-service-header__line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

html[data-cbr='1'] .cbr-service-header__emp {
  flex: 0 0 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--cbr-ink-mute);
}

html[data-cbr='1'] .cbr-service-header__name {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--cbr-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--cbr-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-cbr='1'] .cbr-service-header__yrs {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--cbr-ink-mute);
  white-space: nowrap;
}

/* ---- Rail peek + auto-hide ----------------------------------------------- */
html[data-cbr='1'] .cbr-rail-peek {
  position: fixed;
  z-index: calc(var(--cbr-z-nav) + 1);
  top: var(--cbr-rail-peek-top, 42%);
  right: 0;
  width: var(--cbr-rail-peek);
  height: 72px;
  border: 1px solid rgba(139, 106, 74, 0.65);
  border-right: none;
  border-radius: 10px 0 0 10px;
  background-color: var(--cbr-leather-mid);
  background-image:
    linear-gradient(125deg, rgba(220, 190, 150, 0.1), transparent 50%),
    var(--cbr-leather-nap),
    var(--cbr-leather-grain-fine),
    var(--cbr-leather-grain),
    linear-gradient(180deg, var(--cbr-leather-hi), var(--cbr-leather) 55%, var(--cbr-leather-deep));
  background-size: auto, 120px 120px, 80px 80px, 120px 120px, auto;
  background-repeat: no-repeat, repeat, repeat, repeat, no-repeat;
  background-blend-mode: multiply, overlay, multiply, normal, normal;
  color: #e8d4b8;
  box-shadow:
    0 1px 0 rgba(220, 190, 150, 0.1) inset,
    0 4px 10px rgba(0, 0, 0, 0.4);
  cursor: grab;
  touch-action: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  appearance: none;
}

html[data-cbr='1'] .cbr-rail-peek.is-dragging {
  cursor: grabbing;
  opacity: 0.95;
  box-shadow:
    0 1px 0 rgba(220, 190, 150, 0.15) inset,
    0 6px 16px rgba(0, 0, 0, 0.55);
}

html[data-cbr='1'] .cbr-rail-peek.is-relocating {
  outline: 2px solid rgba(240, 122, 40, 0.75);
  outline-offset: 1px;
}

html[data-cbr='1'][data-cbr-rail-side='left'] .cbr-rail-peek {
  right: auto;
  left: 0;
  border-radius: 0 10px 10px 0;
  border-right: 1px solid rgba(240, 122, 40, 0.35);
  border-left: none;
}

html[data-cbr='1'] .cbr-rail-peek__chev {
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

html[data-cbr='1'][data-cbr-rail='open'] .cbr-rail-peek {
  opacity: 0;
  pointer-events: none;
}

/* Outer panel housing — brushed suede strap (matte bolt-bag feel) */
html[data-cbr='1'] .cbr-rail {
  position: fixed;
  z-index: var(--cbr-z-nav);
  top: 12%;
  bottom: 12%;
  right: 10px;
  width: var(--cbr-rail-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 10px;
  border-radius: 999px;
  overflow: visible;
  background-color: var(--cbr-leather-mid);
  background-image:
    /* matte nap patches on strap */
    radial-gradient(ellipse 48px 72px at 30% 35%, rgba(154, 120, 88, 0.14), transparent 70%),
    radial-gradient(ellipse 52px 68px at 68% 72%, rgba(55, 36, 24, 0.1), transparent 65%),
    var(--cbr-leather-nap),
    var(--cbr-leather-grain-fine),
    var(--cbr-leather-grain),
    var(--cbr-leather-base);
  background-size: auto, auto, 130px 130px, 90px 90px, 130px 130px, auto;
  background-repeat: no-repeat, no-repeat, repeat, repeat, repeat, no-repeat;
  background-blend-mode: normal, normal, overlay, multiply, normal, normal;
  border: 1px solid rgba(139, 106, 74, 0.78);
  box-shadow:
    0 1px 0 rgba(220, 190, 150, 0.1) inset,
    0 -2px 6px rgba(0, 0, 0, 0.48) inset,
    0 0 0 1px rgba(0, 0, 0, 0.32) inset,
    0 10px 28px rgba(0, 0, 0, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s ease, opacity 0.18s ease;
  transform: translateX(120%);
  opacity: 0;
  pointer-events: none;
}

/* Recessed burnished groove the switches sit in */
html[data-cbr='1'] .cbr-rail::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: 10px;
  bottom: 10px;
  left: 50%;
  width: 68px;
  transform: translateX(-50%);
  border-radius: 999px;
  border: 1.5px solid rgba(154, 120, 88, 0.48);
  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.65) 0%,
      rgba(45, 30, 20, 0.92) 40%,
      rgba(28, 18, 12, 0.95) 60%,
      rgba(0, 0, 0, 0.7) 100%
    );
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55) inset,
    0 0 14px rgba(0, 0, 0, 0.75) inset,
    0 1px 0 rgba(220, 190, 150, 0.06) inset;
  pointer-events: none;
}

/* Bolt-bag stitch — cream/tan contrasting thread (functional double-stitch) */
html[data-cbr='1'] .cbr-rail::after {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 5px;
  border-radius: 999px;
  border: 1.5px dashed rgba(245, 230, 200, 0.82);
  box-shadow:
    /* inner punch groove */
    inset 0 0 0 2px rgba(0, 0, 0, 0.14),
    /* inner contrasting stitch line */
    inset 0 0 0 3.5px rgba(245, 230, 200, 0.28),
    /* outer edge catch — matte suede, no wax gloss */
    0 0 0 1px rgba(139, 106, 74, 0.28),
    0 0 0 2px rgba(0, 0, 0, 0.16);
  pointer-events: none;
  opacity: 0.9;
}

html[data-cbr='1'][data-cbr-rail-side='left'] .cbr-rail {
  right: auto;
  left: 10px;
  transform: translateX(-120%);
}

html[data-cbr='1'][data-cbr-rail='open'] .cbr-rail {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/*
 * Panel-mount switch — matte plastic, linear studio light (upper-left).
 * No radial “rings”; bezel is a soft well; face has a short cylinder wall.
 */
html[data-cbr='1'] .cbr-rail__notch {
  appearance: none;
  box-sizing: border-box;
  border: none;
  background: transparent;
  width: var(--cbr-rail-notch);
  height: var(--cbr-rail-notch);
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  z-index: 1;
  position: relative;
  cursor: pointer;
  color: var(--cbr-ink);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html[data-cbr='1'] .cbr-rail__notch-bezel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  /* Quiet housing — light catch on top edge only */
  background: linear-gradient(160deg, #2c333c 0%, #15191f 55%, #0a0c0f 100%);
  border: 1px solid rgba(240, 122, 40, 0.38);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 3px 5px rgba(0, 0, 0, 0.55) inset,
    0 2px 4px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

html[data-cbr='1'] .cbr-rail__notch-face {
  position: absolute;
  z-index: 1;
  inset: var(--cbr-switch-gap);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  /* Linear falloff only — avoids ring / half-moon artifacts */
  background: linear-gradient(
    155deg,
    #7a8492 0%,
    #4e5866 28%,
    #2c333c 58%,
    #1a1f26 82%,
    #12151a 100%
  );
  border: none;
  transform: translate3d(0, calc(var(--cbr-rail-lift) * -1), 0);
  box-shadow:
    /* face volume */
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 4px 8px rgba(255, 255, 255, 0.05) inset,
    0 -3px 6px rgba(0, 0, 0, 0.45) inset,
    1px 2px 4px rgba(0, 0, 0, 0.25) inset,
    /* short matte cylinder wall under the cap */
    0 1px 0 #252a32,
    0 2px 0 #1c2128,
    0 3px 0 #15191f,
    0 4px 0 #10141a,
    0 5px 0 #0c0f14,
    0 6px 0 #080a0e,
    0 7px 0 #050608,
    /* contact shadow on bezel */
    0 8px 10px rgba(0, 0, 0, 0.55),
    1px 10px 14px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.18s cubic-bezier(0.34, 1.4, 0.64, 1),
    box-shadow 0.18s cubic-bezier(0.34, 1.2, 0.64, 1),
    background 0.12s ease;
}

html[data-cbr='1'] .cbr-rail__notch.is-active .cbr-rail__notch-face {
  background: linear-gradient(
    155deg,
    #ffc898 0%,
    var(--cbr-orange-hi) 26%,
    var(--cbr-orange) 58%,
    var(--cbr-orange-deep) 88%,
    #9a4210 100%
  );
  color: #1a0c02;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 4px 8px rgba(255, 230, 180, 0.12) inset,
    0 -3px 6px rgba(80, 30, 0, 0.4) inset,
    1px 2px 4px rgba(60, 20, 0, 0.25) inset,
    0 1px 0 #d46818,
    0 2px 0 #b85612,
    0 3px 0 #9a4210,
    0 4px 0 #7a340c,
    0 5px 0 #5c2608,
    0 6px 0 #3e1a04,
    0 7px 0 #2a1002,
    0 8px 10px rgba(0, 0, 0, 0.5),
    1px 10px 16px rgba(240, 122, 40, 0.22);
}

html[data-cbr='1'] .cbr-rail__notch.is-active .cbr-rail__notch-bezel {
  border-color: rgba(255, 180, 100, 0.55);
}

html[data-cbr='1'] .cbr-rail__notch:active .cbr-rail__notch-face,
html[data-cbr='1'] .cbr-rail__notch.is-pressed .cbr-rail__notch-face {
  transform: translate3d(0, 0, 0);
  background: linear-gradient(
    175deg,
    #2a303a 0%,
    #1a1f26 45%,
    #12151a 100%
  );
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.6) inset,
    0 1px 2px rgba(0, 0, 0, 0.45) inset,
    0 0 0 transparent;
  transition: transform 0.07s ease-out, box-shadow 0.07s ease-out, background 0.07s ease-out;
}

html[data-cbr='1'] .cbr-rail__notch.is-active:active .cbr-rail__notch-face,
html[data-cbr='1'] .cbr-rail__notch.is-active.is-pressed .cbr-rail__notch-face {
  background: linear-gradient(
    175deg,
    var(--cbr-orange) 0%,
    var(--cbr-orange-deep) 55%,
    #8a3a0c 100%
  );
}

html[data-cbr='1'] .cbr-rail__notch .cbr-ico {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
  opacity: 0.95;
}

html[data-cbr='1'] .cbr-rail__notch.is-active .cbr-ico {
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.2)) drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
  opacity: 1;
}

html[data-cbr='1'] .cbr-rail__notch--emphasis {
  width: var(--cbr-rail-notch-hi);
  height: var(--cbr-rail-notch-hi);
}

html[data-cbr='1'] .cbr-rail__notch--emphasis .cbr-rail__notch-face {
  background: linear-gradient(
    155deg,
    #5a6470 0%,
    #343b45 35%,
    #1c2128 70%,
    #0e1116 100%
  );
}

/* Full CraftBelt mark — same lighting language, room for wordmark */
html[data-cbr='1'] .cbr-rail__notch--logo .cbr-rail__notch-face {
  inset: 3px;
  padding: 5px;
  background: linear-gradient(
    155deg,
    #3a424e 0%,
    #1c2128 50%,
    #0e1116 100%
  );
}

html[data-cbr='1'] .cbr-rail__notch-logo {
  width: 92%;
  height: 92%;
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0 auto;
  pointer-events: none;
}

html[data-cbr='1'] .cbr-rail__notch-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
  text-align: center;
  max-width: 92%;
  overflow: hidden;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
}

/* Two-line wrap for longer names (Approvals / Schedule) inside the circle */
html[data-cbr='1'] .cbr-rail__notch-label--wrap {
  font-size: 7.5px;
  letter-spacing: 0.02em;
  line-height: 1.05;
  gap: 0;
}

html[data-cbr='1'] .cbr-rail__notch-label-line {
  display: block;
  max-width: 100%;
}

html[data-cbr='1'] .cbr-rail__notch.is-active .cbr-rail__notch-label {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 1px rgba(0, 0, 0, 0.3);
}

html[data-cbr='1'] .cbr-rail__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cbr-amber-hi), var(--cbr-amber));
  color: #1c1002;
  font-size: 9.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--cbr-void);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* ---- Notch sheet (Lead / Tools / Me groups) ------------------------------ */
.cbr-notch-backdrop {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(5, 7, 9, 0.6);
}

.cbr-notch-sheet {
  position: fixed;
  z-index: var(--cbr-z-sheet);
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--cbr-plank);
  border-top: 1px solid rgba(240, 122, 40, 0.25);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--cbr-shadow);
  padding: 6px 4px 14px;
  max-height: 70dvh;
  overflow: auto;
}

.cbr-notch-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  font-family: var(--cbr-display);
  font-size: 15px;
  color: var(--cbr-ink);
}

.cbr-notch-sheet__close {
  appearance: none;
  border: none;
  background: var(--cbr-raised);
  color: var(--cbr-ink-mute);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
}

.cbr-notch-sheet__list {
  display: flex;
  flex-direction: column;
}

.cbr-notch-sheet__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--cbr-ink);
  font-size: 14px;
  font-weight: 600;
}

.cbr-notch-sheet__item .cbr-ico {
  width: 22px;
  height: 22px;
  color: var(--cbr-orange-hi);
}

.cbr-notch-sheet__item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cbr-notch-sheet__item:active {
  background: var(--cbr-raised);
}

.cbr-notch-sheet__hint {
  font-size: 11.5px;
  color: var(--cbr-ink-faint);
  font-weight: 400;
}

/* ---- Act-as bar + offline badge ------------------------------------------ */
.cbr-actas-bar {
  position: fixed;
  top: max(10px, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--cbr-z-toast);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--cbr-amber);
  color: #1c1002;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: var(--cbr-shadow-sm);
  max-width: min(calc(100% - 48px), 360px);
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .cbr-actas-bar {
    top: max(8px, calc(env(safe-area-inset-top, 0px) + 4px));
    font-size: 11px;
    padding: 5px 10px;
    max-width: calc(100% - 56px);
  }
}

.cbr-actas-bar__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1c1002;
  flex: 0 0 auto;
}

.cbr-actas-bar__exit {
  color: #1c1002;
  text-decoration: underline;
}

.cbr-offline-badge {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--cbr-z-toast);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--cbr-bad);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: var(--cbr-shadow-sm);
}

/* ---- Approval Desk / Scheduler — same phone column as Time Desk --------- */
/* Shell is flex-row by default; desk content must be a column via .cbr-main
   or the week list collapses into a thin empty strip. Never widen past
   .cbr-shell max-width (480px) — home, Approvals, and Scheduler share it. */
html[data-cbr-desk='1'] .cbr-shell {
  flex-direction: column;
  width: 100%;
  max-width: min(480px, 100%);
}

html[data-cbr-desk='1'] .cbr-desk-main {
  width: 100%;
  max-width: 100%;
  padding-bottom: 28px;
}
