:root {
  --primary: #E53935;
  --primary-dark: #8E1414;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --viewport-height: 100vh;
  --viewport-height: 100svh;
  --viewport-height: 100dvh;
  --motivation-scroll-duration: 68s;
  --home-accent-red: #B22222;
  --home-accent-blue: #4682B4;
  --home-gradient-duration: 16s;
  --home-glow-duration: 44s;
  --home-flow-duration: 52s;
  --home-gradient-size: 240% 100%;
  --home-gradient:
    linear-gradient(
      90deg,
      #55161b 0%,
      #6f1d22 12%,
      #93262d 24%,
      #b22222 36%,
      #9e3045 48%,
      #7d466b 58%,
      #62608d 68%,
      #4f74a5 78%,
      #4682B4 88%,
      #6aa9d1 100%
    );
  --text: #000000;
  --text-soft: rgba(0, 0, 0, 0.68);
  --background: #F5F5F5;
  --surface: #FFFFFF;
  --surface-strong: rgba(255, 255, 255, 0.92);
  --surface-dark: #0F1013;
  --secondary: #007AFF;
  --success: #28A745;
  --error: #DC3545;
  --warning: #FFC107;
  --disabled: #BDBDBD;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);
  --shadow-soft: 0 18px 48px rgba(8, 10, 18, 0.10);
  --shadow-deep: 0 24px 64px rgba(8, 10, 18, 0.16);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  min-height: var(--viewport-height);
  width: 100%;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at top left, rgba(229, 57, 53, 0.08), transparent 30%),
    radial-gradient(circle at 78% 22%, rgba(70, 130, 180, 0.05), transparent 26%),
    radial-gradient(circle at bottom right, rgba(123, 114, 255, 0.04), transparent 22%),
    var(--background);
  color: var(--text);
  font-family: "Segoe UI Variable", Bahnschrift, "Segoe UI", Arial, sans-serif;
}

body.policy-dialog-open {
  overflow: hidden;
}

body.home-mode {
  position: relative;
  isolation: isolate;
  background: var(--home-gradient);
  background-size: var(--home-gradient-size);
  background-repeat: no-repeat;
  background-position: 0% 50%;
  animation: home-gradient var(--home-gradient-duration) ease-in-out infinite;
}

body.home-mode::before,
body.home-mode::after {
  content: none;
}

body.rcafe-mode {
  position: relative;
  isolation: isolate;
  background: #050406;
}

body.rcafe-mode::before,
body.rcafe-mode::after {
  content: none;
}

.hidden { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.backdrop {
  position: fixed;
  border-radius: 999px;
  filter: blur(52px);
  opacity: 0.36;
  pointer-events: none;
  z-index: 0;
  will-change: transform, opacity;
}

.backdrop-a {
  width: 360px;
  height: 360px;
  top: -90px;
  left: -110px;
  background:
    radial-gradient(circle at 34% 34%, rgba(178, 34, 34, 0.24), rgba(178, 34, 34, 0.08) 46%, transparent 72%);
  animation: home-backdrop-a calc(var(--home-glow-duration) + 8s) ease-in-out infinite alternate;
}

.backdrop-b {
  width: 380px;
  height: 380px;
  right: -130px;
  bottom: -90px;
  background:
    radial-gradient(circle at 50% 50%, rgba(70, 130, 180, 0.20), rgba(76, 218, 255, 0.08) 40%, transparent 74%);
  animation: home-backdrop-b calc(var(--home-glow-duration) + 14s) ease-in-out infinite alternate;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1280px);
  margin: 0 auto;
  padding:
    calc(18px + var(--safe-area-top))
    calc(18px + var(--safe-area-right))
    calc(18px + var(--safe-area-bottom))
    calc(18px + var(--safe-area-left));
}

body.home-mode .app-shell {
  width: 100%;
  max-width: none;
  padding:
    calc(18px + var(--safe-area-top))
    var(--safe-area-right)
    calc(24px + var(--safe-area-bottom))
    var(--safe-area-left);
}

body.rcafe-mode .app-shell {
  width: 100%;
  max-width: none;
  min-height: var(--viewport-height);
  padding: 0;
}

body.home-mode .mobile-topbar,
body.home-mode .connectivity-banner {
  width: min(calc(100% - 36px - var(--safe-area-left) - var(--safe-area-right)), 1280px);
  margin-left: auto;
  margin-right: auto;
}

.dashboard {
  min-height: var(--viewport-height);
}

body.home-mode .dashboard,
body.home-mode .app-shell {
  min-height: var(--viewport-height);
}

body.rcafe-mode .app-shell {
  min-height: var(--viewport-height);
}

body.home-mode .backdrop {
  display: none;
}

body.rcafe-mode .backdrop {
  display: none;
}

.login-screen {
  min-height: var(--viewport-height);
  display: grid;
  place-items: center;
}

.login-card,
.mobile-topbar,
.ai-home-card,
.section-card,
.app-drawer,
.connectivity-banner,
.onboarding-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.92));
  border: 1px solid rgba(255,255,255,0.66);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.login-card,
.section-card,
.app-drawer,
.connectivity-banner,
.onboarding-card {
  border-radius: var(--radius-lg);
}

.login-card {
  width: min(100%, 480px);
  padding: 34px;
}

.login-card-footer {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.login-access-actions {
  margin-top: 14px;
}

.access-request-btn {
  position: relative;
  width: 100%;
  min-height: 58px;
  padding: 16px 22px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  color: #fff;
  font-size: 1.04rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(110deg, #E53935 0%, #FF6D5C 28%, #4B89D0 62%, #E53935 100%);
  background-size: 220% 100%;
  box-shadow:
    0 16px 34px rgba(229, 57, 53, 0.20),
    0 10px 22px rgba(75, 137, 208, 0.12);
  animation: access-request-gradient 4.6s ease-in-out infinite;
}

.access-request-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.18) 42%, rgba(255,255,255,0.46) 50%, rgba(255,255,255,0.18) 58%, transparent 100%);
  transform: translateX(-120%);
  animation: access-request-sheen 3.2s ease-in-out infinite;
}

.access-request-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 18px 38px rgba(229, 57, 53, 0.24),
    0 12px 24px rgba(75, 137, 208, 0.16);
}

.access-request-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(229, 57, 53, 0.14),
    0 18px 38px rgba(229, 57, 53, 0.24),
    0 12px 24px rgba(75, 137, 208, 0.16);
}

.login-policy-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(28, 28, 28, 0.74);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-align: center;
  text-wrap: balance;
  text-decoration: none;
  cursor: pointer;
}

.login-policy-link:hover {
  color: var(--primary);
  text-decoration: underline;
  transform: none;
}

.login-policy-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(229, 57, 53, 0.10);
}

.brand-mark,
.drawer-brand,
.topbar-brand,
.panel-brand,
.home-brand {
  display: flex;
  align-items: center;
}

.brand-mark { justify-content: center; }

.brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

.brand-logo--login {
  width: min(360px, 80vw);
  margin-bottom: 10px;
}

.brand-logo--drawer { width: 214px; }
.brand-logo--topbar { width: 176px; }
.brand-logo--home { width: min(430px, 82vw); }
.brand-logo--panel { width: 224px; }

.home-brand {
  justify-content: center;
  margin-bottom: 18px;
}

.drawer-brand,
.panel-brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

h1, h2, h3, h4 {
  margin: 8px 0 10px;
  line-height: 1.1;
}

h1 { font-size: clamp(2rem, 4.8vw, 3.1rem); }
h3 { font-size: 1.22rem; }
h4 { font-size: 1.02rem; }

p,
.meta,
.lead {
  color: var(--text-soft);
  line-height: 1.58;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.stack { display: grid; gap: 14px; }
.compact { gap: 10px; }
.filter-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.editor-grid-3 { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input, textarea, select, button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(0, 0, 0, 0.42);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(229, 57, 53, 0.40);
  box-shadow: 0 0 0 4px rgba(229, 57, 53, 0.10);
}

button,
.primary-btn,
.ghost-btn,
.pdf-link,
.source-open,
.tree-btn,
.drawer-home-btn,
.drawer-link,
.tab-btn,
.notification-filter-btn {
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

button {
  border: 0;
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 800;
}

button:hover,
.primary-btn:hover,
.ghost-btn:hover,
.pdf-link:hover,
.source-open:hover,
.tree-btn:hover,
.drawer-home-btn:hover,
.drawer-link:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), #ff6458);
  color: #FFFFFF;
  box-shadow: 0 14px 28px rgba(229, 57, 53, 0.24);
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 13px 18px;
}

.ghost-btn.active {
  background: rgba(229, 57, 53, 0.12);
  color: var(--primary);
  border-color: rgba(229, 57, 53, 0.28);
}

.danger-btn { color: var(--error); }

.hint,
.error-text,
code {
  font-size: 0.94rem;
}

.hint {
  background: rgba(229, 57, 53, 0.06);
  border-radius: 16px;
  padding: 12px 14px;
}

