/*
 * Titan Lock — counter.css (counter shell, phone layout, bottom nav — no print CSS). Owner: WS5-M2.
 * Registered on every panel by the S0 seam (ConfiguresTitanPanel). Styles only this module's own
 * .tl-* classes: the counter shell (R1 home, R12 Keys, R14 Shop, bottom nav), the shared Help /
 * Terms pages, the mPIN unlock boxes and the "set an mPIN" banner (portal + counter).
 * Panel-specific rules are scoped under .fi-panel-counter. Plain CSS (no Tailwind build).
 * After an edit run `php artisan filament:assets` — the panels serve the published copy in
 * public/css/app/.
 */

/* ── Counter panel: phone-first basics (16-px inputs = no iOS zoom, ≥ 44-px tap targets) ── */
.fi-panel-counter input,
.fi-panel-counter select,
.fi-panel-counter textarea {
  font-size: 16px;
}
.fi-panel-counter .fi-btn,
.fi-panel-counter .fi-link,
.fi-panel-counter .fi-tabs-item {
  min-height: 44px;
}

/* Room for the fixed bottom nav below 1024 px. */
@media (max-width: 1023.98px) {
  .fi-panel-counter .fi-main {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* ── mPIN boxes (unlock + set mPIN): masked digits, big targets ── */
.tl-mpin-boxes .fi-one-time-code-input-digit {
  -webkit-text-security: disc;
  font-size: 1.375rem;
  min-height: 3rem;
  text-align: center;
}

/* ── "Set an mPIN" banner (portal + counter, users without an mPIN) ── */
.tl-mpin-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--tl-radius-md);
  background: var(--tl-orange-50);
  border: 1px solid var(--tl-orange-100);
  color: var(--tl-ink-900);
  font-size: 0.875rem;
}
.tl-mpin-banner__icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  color: var(--tl-orange-700);
}
.tl-mpin-banner__text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1 1 16rem;
}
.tl-mpin-banner__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1rem;
  border-radius: var(--tl-radius-sm);
  background: var(--tl-orange-700);
  color: #FFFFFF;
  font-weight: 600;
  text-decoration: none;
}

/* ── Bottom nav (BODY_END): fixed below 1024 px, in the page flow above it ── */
.tl-bottom-nav [x-cloak] {
  display: none !important;
}
.tl-bottom-nav__bar {
  position: relative;
  z-index: 60; /* stays above the More sheet's backdrop, so "More" closes it again */
  display: flex;
  justify-content: space-around;
  margin: 0;
  padding: 0.25rem 0.25rem calc(0.25rem + env(safe-area-inset-bottom, 0px));
  list-style: none;
  background: #FFFFFF;
  border-top: 1px solid var(--tl-steel-200);
}
.tl-bottom-nav__bar > li {
  flex: 1 1 0;
  display: flex;
}
.tl-bottom-nav__item {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  min-height: 56px;
  padding: 0.25rem;
  border: 0;
  background: transparent;
  color: var(--tl-steel-500);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.tl-bottom-nav__item--active {
  color: var(--tl-orange-700);
}
.tl-bottom-nav__icon {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
}
.tl-bottom-nav__backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(11, 37, 33, 0.35);
}
.tl-bottom-nav__sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(4rem + env(safe-area-inset-bottom, 0px)); /* opens just above the bar */
  z-index: 50;
  max-height: 75vh;
  overflow-y: auto;
  padding: 0.75rem;
  border-radius: var(--tl-radius-lg) var(--tl-radius-lg) 0 0;
  background: #FFFFFF;
  box-shadow: var(--tl-shadow-3);
}
.tl-bottom-nav__sheet-list {
  margin: 0 auto;
  padding: 0;
  max-width: 40rem;
  list-style: none;
  display: grid;
  gap: 0.25rem;
}
.tl-bottom-nav__sheet-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 48px;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: var(--tl-radius-sm);
  background: transparent;
  color: var(--tl-ink-900);
  font: inherit;
  font-size: 0.9375rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.tl-bottom-nav__sheet-item:hover {
  background: var(--tl-steel-50);
}
.tl-bottom-nav__sheet-item--danger {
  color: var(--tl-lock-fg);
}
@media (max-width: 1023.98px) {
  .tl-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30; /* below Filament modals and toasts */
  }
  .tl-bottom-nav__bar {
    box-shadow: 0 -2px 8px rgba(11, 37, 33, 0.06);
  }
}
@media (min-width: 1024px) {
  .tl-bottom-nav__bar {
    max-width: 40rem;
    margin: 1.5rem auto;
    border: 1px solid var(--tl-steel-200);
    border-radius: var(--tl-radius-md);
  }
  .tl-bottom-nav__sheet {
    left: 50%;
    right: auto;
    bottom: 0;
    width: 40rem;
    transform: translateX(-50%);
    padding-bottom: 1rem;
  }
}

