.page-shell {
  min-height: 100vh;
  padding: 24px 24px calc(118px + env(safe-area-inset-bottom));
}

.app-frame {
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.app-header {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 30px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(109, 69, 255, 0.14), transparent 24%),
    radial-gradient(circle at 20% 10%, rgba(223, 255, 63, 0.18), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(250, 244, 235, 0.78));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(18px);
}

.app-header::after {
  content: "";
  position: absolute;
  inset: auto -40px -46px auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(109, 69, 255, 0.18), transparent 68%);
  filter: blur(10px);
  pointer-events: none;
}

.app-header__main {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.app-header__brand {
  display: inline-flex;
  align-items: flex-start;
}

.app-header__logo {
  display: block;
  width: min(100%, 300px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(12, 16, 32, 0.1));
}

.panel-stack {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
}

@media (max-width: 1120px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 14px 14px calc(84px + env(safe-area-inset-bottom));
  }

  .app-header {
    padding: 16px 16px 14px;
    border-radius: 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .app-frame {
    gap: 14px;
  }

  .app-header__main {
    width: 100%;
    max-width: none;
  }

  .app-header__logo {
    width: min(72vw, 220px);
  }

  .app-header .section-block {
    width: 100%;
    gap: 10px;
  }

  .app-header .pill {
    width: 100%;
    justify-content: center;
  }
}

.list-page {
  animation: list-page-rise 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes list-page-rise {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.985);
  }

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

.bottom-toolbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 40;
  background: transparent;
  pointer-events: none;
}

.bottom-toolbar__inner {
  width: min(1120px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 30px;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.94), transparent 22%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(243, 238, 255, 0.9));
  backdrop-filter: blur(16px) saturate(1.25);
  box-shadow:
    0 22px 48px rgba(12, 16, 32, 0.14),
    0 10px 0 rgba(109, 69, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  pointer-events: auto;
  overflow: hidden;
}

.bottom-toolbar__action {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 70px;
  border: 1px solid rgba(255, 255, 255, 0);
  border-radius: 24px;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.68), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08));
  color: #453f5d;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  overflow: hidden;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease,
    transform 160ms ease, box-shadow 160ms ease;
}

.bottom-toolbar__action::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 8px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.bottom-toolbar__action::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: -8px;
  width: 28px;
  height: 28px;
  border-radius: 12px;
  background: rgba(223, 255, 63, 0.16);
  filter: blur(3px);
  pointer-events: none;
}

.bottom-toolbar__action:hover {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.82), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(233, 225, 255, 0.88));
  border-color: rgba(109, 69, 255, 0.12);
  color: var(--accent-strong);
  transform: translateY(-3px) rotate(-1deg);
  box-shadow:
    0 18px 30px rgba(109, 69, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.bottom-toolbar__action.is-active {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.88), transparent 28%),
    linear-gradient(135deg, rgba(128, 84, 255, 0.98), rgba(82, 46, 255, 0.96));
  border-color: rgba(255, 255, 255, 0.34);
  color: #fffdfa;
  box-shadow:
    0 18px 30px rgba(82, 46, 255, 0.26),
    0 8px 0 rgba(82, 46, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.bottom-toolbar__action.is-disabled,
.bottom-toolbar__action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bottom-toolbar__action.is-disabled:hover,
.bottom-toolbar__action:disabled:hover {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.68), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08));
  color: #453f5d;
  transform: none;
  box-shadow: none;
}

.bottom-toolbar__icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.28rem;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 12px rgba(15, 23, 42, 0.12);
  line-height: 1;
}