.error-text {
  min-height: 22px;
  color: var(--error);
  font-weight: 700;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 16, 19, 0.34);
  z-index: 29;
}

.app-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(90vw, 372px);
  padding:
    calc(22px + var(--safe-area-top))
    18px
    calc(22px + var(--safe-area-bottom))
    calc(18px + var(--safe-area-left));
  z-index: 30;
  display: grid;
  gap: 18px;
  align-content: start;
  transform: translateX(-110%);
  transition: transform 0.24s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.app-drawer.open { transform: translateX(0); }

.drawer-head,
.drawer-user,
.mobile-topbar,
.section-header,
.list-actions,
.camera-actions,
.answer-actions,
.notice-head,
.folder-note,
.admin-header-actions,
.connectivity-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-title {
  font-size: 1.08rem;
  font-weight: 800;
}

.drawer-home-btn,
.drawer-link {
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
  border: 1px solid transparent;
}

.drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.drawer-link--rcafe {
  justify-content: center;
  padding: 18px 20px;
  background:
    radial-gradient(circle at 16% 24%, rgba(255, 220, 120, 0.42), transparent 20%),
    radial-gradient(circle at 84% 78%, rgba(255, 194, 70, 0.22), transparent 24%),
    linear-gradient(135deg, #54040c 0%, #a30614 30%, #ff1020 62%, #b20816 100%);
  color: #FFFFFF;
  border-color: rgba(255, 209, 112, 0.24);
  border-radius: 24px;
  box-shadow:
    0 14px 24px rgba(207, 10, 24, 0.26),
    0 6px 16px rgba(140, 77, 6, 0.16),
    inset 0 1px 0 rgba(255, 240, 201, 0.24);
}

.drawer-link--rcafe:hover {
  background:
    radial-gradient(circle at 18% 26%, rgba(255, 227, 138, 0.48), transparent 21%),
    radial-gradient(circle at 84% 76%, rgba(255, 203, 92, 0.24), transparent 25%),
    linear-gradient(135deg, #65050f 0%, #b70717 28%, #ff1d2e 62%, #c40c1b 100%);
  box-shadow:
    0 18px 28px rgba(207, 10, 24, 0.30),
    0 8px 18px rgba(140, 77, 6, 0.18),
    inset 0 1px 0 rgba(255, 244, 214, 0.28);
}

.drawer-link--rcafe.active {
  background:
    radial-gradient(circle at 18% 28%, rgba(250, 211, 112, 0.30), transparent 20%),
    linear-gradient(135deg, #4c030a 0%, #940411 30%, #de0016 62%, #a10611 100%);
  color: #FFFFFF;
  border-color: rgba(255, 220, 154, 0.30);
  box-shadow:
    0 16px 26px rgba(180, 8, 21, 0.28),
    0 6px 16px rgba(120, 62, 5, 0.14),
    inset 0 1px 0 rgba(255, 239, 194, 0.22);
}

.drawer-link-rcafe-logo {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  width: 100%;
  font-weight: 900;
  font-size: 1.1rem;
  line-height: 1;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

.drawer-link-rcafe-bracket {
  font-size: 1.28rem;
  letter-spacing: -0.05em;
}

.drawer-link-rcafe-word {
  font-size: 1.08rem;
}

.drawer-link-beta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(229, 57, 53, 0.10);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.drawer-home-btn {
  background:
    radial-gradient(circle at 82% 26%, rgba(70, 130, 180, 0.28), transparent 28%),
    linear-gradient(135deg, #140d11 0%, #43171d 34%, #7a2328 66%, #4682B4 100%);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 16px 30px rgba(178, 34, 34, 0.22),
    0 10px 22px rgba(70, 130, 180, 0.12);
}

.drawer-home-label {
  display: block;
  font-weight: 800;
}

.drawer-home-note {
  display: block;
  opacity: 0.82;
  font-size: 0.92rem;
}

.drawer-nav { display: grid; gap: 10px; }

.drawer-link.active:not(.drawer-link--rcafe) {
  border-color: rgba(229, 57, 53, 0.24);
  color: var(--primary);
  background: rgba(229, 57, 53, 0.08);
}

.drawer-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.drawer-logout { width: 100%; }

.drawer-version {
  margin-top: 10px;
  padding-top: 6px;
  color: rgba(28, 28, 28, 0.56);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  letter-spacing: 0.01em;
}

.drawer-policy-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(28, 28, 28, 0.72);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
}

.drawer-policy-link:hover {
  color: var(--primary);
  text-decoration: underline;
  transform: none;
}

.drawer-policy-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(229, 57, 53, 0.10);
}

.topbar-motivation-shell {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 22px;
  border: 0;
  background: rgba(0, 0, 0, 0.035);
}

.topbar-motivation-label {
  flex: 0 0 auto;
  font-size: clamp(0.78rem, 0.65rem + 0.28vw, 0.92rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text-soft);
  white-space: nowrap;
}

.topbar-motivation-viewport {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  min-height: 28px;
  display: flex;
  align-items: center;
}

.topbar-motivation-ticker {
  width: 100%;
  overflow: hidden;
  min-height: 28px;
  display: flex;
  align-items: center;
  line-height: 1.4;
}

.topbar-motivation-ticker.compact {
  min-height: 52px;
  align-items: center;
}

.topbar-motivation-toggle {
  flex: 0 0 auto;
  min-width: 0;
  padding: 10px 14px;
}

.topbar-motivation-toggle.is-off {
  color: var(--disabled);
}

.topbar-motivation-ticker,
.drawer-motivation-ticker {
  overflow: hidden;
  min-height: 28px;
}

.motivation-marquee {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
}

.motivation-track {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-width: max-content;
  padding-left: 100%;
  animation: motivation-scroll var(--motivation-scroll-duration) linear infinite;
}

.motivation-phrase {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  font-size: clamp(0.88rem, 0.8rem + 0.18vw, 1rem);
  line-height: 1.38;
  text-wrap: pretty;
}

.motivation-phrase::before {
  content: "•";
  color: var(--primary);
}

.motivation-marquee--compact {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  white-space: normal;
  overflow: hidden;
}

.motivation-track--compact {
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  padding-left: 0;
  animation: none;
}

.motivation-phrase--compact {
  display: -webkit-box;
  width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(0.84rem, 0.74rem + 0.42vw, 0.98rem);
  font-weight: 700;
  line-height: 1.38;
  text-wrap: pretty;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  animation: motivation-compact-cycle 4.2s ease-in-out both;
}

.motivation-phrase--compact::before {
  content: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.pill.dark {
  background: #0F1013;
  color: #FFFFFF;
}

.pill.critical {
  background: rgba(220, 53, 69, 0.12);
  color: var(--error);
}

.pill.warning {
  background: rgba(255, 193, 7, 0.18);
  color: #8A6500;
}

.pill.info {
  background: rgba(0, 122, 255, 0.12);
  color: var(--secondary);
}

.pill.success {
  background: rgba(40, 167, 69, 0.14);
  color: var(--success);
}

.pill.muted {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-soft);
}

.mobile-topbar {
  position: sticky;
  top: calc(12px + var(--safe-area-top));
  z-index: 18;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 22px;
  align-items: center;
  justify-content: space-between;
}

.menu-btn {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.topbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  min-width: 0;
  width: min(260px, calc(100% - 168px));
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.topbar-center .topbar-brand {
  justify-content: center;
  width: max-content;
  max-width: 100%;
  transform: translateX(9.8%);
}

.topbar-title {
  width: 100%;
  font-weight: 800;
  text-align: center;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 92px;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 8px rgba(40, 167, 69, 0.10);
}

.status-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-soft);
}

body.offline .status-dot {
  background: var(--warning);
  box-shadow: 0 0 0 8px rgba(255, 193, 7, 0.16);
}

body.home-mode .topbar-center,
body.home-mode .topbar-status {
  display: none;
}

body.home-mode .mobile-topbar {
  justify-content: flex-start;
}

body.rcafe-mode .topbar-motivation-shell,
body.rcafe-mode .topbar-center,
body.rcafe-mode .topbar-status,
body.rcafe-mode .connectivity-banner {
  display: none !important;
}

body.rcafe-mode .mobile-topbar {
  position: fixed;
  top: calc(14px + var(--safe-area-top));
  left: calc(14px + var(--safe-area-left));
  z-index: 30;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  justify-content: flex-start;
}

body.rcafe-mode .menu-btn {
  background: rgba(8, 8, 12, 0.42);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
}

body.rcafe-mode .menu-btn span {
  background: #FFFFFF;
}

.icon-btn,
.icon-action {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn span,
.menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

.menu-btn {
  gap: 4px;
  flex-direction: column;
}

#closeDrawerBtn { position: relative; }
#closeDrawerBtn span:first-child { position: absolute; transform: rotate(45deg); }
#closeDrawerBtn span:last-child { position: absolute; transform: rotate(-45deg); }

.icon-action svg,
.permission-icon svg,
.offline-fallback-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.icon-action.listening {
  background: rgba(229, 57, 53, 0.12);
  color: var(--primary);
}

.content-stage {
  display: grid;
  gap: 16px;
  padding-bottom: var(--safe-area-bottom);
}

body.home-mode .content-stage {
  gap: 0;
  min-height: calc(var(--viewport-height) - 108px - var(--safe-area-top) - var(--safe-area-bottom));
}

body.rcafe-mode .content-stage {
  gap: 0;
  min-height: var(--viewport-height);
  padding-bottom: 0;
}

body.rcafe-mode .qr-section {
  display: none !important;
}

.qr-section {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr) minmax(0, 0.85fr);
  gap: 16px;
  width: min(calc(100% - 36px - var(--safe-area-left) - var(--safe-area-right)), 1320px);
  margin: 42px auto 20px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.qr-card {
  min-height: 590px;
  padding: 30px 28px 26px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 24px;
  align-content: stretch;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(255,255,255,0.92));
  box-shadow:
    0 28px 58px rgba(8, 10, 18, 0.18),
    0 10px 24px rgba(229, 57, 53, 0.08);
  backdrop-filter: blur(18px);
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
  animation: qr-fade-in 0.5s ease both;
}

.qr-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 34px 64px rgba(8, 10, 18, 0.22),
    0 14px 28px rgba(229, 57, 53, 0.12);
}

.qr-card-copy {
  display: grid;
  gap: 14px;
  align-content: start;
}

.qr-card-copy h3,
.qr-card-copy p {
  margin: 0;
}

.qr-card-copy h3 {
  font-size: clamp(2rem, 2.4vw, 3rem);
  line-height: 1.08;
}

.qr-card-copy p {
  max-width: 28ch;
  font-size: clamp(1.08rem, 1.2vw, 1.42rem);
  line-height: 1.45;
}

.qr-card .eyebrow {
  font-size: 0.9rem;
  letter-spacing: 0.18em;
}

.qr-code-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: end;
  align-self: end;
}