/* ── Shared counter atoms (cards, rows, banners, empty states) ── */
.tl-counter-card {
  display: block;
  padding: 0.875rem 1rem;
  border-radius: var(--tl-radius-md);
  border: 1px solid var(--tl-steel-200);
  background: #FFFFFF;
}
.tl-counter-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.tl-counter-card__title {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--tl-ink-900);
}
.tl-counter-card__link {
  color: var(--tl-orange-700);
  font-weight: 600;
  text-decoration: none;
}
.tl-counter-card__link:hover {
  text-decoration: underline;
}
.tl-counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-top: 1px solid var(--tl-steel-100);
}
.tl-counter-card__head + .tl-counter-row,
.tl-counter-card__title + .tl-counter-row {
  border-top: 0;
}
.tl-counter-row__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tl-counter-row__title {
  font-weight: 600;
  color: var(--tl-ink-900);
  overflow-wrap: break-word;
}
.tl-counter-row__sub {
  font-size: 0.8125rem;
  color: var(--tl-steel-500);
}
.tl-counter-row__side {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
}
.tl-counter-delta {
  flex: none;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tl-counter-delta--plus {
  color: var(--tl-green-700);
}
.tl-counter-delta--minus {
  color: var(--tl-lock-fg);
}
.tl-counter-banner {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--tl-radius-md);
  font-size: 0.875rem;
  line-height: 1.4;
}
.tl-counter-banner__icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
}
.tl-counter-banner > span {
  flex: 1 1 14rem;
}
.tl-counter-banner--frozen {
  background: var(--tl-warn-bg);
  color: var(--tl-warn-fg);
}
/* Key gold is only for the key economy (brand rule 4). */
.tl-counter-banner--keys {
  background: var(--tl-gold-50);
  color: var(--tl-gold-700);
  box-shadow: inset 0 0 0 1px var(--tl-gold-400);
}
.tl-counter-banner__link {
  font-weight: 700;
  color: inherit;
}
.tl-counter-empty {
  margin: 0.25rem 0;
  color: var(--tl-steel-500);
  font-size: 0.875rem;
}
.tl-counter-footnote {
  text-align: center;
  font-size: 0.8125rem;
}

