/*
===============================================================================
ASKCARBI FUTURISTIC ORGANIZED HOME V2
===============================================================================
Organized, scrollable customer command center.
Existing ASKCARBI systems remain underneath and unchanged.
===============================================================================
*/

:root {
  --cfh-blue: #1679ff;
  --cfh-blue-light: #69b8ff;
  --cfh-cyan: #42e8ff;
  --cfh-indigo: #3858ff;
  --cfh-navy: #071525;
  --cfh-navy-soft: #10263f;
  --cfh-panel: rgba(8, 26, 47, 0.82);
  --cfh-panel-light: rgba(17, 44, 73, 0.78);
  --cfh-border: rgba(100, 203, 255, 0.24);
  --cfh-text: #f4fbff;
  --cfh-muted: #a9c0d4;
  --cfh-success: #4fffc1;
  --cfh-warning: #ffd76b;
  --cfh-danger: #ff6b83;
  --cfh-safe-top: env(safe-area-inset-top, 0px);
  --cfh-safe-bottom: env(safe-area-inset-bottom, 0px);
}

html.cfh-home-open,
body.cfh-home-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

#carbi-futuristic-home,
#carbi-futuristic-home * {
  box-sizing: border-box;
}

#carbi-futuristic-home {
  position: fixed;
  inset: 0;
  z-index: 7000;
  display: none;
  width: 100%;
  height: 100dvh;
  color: var(--cfh-text);
  background:
    radial-gradient(
      circle at 50% -10%,
      rgba(45, 145, 255, 0.32),
      transparent 38%
    ),
    radial-gradient(
      circle at 100% 45%,
      rgba(38, 220, 255, 0.13),
      transparent 42%
    ),
    radial-gradient(
      circle at 0% 80%,
      rgba(61, 86, 255, 0.16),
      transparent 42%
    ),
    linear-gradient(
      155deg,
      #06111f 0%,
      #081a2c 48%,
      #06101c 100%
    );
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  isolation: isolate;
}

#carbi-futuristic-home[data-open="true"] {
  display: flex;
}

#carbi-futuristic-home::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  pointer-events: none;
  opacity: 0.24;
  background-image:
    linear-gradient(
      rgba(104, 201, 255, 0.06) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(104, 201, 255, 0.06) 1px,
      transparent 1px
    );
  background-size: 34px 34px;
  mask-image:
    linear-gradient(
      to bottom,
      black,
      transparent 92%
    );
}

#carbi-futuristic-home::after {
  position: absolute;
  top: -180px;
  left: 50%;
  z-index: -1;
  width: 560px;
  height: 560px;
  content: "";
  pointer-events: none;
  border-radius: 50%;
  transform: translateX(-50%);
  background:
    radial-gradient(
      circle,
      rgba(56, 170, 255, 0.2),
      rgba(56, 170, 255, 0) 68%
    );
  filter: blur(12px);
}

.cfh-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(100%, 1160px);
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
}

.cfh-header {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding:
    calc(14px + var(--cfh-safe-top))
    18px
    13px;
  border-bottom: 1px solid rgba(105, 197, 255, 0.14);
  background:
    linear-gradient(
      180deg,
      rgba(4, 17, 31, 0.97),
      rgba(7, 23, 40, 0.86)
    );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.cfh-brand {
  display: flex;
  min-width: 0;
  gap: 12px;
  align-items: center;
}

.cfh-brand-core {
  position: relative;
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  overflow: visible;
  border: 1px solid rgba(111, 225, 255, 0.65);
  border-radius: 17px;
  color: white;
  background:
    radial-gradient(
      circle at 34% 25%,
      #82efff,
      #177dff 48%,
      #214ee5 100%
    );
  box-shadow:
    0 0 0 5px rgba(30, 143, 255, 0.09),
    0 0 25px rgba(42, 190, 255, 0.38),
    inset 0 0 14px rgba(255, 255, 255, 0.22);
  font-size: 25px;
  font-weight: 800;
}

.cfh-brand-core::after {
  position: absolute;
  inset: -7px;
  content: "";
  border: 1px solid rgba(83, 209, 255, 0.2);
  border-radius: 22px;
  animation: cfh-core-pulse 2.8s ease-in-out infinite;
}

@keyframes cfh-core-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.96);
  }

  50% {
    opacity: 0.95;
    transform: scale(1.05);
  }
}