.qr-code-grid--double {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.qr-code-item {
  display: grid;
  grid-template-rows: auto auto auto;
  justify-items: center;
  align-content: start;
  gap: 14px;
  text-align: center;
}

.qr-code-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(229, 57, 53, 0.12), rgba(229, 57, 53, 0.08));
  color: var(--primary);
  font-weight: 800;
  font-size: 0.92rem;
}

.qr-code-box {
  width: 188px;
  height: 188px;
  min-height: 188px;
  padding: 10px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.qr-code-box canvas,
.qr-code-box img {
  display: block;
  width: 168px !important;
  height: 168px !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.qr-code-fallback {
  font-size: 0.9rem;
  color: var(--text-soft);
}

.qr-open-btn {
  min-width: 164px;
  min-height: 54px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(240,240,240,0.92));
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 8px 18px rgba(8, 10, 18, 0.08);
  font-weight: 800;
}

.view-section { display: none; }
.view-section.active { display: block; }

.rcafe-view {
  position: relative;
  min-height: var(--viewport-height);
}

.rcafe-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 6, 10, 0.84) 0%, rgba(7, 7, 10, 0.42) 24%, rgba(22, 10, 10, 0.16) 58%, rgba(5, 5, 8, 0.78) 100%),
    radial-gradient(circle at 76% 24%, rgba(229, 57, 53, 0.12), transparent 18%),
    radial-gradient(circle at 22% 80%, rgba(255, 196, 94, 0.10), transparent 24%),
    url("/static/rcafe-stage-bg.jpg") center center / cover no-repeat;
  filter: saturate(0.92) brightness(0.62);
  transition:
    opacity 560ms ease,
    transform 900ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 900ms ease;
}

body.rcafe-mode.rcafe-stage-ready .rcafe-scene {
  opacity: 1;
  transform: scale(1);
  filter: saturate(1) brightness(0.74);
}

.rcafe-shell {
  position: relative;
  z-index: 1;
  min-height: var(--viewport-height);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding:
    calc(116px + var(--safe-area-top))
    clamp(24px, 4vw, 58px)
    calc(40px + var(--safe-area-bottom))
    clamp(24px, 4vw, 58px);
}

.rcafe-menu-card {
  position: relative;
  width: min(44vw, 700px);
  min-width: min(100%, 340px);
  padding: clamp(28px, 3.4vw, 42px);
  display: grid;
  gap: 20px;
  align-content: start;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(12, 11, 15, 0.26), rgba(8, 8, 12, 0.14));
  box-shadow:
    0 26px 48px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transform: translate3d(-34px, 18px, 0) scale(0.985);
  transition:
    opacity 420ms ease,
    transform 680ms cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.rcafe-menu-card::before {
  content: "";
  position: absolute;
  inset: clamp(16px, 2vw, 24px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

body.rcafe-mode.rcafe-ready .rcafe-menu-card {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.rcafe-menu-header {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.rcafe-menu-eyebrow {
  color: rgba(255, 221, 151, 0.94);
}

.rcafe-menu-copy {
  max-width: 46ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.98rem;
  line-height: 1.58;
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
}

.rcafe-sync-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.rcafe-sync-btn {
  width: auto;
  min-width: 220px;
  min-height: 48px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  box-shadow:
    0 12px 22px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.rcafe-sync-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.26);
}

body.rcafe-mode .status-chip.rcafe-sync-status {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.rcafe-menu-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 32px);
  align-items: start;
}

.rcafe-menu-btn {
  min-height: 78px;
  width: 100%;
  padding: 18px 24px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background:
    linear-gradient(180deg, rgba(14, 14, 18, 0.34), rgba(14, 14, 18, 0.18));
  color: #FFFFFF;
  font-size: clamp(1.1rem, 1.2rem + 0.45vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.52);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(18px);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    opacity 420ms ease;
}

.rcafe-menu-btn:nth-child(1) { transition-delay: 140ms; }
.rcafe-menu-btn:nth-child(2) { transition-delay: 220ms; }
.rcafe-menu-btn:nth-child(3) { transition-delay: 300ms; }

body.rcafe-mode.rcafe-ready .rcafe-menu-btn {
  opacity: 1;
  transform: translateY(0);
}

.rcafe-menu-btn.is-active {
  border-color: rgba(255, 255, 255, 0.30);
  background:
    linear-gradient(180deg, rgba(26, 26, 32, 0.56), rgba(12, 12, 16, 0.24));
  box-shadow:
    0 22px 38px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.rcafe-menu-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(22, 22, 28, 0.44), rgba(22, 22, 28, 0.22));
  box-shadow:
    0 24px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.rcafe-menu-btn:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.10),
    0 22px 38px rgba(0, 0, 0, 0.28);
}

.rcafe-menu-btn--wide {
  grid-column: 1 / -1;
  width: min(100%, 380px);
  justify-self: center;
}

.rcafe-flow-shell {
  position: relative;
  z-index: 1;
  min-height: 96px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(12, 11, 15, 0.28), rgba(8, 8, 12, 0.14));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 34px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  transition:
    max-height 420ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 240ms ease,
    background 240ms ease;
}

.rcafe-flow-shell[data-view="categories"] {
  max-height: min(52vh, 420px);
}

.rcafe-flow-shell[data-view="products"] {
  max-height: min(56vh, 640px);
}

.rcafe-flow-shell[data-view="product"] {
  max-height: min(44vh, 420px);
}

.rcafe-flow {
  min-height: 58px;
  max-height: min(52vh, 596px);
  overflow-y: auto;
  padding-right: 6px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 220ms ease, transform 220ms ease;
}

.rcafe-flow.is-leaving {
  opacity: 0;
  transform: translateY(14px);
}

.rcafe-flow.is-entering {
  opacity: 0;
  transform: translateY(-10px);
}

.rcafe-flow.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.rcafe-categories-stage,
.rcafe-placeholder-card,
.rcafe-products-stage,
.rcafe-product-card {
  display: grid;
  gap: 16px;
}

.rcafe-categories-stage {
  align-content: start;
}

.rcafe-placeholder-card strong {
  font-size: 1.08rem;
  color: #FFFFFF;
}

.rcafe-placeholder-card p,
.rcafe-product-placeholder {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.58;
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
}

.rcafe-standard-card {
  border-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(16, 16, 22, 0.22), rgba(8, 8, 12, 0.12));
  box-shadow:
    0 20px 32px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: #FFFFFF;
}

.rcafe-card-actions {
  justify-content: flex-end;
}

.rcafe-flow-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rcafe-flow-head h3 {
  margin: 6px 0 0;
  color: #FFFFFF;
  font-size: clamp(1.18rem, 1rem + 0.4vw, 1.5rem);
  text-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
}

.rcafe-menu-eyebrow,
.rcafe-flow-eyebrow {
  color: rgba(255, 255, 255, 0.70);
}

.rcafe-products-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rcafe-product-btn,
.rcafe-back-btn {
  width: 100%;
  min-height: 62px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  color: #FFFFFF;
  text-align: left;
  font-weight: 700;
  box-shadow:
    0 14px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.42);
}

.rcafe-product-btn:hover,
.rcafe-back-btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
}

.rcafe-back-btn {
  width: auto;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  padding: 12px 16px;
}

