/* =========================================================
   FRIDJI • Project Root
   Clean MacroFactor Black / Glass UI
   Unified V1 Stylesheet
   ========================================================= */

* {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

:root {
  --bg: #0b0f18;
  --panel: rgba(12, 16, 26, 0.65);
  --panelBorder: rgba(255,255,255,0.10);
  --card: rgba(255,255,255,0.06);
  --cardBorder: rgba(255,255,255,0.10);

  --text: #e8eaee;
  --muted: rgba(232,234,238,0.70);

  --activeBg: rgba(255,255,255,0.10);
  --activeBorder: rgba(255,255,255,0.22);

  --btn: rgba(255,255,255,0.08);
  --btnBorder: rgba(255,255,255,0.14);

  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
}

/* =========================================================
   BODY / BACKGROUND
   ========================================================= */
html {
  background: #0b0f18;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1000px 700px at 15% 10%, rgba(255,255,255,0.05), transparent 60%),
    radial-gradient(900px 600px at 85% 20%, rgba(255,255,255,0.03), transparent 55%),
    linear-gradient(180deg, #0a0d14 0%, #0b0f18 100%);
  overscroll-behavior-y: none;
}


.hidden { display: none !important; }

/* =========================================================
   SCREEN + APP SHELL
   ========================================================= */

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px;
  gap: 24px;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

/* Stacked onboarding layout (Fridji home screen) */
.screen .primary {
  width: 100%;
  max-width: 640px;
}

.screen .secondary {
  width: 100%;
  max-width: 640px;
  height: 60px;
}

.screen input[type="text"],
.screen input[type="search"] {
  width: 100%;
  max-width: 640px;
  height: 60px;
}

.screen input[type="text"],
.screen input[type="search"] {
  margin-bottom: 12px;
}



.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  position: relative;
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.06), transparent 45%),
    radial-gradient(circle at 70% 80%, rgba(255,255,255,0.04), transparent 55%);
  filter: blur(18px);
  opacity: .7;
  pointer-events: none;
}



/* =========================================================
   PANEL
   ========================================================= */

.view {
  width: 100%;
  max-width: 760px;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
}

.panel {
  width: min(760px, 94vw);
  background: rgba(18, 22, 32, 0.72);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  box-shadow:
    0 25px 70px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(22px);
  padding: 22px;
  gap: 14px;
  display: flex;
  flex-direction: column;
  margin-bottom: 88px;
}

/* =========================================================
   TYPOGRAPHY
   ========================================================= */

   .title {
  margin: 0;
  font-size: 34px;
  font-weight: 950;
  letter-spacing: -1px;
  line-height: 0.98;
}


.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}

/* =========================================================
   BUTTONS
   ========================================================= */

button {
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.15s ease;
}
.primary {
  width: 100%;
  padding: 14px;
  border: none;
  background: linear-gradient(180deg, #ffffff 0%, #e5e7eb 100%);
  color: #111;
  font-weight: 900;
  border-radius: 16px;
}

.primary:hover {
  opacity: .92;
}

.secondary {
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: rgba(229,231,235,0.92);
  border-radius: 16px;
}

.secondary:hover {
  background: rgba(255,255,255,0.14);
}

/* =========================================================
   INVENTORY FORM
   ========================================================= */

.form {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 1fr auto;
  gap: 8px;
  margin-bottom: 12px;
}

.form input {
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  color: #fff;
  outline: none;
}

input[type="text"],
input[type="search"],
input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 15px;
  transition: 0.15s ease;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="number"]:focus {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.10);
  outline: none;
}

.form input::placeholder {
  color: rgba(255,255,255,0.55);
}

#addBtn {
  min-height: 48px;
  border: 1px solid rgba(255,255,255,0.20);
  background: rgba(255,255,255,0.12);
  color: rgba(229,231,235,0.95);
  padding: 10px 14px;
  border-radius: 16px;
}

#addBtn:hover {
  background: rgba(255,255,255,0.18);
}

/* =========================================================
   INVENTORY LIST
   ========================================================= */

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

li {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 10px;
  transition: 0.15s ease;
}

li:hover {
  background: rgba(255,255,255,0.06);
}

.item-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.item-main {
  flex: 1;
}

.item-text {
  text-align: left;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
}

.bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 6px;
  width: 100%;
}

/* Ensure delete button does not shrink layout */
button.del {
  flex-shrink: 0;
}