.cfh-brand-copy {
  min-width: 0;
}

.cfh-brand-copy strong {
  display: block;
  overflow: hidden;
  color: #ffffff;
  font-size: 18px;
  font-weight: 790;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cfh-brand-copy span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--cfh-muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cfh-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cfh-icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(116, 203, 255, 0.2);
  border-radius: 14px;
  color: white;
  background:
    linear-gradient(
      145deg,
      rgba(34, 75, 113, 0.78),
      rgba(10, 32, 56, 0.88)
    );
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.06),
    0 8px 20px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cfh-icon-button:active {
  transform: scale(0.96);
}

.cfh-main {
  position: relative;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color:
    rgba(68, 185, 255, 0.55)
    transparent;
  -webkit-overflow-scrolling: touch;
}

.cfh-main-inner {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding:
    19px
    18px
    110px;
}

.cfh-welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.cfh-welcome-copy {
  min-width: 0;
}

.cfh-eyebrow {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 7px;
  color: #76d8ff;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.cfh-eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--cfh-success);
  box-shadow:
    0 0 11px rgba(79, 255, 193, 0.9);
}

.cfh-welcome h1 {
  margin: 0;
  color: white;
  font-size: clamp(24px, 5.8vw, 38px);
  font-weight: 820;
  line-height: 1.07;
  letter-spacing: -0.035em;
}

.cfh-welcome h1 span {
  color: #62d8ff;
}

.cfh-welcome p {
  max-width: 620px;
  margin: 9px 0 0;
  color: var(--cfh-muted);
  font-size: 13px;
  line-height: 1.5;
}

.cfh-status-orb {
  position: relative;
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border: 1px solid rgba(111, 227, 255, 0.25);
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      rgba(65, 224, 255, 0.33),
      rgba(30, 112, 255, 0.13) 42%,
      rgba(8, 27, 49, 0.12) 69%
    );
  box-shadow:
    0 0 28px rgba(37, 181, 255, 0.28);
}

.cfh-status-orb::before,
.cfh-status-orb::after {
  position: absolute;
  inset: 8px;
  content: "";
  border: 1px solid rgba(108, 221, 255, 0.34);
  border-radius: 50%;
  animation: cfh-orbit 6s linear infinite;
}

.cfh-status-orb::after {
  inset: 17px;
  border-style: dashed;
  animation-duration: 4.2s;
  animation-direction: reverse;
}

.cfh-status-orb strong {
  z-index: 1;
  font-size: 26px;
  text-shadow:
    0 0 14px rgba(84, 221, 255, 0.9);
}

@keyframes cfh-orbit {
  to {
    transform: rotate(360deg);
  }
}

.cfh-search-wrap {
  position: sticky;
  top: 0;
  z-index: 12;
  margin: 0 -6px 18px;
  padding: 7px 6px 9px;
  background:
    linear-gradient(
      180deg,
      rgba(7, 21, 38, 0.97),
      rgba(7, 21, 38, 0.86) 78%,
      transparent
    );
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.cfh-search {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-height: 58px;
  padding: 7px 8px;
  border: 1px solid rgba(111, 212, 255, 0.27);
  border-radius: 19px;
  background:
    linear-gradient(
      145deg,
      rgba(20, 53, 85, 0.92),
      rgba(9, 30, 52, 0.94)
    );
  box-shadow:
    0 16px 35px rgba(0, 0, 0, 0.22),
    inset 0 1px rgba(255, 255, 255, 0.06);
}

.cfh-search-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #aeeeff;
  background: rgba(35, 134, 214, 0.16);
  font-size: 20px;
}

.cfh-search input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 5px;
  border: 0;
  outline: 0;
  color: white;
  background: transparent;
  font: inherit;
  font-size: 16px;
}

.cfh-search input::placeholder {
  color: #8da6bc;
}

.cfh-search button {
  min-width: 48px;
  height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(105, 224, 255, 0.4);
  border-radius: 14px;
  color: white;
  background:
    linear-gradient(
      135deg,
      #278dff,
      #425eff
    );
  box-shadow:
    0 8px 18px rgba(34, 105, 255, 0.28);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.cfh-search-results {
  display: none;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(95, 204, 255, 0.23);
  border-radius: 16px;
  background: rgba(6, 22, 39, 0.97);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.34);
}