.rcafe-product-placeholder {
  min-height: 180px;
  padding: 24px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(16, 16, 22, 0.18), rgba(8, 8, 12, 0.10));
  display: grid;
  place-items: center;
  text-align: center;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 8px 20px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body.rcafe-mode .rcafe-sync-controls .ghost-btn,
body.rcafe-mode .rcafe-card-actions .ghost-btn,
body.rcafe-mode .rcafe-product-card .pill,
body.rcafe-mode .rcafe-products-stage .pill {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 700;
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
  box-shadow:
    0 12px 22px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.rcafe-mode .rcafe-sync-controls .ghost-btn:hover,
body.rcafe-mode .rcafe-card-actions .ghost-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

.rcafe-product-card .standard-card,
.rcafe-product-card .standard-card strong,
.rcafe-product-card .standard-card h4,
.rcafe-product-card .standard-card .standard-meta,
.rcafe-product-card .standard-card .meta,
.rcafe-product-card .standard-card li,
.rcafe-product-card .standard-card div,
.rcafe-product-card .standard-card span {
  color: #FFFFFF;
}

.rcafe-product-card .standard-card .meta,
.rcafe-product-card .standard-card .standard-meta,
.rcafe-product-card .standard-card .answer-block-text,
.rcafe-product-card .standard-card li,
.rcafe-product-card .standard-card p {
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 6px 14px rgba(0, 0, 0, 0.32);
}

.rcafe-product-card .standard-card .pdf-link,
.rcafe-product-card .standard-card .source-open {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.12);
  text-shadow: 0 6px 14px rgba(0, 0, 0, 0.32);
}

.rcafe-product-card .standard-card .pdf-link:hover,
.rcafe-product-card .standard-card .source-open:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
}

.rcafe-product-card .standard-card .eyebrow,
.rcafe-product-card .standard-card .answer-title,
.rcafe-product-card .standard-card .answer-block-title,
.rcafe-product-card .standard-card h3,
.rcafe-product-card .standard-card h4,
.rcafe-product-card .standard-card strong {
  color: #FFFFFF;
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.38);
}

.rcafe-product-card .standard-card .answer-block,
.rcafe-product-card .standard-card .standard-knowledge .answer-block {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    0 12px 20px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.rcafe-product-card .standard-card .answer-block-list li,
.rcafe-product-card .standard-card .answer-block-text {
  color: rgba(255, 255, 255, 0.86);
}

.section-card { padding: 24px; }

.connectivity-banner {
  margin-bottom: 16px;
  padding: 16px 18px;
  align-items: flex-start;
}

.connectivity-copy {
  display: grid;
  gap: 6px;
}

.connectivity-title {
  font-weight: 800;
}

.ai-home-shell {
  position: relative;
  min-height: calc(var(--viewport-height) - 126px - var(--safe-area-top) - var(--safe-area-bottom));
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 28px;
  isolation: isolate;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding:
    34px
    calc(18px + var(--safe-area-right))
    calc(42px + var(--safe-area-bottom))
    calc(18px + var(--safe-area-left));
  overflow: hidden;
}

.ai-home-glow {
  position: absolute;
  inset: 0;
  border-radius: 0;
  display: none;
}

.ai-home-card {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  padding: 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255,255,255,0.90), rgba(255,255,255,0.84));
  border: 1px solid rgba(255,255,255,0.32);
  box-shadow: var(--shadow-deep);
}

.home-more-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 12px 0;
  border: 0;
  background: transparent;
  color: #FFFFFF;
  cursor: pointer;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.home-more-link:hover,
.home-more-link:focus-visible {
  transform: translateY(-2px);
  opacity: 0.96;
}

.home-more-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 6px;
  border-radius: 999px;
}

.home-more-link__label {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.home-more-link__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 18px 30px rgba(8, 10, 18, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  animation: home-more-bounce 2.6s ease-in-out infinite;
}

.home-more-link__icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.ai-search-form {
  display: grid;
  gap: 14px;
}

.ai-search-input-shell {
  position: relative;
  min-width: 0;
  width: 100%;
}

.ai-search-input {
  width: 100%;
  min-width: 0;
  min-height: 74px;
  font-size: 1.08rem;
  border-radius: 24px;
  padding: 0 22px;
}

.ai-search-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 0 22px;
  font-size: 1.08rem;
  line-height: 1.35;
  color: rgba(0, 0, 0, 0.42);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.28s ease;
}

.ai-search-placeholder.hidden {
  opacity: 0;
}

.ai-search-placeholder-title,
.ai-search-placeholder-hint {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.ai-search-placeholder-title {
  font-weight: 600;
}

.ai-search-placeholder-prefix,
.ai-search-placeholder-example {
  overflow-wrap: anywhere;
}

.ai-search-placeholder-example {
  display: inline-block;
  max-width: 100%;
  color: rgba(0, 0, 0, 0.52);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    filter 0.28s ease;
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.ai-search-placeholder-example.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
  filter: blur(2px);
}

.ai-search-placeholder-example.is-entering {
  opacity: 0;
  transform: translateY(6px);
  filter: blur(2px);
}

.ai-search-placeholder-example.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.ai-search-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.query-feedback-trigger-slot {
  display: flex;
  flex: 1 1 168px;
  justify-content: flex-end;
  min-width: 168px;
}

.query-feedback-trigger {
  min-width: 168px;
  width: 100%;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.24s ease, transform 0.24s ease, visibility 0.24s ease, box-shadow 0.18s ease;
}

.query-feedback-trigger.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
}

.query-feedback-trigger-slot.is-empty {
  pointer-events: none;
}

.search-btn {
  min-width: 168px;
}

.home-answer {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.answer-box {
  min-height: 64px;
  padding: 18px 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(229,57,53,0.07), rgba(229,57,53,0.04));
  border: 1px solid rgba(229,57,53,0.14);
  font-size: 1.02rem;
  line-height: 1.54;
  white-space: pre-line;
}

.home-answer-box {
  min-height: 92px;
  display: block;
}

.answer-structured,
.answer-blocks,
.standard-knowledge {
  display: grid;
  gap: 14px;
  white-space: normal;
}

.answer-title {
  font-size: 1.08rem;
  font-weight: 900;
  color: var(--text);
}

.answer-block {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(229, 57, 53, 0.12);
  box-shadow: 0 8px 18px rgba(8, 10, 18, 0.05);
}

.answer-block-title {
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--primary-dark);
}

.answer-block-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.answer-block-list li,
.answer-block-text {
  color: var(--text-soft);
  line-height: 1.55;
}

.standard-knowledge .answer-block {
  background: rgba(0, 0, 0, 0.03);
  border-color: var(--line);
  box-shadow: none;
}

.standard-knowledge .answer-block-title {
  color: var(--text);
}

.editor-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--line);
}

.process-editor-note {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.process-editor-card,
.process-stage-editor {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(14, 22, 40, 0.05);
}

.process-editor-card__title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.process-stage-parameters {
  display: grid;
  gap: 12px;
}

.process-stage-card,
.process-section-card,
.process-flow {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 32px rgba(14, 22, 40, 0.06);
}

.process-stage-grid,
.process-section-grid {
  display: grid;
  gap: 14px;
}

.process-section-card__desc {
  color: var(--text-soft);
  font-size: 0.96rem;
  line-height: 1.5;
}

.process-section-card__content {
  white-space: pre-wrap;
  color: var(--text);
  line-height: 1.62;
}

.process-flow__title {
  font-weight: 800;
  color: var(--text);
}

.process-flow__steps {
  display: grid;
  gap: 12px;
}

.process-flow-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.process-flow-step__num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 8px 18px rgba(180, 34, 34, 0.24);
}

.process-flow-step__body {
  display: grid;
  gap: 4px;
}

.process-flow-step__body strong {
  color: var(--text);
  font-size: 0.98rem;
}

.process-flow-step__body span {
  color: var(--text-soft);
  line-height: 1.5;
}