.bottom-toolbar__label {
  position: relative;
  z-index: 1;
  font-size: 0.82rem;
  line-height: 1.1;
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
  text-align: center;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.floating-controls {
  pointer-events: none;
}

.floating-action {
  --floating-action-size: 56px;
  position: fixed;
  bottom: calc(94px + env(safe-area-inset-bottom));
  z-index: 52;
  min-width: var(--floating-action-size);
  height: var(--floating-action-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(135deg, rgba(122, 77, 255, 0.98), rgba(76, 41, 255, 0.96));
  color: #fffdfa;
  box-shadow:
    0 22px 38px rgba(76, 41, 255, 0.22),
    0 10px 0 rgba(76, 41, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -12px 18px rgba(24, 16, 68, 0.16);
  pointer-events: auto;
  overflow: hidden;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.floating-action::before {
  content: "";
  position: absolute;
  inset: 8px 8px auto auto;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  filter: blur(1px);
  pointer-events: none;
}

.floating-action::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 7px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.floating-action:hover {
  transform: translateY(-3px) rotate(-2deg) scale(1.02);
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.98), transparent 34%),
    linear-gradient(135deg, rgba(143, 98, 255, 1), rgba(90, 54, 255, 0.98));
  box-shadow:
    0 26px 42px rgba(76, 41, 255, 0.28),
    0 12px 0 rgba(76, 41, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -12px 18px rgba(24, 16, 68, 0.18);
}

.floating-action:disabled {
  cursor: wait;
}

.floating-action--drive {
  left: 14px;
  border-radius: 20px 28px 20px 28px;
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(135deg, rgba(28, 187, 120, 0.98), rgba(12, 148, 101, 0.96));
  transform: rotate(-4deg);
}







.floating-action.is-active {
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.94), transparent 34%),
    linear-gradient(135deg, rgba(255, 137, 198, 0.98), rgba(255, 90, 153, 0.95));
  outline: 1px solid rgba(109, 69, 255, 0.24);
}

.floating-action.is-connected {
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(135deg, rgba(42, 209, 138, 0.98), rgba(18, 163, 109, 0.96));
  outline: 1px solid rgba(134, 239, 172, 0.4);
}

.floating-action.is-disconnected {
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.94), transparent 34%),
    linear-gradient(135deg, rgba(255, 188, 73, 0.98), rgba(255, 132, 39, 0.95));
  outline: 1px solid rgba(253, 186, 116, 0.28);
}

.floating-action.is-unavailable {
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.94), transparent 34%),
    linear-gradient(135deg, rgba(148, 163, 184, 0.98), rgba(100, 116, 139, 0.95));
  outline: 1px solid rgba(148, 163, 184, 0.24);
}

.floating-action.is-busy {
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.94), transparent 34%),
    linear-gradient(135deg, rgba(68, 166, 255, 0.98), rgba(39, 116, 255, 0.95));
}

.floating-action__icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 12px rgba(15, 23, 42, 0.18);
  line-height: 1;
}

.floating-action__badge {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
}

.floating-action__badge--drive.is-connected {
  background: #16a34a;
  color: #f8fafc;
}

.floating-action__badge--drive.is-disconnected {
  background: #f59e0b;
  color: #172033;
}

.floating-action__badge--drive.is-unavailable {
  background: #64748b;
  color: #f8fafc;
}

.floating-action__badge--drive.is-busy {
  background: #60a5fa;
  color: #0f172a;
}

@media (max-width: 640px) {
  .bottom-toolbar--work .bottom-toolbar__inner,
  .bottom-toolbar--revision .bottom-toolbar__inner,
  .bottom-toolbar--reading-sheet .bottom-toolbar__inner {
    overflow-x: auto;
  }

  .bottom-toolbar--work .bottom-toolbar__action,
  .bottom-toolbar--revision .bottom-toolbar__action,
  .bottom-toolbar--reading-sheet .bottom-toolbar__action {
    flex: 0 0 90px;
  }

  .page-shell {
    padding: 14px 10px calc(146px + env(safe-area-inset-bottom));
  }

  .app-frame {
    gap: 12px;
  }

  .bottom-toolbar__inner {
    width: min(100vw, calc(100vw - 10px));
    padding-inline: 6px;
    gap: 4px;
    border-radius: 22px;
  }

  .bottom-toolbar__action {
    min-height: 54px;
    padding: 8px 4px;
  }

  .bottom-toolbar__label {
    display: block;
    font-size: 0.62rem;
  }

  .bottom-toolbar__icon {
    font-size: 1.02rem;
  }

  .floating-action {
    --floating-action-size: 52px;
    bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .floating-action--drive {
    transform: rotate(-3deg);
  }





}

@media (prefers-reduced-motion: reduce) {
  .list-page {
    animation: none;
  }

  .bottom-toolbar__action,
  .floating-action {
    transition: none;
  }

  .bottom-toolbar__action:hover,
  .floating-action:hover {
    transform: none;
  }
}