.cfh-search-results[data-open="true"] {
  display: block;
}

.cfh-search-result {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid rgba(100, 197, 255, 0.09);
  color: white;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.cfh-search-result:last-child {
  border-bottom: 0;
}

.cfh-search-result:hover,
.cfh-search-result:focus-visible {
  background: rgba(42, 140, 215, 0.14);
}

.cfh-search-result-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  background: rgba(41, 144, 224, 0.17);
  font-size: 18px;
}

.cfh-search-result-copy {
  min-width: 0;
}

.cfh-search-result-copy strong,
.cfh-search-result-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cfh-search-result-copy strong {
  font-size: 13px;
}

.cfh-search-result-copy span {
  margin-top: 3px;
  color: var(--cfh-muted);
  font-size: 11px;
}

.cfh-search-empty {
  padding: 16px;
  color: var(--cfh-muted);
  font-size: 13px;
  text-align: center;
}

.cfh-primary-actions {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.cfh-primary-action {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 92px;
  padding: 14px 11px 12px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(94, 204, 255, 0.2);
  border-radius: 19px;
  color: white;
  text-align: center;
  background:
    linear-gradient(
      145deg,
      rgba(25, 64, 98, 0.76),
      rgba(9, 30, 52, 0.92)
    );
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.05),
    0 12px 26px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cfh-primary-action::before {
  position: absolute;
  inset: auto -25% -50% -25%;
  height: 70%;
  content: "";
  background:
    radial-gradient(
      ellipse,
      rgba(44, 174, 255, 0.19),
      transparent 68%
    );
}

.cfh-primary-action:active,
.cfh-tool-card:active {
  transform: scale(0.975);
}

.cfh-primary-action span {
  position: relative;
  display: grid;
  width: 39px;
  height: 39px;
  margin-bottom: 7px;
  place-items: center;
  border-radius: 14px;
  background:
    linear-gradient(
      145deg,
      rgba(49, 172, 255, 0.32),
      rgba(48, 84, 255, 0.2)
    );
  box-shadow:
    0 0 18px rgba(55, 182, 255, 0.17);
  font-size: 20px;
}

.cfh-primary-action strong {
  position: relative;
  display: block;
  overflow: hidden;
  max-width: 100%;
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cfh-category {
  margin-bottom: 22px;
}

.cfh-category-header {
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 11px;
}

.cfh-category-heading {
  min-width: 0;
}

.cfh-category-heading small {
  display: block;
  margin-bottom: 4px;
  color: #6edaff;
  font-size: 9px;
  font-weight: 780;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cfh-category-heading h2 {
  margin: 0;
  color: white;
  font-size: 17px;
  font-weight: 780;
  letter-spacing: -0.015em;
}

.cfh-category-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(99, 203, 255, 0.16);
  border-radius: 999px;
  color: #94bfd7;
  background: rgba(31, 74, 108, 0.2);
  font-size: 10px;
}

.cfh-tools-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cfh-tool-card {
  position: relative;
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) 20px;
  gap: 11px;
  align-items: center;
  min-width: 0;
  min-height: 82px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(100, 204, 255, 0.17);
  border-radius: 18px;
  color: white;
  text-align: left;
  background:
    linear-gradient(
      145deg,
      rgba(18, 49, 79, 0.76),
      rgba(8, 28, 48, 0.9)
    );
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.04),
    0 11px 24px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.cfh-tool-card:hover {
  border-color: rgba(101, 218, 255, 0.37);
  background:
    linear-gradient(
      145deg,
      rgba(24, 66, 104, 0.84),
      rgba(8, 31, 54, 0.94)
    );
}

.cfh-tool-icon {
  position: relative;
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border: 1px solid rgba(113, 220, 255, 0.17);
  border-radius: 15px;
  background:
    linear-gradient(
      145deg,
      rgba(41, 154, 235, 0.23),
      rgba(50, 91, 255, 0.14)
    );
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.07);
  font-size: 21px;
}

.cfh-tool-copy {
  min-width: 0;
}