.process-flow__critical {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.process-flow__critical li {
  line-height: 1.5;
}

.standard-photo,
.photo-preview {
  display: grid;
  gap: 12px;
}

.standard-photo img,
.photo-preview img {
  width: 100%;
  max-width: 360px;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  object-fit: cover;
  background: rgba(0, 0, 0, 0.04);
}

.answer-actions { justify-content: flex-start; }

.followup-form {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
}

.query-feedback {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(70, 130, 180, 0.16);
  box-shadow: 0 12px 28px rgba(29, 40, 62, 0.08);
}

.query-feedback.is-emphasized {
  animation: query-feedback-pulse 0.72s ease;
}

.query-feedback-head {
  display: grid;
  gap: 4px;
}

.query-feedback-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.query-feedback-summary-item,
.query-feedback-parameters {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.query-feedback-summary-item span,
.query-feedback-parameters legend {
  color: var(--muted);
  font-size: 0.86rem;
}

.query-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.query-feedback-actions .ghost-btn,
.query-feedback-actions .primary-btn {
  min-width: 132px;
}

.query-feedback-correction {
  display: grid;
  gap: 14px;
}

.query-feedback-parameter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.query-feedback-parameter-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.query-feedback-parameter-option input {
  accent-color: var(--primary);
}

@keyframes query-feedback-pulse {
  0% {
    box-shadow: 0 12px 28px rgba(29, 40, 62, 0.08);
    transform: translateY(0);
  }
  45% {
    box-shadow: 0 18px 38px rgba(229, 57, 53, 0.18);
    transform: translateY(-2px);
  }
  100% {
    box-shadow: 0 12px 28px rgba(29, 40, 62, 0.08);
    transform: translateY(0);
  }
}

.offline-fallback {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px dashed rgba(229, 57, 53, 0.30);
  text-align: center;
}

.offline-fallback-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto;
  border-radius: 18px;
  background: rgba(229, 57, 53, 0.10);
  display: grid;
  place-items: center;
  color: var(--primary);
}

.offline-fallback-icon svg {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.8;
}

.tree,
.list,
.metrics,
.standard-params,
.analytics-breakdown {
  display: grid;
  gap: 12px;
}

.navigation-toolbar {
  display: flex;
  justify-content: flex-start;
  margin: 14px 0 0;
}

.tree-item,
.standard-card,
.source-card,
.list-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.86);
  padding: 16px;
}

.tree-head,
.source-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.tree-chips,
.pdf-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.tree-btn,
.pdf-link {
  padding: 10px 14px;
  background: rgba(0,0,0,0.05);
  color: var(--text);
  border: 1px solid transparent;
}

.tree-btn.active,
.list-select.active {
  background: rgba(229,57,53,0.10);
  border-color: rgba(229,57,53,0.18);
  color: var(--primary);
}

.standard-card {
  display: grid;
  gap: 16px;
}

.standard-card.active {
  border-color: rgba(229, 57, 53, 0.24);
  box-shadow: 0 18px 34px rgba(229, 57, 53, 0.1);
}

.standard-card-grid {
  display: grid;
  gap: 14px;
}

.standard-card--stacked {
  background: rgba(255,255,255,0.9);
}

.standard-card.is-selectable {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.standard-card.is-selectable:hover {
  transform: translateY(-2px);
  border-color: rgba(229, 57, 53, 0.18);
  box-shadow: 0 16px 28px rgba(8, 10, 18, 0.08);
}

.standard-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.standard-params {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.param-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(0,0,0,0.03);
}

.standard-meta {
  line-height: 1.54;
  color: var(--text-soft);
}

.source-open,
.pdf-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
}

.source-open {
  background: rgba(0,122,255,0.08);
  color: var(--secondary);
}

.camera-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  min-height: 320px;
  background: #111;
}

.camera-frame video {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  display: block;
}

.camera-overlay {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  background: rgba(15, 16, 19, 0.74);
  color: #FFFFFF;
  padding: 12px 14px;
  border-radius: 16px;
}

.camera-feedback {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.metric-card {
  padding: 14px;
  border-radius: 18px;
  color: var(--text);
  background: rgba(0,0,0,0.04);
  border: 1px solid var(--line);
}

.metric-card.ok {
  border-color: rgba(40,167,69,0.24);
  background: rgba(40,167,69,0.08);
}

.metric-card.warning {
  border-color: rgba(255,193,7,0.32);
  background: rgba(255,193,7,0.16);
}

.metric-card.critical {
  border-color: rgba(220,53,69,0.28);
  background: rgba(220,53,69,0.10);
}

.admin-shell { display: grid; gap: 18px; }

.folder-note {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(0,0,0,0.04);
  border: 1px solid var(--line);
  flex-wrap: wrap;
}

.admin-tabs,
.admin-subtabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.subpanel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.notifications-toolbar {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  margin-bottom: 16px;
  padding-top: 6px;
}

.ai-history-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.ai-history-table-wrap {
  overflow: auto;
  border: 1px solid rgba(176, 174, 192, 0.28);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
}

.ai-history-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

.ai-history-table th,
.ai-history-table td {
  padding: 14px 16px;
  vertical-align: top;
  border-bottom: 1px solid rgba(176, 174, 192, 0.18);
  text-align: left;
}

.ai-history-table th {
  font-size: 13px;
  font-weight: 800;
  color: rgba(28, 28, 28, 0.74);
  background: rgba(245, 245, 247, 0.92);
  position: sticky;
  top: 0;
  z-index: 1;
}

.ai-history-details-row td {
  background: rgba(248, 240, 242, 0.72);
}

.ai-history-details {
  display: grid;
  gap: 12px;
}

.ai-history-diff-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid rgba(176, 174, 192, 0.18);
  border-radius: 18px;
  overflow: hidden;
}

.ai-history-diff-table th,
.ai-history-diff-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(176, 174, 192, 0.14);
  text-align: left;
  font-size: 14px;
}

.ai-history-diff-table th {
  background: rgba(245, 245, 247, 0.88);
  font-weight: 800;
}

.ai-history-diff-table tr:last-child td {
  border-bottom: none;
}

.notifications-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.notification-filter-btn {
  padding: 11px 16px;
  background: var(--surface);
  color: var(--disabled);
  border: 1px solid var(--disabled);
}

.notification-filter-btn.active {
  background: rgba(229, 57, 53, 0.10);
  color: var(--primary);
  border-color: var(--primary);
}

.notifications-controls {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 220px auto;
  align-items: end;
}

.notifications-search,
.notifications-sort {
  display: block;
}

.notifications-clear-btn {
  white-space: nowrap;
}

.tab-btn {
  padding: 12px 18px;
  background: rgba(0,0,0,0.05);
  color: var(--text);
  border: 1px solid var(--line);
}

.tab-btn.active {
  background: rgba(229,57,53,0.10);
  color: var(--primary);
  border-color: rgba(229,57,53,0.18);
}

.admin-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 0.92fr 1.08fr;
}

#adminStandardsPanel .admin-grid {
  grid-template-columns: minmax(240px, 0.72fr) minmax(820px, 1.48fr);
  align-items: start;
}

#adminStandardsPanel .admin-section:nth-of-type(2) {
  overflow: visible;
}

.admin-section {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.80);
}

.list-card {
  display: grid;
  gap: 8px;
  text-align: left;
}

.list-select { width: 100%; }

.list-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.storage-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.storage-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.storage-source-note {
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.45;
}

.storage-table-wrap {
  overflow: auto;
  max-height: min(62vh, 720px);
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  width: 100%;
}

.storage-table {
  width: 100%;
  min-width: 1260px;
  border-collapse: separate;
  border-spacing: 0;
}

.storage-table thead {
  display: none;
}

.storage-table th:nth-child(1),
.storage-table td:nth-child(1) {
  min-width: 320px;
}

.storage-table th:nth-child(2),
.storage-table td:nth-child(2) {
  min-width: 240px;
}

.storage-table th:nth-child(3),
.storage-table td:nth-child(3) {
  min-width: 400px;
}

.storage-table th:nth-child(4),
.storage-table td:nth-child(4) {
  min-width: 180px;
}

.storage-table th:nth-child(5),
.storage-table td:nth-child(5) {
  min-width: 180px;
}

.storage-category-row td {
  padding: 0 16px;
  min-height: 40px;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  background: #ff1e14;
  border-bottom: 2px solid rgba(0, 0, 0, 0.35);
}

.storage-category-row--draft td {
  background: linear-gradient(90deg, #ff1e14, #ff6a5c);
}

.storage-columns-row td {
  padding: 10px 14px;
  color: #111111;
  font-size: 0.92rem;
  font-weight: 800;
  background: #d5d1d1;
  border-right: 2px solid rgba(0, 0, 0, 0.35);
  border-bottom: 2px solid rgba(0, 0, 0, 0.35);
}

.storage-columns-row td:last-child {
  border-right: none;
}

.storage-row td {
  padding: 16px 18px;
  vertical-align: top;
  border-right: 2px solid rgba(0, 0, 0, 0.28);
  border-bottom: 2px solid rgba(0, 0, 0, 0.28);
  background: rgba(255, 255, 255, 0.96);
}

.storage-row:last-child td {
  border-bottom: none;
}

.storage-row td:last-child {
  border-right: none;
}

.storage-row {
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.storage-row:hover {
  background: rgba(229, 57, 53, 0.03);
}

.storage-row.is-editing {
  cursor: default;
}

.storage-row.is-editing,
.storage-row.is-editing:hover {
  background: rgba(229, 57, 53, 0.05);
}

.storage-cell-main {
  display: grid;
  gap: 8px;
}

.storage-row-meta {
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.45;
}

.storage-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.storage-edited-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.storage-edited-badge.auto {
  color: var(--text-secondary);
  background: rgba(28, 28, 28, 0.06);
}

.storage-edited-badge.edited {
  color: var(--primary);
  background: rgba(229, 57, 53, 0.12);
}

.storage-actions-cell {
  width: 1%;
  white-space: nowrap;
}

.storage-actions-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.storage-inline-field {
  display: grid;
  gap: 8px;
}

.storage-inline-field + .storage-inline-field {
  margin-top: 10px;
}

.storage-inline-field span {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.storage-row.is-editing input {
  min-width: 0;
  width: 100%;
}

.user-card-head,
.user-presence-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-presence-line {
  justify-content: flex-start;
}

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

.user-stat-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.035);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.user-management-card {
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.88);
  box-shadow: 0 10px 26px rgba(8, 10, 18, 0.05);
}

.access-request-item {
  gap: 12px;
}

.access-request-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.access-request-meta {
  display: grid;
  gap: 4px;
}

.access-request-email {
  font-weight: 700;
  color: rgba(18, 18, 18, 0.88);
}

.access-request-decision {
  padding-top: 10px;
  border-top: 1px solid rgba(28, 28, 28, 0.08);
}

.role-admin {
  background: rgba(229, 57, 53, 0.14);
  color: var(--primary);
  border: 1px solid rgba(229, 57, 53, 0.22);
}

.role-tester {
  background: rgba(255, 140, 0, 0.16);
  color: #C96A00;
  border: 1px solid rgba(255, 140, 0, 0.22);
}

.role-employee {
  background: rgba(189, 189, 189, 0.22);
  color: #5F6368;
  border: 1px solid rgba(189, 189, 189, 0.24);
}

.user-role-line,
.user-role-editor {
  display: grid;
  gap: 10px;
}

.user-role-editor {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.user-role-select {
  min-width: 0;
}

.user-feature-panel,
.feature-flag-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(0, 0, 0, 0.03);
}

.feature-flag-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.feature-role-grid,
.feature-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-role-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
}