.bar.good { background: linear-gradient(90deg,#22c55e,#16a34a); }
.bar.warn { background: linear-gradient(90deg,#f59e0b,#ea580c); }
.bar.bad  { background: linear-gradient(90deg,#ef4444,#b91c1c); }

button.del {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  border: 1px solid rgba(239,68,68,0.30);
  background: rgba(239,68,68,0.22);
  color: #fff;
}

button.del:hover {
  background: rgba(239,68,68,0.32);
}

/* =========================================================
   DASHBOARD PILLS
   ========================================================= */

.pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  margin-top: 10px;
  transition: 0.15s ease;
}

.pill.good { border-left: 3px solid var(--good); }
.pill.warn { border-left: 3px solid var(--warn); }
.pill.bad  { border-left: 3px solid var(--bad); }


.pill:hover {
  background: rgba(255,255,255,0.06);
}


.pill .right-tag {
  margin-left: auto;
  font-weight: 900;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dot.good { background: var(--good); }
.dot.warn { background: var(--warn); }
.dot.bad  { background: var(--bad); }

/* =========================================================
   BOTTOM NAV
   ========================================================= */

   .bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  width: min(760px, 94vw);

  display: grid;
  grid-template-columns: 1fr 1fr auto 1fr 1fr;
  gap: 10px;

  padding: 10px;
  background: rgba(18,22,32,0.88);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  backdrop-filter: blur(22px);
  box-shadow:
    0 25px 80px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(255,255,255,0.04);
  z-index: 1500;
}

.nav-btn {
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  min-height: 50px;
  padding: 10px 12px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 15px;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.08);
}

.nav-btn.active {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
}

.nav-btn.active {
  background: var(--activeBg);
  border-color: var(--activeBorder);
}

.nav-plus {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  font-size: 22px;
}

/* =========================================================
   ONBOARDING + SETTINGS POLISH
   ========================================================= */

.section-block {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 18px;
  margin-top: 14px;
}

.section-block + .section-block {
  margin-top: 16px;
}

.settings-title {
  font-weight: 900;
  font-size: 20px;
  margin-bottom: 10px;
}

.settings-sub {
  color: var(--muted);
  margin-bottom: 14px;
}

.code-line {
  font-weight: 700;
  letter-spacing: 1px;
  margin: 8px 0 20px;
}

/* =========================================================
   VOICE MODAL (FINAL CLEAN VERSION)
   ========================================================= */

#voiceModal {
  position: fixed;
  inset: 0;
  z-index: 3000;
}

.voice-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(18px);
}


.voice-panel {
  position: relative;
  width: min(440px, 92vw);
  margin: 22vh auto 0;
  padding: 30px;
  border-radius: 28px;

  background: rgba(18,22,32,0.95);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    0 40px 120px rgba(0,0,0,.9),
    inset 0 1px 0 rgba(255,255,255,0.04);

  text-align: center;
}


.voice-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.voice-title {
  font-weight: 900;
}

.voice-wave {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 28px;
  margin: 16px 0;
}

.voice-wave span {
  width: 6px;
  height: 10px;
  border-radius: 999px;
  background: rgba(34,197,94,.8);
  transform-origin: bottom;
}


/* ==============================
   INLINE VOICE BAR (Inventory)
============================== */

.voice-inline-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 18px;
  opacity: .9;
}

.voice-mic {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 18px;
}

.voice-mic:hover {
  background: rgba(255,255,255,0.08);
}

.voice-wave-inline {
  display: flex;
  gap: 4px;
  height: 16px;
  align-items: flex-end;
}

.voice-wave-inline span {
  width: 4px;
  height: 6px;
  border-radius: 999px;
  background: #22c55e;
  animation: pulseWave 1.2s infinite ease-in-out;
}

.voice-wave-inline span:nth-child(2) { animation-delay: .1s; }
.voice-wave-inline span:nth-child(3) { animation-delay: .2s; }
.voice-wave-inline span:nth-child(4) { animation-delay: .3s; }
.voice-wave-inline span:nth-child(5) { animation-delay: .4s; }

@keyframes pulseWave {
  0%,100% { height: 6px; }
  50% { height: 18px; }
}


.voice-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
}

.voice-mic-btn,
.voice-send-btn {
  height: 46px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.10);
  color: #fff;
}

.voice-status {
  text-align: center;
  margin-top: 10px;
  color: var(--muted);
}

/* =========================================================
   VOICE CONFIRM SCREEN
   ========================================================= */

#voiceConfirmScreen {
  position: fixed;
  inset: 0;
  z-index: 3500;
}

.voice-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(18px);
}