/* ── R1 counter home ── */
.tl-counter-shop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.tl-counter-shop__name {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tl-counter-shop__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--tl-ink-900);
  overflow-wrap: anywhere;
}
.tl-counter-shop__tier {
  font-size: 0.8125rem;
}
.tl-counter-shop__keys {
  flex: none;
  min-height: 36px;
  font-size: 0.875rem;
  text-decoration: none;
}
.tl-counter-find {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 48px;
  padding: 0 1rem;
  border-radius: var(--tl-radius-md);
  border: 1px solid var(--tl-steel-200);
  background: #FFFFFF;
  color: var(--tl-steel-500);
  text-decoration: none;
}
.tl-counter-find__icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
}
.tl-counter-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.625rem;
}
.tl-counter-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 96px;
  padding: 0.75rem 0.5rem;
  border-radius: var(--tl-radius-md);
  border: 1px solid var(--tl-steel-200);
  background: #FFFFFF;
  color: var(--tl-ink-900);
  font-weight: 600;
  font-size: 0.875rem;
  text-align: center;
  text-decoration: none;
}
.tl-counter-tile__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--tl-radius-sm);
  background: var(--tl-steel-100);
  color: var(--tl-ink-800);
}
.tl-counter-tile__icon svg {
  width: 1.375rem;
  height: 1.375rem;
}
.tl-counter-tile--primary {
  background: var(--tl-orange-700);
  border-color: var(--tl-orange-700);
  color: #FFFFFF;
}
.tl-counter-tile--primary .tl-counter-tile__icon {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}
.tl-counter-tile--disabled {
  background: var(--tl-steel-50);
  color: var(--tl-steel-400);
  cursor: not-allowed;
}
.tl-counter-tile__reason {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--tl-steel-500);
}
@media (max-width: 359.98px) {
  .tl-counter-tiles {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── R12 Keys ── */
.tl-counter-balance {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1rem;
  border-radius: var(--tl-radius-md);
  background: var(--tl-gold-50);
  box-shadow: inset 0 0 0 1px var(--tl-gold-400);
  text-align: center;
}
.tl-counter-balance__label,
.tl-counter-balance__note {
  color: var(--tl-gold-700);
  font-size: 0.8125rem;
}
.tl-counter-balance__value {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--tl-gold-700);
  font-size: 2.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.tl-counter-balance__icon {
  width: 2rem;
  height: 2rem;
  color: var(--tl-gold-600);
}

/* ── R14 Shop ── */
.tl-counter-profile {
  text-align: center;
}
.tl-counter-profile__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 0.5rem;
  border-radius: var(--tl-radius-pill);
  background: var(--tl-ink-800);
  color: #FFFFFF;
  font-size: 1.25rem;
  font-weight: 700;
}
.tl-counter-profile__name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--tl-ink-900);
}
.tl-counter-profile__sub {
  margin: 0.25rem 0 0;
  color: var(--tl-steel-500);
  font-size: 0.875rem;
}
.tl-counter-kv {
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
.tl-counter-kv > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.tl-counter-kv dt {
  color: var(--tl-steel-500);
  font-size: 0.875rem;
}
.tl-counter-kv dd {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  color: var(--tl-ink-900);
  overflow-wrap: anywhere;
}
.tl-counter-kv__hint {
  color: var(--tl-steel-500);
  font-size: 0.75rem;
}
.tl-counter-links {
  padding: 0.25rem 1rem;
}
.tl-counter-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0.5rem 0;
  border-top: 1px solid var(--tl-steel-100);
  color: var(--tl-ink-900);
  text-decoration: none;
}
.tl-counter-link:first-child {
  border-top: 0;
}
.tl-counter-link__icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  color: var(--tl-steel-500);
}
.tl-counter-link__text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  font-weight: 600;
}
.tl-counter-link__text small {
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--tl-steel-500);
}
.tl-counter-link__chev {
  width: 1rem;
  height: 1rem;
  flex: none;
  color: var(--tl-steel-400);
}
.tl-counter-logout {
  display: flex;
  justify-content: center;
}
.tl-counter-logout__button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1.25rem;
  border: 1.5px solid var(--tl-lock-bg);
  border-radius: var(--tl-radius-sm);
  background: #FFFFFF;
  color: var(--tl-lock-fg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* ── E6 Help + Terms (portal + counter) ── */
.tl-help__guides {
  display: grid;
  gap: 0.5rem;
}
.tl-help__summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-weight: 700;
  color: var(--tl-ink-900);
  cursor: pointer;
  list-style: none;
}
.tl-help__summary::-webkit-details-marker {
  display: none;
}
/* Open / closed marker (the flex summary hides the browser's own triangle). */
.tl-help__summary::after {
  content: "+";
  flex: none;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--tl-steel-500);
}
details[open] > .tl-help__summary::after {
  content: "\2212";
}
.tl-help__text {
  margin: 0.375rem 0 0;
  color: var(--tl-ink-800);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.tl-help__videos {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.375rem;
}
.tl-terms__body {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--tl-ink-800);
  overflow-wrap: anywhere;
}
.tl-terms__body h1,
.tl-terms__body h2 {
  margin: 1rem 0 0.375rem;
  font-weight: 700;
  color: var(--tl-ink-900);
}
.tl-terms__body h1 {
  font-size: 1.125rem;
}
.tl-terms__body h2 {
  font-size: 1rem;
}
.tl-terms__body p,
.tl-terms__body ul,
.tl-terms__body ol {
  margin: 0.375rem 0;
}
.tl-terms__body ul,
.tl-terms__body ol {
  padding-left: 1.25rem;
}
.tl-terms__body ul {
  list-style: disc;
}
.tl-terms__body ol {
  list-style: decimal;
}