.feature-role-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  accent-color: var(--primary);
}

.feature-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
}

.feature-switch input {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  accent-color: var(--primary);
}

.user-features-toggle-btn.active {
  color: var(--primary);
  border-color: rgba(229, 57, 53, 0.24);
  background: rgba(229, 57, 53, 0.08);
}

.role-change-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(229, 57, 53, 0.14);
  background: rgba(255,255,255,0.84);
  box-shadow: 0 12px 32px rgba(8, 10, 18, 0.05);
}

.presence-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.presence-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(40, 167, 69, 0.12);
}

.presence-dot.offline {
  background: var(--disabled);
  box-shadow: 0 0 0 6px rgba(189, 189, 189, 0.16);
}

.notice-card.critical {
  border-color: rgba(220,53,69,0.22);
  background: rgba(220,53,69,0.08);
}

.notice-card.warning {
  border-color: rgba(255,193,7,0.28);
  background: rgba(255,193,7,0.12);
}

.notice-card.info {
  border-color: rgba(0,122,255,0.18);
  background: rgba(0,122,255,0.07);
}

.analytics-breakdown {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-card { min-height: 128px; }

.analytics-segments {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.analytics-segment-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.86);
  box-shadow: 0 12px 32px rgba(8,10,18,0.05);
}

.analytics-segment-head,
.analytics-segment-actions,
.analytics-type-row,
.analytics-graph-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.analytics-segment-summary {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
}

.analytics-query-card {
  display: grid;
  gap: 14px;
}

.analytics-query-summary {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
}

.analytics-day-strip {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-top: 10px;
}

.analytics-day-pill {
  display: grid;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 16px;
  background: rgba(0,0,0,0.04);
  border: 1px solid var(--line);
  text-align: center;
}

.analytics-day-pill span {
  font-size: 0.76rem;
  color: var(--text-soft);
  font-weight: 700;
}

.analytics-day-pill strong {
  font-size: 1rem;
  font-weight: 800;
}

.analytics-day-pill.active {
  background: rgba(229,57,53,0.09);
  border-color: rgba(229,57,53,0.24);
}

.analytics-segment-types {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--line);
}

.analytics-type-row {
  font-size: 0.95rem;
}

.analytics-graph-panel {
  display: grid;
  gap: 12px;
}

.analytics-open-graph-btn {
  min-width: 190px;
}

.analytics-graph-shell {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--line);
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
}

.legend-chip::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}

.legend-chip.temperature { color: var(--primary); }
.legend-chip.storage { color: var(--secondary); }
.legend-chip.cooking { color: var(--success); }

.analytics-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 220px;
}

.analytics-chart-day {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.analytics-chart-bars {
  width: 100%;
  min-height: 180px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 6px;
}

.analytics-bar {
  width: min(22px, 28%);
  border-radius: 999px 999px 10px 10px;
  min-height: 8px;
  box-shadow: 0 10px 20px rgba(8,10,18,0.10);
}

.analytics-bar.temperature { background: linear-gradient(180deg, #ff7068, var(--primary)); }
.analytics-bar.storage { background: linear-gradient(180deg, #67b1ff, var(--secondary)); }
.analytics-bar.cooking { background: linear-gradient(180deg, #58cf7d, var(--success)); }

.analytics-chart-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-soft);
}

.analytics-percent {
  font-size: 1.15rem;
  font-weight: 800;
}

.analytics-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(40,167,69,0.10);
  color: var(--success);
  font-weight: 800;
}

.status-chip.warning {
  background: rgba(255,193,7,0.18);
  color: #8A6500;
}

.status-chip.critical {
  background: rgba(220,53,69,0.14);
  color: var(--error);
}

.toast-stack {
  position: fixed;
  top: calc(18px + var(--safe-area-top));
  right: calc(18px + var(--safe-area-right));
  z-index: 60;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: min(360px, calc(100vw - 36px));
  max-width: min(420px, calc(100vw - 36px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  color: #FFFFFF;
  box-shadow: 0 18px 34px rgba(28, 28, 28, 0.18);
  opacity: 0;
  transform: translateY(-10px);
  animation: toast-in 0.28s ease forwards;
}

.toast.success { background: #28A745; }
.toast.error { background: #DC3545; }
.toast.warning { background: #c98a00; }

.toast.is-leaving {
  animation: toast-out 0.24s ease forwards;
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.98rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.toast-text {
  font-weight: 700;
  line-height: 1.35;
}

.global-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  pointer-events: none;
}

.global-loading.login-loading-mode {
  inset: 0;
  pointer-events: auto;
}

.global-loading.login-loading-mode .global-loading-bar,
.global-loading.login-loading-mode .global-loading-ring {
  display: none;
}

.global-loading-bar {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary), #ff7b73, transparent);
  background-size: 220% 100%;
  animation: loading-bar 1.2s linear infinite;
}

.global-loading-ring {
  position: fixed;
  right: calc(22px + var(--safe-area-right));
  bottom: calc(22px + var(--safe-area-bottom));
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 3px solid rgba(229,57,53,0.14);
  border-top-color: var(--primary);
  background: rgba(255,255,255,0.88);
  box-shadow: var(--shadow-soft);
  animation: spin 0.9s linear infinite;
}

.login-loading-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding:
    calc(22px + var(--safe-area-top))
    calc(18px + var(--safe-area-right))
    calc(22px + var(--safe-area-bottom))
    calc(18px + var(--safe-area-left));
  background:
    radial-gradient(circle at top left, rgba(229, 57, 53, 0.12), transparent 34%),
    radial-gradient(circle at bottom right, rgba(70, 130, 180, 0.14), transparent 28%),
    rgba(245, 245, 245, 0.58);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.login-loading-card {
  width: min(100%, 520px);
  display: grid;
  gap: 18px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(16, 20, 32, 0.14);
}

.login-loading-copy {
  display: grid;
  gap: 8px;
}

.login-loading-title {
  margin: 0;
  font-size: clamp(1.7rem, 1.32rem + 1vw, 2.2rem);
}

.login-loading-step {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.98rem;
  font-weight: 700;
}

.login-loading-progress {
  display: grid;
  gap: 10px;
}

.login-loading-progress-track {
  position: relative;
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
}

.login-loading-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #E53935 0%, #ff7b73 56%, #4682B4 100%);
  box-shadow: 0 8px 22px rgba(229, 57, 53, 0.22);
  transition: width 0.45s ease;
}

.login-loading-phrase-shell {
  min-height: 32px;
  display: flex;
  align-items: center;
}

.login-loading-phrase {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.login-loading-phrase.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.onboarding-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding:
    calc(20px + var(--safe-area-top))
    calc(20px + var(--safe-area-right))
    calc(20px + var(--safe-area-bottom))
    calc(20px + var(--safe-area-left));
  background: rgba(8, 10, 18, 0.52);
}

.onboarding-card {
  width: min(100%, 760px);
  padding: 28px;
  position: relative;
  max-height: min(calc(var(--viewport-height) - var(--safe-area-top) - var(--safe-area-bottom) - 40px), 760px);
  overflow: auto;
}

.onboarding-card__close {
  position: absolute;
  top: 18px;
  right: 18px;
  min-width: 0;
  padding: 8px 12px;
}

.permission-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

.permission-item {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
  border-radius: 22px;
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--line);
}

.permission-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(229,57,53,0.10);
  color: var(--primary);
  display: grid;
  place-items: center;
}

.permission-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.05);
  color: var(--text-soft);
  font-weight: 700;
  font-size: 0.88rem;
}

.permission-status.granted {
  background: rgba(40,167,69,0.12);
  color: var(--success);
}

.permission-status.denied {
  background: rgba(220,53,69,0.10);
  color: var(--error);
}

.permission-status.blocked {
  background: rgba(229,57,53,0.12);
  color: var(--primary);
}

.permission-status.prompt {
  background: rgba(255,193,7,0.16);
  color: #8A6500;
}

.permission-status.unsupported {
  background: rgba(0,0,0,0.08);
  color: var(--text-soft);
}

.permissions-actions,
.permission-card-actions,
.permission-dialog-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.permissions-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(229,57,53,0.06);
  border: 1px solid rgba(229,57,53,0.10);
  color: var(--text-soft);
  line-height: 1.55;
}

.permissions-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.permission-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.84);
  box-shadow: 0 12px 32px rgba(8,10,18,0.06);
}