.voice-confirm-panel {
  position: relative;
  width: min(600px, 92vw);
  margin: 14vh auto 0;

  padding: 28px;
  border-radius: 26px;

  background: rgba(18,22,32,0.96);
  border: 1px solid rgba(255,255,255,0.08);

  box-shadow:
    0 40px 120px rgba(0,0,0,.9),
    inset 0 1px 0 rgba(255,255,255,0.04);

  backdrop-filter: blur(24px);
}


.voice-confirm-title {
  text-align: center;
  font-weight: 950;
  margin-bottom: 16px;
}

.voice-confirm-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 6px;
}

.voice-confirm-list::-webkit-scrollbar {
  width: 6px;
}

.voice-confirm-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
}

.voice-confirm-list::-webkit-scrollbar-track {
  background: transparent;
}


.voice-confirm-row {
  display: grid;
  grid-template-columns: 1fr 70px 150px 40px;
  align-items: center;
  gap: 12px;

  padding: 14px 16px;
  border-radius: 18px;

  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);

  transition: 0.15s ease;
}

.voice-confirm-row:hover {
  background: rgba(255,255,255,0.06);
}



.voice-confirm-row input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  color: #fff;

  border-radius: 14px;
  padding: 8px 10px;
  font-weight: 600;

  transition: 0.15s ease;
}

.voice-confirm-row input:focus {
  border-color: rgba(255,255,255,0.25);
  outline: none;
}


.voice-confirm-del {
  width: 36px;
  height: 36px;
  border-radius: 14px;

  border: 1px solid rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.22);
  color: #ef4444;

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 900;
  cursor: pointer;
  transition: 0.15s ease;
}

.voice-confirm-del:hover {
  background: rgba(239,68,68,0.32);
}

/* Ensure JS-generated remove button matches red styling */
.voice-confirm-row .remove {
  width: 36px;
  height: 36px;
  border-radius: 14px;

  border: 1px solid rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.22);
  color: #ef4444;

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 900;
  cursor: pointer;
  transition: 0.15s ease;
}

.voice-confirm-row .remove:hover {
  background: rgba(239,68,68,0.32);
}

/* Confirm actions row */
.voice-confirm-actions {
  display: flex;
  gap: 14px;
  margin-top: 18px;
}

.voice-confirm-actions button {
  flex: 1;
  height: 52px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-weight: 800;
}

.voice-confirm-actions button:hover {
  background: rgba(255,255,255,0.10);
}

/* =========================================================
   ROOT CHAT UI
   ========================================================= */

.root-shell {
  width: min(1040px, 96vw);
  min-height: calc(100vh - 44px);
  min-height: calc(100dvh - 44px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 96px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.root-header {
  padding: 4px 4px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  text-align: left;
}

.root-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.05;
}

.root-subtitle {
  margin-top: 4px;
  color: rgba(232,234,238,0.62);
  font-size: 15px;
}

.root-thread {
  flex: 1;
  overflow-y: auto;
  padding: 14px 4px 188px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  scroll-behavior: smooth;
}


body.root-mode .root-thread {
  padding-bottom: 230px;
}

.root-thread::-webkit-scrollbar {
  width: 8px;
}

.root-thread::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
}

.root-thread::-webkit-scrollbar-track {
  background: transparent;
}

.root-empty-state {
  padding: 4px 4px 8px;
  text-align: left;
}

.root-empty-title {
  font-size: 32px;
  font-weight: 850;
  letter-spacing: -0.6px;
  margin-bottom: 10px;
}

.root-empty-copy {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.65;
  font-size: 16px;
}

.root-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  margin-bottom: 8px;
}

.root-chip {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.root-chip:hover {
  background: rgba(255,255,255,0.10);
}

.root-message {
  max-width: min(760px, 78%);
  padding: 14px 18px;
  border-radius: 22px;
  line-height: 1.55;
  font-size: 16px;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.root-message.user {
  align-self: flex-end;
  background: linear-gradient(180deg, #d9dde5 0%, #cfd4dd 100%);
  color: #111;
  border-bottom-right-radius: 10px;
}

.root-message.root {
  align-self: flex-start;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  border-bottom-left-radius: 10px;
}

.root-card {
  align-self: flex-start;
  width: min(100%, 760px);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  padding: 16px 18px;
  margin-top: 2px;
}

.root-card-title {
  font-weight: 950;
  font-size: 18px;
  margin-bottom: 12px;
}

.root-card-steps {
  margin: 0;
  padding-left: 20px;
  color: rgba(232,234,238,0.88);
  line-height: 1.6;
}

.root-card-steps li + li {
  margin-top: 6px;
}

.root-composer-wrap {
  padding: 14px 0 0;
  border-top: none;
  background: transparent;
  backdrop-filter: none;
}

body.root-mode .root-composer-wrap {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 72px;
  width: min(800px, 96vw);
  z-index: 1490;
  padding-top: 26px;
  background: transparent;
  border-radius: 0;
}

body.root-mode .root-composer-wrap::before {
  content: none;
}

.root-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
  margin: 0 auto;
  padding: 10px 10px;
  background: rgba(20, 24, 34, 0.86);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 22px;
  box-shadow:
    0 18px 50px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 2;
  overflow: visible;
}

body.root-mode .root-input-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -18px;
  height: 18px;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(11,15,24,0.88) 0%,
    rgba(11,15,24,0.50) 46%,
    rgba(11,15,24,0.14) 80%,
    rgba(11,15,24,0) 100%
  );
  z-index: 1;
}