.cfh-tool-copy strong {
  display: block;
  overflow: hidden;
  color: white;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cfh-tool-copy span {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  color: var(--cfh-muted);
  font-size: 10.5px;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cfh-tool-arrow {
  color: #67cbff;
  font-size: 19px;
}

.cfh-tool-card[data-coming-soon="true"] {
  opacity: 0.66;
}

.cfh-tool-card[data-coming-soon="true"]::after {
  position: absolute;
  top: 7px;
  right: 8px;
  padding: 3px 6px;
  content: "SOON";
  border: 1px solid rgba(255, 217, 106, 0.22);
  border-radius: 999px;
  color: #ffe08d;
  background: rgba(98, 73, 19, 0.24);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.cfh-footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns:
    repeat(5, minmax(0, 1fr));
  gap: 5px;
  padding:
    8px
    11px
    calc(8px + var(--cfh-safe-bottom));
  border-top: 1px solid rgba(100, 201, 255, 0.17);
  background: rgba(5, 19, 34, 0.93);
  box-shadow:
    0 -15px 35px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.cfh-footer button {
  display: grid;
  min-width: 0;
  min-height: 53px;
  padding: 6px 4px;
  place-items: center;
  border: 0;
  border-radius: 14px;
  color: #86a4bc;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cfh-footer button[data-active="true"] {
  color: white;
  background:
    linear-gradient(
      145deg,
      rgba(43, 143, 224, 0.2),
      rgba(45, 78, 220, 0.15)
    );
  box-shadow:
    inset 0 0 0 1px
      rgba(86, 201, 255, 0.16);
}

.cfh-footer button span {
  display: block;
  font-size: 19px;
}

.cfh-footer button small {
  display: block;
  max-width: 100%;
  margin-top: 3px;
  overflow: hidden;
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cfh-toast {
  position: fixed;
  right: 18px;
  bottom:
    calc(82px + var(--cfh-safe-bottom));
  left: 18px;
  z-index: 7020;
  display: none;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 15px;
  border: 1px solid rgba(105, 218, 255, 0.28);
  border-radius: 15px;
  color: white;
  text-align: center;
  background: rgba(8, 33, 55, 0.97);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.32);
  font-size: 12px;
}

.cfh-toast[data-open="true"] {
  display: block;
  animation: cfh-toast-in 180ms ease-out;
}

@keyframes cfh-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cfh-hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .cfh-header {
    padding-right: 13px;
    padding-left: 13px;
  }

  .cfh-main-inner {
    padding-right: 13px;
    padding-left: 13px;
  }

  .cfh-primary-actions {
    grid-template-columns:
      repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .cfh-primary-action {
    min-height: 82px;
    padding: 11px 5px 9px;
    border-radius: 16px;
  }

  .cfh-primary-action span {
    width: 35px;
    height: 35px;
    margin-bottom: 6px;
    border-radius: 12px;
    font-size: 18px;
  }

  .cfh-primary-action strong {
    font-size: 10px;
  }

  .cfh-tools-grid {
    grid-template-columns: 1fr;
  }

  .cfh-tool-card {
    min-height: 78px;
  }
}

@media (max-width: 440px) {
  .cfh-brand-core {
    flex-basis: 43px;
    width: 43px;
    height: 43px;
    border-radius: 15px;
    font-size: 22px;
  }

  .cfh-brand-copy strong {
    font-size: 16px;
  }

  .cfh-brand-copy span {
    font-size: 10px;
  }

  .cfh-header-actions {
    gap: 6px;
  }

  .cfh-icon-button {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .cfh-welcome {
    grid-template-columns: minmax(0, 1fr) 62px;
    gap: 8px;
  }

  .cfh-status-orb {
    width: 59px;
    height: 59px;
  }

  .cfh-status-orb strong {
    font-size: 21px;
  }

  .cfh-welcome p {
    font-size: 12px;
  }

  .cfh-search {
    grid-template-columns: 38px minmax(0, 1fr) 44px;
    min-height: 54px;
    padding: 6px;
    border-radius: 17px;
  }

  .cfh-search-icon {
    width: 38px;
    height: 38px;
  }

  .cfh-search input {
    height: 40px;
    font-size: 16px;
  }

  .cfh-search button {
    width: 44px;
    min-width: 44px;
    height: 40px;
    padding: 0;
    font-size: 0;
  }

  .cfh-search button::after {
    content: "➜";
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cfh-brand-core::after,
  .cfh-status-orb::before,
  .cfh-status-orb::after {
    animation: none;
  }
}