.permission-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.permission-card-copy {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.permission-card-copy h4 {
  margin: 0 0 6px;
}

.permission-card-copy p,
.permission-card-description {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.permission-card-icon svg,
.permission-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.permission-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding:
    calc(20px + var(--safe-area-top))
    calc(20px + var(--safe-area-right))
    calc(20px + var(--safe-area-bottom))
    calc(20px + var(--safe-area-left));
  background: rgba(8, 10, 18, 0.52);
}

.permission-dialog-card {
  width: min(100%, 480px);
  padding: 28px;
  max-height: min(calc(var(--viewport-height) - var(--safe-area-top) - var(--safe-area-bottom) - 40px), 560px);
  overflow: auto;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(255,255,255,0.93));
  border: 1px solid rgba(255,255,255,0.66);
  box-shadow: var(--shadow-deep);
  backdrop-filter: blur(18px);
}

.permission-dialog-card h3,
.permission-dialog-card p {
  margin-left: 0;
  margin-right: 0;
}

.policy-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 86;
  display: grid;
  place-items: center;
  padding:
    calc(20px + var(--safe-area-top))
    calc(20px + var(--safe-area-right))
    calc(20px + var(--safe-area-bottom))
    calc(20px + var(--safe-area-left));
  background: rgba(8, 10, 18, 0.52);
}

.policy-dialog-card {
  width: min(100%, 980px);
  height: min(calc(var(--viewport-height) - var(--safe-area-top) - var(--safe-area-bottom) - 40px), 820px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.95));
  border: 1px solid rgba(255,255,255,0.66);
  box-shadow: var(--shadow-deep);
  backdrop-filter: blur(18px);
}

.policy-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.policy-dialog-copy h3 {
  margin: 4px 0 0;
}

.policy-dialog-close {
  flex: 0 0 auto;
  font-size: 32px;
  line-height: 1;
  font-weight: 300;
}

.policy-dialog-frame-shell {
  min-height: 0;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(28, 28, 28, 0.08);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

.policy-dialog-frame {
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: 0;
  background: #fff;
}

.access-request-backdrop {
  position: fixed;
  inset: 0;
  z-index: 87;
  display: grid;
  place-items: center;
  padding:
    calc(20px + var(--safe-area-top))
    calc(20px + var(--safe-area-right))
    calc(20px + var(--safe-area-bottom))
    calc(20px + var(--safe-area-left));
  background: rgba(8, 10, 18, 0.52);
}

.access-request-card {
  width: min(100%, 540px);
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.94));
  border: 1px solid rgba(255,255,255,0.66);
  box-shadow: var(--shadow-deep);
  backdrop-filter: blur(18px);
}

.access-request-form {
  gap: 14px;
}

.access-request-note {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(229, 57, 53, 0.10);
  background: linear-gradient(180deg, rgba(229, 57, 53, 0.06), rgba(75, 137, 208, 0.05));
}

.access-request-note strong,
.access-request-note p {
  margin: 0;
}

.access-request-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.onboarding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

code {
  display: inline-flex;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,0.05);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

@keyframes home-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes access-request-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes access-request-sheen {
  0%,
  12% { transform: translateX(-125%); }
  44%,
  100% { transform: translateX(125%); }
}

@keyframes home-liquid-glow {
  0% {
    transform: translate3d(-1.5%, -1%, 0) scale(1.02);
    opacity: 0.44;
  }
  50% {
    transform: translate3d(1.5%, 1%, 0) scale(1.08);
    opacity: 0.56;
  }
  100% {
    transform: translate3d(-1%, 1.5%, 0) scale(1.03);
    opacity: 0.46;
  }
}

@keyframes home-flow-lines {
  0% {
    transform: translate3d(-3%, -1.5%, 0) scale(1.08) rotate(-2deg);
    opacity: 0.34;
  }
  50% {
    transform: translate3d(2%, 1%, 0) scale(1.12) rotate(1deg);
    opacity: 0.44;
  }
  100% {
    transform: translate3d(-1%, 2%, 0) scale(1.09) rotate(-1deg);
    opacity: 0.36;
  }
}

@keyframes home-backdrop-a {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(24px, 18px, 0) scale(1.12); }
}

@keyframes home-backdrop-b {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-26px, -20px, 0) scale(1.14); }
}

@keyframes home-more-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

@keyframes loading-bar {
  0% { background-position: 200% 0; }
  100% { background-position: -20% 0; }
}

@keyframes motivation-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes motivation-compact-cycle {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  12%,
  82% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes qr-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

body.rcafe-mode .rcafe-product-card .standard-card,
body.rcafe-mode .rcafe-product-card .rcafe-standard-card {
  background: linear-gradient(180deg, rgba(18, 18, 24, 0.20), rgba(8, 8, 12, 0.10)) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow:
    0 20px 32px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
}

body.rcafe-mode .rcafe-product-card .answer-block,
body.rcafe-mode .rcafe-product-card .standard-knowledge .answer-block {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  box-shadow:
    0 12px 20px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
}

body.rcafe-mode .rcafe-product-card .answer-block-title,
body.rcafe-mode .rcafe-product-card .answer-title,
body.rcafe-mode .rcafe-product-card .standard-card strong,
body.rcafe-mode .rcafe-product-card .standard-card h3,
body.rcafe-mode .rcafe-product-card .standard-card h4,
body.rcafe-mode .rcafe-product-card .standard-card .eyebrow {
  color: #FFFFFF !important;
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.38) !important;
}

body.rcafe-mode .rcafe-product-card .answer-block-list li,
body.rcafe-mode .rcafe-product-card .answer-block-text,
body.rcafe-mode .rcafe-product-card .standard-card p,
body.rcafe-mode .rcafe-product-card .standard-card .meta,
body.rcafe-mode .rcafe-product-card .standard-card .standard-meta {
  color: rgba(255, 255, 255, 0.88) !important;
  text-shadow: 0 6px 14px rgba(0, 0, 0, 0.32) !important;
}

@media (max-width: 1024px) {
  .app-shell { width: 100%; }
  .admin-grid,
  .analytics-breakdown,
  .permission-grid {
    grid-template-columns: 1fr;
  }
  #adminStandardsPanel .admin-grid {
    grid-template-columns: 1fr;
  }
  .qr-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(calc(100% - 24px), 1080px);
  }
  .qr-card--community {
    grid-column: 1 / -1;
  }
  .qr-card {
    min-height: 0;
  }
}