body.root-mode .root-input-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 18px;
  background: rgba(11,15,24,0.98);
  pointer-events: none;
  z-index: 1;
}

.root-input {
  flex: 1;
  min-height: 52px;
  border-radius: 18px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 12px 8px;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  font-size: 16px;
}

.root-input::placeholder {
  color: rgba(232,234,238,0.42);
}

.root-send-btn {
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 999px;
  border: none;
  background: linear-gradient(180deg, #f3f5f8 0%, #d8dde6 100%);
  color: #111;
  font-size: 22px;
  font-weight: 900;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.root-send-btn:hover {
  opacity: 0.94;
}

.root-jump-bottom {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 126px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(20,24,34,0.92);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

.root-jump-bottom:hover {
  background: rgba(34,39,52,0.96);
}

body.root-mode .bottom-nav {
  width: min(800px, 96vw);
  bottom: 12px;
  padding: 10px;
  gap: 10px;
  border-radius: 20px;
  background: rgba(11,15,24,0.98);
}

body.root-mode .bottom-nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -24px;
  height: 24px;
  background: rgba(11,15,24,0.98);
  pointer-events: none;
}

body.root-mode .nav-btn {
  padding: 10px;
  border-radius: 14px;
  font-size: 14px;
}

body.root-mode .nav-plus {
  width: 40px;
  height: 40px;
  font-size: 20px;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 520px) {
  .screen {
    padding: 14px;
    gap: 14px;
  }

  .app-shell {
    padding: 12px;
    align-items: flex-start;
  }

  .view {
    align-items: stretch;
  }

  .panel {
    width: 100%;
    padding: 18px;
    border-radius: 20px;
    gap: 12px;
    margin-bottom: 82px;
  }

  .title {
    font-size: 30px;
  }

  .subtitle {
    font-size: 14px;
  }

  .global-settings-btn {
    top: 14px;
    left: 14px;
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .form {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "name name"
      "qty date"
      "btn btn";
    gap: 8px;
    margin-bottom: 10px;
  }

  .form input,
  .form button,
  #addBtn {
    min-height: 46px;
    padding: 10px 12px;
    font-size: 15px;
  }

  .voice-inline-bar {
    gap: 8px;
    margin: 8px 0 12px;
  }

  .voice-mic {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .pill {
    padding: 12px 14px;
    border-radius: 16px;
    margin-top: 8px;
  }

  li {
    padding: 12px;
    margin-bottom: 8px;
  }

  .item-row {
    gap: 12px;
  }

  .item-text {
    font-size: 14px;
  }

  .bottom-nav {
    width: calc(100% - 16px);
    bottom: 8px;
    padding: 8px;
    gap: 8px;
    border-radius: 20px;
  }

  .nav-btn {
    min-height: 48px;
    padding: 8px 10px;
    border-radius: 14px;
    font-size: 14px;
  }

  .nav-plus {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  .root-shell {
    width: 100%;
    min-height: calc(100vh - 18px);
    min-height: calc(100dvh - 18px);
    margin-bottom: 82px;
  }

  .root-header {
    padding: 2px 0 10px;
  }

  .root-title {
    font-size: 22px;
  }

  .root-subtitle {
    font-size: 14px;
  }

  .root-thread {
    padding: 10px 0 178px;
    gap: 10px;
  }

  .root-message {
    max-width: 90%;
    font-size: 15px;
    padding: 13px 14px;
  }

  .root-card {
    width: 100%;
    padding: 14px 16px;
  }

  .root-composer-wrap {
    padding-top: 12px;
  }

  body.root-mode .root-composer-wrap {
    width: calc(100% - 16px);
    bottom: 60px;
    padding-top: 14px;
    background: transparent;
  }

  body.root-mode .root-composer-wrap::before {
    content: none;
  }

  body.root-mode .root-input-bar::before {
    top: -12px;
    height: 12px;
  }

  body.root-mode .root-input-bar::after {
    height: 12px;
  }

  .root-input-bar {
    width: 100%;
    gap: 8px;
    padding: 8px;
    flex-direction: row;
    align-items: flex-end;
    border-radius: 20px;
  }

  .root-input {
    min-height: 48px;
    font-size: 15px;
  }

  .root-send-btn {
    width: 46px;
    min-width: 46px;
    height: 46px;
    font-size: 20px;
  }

  .root-jump-bottom {
    left: 50%;
    transform: translateX(-50%);
    bottom: 110px;
  }

  body.root-mode .bottom-nav {
    width: calc(100% - 16px);
    bottom: 8px;
    padding: 8px;
    gap: 8px;
    background: rgba(11,15,24,0.98);
  }
}

.app-shell {
  position: relative;
}

.global-settings-btn {
  position: fixed;
  top: 22px;
  left: 22px;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 18px;
  backdrop-filter: blur(18px);
  z-index: 2000;
}

.global-settings-btn:hover {
  background: rgba(255,255,255,0.08);
}


#btnSeeMore {
  background: none;
  border: none;
  padding: 0;
  font-weight: 700;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
}

#btnSeeMore {
  margin-left: auto;
}


.card-row {
  display: flex;
  align-items: center;
}

.voice-controls-modern {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
}

#startVoice,
#closeVoice {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  color: white;
  font-size: 20px;
}

#sendVoice {
  padding: 14px 24px;
  border-radius: 18px;
  border: none;
  background: linear-gradient(180deg,#ffffff,#e5e7eb);
  color: #111;
  font-weight: 900;
}

/* ==============================
   CLEAN VOICE ICON BUTTONS
============================== */

.clean-controls {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 18px;
}

.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .15s ease;
}