@media (max-width: 900px) {
  .admin-grid,
  .standard-params,
  .filter-grid,
  .editor-grid-3,
  .notifications-controls,
  .analytics-segment-summary,
  .analytics-query-summary {
    grid-template-columns: 1fr;
  }

  .storage-toolbar {
    grid-template-columns: 1fr;
  }

  .storage-toolbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .storage-table {
    min-width: 1120px;
  }

  .storage-actions-stack {
    justify-content: stretch;
  }

  .storage-actions-stack .ghost-btn,
  .storage-actions-stack .primary-btn {
    width: 100%;
  }
}

  @media (max-width: 680px) {
    :root {
    --home-gradient-duration: 8s;
      --home-glow-duration: 56s;
      --home-flow-duration: 64s;
    }
  .app-shell { padding: 12px; }
  .app-shell {
    padding:
      calc(12px + var(--safe-area-top))
      calc(12px + var(--safe-area-right))
      calc(12px + var(--safe-area-bottom))
      calc(12px + var(--safe-area-left));
  }
  .login-card,
  .section-card,
  .ai-home-card,
  .onboarding-card {
    padding: 20px;
  }
  .mobile-topbar {
    top: calc(8px + var(--safe-area-top));
    padding: 12px 14px;
    align-items: flex-start;
  }
  .brand-logo--drawer { width: 188px; }
  .brand-logo--topbar { width: 146px; }
  .brand-logo--panel { width: 190px; }
  .topbar-center {
    width: min(220px, calc(100% - 136px));
    gap: 2px;
  }
  .ai-home-shell {
      min-height: calc(var(--viewport-height) - 122px - var(--safe-area-top) - var(--safe-area-bottom));
      gap: 20px;
      padding:
        20px
        calc(12px + var(--safe-area-right))
        calc(30px + var(--safe-area-bottom))
        calc(12px + var(--safe-area-left));
    }
  .ai-search-input { min-height: 68px; font-size: 1rem; }
  .ai-search-input-shell {
    min-height: 84px;
  }
  .ai-search-input {
    min-height: 84px;
    padding: 0 18px;
  }
  .ai-search-placeholder {
    gap: 4px;
    padding: 12px 18px;
    font-size: 0.94rem;
    line-height: 1.28;
  }
  .ai-search-placeholder-example {
    max-width: 100%;
    text-wrap: balance;
  }
  .rcafe-shell {
    align-items: flex-end;
    padding:
      calc(108px + var(--safe-area-top))
      calc(18px + var(--safe-area-right))
      calc(28px + var(--safe-area-bottom))
      calc(18px + var(--safe-area-left));
  }
  .rcafe-scene {
    background:
      linear-gradient(180deg, rgba(5, 5, 8, 0.88) 0%, rgba(8, 8, 10, 0.34) 26%, rgba(26, 11, 10, 0.16) 58%, rgba(5, 5, 8, 0.78) 100%),
      radial-gradient(circle at 82% 74%, rgba(255, 116, 66, 0.10), transparent 24%),
      radial-gradient(circle at 18% 22%, rgba(65, 133, 214, 0.12), transparent 22%),
      url("/static/rcafe-stage-mobile-bg.png") center top / cover no-repeat;
    filter: saturate(1.02) brightness(0.72);
  }
  body.rcafe-mode.rcafe-stage-ready .rcafe-scene {
    filter: saturate(1.06) brightness(0.82);
  }
  .rcafe-menu-card {
    width: 100%;
    min-width: 0;
    padding: 24px 18px;
    border-radius: 24px;
  }
  .rcafe-menu-card::before {
    inset: 12px;
    border-radius: 18px;
  }
  .rcafe-menu-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .rcafe-menu-btn,
  .rcafe-menu-btn--wide {
    width: 100%;
    min-height: 72px;
  }
  .rcafe-menu-btn--wide {
    grid-column: auto;
  }
  .rcafe-menu-copy {
    font-size: 0.92rem;
  }
  .rcafe-sync-controls {
    display: grid;
    grid-template-columns: 1fr;
  }
  .rcafe-sync-btn {
    width: 100%;
    min-width: 0;
  }
  .rcafe-flow-shell {
    min-height: 88px;
    padding: 14px;
  }
  .rcafe-flow-shell[data-view="categories"] {
    max-height: min(46vh, 360px);
  }
  .rcafe-flow-shell[data-view="products"] {
    max-height: min(48vh, 460px);
  }
  .rcafe-flow-shell[data-view="product"] {
    max-height: min(42vh, 360px);
  }
  .rcafe-flow {
    max-height: min(44vh, 420px);
    padding-right: 2px;
  }
  .rcafe-flow-head,
  .rcafe-flow-head--card {
    display: grid;
    grid-template-columns: 1fr;
  }
  .rcafe-products-grid {
    grid-template-columns: 1fr;
  }
  .rcafe-product-btn {
    min-height: 58px;
  }
  .rcafe-product-placeholder {
    min-height: 150px;
    padding: 18px;
  }
  .home-more-link {
    gap: 8px;
    padding-top: 0;
  }
  .home-more-link__label {
    font-size: 0.82rem;
    letter-spacing: 0.1em;
  }
  .home-more-link__icon {
    width: 48px;
    height: 48px;
  }
  .ai-history-toolbar {
    grid-template-columns: 1fr;
  }
  .ai-history-table {
    min-width: 760px;
  }
  .home-more-link__icon svg {
    width: 20px;
    height: 20px;
  }
  .ai-search-actions,
  .followup-form,
  .query-feedback-summary,
  .query-feedback-actions,
  .camera-actions,
  .folder-note,
  .connectivity-banner,
  .onboarding-actions,
  .permissions-actions,
  .permission-card-head,
  .permission-card-copy,
  .permission-card-actions,
  .permission-dialog-actions,
  .analytics-segment-head,
  .analytics-segment-actions,
  .analytics-graph-legend {
    display: grid;
    grid-template-columns: 1fr;
  }

  .policy-dialog-card {
    height: min(90vh, 760px);
    padding: 16px;
    border-radius: 24px;
  }

  .policy-dialog-head {
    align-items: flex-start;
  }

  .policy-dialog-frame {
    min-height: 360px;
  }

  .login-card-footer {
    margin-top: 16px;
  }

  .login-policy-link {
    font-size: 0.95rem;
  }

  .query-feedback {
    padding: 16px;
  }
  .query-feedback-trigger-slot {
    min-width: 0;
    flex: 1 1 auto;
  }
  .query-feedback-trigger-slot.is-empty {
    display: none;
  }
  .query-feedback-trigger {
    min-width: 0;
  }
  .query-feedback-parameter-list {
    display: grid;
    grid-template-columns: 1fr;
  }
  .topbar-motivation-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "label toggle"
      "ticker ticker";
    align-items: start;
    gap: 8px 10px;
    padding: 10px 12px;
    width: 100%;
  }
  .topbar-motivation-label {
    display: block;
    grid-area: label;
    white-space: normal;
    font-size: clamp(0.72rem, 2.5vw, 0.84rem);
    line-height: 1.25;
    letter-spacing: 0.02em;
    text-wrap: balance;
  }
  .topbar-motivation-viewport {
    grid-area: ticker;
    min-height: 52px;
    align-items: center;
    overflow: hidden;
  }
  .topbar-motivation-ticker {
    min-height: 52px;
    align-items: center;
  }
  .topbar-motivation-toggle {
    grid-area: toggle;
    justify-self: end;
    align-self: start;
    width: auto;
    min-width: 0;
    padding: 8px 12px;
    font-size: 0.84rem;
  }
  .motivation-marquee--compact {
    min-height: 52px;
  }
  .motivation-track--compact {
    width: 100%;
  }
  .motivation-phrase--compact {
    font-size: clamp(0.82rem, 2.9vw, 0.94rem);
    line-height: 1.42;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
  }
  .qr-section {
    grid-template-columns: 1fr;
    gap: 14px;
    width: 100%;
    margin: 18px auto 12px;
  }
  .qr-card,
  .qr-card--community {
    grid-column: auto;
    min-height: 0;
    padding: 22px 20px 20px;
    gap: 20px;
    border-radius: 28px;
  }
  .qr-card-copy {
    gap: 12px;
  }
  .qr-card-copy h3 {
    font-size: clamp(1.6rem, 8vw, 2.2rem);
  }
  .qr-card-copy p {
    font-size: 1rem;
    max-width: none;
  }
  .qr-code-grid--double {
    grid-template-columns: 1fr;
  }
  .qr-code-box {
    width: min(188px, 56vw);
    height: min(188px, 56vw);
    min-height: min(188px, 56vw);
  }
  .qr-open-btn {
    min-width: 148px;
    min-height: 50px;
  }
  .analytics-chart {
    gap: 8px;
  }
  .analytics-chart-bars {
    min-height: 140px;
  }
  .analytics-day-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .search-btn,
  .ghost-btn,
  .primary-btn {
    width: 100%;
  }

  .user-stats-grid {
    grid-template-columns: 1fr;
  }

  .user-role-editor,
  .feature-flag-head {
    grid-template-columns: 1fr;
  }

  .camera-frame,
  .camera-frame video {
    min-height: 240px;
  }
  .toast-stack {
    top: auto;
    right: 12px;
    left: 12px;
    bottom: 12px;
  }
  .toast {
    min-width: 0;
    max-width: 100%;
  }
  .global-loading-ring {
    width: 44px;
    height: 44px;
    right: 16px;
    bottom: 16px;
  }
  .login-loading-card {
    padding: 24px 18px;
    border-radius: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  body.home-mode,
  body.home-mode::before,
  body.home-mode::after,
  .backdrop,
  .ai-home-glow {
    animation: none !important;
  }
}

body.home-mode.home-static,
body.home-mode[data-home-motion="off"] {
  animation: none !important;
  background-position: 50% 50%;
}

body.home-mode.home-static::before,
body.home-mode.home-static::after,
body.home-mode[data-home-motion="off"]::before,
body.home-mode[data-home-motion="off"]::after,
body.home-mode.home-static .backdrop,
body.home-mode[data-home-motion="off"] .backdrop,
body.home-mode.home-static .ai-home-glow,
body.home-mode[data-home-motion="off"] .ai-home-glow {
  animation: none !important;
}

body.rcafe-mode .rcafe-shell {
  align-items: flex-start;
}

body.rcafe-mode .rcafe-flow-shell,
body.rcafe-mode .rcafe-flow-shell[data-view="categories"],
body.rcafe-mode .rcafe-flow-shell[data-view="products"],
body.rcafe-mode .rcafe-flow-shell[data-view="product"] {
  max-height: none !important;
  overflow: visible !important;
}

body.rcafe-mode .rcafe-flow {
  max-height: none !important;
  overflow: visible !important;
  padding-right: 0 !important;
}