.icon-btn:hover {
  background: rgba(255,255,255,0.08);
}

.confirm-btn {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  color: var(--text) !important;
}

.confirm-btn:hover {
  background: rgba(255,255,255,0.10) !important;
}

.close-btn {
  background: rgba(239,68,68,0.22) !important;
  border: 1px solid rgba(239,68,68,0.40) !important;
  color: #ef4444 !important;
}

/* ==============================
   LIVE AUDIO PILL
============================== */

.voice-live {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  padding: 16px 28px;
  border-radius: 999px;
  background: rgba(18,22,32,0.85);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  box-shadow: 0 15px 50px rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 4000;
}

.live-bars {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 28px;
}

.live-bars span {
  width: 6px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
  transition: height .1s ease;
}

/* active speaking animation */
.voice-live.active .live-bars span {
  animation: livePulse 0.6s infinite ease-in-out;
}

.live-bars span:nth-child(2) { animation-delay: .05s; }
.live-bars span:nth-child(3) { animation-delay: .1s; }
.live-bars span:nth-child(4) { animation-delay: .15s; }
.live-bars span:nth-child(5) { animation-delay: .2s; }

@keyframes livePulse {
  0%,100% { height: 6px; }
  50% { height: 28px; }
}

/* Force onboarding + switch fridge inputs to pill style */
.screen input[type="text"],
.screen input[type="search"],
.screen input[type="number"] {
  width: 100%;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 15px;
}
/* ======================================
   FINAL ONBOARDING STACK (2 BUTTONS)
====================================== */

/* Stack buttons vertically and center */
.screen {
  flex-direction: column;
}

/* Both buttons full width and identical size */
#btnJoinFridge,
#btnCreateFridge {
  width: 100%;
  max-width: 640px;
  height: 64px;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 900;
}

/* Make Join appear ABOVE Create */
#btnJoinFridge {
  order: 1;
  margin-bottom: 14px;
}

#btnCreateFridge {
  order: 2;
}

/* Ensure join button uses dark style */
#btnJoinFridge {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

#btnJoinFridge:hover {
  background: rgba(255,255,255,0.10);
}

/* Hide old inline input if still present */
#joinCodeInput {
  display: none !important;
}


#createSetup {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#createSetup .onboarding-form input {
  display: block;
  width: 100%;
  max-width: 640px;
  height: 64px;
  padding: 16px 20px;
  border-radius: 24px;

  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 15px;

  margin: 18px auto 22px auto;
}